0

I'm trying to set up a private ethereum network using bootnode. I created two instances on EC2 (t2.medium) having the same security group.Firstly i created boot key by using

     bootnode -genkey boot.key

then i set up the bootnode by using following command

     bootnode -nodekey boot.key -verbosity 7 -addr "172.31.20.13:30310"

The bootnode was set up successfully with enode value =enode://52c75d5bb8f8287a5942151dabb35756b2ee664faa8a1f98b8fb5ae778953bf0dde553b0d574e85cbfcbd8adf4068a0c7611f270e673776c7e67225b38eadcd2@172.31.20.13:30310

I initialised both the nodes using the genesis file and following command

geth --datadir "./mydatadir" init genesis.json

Genesis.json

{
"config": {
    "chainId": 1337,
    "homesteadBlock": 0,
    "eip155Block": 0,
    "eip158Block": 0
},
"nonce": "0x0000000000000042",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x00",
"gasLimit": "0x8000000",
"difficulty": "0x01",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x238dd521ad221b37cc176fa9f4bf88cf19fe39f1",
"alloc": {
  "0x238dd521ad221b37cc176fa9f4bf88cf19fe39f1" : {
    "balance" : "200000000000000000000000"
  },
  "0xaebc7588345fc7963505dd6de9d12390980fc13d" : {
    "balance" : "10000000000000000000"
  },
  "0xa5c77bd6319a5eaba9494acd90cac9712f9e15c9" : {
    "balance" : "20000000000000000000"
    }
 }
 }

I tried connecting now two nodes (two instances) to bootnode one node being on the same instance that of bootnode. I used th following command

geth --networkid 1337 --datadir "./mydatadir" --bootnodes                              "enode://52c75d5bb8f8287a5942151dabb35756b2ee664faa8a1f98b8fb5ae778953bf0dde553b0d574e85cbfcbd8adf4068a0c7611f270e673776c7e67225b38eadcd2@172.31.20.13:30310" --port 3003 --ipcdisable --syncmode full console

This nodes gets joined to bootnode successfully interacting with it

TRACE[05-24|21:01:55] << FINDNODE/v4                           addr=172.31.20.13:3003 err="unknown node"<br>
TRACE[05-24|21:01:55] >> PONG/v4                               addr=172.31.20.13:3003 err=nil<br>
TRACE[05-24|21:01:55] << PING/v4                               addr=172.31.20.13:3003 err=nil<br>
TRACE[05-24|21:01:55] Starting bonding ping/pong               id=33c0695b8d4f9ff6 known=false failcount=0 age=424221h1m55.666391609s<br>
TRACE[05-24|21:01:55] >> PING/v4                               addr=172.31.20.13:3003 err=nil

But when i run the same command on other instance (node)

geth --networkid 1337 --datadir "./mydatadir" --bootnodes "enode://52c75d5bb8f8287a5942151dabb35756b2ee664faa8a1f98b8fb5ae778953bf0dde553b0d574e85cbfcbd8adf4068a0c7611f270e673776c7e67225b38eadcd2@172.31.20.13:30310" --port 3004 --ipcdisable --syncmode full console 

The node is launched successfully but i don't see it interacting with the bootnode and when i type admin.peer command on both the nodes i get empty list.Am i doing something wrong? Please help me out

2 Answers 2

0

Seems like the firewall in one of the nodes... By default the bootnode starts on port 30301. May be you have configured security group such that port 30310 is not open. Make sure the required ports are open and both EC2 nodes are able to communicate to each other over IP

-1

Ensure that you can access the listening ports using UDP as geth uses that for peering

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.