serverSecond subnet creation and deployment

This page will guide you to setup a second subnet. It is similar to the Creation and initialization of the first subnet.

circle-check

Step 1: Subnet creation

In the same way as we created our first subnet, connect to the bitcoin-ipc-local container running:

docker exec -it bitcoin-ipc bash

Then run:

# from inside the container
/usr/local/bin/bootstrap_subnet_b_from_container.sh

Step 2: Validator deployment

circle-exclamation

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:

  1. 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.

  2. 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.

Step 1: Create a child subnet

Exactly the same as in Subnet creation:

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.

Step 3: Join the subnet

Exactly the same as in Subnet creation:

Step 4: Fund the validators

Exactly the same as in Subnet creation:

Step 5: Deploy the validators

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.

Step 6: Check the status of the subnet

Exactly the same as in Deploy the validators:

Run the block_checker helper script:

Run the balancer helper script:

Last updated