I am trying to setup multiple geth nodes on multiple docker containers. I am using a script that can initialize a genesis json file and start geth. After that, I am doing the following manually (and I want to automate them via a JS script which I can call while starting geth):

  1. creating and unlocking user account.

  2. adding other peers. Here, can I have a customer admin.eNodeInfo URL generated for each node? That way, I can automate the way I add the other nodes.Ex: if I hardcode node1's URL to "enode://abcdef@ip:port"

and node2's URL to "enode://lmnopq@ip:port"

then I could have my script automatically setup node1 and node2 as peers. Else, I need to create node 1 and then manually update the JS script of node2 to pick up node1's enodeURL

I know I can use --bootnodes option, but that will only ensure that we tell geth at startup itself to connect to the other peers by providing the enodeURL of the other peers.

Please let me know.

1 Answer 1


Bootnode can automate this process.

  1. Create a keypair for bootnode
  2. Generate URL for bootnode
  3. In start command for all other nodes, just provide bootnode URL

With this :

  • Each node "announces" itself to bootnode on startup
  • Queries peers from bootnode and connects to peers

This article has an example :


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.