:toc: = Substrate/Polkadot local chain This gists contains a collection of docker-compose config for Polkadot and Substrate. You may clone this gist with: git clone git@gist.github.com:be461d11c56baecb0e7bbcb920e964fb.git Then run each docker-compose config using: docker-compose -f up --force-recreate NOTE: Alternatively you can find below several one-liners that will download the config to your temp folder, pull and start containers, without the need to clone anything. NOTE: I usually alias docker-compose as `dcp` and you will see `dcp` below. WARNING: If you get any message similar to `ERROR: Pool overlaps with other one on this address space`, please run the following commands: docker network ls | grep tmp | awk '{print $1}' | xargs docker network rm NOTE: By default, all commands will pull the `latest` tag for the polkadot/substrate images. This may not always be what you want. To get the tag `1.2.3` you can prepend `TAG=1.2.3` to the command. For instance `TAG=bbqb dcp -f dcp-substrate-2nodes-noui.yml up --force-recreate` NOTE: After starting the commands including a UI, you may reach the UI at http://localhost:80/. You need however to adjust the `settings` in the UI in order to switch from the Hosted node to *your* local node. == Docker environment cleanup You can cleanup your docker ENV using the following: docker ps -a | grep "polkadot\|substrate" | awk '{print $1}' | xargs docker stop | xargs docker rm docker network ls | grep tmp | awk '{print $1}' | xargs docker network rm This will *NOT* delete all your containers but only those related to polkadot or substrate. == Substrate === 2 nodes .2 nodes no UI dcp -f dcp-substrate-2nodes-noui.yml up --force-recreate wget https://gist.github.com/chevdor/be461d11c56baecb0e7bbcb920e964fb/raw/b7391dadfd4901cb87d84d6785ea94b09d36de15/dcp-polkadot-5nodes-ui.yml -O /tmp/dcp-local.yml && docker-compose -f /tmp/dcp-local.yml up --force-recreate .2 nodes with UI dcp -f dcp-substrate-2nodes-ui.yml up --force-recreate wget https://gist.github.com/chevdor/be461d11c56baecb0e7bbcb920e964fb/raw/b7391dadfd4901cb87d84d6785ea94b09d36de15/dcp-substrate-2nodes-ui.yml -O /tmp/dcp-local.yml && docker-compose -f /tmp/dcp-local.yml up --force-recreate == Polkadot === 2 nodes .2 nodes no UI dcp -f dcp-polkadot-2nodes-noui.yml up --force-recreate wget https://gist.github.com/chevdor/be461d11c56baecb0e7bbcb920e964fb/raw/b7391dadfd4901cb87d84d6785ea94b09d36de15/dcp-polkadot-2nodes-noui.yml -O /tmp/dcp-local.yml && docker-compose -f /tmp/dcp-local.yml up --force-recreate .2 nodes with UI dcp -f dcp-polkadot-2nodes-ui.yml up --force-recreate wget https://gist.github.com/chevdor/be461d11c56baecb0e7bbcb920e964fb/raw/b7391dadfd4901cb87d84d6785ea94b09d36de15/dcp-polkadot-2nodes-ui.yml -O /tmp/dcp-local.yml && docker-compose -f /tmp/dcp-local.yml up --force-recreate === 5 nodes .5 nodes with UI dcp -f dcp-polkadot-5nodes-ui.yml up --force-recreate wget https://gist.github.com/chevdor/be461d11c56baecb0e7bbcb920e964fb/raw/b7391dadfd4901cb87d84d6785ea94b09d36de15/dcp-polkadot-5nodes-ui.yml -O /tmp/dcp-local.yml && docker-compose -f /tmp/dcp-local.yml up --force-recreate