status-go can be built in two modes:
- standalone server (
- cross-build for Android (
build/android-16/aar) and iOS (
build/os-9.3/framework), with extra variant for iOS simulator builds
cgo is used to in order to provide bridge between JNI and iOS. Internally we use xgo for cross building (xgo is a docker image with all necessary build dependencies, for a given build target, installed).
The main working branch for status-go is
- Go - You need to install Go programming language, currently the version 1.8.3. Installation is straightforward, just follow instructions on the website.
- Docker - the xgo relies on Docker images. So, for building process to work correctly, you need to have configured Docker environment present.
Makefile, you can run make help to see available commands:
$ make help Usage: make [target] build: statusgo Build status-go as statusd server wnode-status Build wnode-status (Whisper 5 debug tool) cross-compile: statusgo-android Build status-go for Android statusgo-ios Build status-go for iOS statusgo-ios-simulator Build status-go for iOS Simulator other: help Show this help generate Regenerate assets and other auto-generated stuff mock-install Install mocking tools mock Regenerate mocks clean Cleanup tests: test Run basic, short tests during development test-unit Run unit and integration tests test-unit-coverage Run unit and integration tests with coverage ci Run all linters and tests at once
Makefile commands use
build/env.sh script that makes sure that everything is built
within build/_workspace and we do not touch system-wise Go installation, and all vendored dependencies are pushed to
You may also use
go build /
go test commands manually.
Building for iOS
make statusgo-ios or
make statusgo-ios-simulator (the later will build iOS library that includes simulator SDK). Again, iOS specific code in
library.c should be guarded by
#ifdef IOS_DEPLOYMENT pragma.
We build for version 9.3 of the SDKs. Once build process is done, see the
build/bin folder for artifacts.
Building for Android
make statusgo-android. In order for binding to communicate up, we rely on JNI: Go → C → JNI → Java App.
The communication code is saved in
library.c. Our patched version of xgo, allows us to distinguish between platforms:
#ifdef IOS_DEPLOYMENT /* iOS related code */ #else /* Android related code */ #include <jni.h> #endif