I returned to the Celo dev setup a few times so I decided to copy the instructions for future reference.

The instructions below are mostly exact copies of celo-org/celo-monorepo/SETUP.md:


Follow these steps to get everything that you need installed to build the celo-monorepo codebase on your computer.

Install Go

We need Go for celo-blockchain, the Go Celo implementation, and gobind to build Java language bindings to Go code for the Android Geth client).

Note: We currently use Go 1.13. Install Go 1.13 manually, then run

go get golang.org/x/mobile/cmd/gobind

Execute the following (and make sure the lines are in your ~/.bash_profile):

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Install Node

Currently Node.js v12.x is required in order to work with this repo.

Install nvm (allows you to manage multiple versions of Node) by following the instructions here: https://github.com/nvm-sh/nvm.

Once nvm is successfully installed, restart the terminal and run the following commands to install the npm versions that celo-monorepo will need:

# restart the terminal after installing nvm
nvm install 12
nvm alias default 12

Xcode CLI

Install the Xcode command line tools:

xcode-select --install


Install Homebrew, the best way of managing packages on OSX:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Yarn

We use Yarn to build all of the celo-monorepo repo. Install it using Homebrew:

brew install yarn

Install Rust (Optional)

We use Rust for some cryptography repositories This is not required if you only want use the blockchain, monorepo, and mobile wallet.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Now lets add Rust to the PATH:

echo "export PATH=$PATH:~/.cargo/bin/" >> ~/.bashrc
source ~/.bashrc

With Rust binaries in your PATH you should be able to run:

rustup install 1.42.0
rustup default 1.42.0

If you’re building Geth for Android, you need a NDK that has a cross-compilation toolchain. We need version 19.

On Mac (darwin):

brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/a39a95824122da8448dbeb0b0ca1dde78e5a793c/Casks/android-ndk.rb

export ANDROID_NDK=/usr/local/share/android-ndk

In celo-blockchain, define the relevant environment variables, e.g.:

export NDK_VERSION=android-ndk-r19c

and run make ndk_bundle. This will download the NDK for your platform.

Building celo-monorepo

Clone the celo-monorepo repo:

mkdir ~/celo
cd celo
git clone https://github.com/celo-org/celo-monorepo.git

Then install the packages:

cd celo-monorepo
# install dependencies and run post-install script
# build all packages
yarn build --ignore docs

Note that if you do your checkouts with a different method, Yarn will fail if you haven’t used git with ssh at least once previously to confirm the github.com host key. Clone a repo or add the github host key to ~/.ssh/known_hosts and then try again.

When removing a dependency via yarn remove some-package, be sure to also run yarn postinstall so you aren’t left with freshly unpackaged modules. This is because we use patch-package and the postinstall step which uses it is not automatically run after using yarn remove.

The docs package relies on gitbook which has problems off of a fresh install. Running yarn build --ignore docs is a known workaround.

Running the mobile wallet

To build and run the mobile wallet on your iOS or Android devices see the guide in the mobile directory.