Building from Source

Learn how to build the plasma binary and deploy its associated smart contracts from source.

Sections in this article


  1. Golang: This is a Golang project.
  2. dep: We use dep for Golang dependency management.
  3. Node.js and npm to install and run Truffle and JavaScript code.
  4. Truffle: For convenience, Truffle is currently used to migrate Plasma contracts to the Ethereum root chain. Please make sure that the version of solc used by Truffle matches the one used by the contracts. Currently, Truffle v4.0.5 is most recent to support Solidity v0.4.18 npm install -g truffle@v4.0.5
  5. Ganache: Currently we use Ganache to test against a root chain.
  6. Geth: To run a local private chain for testing with web sockets and lower mining difficulty.


We assume that you are installing Plasma for the purposes of local testing, and so will be deploying the Plasma contract to a local Truffle testnet.

1. Checkout and install dependencies

mkdir -p $GOPATH/src/
git clone
cd plasma
make deps

make deps will automatically run dep and npm install.

2. Start the testnet

In a new terminal, run the following commands:

cd contracts
make testnet

This will start a Ganache testnet with the following configuration options:

  • RPC port 9545
  • HD wallet mnemonic candy maple cake sugar pudding cream honey rich smooth crumble sweet treat
  • Block time 1 second

You should leave this terminal window open as you develop. Note that you will have to migrate smart contracts manually each time you restart Ganache. To do this, you can run make migrate.

3. (Optional) Set up a local private chain or testnet

This is a simple example of setting up a private chain. For more details refer to the Private Network written by Ethereum.

mkdir -p ~/geth/chain
cd ~/geth
echo '{    "config": {        "chainId": 15,        "homesteadBlock": 0,        "eip155Block": 0,        "eip158Block": 0    },    "difficulty": "1024",    "gasLimit": "10000000",    "alloc": {        "0x44a5cae1ebd47c415630da1e2131b71d1f2f5803": { "balance": "1000000000000000000000" }    }}' > genesis.json
geth --datadir chain init genesis.json
geth account new --datadir chain
geth --datadir chain --rpc --ws --mine --unlock [YOUR_ADDRESS]

4. Build Plasma

You’re now ready to build the Plasma binary. Simply run make build to do this. Here’s what make build does:

  1. Migrates the smart contracts.
  2. Runs abigen to generate Go bindings to the smart contracts.
  3. Compiles the plasma binary and installs it into your GOPATH.

Next Steps

You’re now ready to start using plasma! Checkout the following articles for how to configure a node and start transacting: