0

I'm quite new to ethereum, I followed some tutorial to create a private ethereum network. I created 3 nodes, and to connect these 3 nodes, I need to run on node 1: admin.addPeer(enodeofNode2), admin.addPeer(enodeofNode3). Besides, I also need to run on node 2: admin.addPeer(enodeOfNode3). I want to ask that is there any option that I don't need to manually run like that because if I have 100 nodes, the job will be much difficult.

Regards,

eth.cat

1
$ geth --datadir blkchain2 init genesis.json

$ geth --datadir blkchain2 --nodiscover --networkid 1234 --port 30304 console

where, blkchain2 is the data directory for second node, genesis.json is the same genesis file you used in the first node, networkid must be same as the first node and the default port is 30303. It will be used by the first node so define the port as 30304.

0

You can use a bootnode. Basically, it's a node that every other node know about and connect at the start.

Here you can find a geth tutorial that can help you.

1
  • thank you so much, I'll try
    – Eth.Cat
    Sep 10 '20 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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