This repo provides simple scripts, inspired by polkadot/cumulus, to set up a network with:-
- Relay Chain with 4 validators (Alice, Bob, Charlie and Dave)
- Generic parachain (test parachain in cumulus)
- Subdex parachain (parachain with generic-asset and dex pallet)
The relay chain chain-specs is a modified version of westend_local, with validator_count = 4
to support 2 parachains.
This is a part of the submission for Hackusama 2020.
- subdex-chain (Standalone dex-pallet in a substrate node)
- subdex-ui (React frontend providing friendly UI)
- subdex-xc-network (current repo)
- subdex-parachains (Parachains using the Cumulus framework with the substrate-parachain-template, generic-parachain and dex_chain branches)
# in the root of this directory
docker-compose --file docker-compose-xc.yml up
# in the root of this directory
docker-compose --file docker-compose-xc.yml down -v
./clear_all.sh
- Base images - this is to compile the binary / wasm file from branches of subdex_cumulus
# To build
# for generic-parachain
git clone https://github.com/subdarkdex/subdex_parachains.git dex-parachain
cd dex-parachain
docker build --tag subdarkdex/generic-chain:<version>
- Collators, WASM Runtime Volume, Registrar
- collators - both dex and generic parachains
- wasm runtime volume - this is a copy of the wasm runtime for the collators, used to register parachain, we also have the genesis state volume built during docker-compose up for this purpose
- registrar - simple polkadotjs cli container to register the parachains using sudo
cd docker
./build-containers.sh v0.1.0
# or other versions
- Docker version 19.03.8, build afacb8b
- execute access for the
.sh
files in this repo
NOTE: - we are not using the script provided in cumulus because we want 2 parachains, also, need to be able to build and rebuild the parachain binaries as we experiment. But when we get more familiar / more stable versions of the parachains, we can build a similar script to do all steps.
Steps required are:-
- set up relay chain validators
- set up default cumulus parachain
- run paraA and paraB
- register parachains
docker-compose -f docker-compose-validatorsOnly.yml up
will set up alice, bob, charlie and dave
./build_collators.sh
./start_collators.sh
./register_parachain.sh
docker-compose -f docker-compose-validatorsOnly.yml down
./clear_all.sh
The parachain account is tied to the parachain_id
encoded
Parachain id: Id(100) Generic Parachain
Parachain Account: 5Ec4AhP7HwJNrY2CxEcFSy1BuqAY3qxvCQCfoois983TTxDA
...
Parachain id: Id(200) Dex Parachain
Parachain Account: 5Ec4AhPTL6nWnUnw58QzjJvFd3QATwHA3UJnvSD4GVSQ7Gop
The DarkDex chain spec is a duplication of the westend-local chain, but with 4 validators and validator count as 4. Changes were made to v0.8.14 - chain_spec.rs
# westend-local was updated with 4 validators, Alice, Bob, Charlie and Dave
./target/release/polkadot build-spec --chain=westend-local --raw --disable-default-bootnode > dex_raw.json
This version works with 1.29 polkadot js on https://polkadot.js.org/apps/
{
"AssetId": "u64",
"Address": "AccountId",
"LookupSource": "AccountId"
}