I would like to know how i can set up multiple bootnodes that share the same state. Would doing this require the bootnodes to share the same database? I know this is basic substrate staff but it would be helpful for a beginner like me to understand how the networking in substrate works. A detailed answer with some examples is highly appreciated.

1 Answer 1

  1. Generate the key (two ways)
    • Use subkey, and put the key into <DATA-DIR>/chains/<CHAIN-NAME>/network/<KEY>
    • Run the node and stop it, the key will be created and it can be found under <DATA-DIR>/chains/<CHAIN-NAME>/network/<KEY>
  2. Read the your bootnode address
    1. Run the node
    2. Search the output like this
      [Parachain] 🔍 Discovered new external address for our node: /ip4/<IP>/tcp/<PORT>/ws/<KEY>
    3. Replace the <IP>with your ip.
    • Note:
      • <IP> might be a private address, that you read from the log directly, you need figure out your public ip address and make sure you have a public address
      • if you are running a parachain, only focus on the [Parachain] log, not [Relaychain]
      • <PORT> must be opened, without the firewall
  3. Finally, configure the bootnodes like this: https://github.com/darwinia-network/darwinia/blob/b2f5f4bb8937028d57bb8ebb5b0cafec6a37bba4/node/src/chain_spec/crab.rs#L270

Tips: backup your key, once you delete the <DATA-DIR> the key will be lost, this happens a lot...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.