- Introduction
- Options
- Preparation
- Local Usage
- Start relaychain and parachain
- Additional Docker Commands
parachain-launch is a script that generates a docker compose file allowing you to launch a testnet of multiple blockchain nodes.
The following options are supported by the generate script.
| Option | Description | Required | Default |
|---|---|---|---|
| --config | Path to config file. | No | ./config.yml |
| --output | Path to output dir. | No | ./output |
| --yes | Overwrite generated files? | No | false |
- Download the peaq-network-node
- Checkout to the
parachain_devbranch in the peaq-network-node - Follow the peaq-node-builder to build the peaq-node's binary
- Build the docker images on the peaq-network-node folder.
cd ../peaq-network-node
docker build -f scripts/Dockerfile.parachain-launch -t peaq_para_node .- Install dependency:
yarn install- Build project
yarn build-
Use the
config.parachain.ymlfile and edit as necessary. -
Run the service from within the local directory:
./bin/parachain-launch generate --config=/path/to/config.parachain.yml [--yes] [--output=/path/to/output]./bin/parachain-launch generate --config=config.parachain.yml --output=yoyoThis will generate the docker files a folder called output in your current working directory or in the directory provided to the --output option.
To start the nodes, navigate to the output folder that you generated the scripts in and build the docker container:
cd ./output # OR custom output directory
docker compose up -d --buildNOTE:
- If you regenerate the output directory, you will need to rebuild the docker images.
- Please use Polkadot/apps to connect the relay/parachain chain.
List all of the containers:
docker ps -aTrack container logs:
docker logs -f [container_id/container_name]Stop all of the containers:
docker compose stopRemove all of the containers:
docker compose rmRemove all of the containers and volumes (This will wipe any existing chain data):
docker compose down -v- Use
git submodule update --init --recursiveto download the fork-off-substrate - Go to the fork-off-substrate to install the library by
cd fork-off-substrate; npm install - Setup all parameter needed in
forked.generated.sh - Copy the peaq-node bianry to your FORK_FOLDER If your want to forked the parachain which ran the runtime upgraded already, please remember to use the correct binary and docker image which are the same as the runtime upgrade. For example, our Krest network's runtime ugprade version is based on the krest-v0.0.3, then your binary/docker image should be also based on the krest-v0.0.3
- Execute the scripts
sh forked.generated.sh, it'll launch the forked parchain automatically However, please double-check the log carefully
FORKED_CONFIG_FILE="config.parachain.agung.forked.yml" \
RPC_ENDPOINT="https://wss-async.agung.peaq.network" \
DOCKER_COMPOSE_FOLDER="yoyo" \
FORK_FOLDER="/home/peaq/fork-test/fork-binary/peaq-dev-v06042023" \
sh -e -x forked.generated.sh
FORKED_CONFIG_FILE="config.parachain.krest.forked.yml" \
RPC_ENDPOINT="https://krest.api.onfinality.io/public" \
DOCKER_COMPOSE_FOLDER="yoyo" \
FORK_FOLDER="/home/peaq/fork-test/fork-binary/krest-v0.0.3" \
sh -e -x forked.generated.sh
- ust remember you can add
OVERRIDE_STORAGE_PATHto shorten the fetching data time in thescripts/forked-*.shThe storage file is store under fork-off-substrate/data/storage.json after the script is run. However, just remember to copy to somewhere else, otherwise, it'll be deleted when reruning the script. For example:OVERRIDE_STORAGE_PATH="/home/jaypan/Work/peaq/parachain-launch/storage.json" \