Building status-go

From Status Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search


status-go can be built in two modes:

  • standalone server (cmd/statusd)
  • 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 develop.


  • 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.


We use Makefile, you can run make help to see available commands:

 $ make help
 Usage: make [target]
   statusgo                        Build status-go as statusd server
   wnode-status                    Build wnode-status (Whisper 5 debug tool)
   statusgo-android                Build status-go for Android
   statusgo-ios                    Build status-go for iOS
   statusgo-ios-simulator          Build status-go for iOS Simulator
   help                            Show this help
   generate                        Regenerate assets and other auto-generated stuff
   mock-install                    Install mocking tools
   mock                            Regenerate mocks
   clean                           Cleanup
   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/ 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 build/_workspace.

You may also use go build / go test commands manually.

Building for iOS

Use either 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

Use make statusgo-android. In order for binding to communicate up, we rely on JNIGo → C → JNI → Java App.

The communication code is saved in library.c. Our patched version of xgo, allows us to distinguish between platforms:

 /* iOS related code */
 /* Android related code */
 #include <jni.h>