🔥 plasma-demo 🔥🧼
If you are using
nix-shell -p nodejs-8_x go dep jq
You wold also need to add this to
export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
We now provide a super simple way to run the test-suite. It only depends on docker!
make install docker-compose pull docker-compose up -d sleep 5 make build-purs make deploy-and-test docker-compose down
If you want to run each step manually, you can do something like but note that this currently deploys the contracts twice
make install docker-compose pull docker-compose up -d cliquebait make deploy-contracts make write-plasma-toml sleep 5 docker-compose up -d plasma make build-purs make deploy-and-test docker-compose down
plasma-mvp-sidechain (only once)
- Install original sources of
plasma-mvp-sidechainand switch to our custom branch as follow:
go get github.com/FourthState/plasma-mvp-sidechain cd $GOPATH/src/github.com/FourthState/plasma-mvp-sidechain git remote rename origin upstream git remote add origin firstname.lastname@example.org:f-o-a-m/plasma-mvp-sidechain.git git fetch --all git checkout http-server dep ensure -vendor-only
cd server/plasmad go install ./...
cd client/plasmacli go install ./...
Run the tendermint node and server
plasmad initshould create
$HOME. Inside you should find a
config/plasma.tomlfile. Open that file to add the address of the
ethereum_plasma_contract_address. To do that, you need to have already deployed the
PlasmaMVPcontract as described in compile contracts.
- To start the node, run
- To start the server, run
plasmacli rest-server. This should spin up the server on
Running the test suite
> npm install
build purs files
> make build-purs
generating cliquebait.json and launching cliquebait
> make generate-genesis
You can then launch cliquebait with this json file using
> docker run -it -p 8545:8545 -v `pwd`/cliquebait-generated.json:/cliquebait/cliquebait.json foamspace/cliquebait:latest
> make compile-contracts
run test suite
Make sure you have the tendermint node up
> PLASMA_ADDRESS=<whatever-the-address-is> make test-plasma
PLASMA_ADDRESS is visible after running
plasmad start. In following example it is
plasmad start I[2046-04-02|14:05:54.360] Starting ABCI with Tendermint module=main I[2046-04-02|14:05:54.388] binding to contract address 0xe545eaf693277ead76f5d9b4665291b0ac38853c module=main ...
Generating a plasma.toml config file
You can generate a plasma.toml config file by running
make write-plasma-toml. If you would like to create a config for an
IS_OPERATOR=true OPERATOR_PRIVATE_KEY=<whatever-it-is> make write-plasma-toml.
We are still trying to figure out how to automate config/setup so that it's the same everywhere (test config vs $HOME/.plasmad/config/plasma.toml etc). Until that's done, you should check this warnings list/ update it with new warnings when you find them.
- When running
make plasma-testyou need to supply the root chain plasma contract with environment variable
- When running
make plasma-testyou need to make sure that the
FINALIZED_PERIODenvironment variable is the same as what's listed under
ethereum_finalityin the plasma.toml file. Otherwise you will not be able to pass the include deposit test.
- This part is confusing https://www.learnplasma.org/en/learn/mvp.html#confirmation-signatures