Start Bootstrap Node

Running a bootstrap node is an optional feature for subnet nodes. It's suggested that each subnet node run a bootstrap node on a separate server.

Not implemented in the current version.

A bootstrap node is a persistent, well-known node that helps new peers discover and connect to the peer-to-peer (P2P) network. It acts as an entry point for nodes joining the network for the first time.

A bootstrap node doesn't hold transformer blocks and therefore doesn't require a GPU.

A bootstrap node is linked to a subnet node and uses that subnet node as its PoS (proof of stake) to enter the subnet DHT.

In the Generate Keypair step, a bootstrap private key will be created to generate a bootstrap Peer ID. The bootstrap Peer ID is then submitted while registering the subnet node on-chain. While having a bootstrap node isn't required, it is suggested each node to have one.

python -m subnet.cli.subnet.run_dht_validator --host_maddrs /ip4/0.0.0.0/tcp/{PORT} --subnet_id {SUBNET_ID} --identity_path {BOOTSTRAP_PRIVATE_KEY_PATH} --initial_peers {INITIAL_PEERS}

Parameters:

--host_maddr (Optional):

  • You can remove this argument and a port will be chosen for you.

  • Multiaddrs to listen for external connections from other DHT instances.

  • Defaults to all IPv4 interfaces and the TCP protocol: /ip4/0.0.0.0/tcp/0.

--subnet_id: The ID of the subnet.

--identity_path: The path to the ed25519 private key file previously generated in the generate keypair step.

  • This defaults to bootstrap_private_key.key

--initial_peers:

  • If the subnet has not been deployed yet and you're the first node to deploy the subnet, remove this argument.

  • If the subnet is already running, pass in other bootstrap nodes.

# format
--initial_peers /ip4/{IP}/tcp/{PORT}/p2p/{PEER_ID} /ip4/{IP}/tcp/{PORT}/p2p/{PEER_ID}

# example
--initial_peers /ip4/127.0.0.1/tcp/31330/p2p/12D3KooWHRgVBAYr4w56YauwnrgGG2ufF7D2LcMTrfKowm4TmneK /ip4/127.0.0.2/tcp/31330/p2p/12D3KooWJUCVne3tEPQH92zn5vjKUvv6VasSSPUubhyJrYaYWuD

This will:

  • Run a bootstrap node for others to connect to.

  • Start consensus integration automatically once the node is activated.

Output:

Running a DHT instance. To connect other peers to this one, use --initial_peers /ip4/127.0.0.1/tcp/39013/p2p/12D3KooWMRSF23cFaFPTM9YTz712BSntSY5WmA88Db12E9NqtT8S

The /ip4/127.0.0.1/tcp/39013/p2p/12D3KooWMRSF23cFaFPTM9YTz712BSntSY5WmA88Db12E9NqtT8Sis the bootstrap node you can share with others so they can connect to the subnet.


While another subnet node can connect using your validator node multiaddress, installing the bootstrap node will give you the option to keep your validator node IP and port private from the general public.

Last updated