Subnet creation and deployment
We have now created all the required wallets and configuration files for five validators and two users. We'll now create an L2 subnet, have four validators join it, and then spin up their binaries.
Step 1: Subnet creation
To create a subnet, first connect to the bitcoin-ipc container running:
docker exec -it bitcoin-ipc bashThen run:
# from inside the container
/usr/local/bin/bootstrap_subnet_a_from_container.shThe script outputs the SUBNET_ID of the newly created subnet, make sure you export it using the printed command!
This is the scripts/bootstrap_subnet_a_from_container.sh script from the bitcoin-ipc repo, which has been mounted in the container for convenience. It does the following:
It submits to bitcoin-core all required transactions to create a subnet and to join and fund four validators.
It updates the
config.jsonfiles of all validators in the/root/.ipcdirectory of the container.It prints, among others, the
SubnetIDof the newly created subnet — it is a good idea to export it to an env variable.
Step 2: Validator deployment
The subnet has now been created and sufficiently many validators have joined. We can start the validators by running:
# from inside the container
/usr/local/bin/spin_up_subnet_a_from_container.sh $SUBNET_IDwhere SUBNET_ID indicates the subnet from the first step.
This is the /scripts/spin_up_subnet_a_from_container.sh script from the bitcoin-ipc repo, which has been mounted in the container for convenience. Even though it is run inside the container, the command is handled by the docker daemon on your host machine. It does the following:
It starts twelve Docker containers (three for each validator:
fendermint,cometbft, andethapi) 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.
Last updated