1

I have initialized genesis file in my system, this is my genesis.json file-

    {
"alloc": {
     "790a2dc4ea3aa44eb27cbb430cf4e1cff989706790":  {"balance": "9999999999999999999999999999999999"}
  },
"coinbase": "0x0000000000000000000000000000000000000000",
"difficulty": "0x20000",
"extraData": "",
"gasLimit": "21000",
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x00",
"config": {
"chainId":89822 ,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
 }
}

Than I have launched the network using the following command :

    geth --rpc --rpcaddr 0.0.0.0 --rpcport 8549 --rpccorsdomain "*" --rpcvhosts "*" --rpcapi "web3,network,admin,personal" --datadir /home/ethereum --networkid 89822 console  

Same file I have initialized in my AWS linux client. Then i have launched the network using the same command as above except I have changed the port to 30304 which was 30303 by default in the 1st client:

    geth --rpc --rpcaddr 0.0.0.0 --rpcport 8549 --rpccorsdomain "*" --rpcvhosts "*" --rpcapi "web3,network,admin,personal" --datadir /home/private --networkid 89822 --port 30304 console  

now I am adding AWS client as peer to the 1st client using the following command:

    admin.addPeer("enode://4b1a3942568e227d169ffd68b6733ef6f40e4cb77df7de819e63e6cc521c5dbd48c458799696edd0fa711f74f3752f43e81a4babad122fa6d58bddb4eaf7ef85@192.168.0.175:30304");  

Whose IP address should I give after @? Here I am using the IP of the 1st client. It is giving true, but when I type admin.peers it shows null:

    > admin.peers
    []
1

I think you are trying to add your machine and AWS EC2 instance in the same blockchain network. In that case, your machine needs to have public IP address as well.

Refer to the following article for setting up two nodes private ethereum blockchain network -

https://blockgeeks.com/two-node-setup-of-a-private-ethereum/

| improve this answer | |

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.