This page will guide you to setup a second subnet. It is similar to the Creation and initialization of the first subnet.
For simplicity, the new subnet we are creating is run by the same validators as the first subnet. This is not mandatory.
Step 1: Subnet creation
In the same way as we created our first subnet, connect to the bitcoin-ipc-local container running:
dockerexec-itbitcoin-ipcbash
Then run:
# from inside the container/usr/local/bin/bootstrap_subnet_b_from_container.sh
Step 2: Validator deployment
Make sure you use the Subnet ID of the subnet we just created and not the one from the previous pages.
Run:
# from inside the container/usr/local/bin/spin_up_subnet_b_from_container.sh$SUBNET_ID
where SUBNET_ID indicates the subnet for which you deploy validators (the script of the previous step outputs it).
Similar to the script we used for subnet A, it does the following:
It starts twelve Docker containers (three for each validator: fendermint-X-subnet-b, cometbft-X-subnet-b , and ethapi-X-subnet-b) on your host.
It starts a Relayer for each validator, with log files stored in /root/logs/ in the container. See Optional: Helper scripts for more information on the log files.
Alternative: Install on the host machine
If in page Installation you chose the alternative deployment — hence bitcoin-core , the monitors and providers, and ipc-cli are running on your host machine — then you must also use this alternative approach here to create a second subnet and deploy the validators.
Even if you used the default Docker-based deployment, you still have the option to use this alternative approach here. In that case, you need to run all following commands from inside the bitcoin-ipc container — the ipc and bitcoin-ipc repos can be found in the /root/workspace directory.
Make sure you write down the subnet id or export it to a env variable $SUBNET_ID.
Step 2: Update the config.toml files
We now need to add the new subnet configuration to all of the following configuration files:
~/.ipc/validator1/config.toml
~/.ipc/validator2/config.toml
~/.ipc/validator3/config.toml
~/.ipc/validator4/config.toml
~/.ipc/validator5/config.toml
~/.ipc/user1/config.toml
~/.ipc/user2/config.toml
~/.ipc/config.toml
Notice that this time we are changing the entry for Subnet B. The config files already contain the corresponding entry, you only have to replace /b4/t410ftkmrmongfxyrefwgpyz524taorvrijfwfzrfwgy with the new subnet id.
Similar to Deploy the validators, we recommend that you use the helper script to deploy the validator containers for the second subnet. This is because all the ports change, and this can be tricky to do manually.