Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Solar-Punk-Ltd/swarm-mobile

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Solar-Punk-Ltd/swarm-mobile

  • v0.0.3
  • Source
  • Go
  • Socket score

Version published
Created
Source

swarm-mobile

SwarmMobile is a bee client built with fyne using bee-lite. It can run on multiple platforms supported by fyne.

Build guide

To Build from source you will need fyne.

make get-fyne

Also necessary to install the android ndk and set the following environment variables. Then add them to the PATH environment variable.

export ANDROID_HOME=$HOME/Library/Android/Sdk
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/<specific-ndk-version>
export PATH=$ANDROID_HOME:$ANDROID_NDK_HOME:$PATH

By default the target is is android/arm64 and the app ID is com.solarpunk.swarmmobile. To overwrite them set the following environment variables:

export APP_ID=<app-id>
export TARGET_OS=<target-os>

To create a package:

make package

Development

To run without packaging on your local development environment:

go run main.go

If you wish to simulate a mobile application:

go run -tags mobile main.go

In order for the android networking to work: Copy the _android files under the net/ and syscall/ subfolders of this repo to their respective folders under your go installation, e.g.:

cp ./net/* /opt/homebrew/Cellar/go/1.22.4/libexec/src/net/
cp ./syscall/* /opt/homebrew/Cellar/go/1.22.4/libexec/src/syscall/

Furthermore, add the following build directive to the existing dnsconfig_unix, interface_linux, netlink_linux files:

//go:build !android

so that the target will be the newly added *_android files.

Based on the following github issues: dnsconfig_unix.go netlink_linux.go, interface_linux.go

Debugging on Android

By building the sources an .apk package is generated. It can be installed wiht a simple drag-and-drop on an Android device by connecting your computer via USB. Then just install the package by tapping on the installer (you might need to enable installing packages from unknown sources).

Then on your computer adb needs to be installed. Use the following script to start the adb service and listen for the logs coming from the app (it filters out the logs coming from the fyne framework and colors the lines):

DEVICE_ID=$(adb devices | awk 'FNR == 2 {print $1}')
echo "device ID: ${DEVICE_ID}"
adb logcat -v color time Fyne:V *:S ${DEVICE_ID} > swarm_mobile.log

Run in the browser

To be able to run the app in the browser set the following environment variable:

export GOPHERJS_GOROOT=<specific-go-path>/libexec

Then run the command:

fyne serve -os wasm

For more information about the build options run:

fyne package --help

TODO

  • release for testnet and mainnet
  • code review
  • use latest bee-lite version
  • fix networking on errors on Android
  • host binaries for Android
  • host binaries for IOS

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc