1

i want to connect two different machines in a ethereum private network!

I did it before with a normal PoW-Consesus but with PoA created by puppeth i cant see some Peers when i try:

admin.peers

Things i have done:

Initalize ethereum accounts on both machines with:

geth --datadir data/node1 account new
geth --datadir data/node2 account new

Then i created a genesis file with puppeth and copied it to the other machine that they are similiar!

The file looks like this:

{ "config": { "chainId": 1001, "homesteadBlock": 1, "eip150Block": 2, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 3, "eip158Block": 3, "byzantiumBlock": 4, "constantinopleBlock": 5, "clique": { "period": 0, "epoch": 30000 } }, "nonce": "0x0", "timestamp": "0x5c3894dc", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000d460f5cc1dd0efec245ca8a87afd5c1ba1456f7e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x47b760", "difficulty": "0x1", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "d460f5cc1dd0efec245ca8a87afd5c1ba1456f7e": { "balance": "0x200000000000000000000000000000000000000000000000000000000000000" } }, "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"

Then i initialized the genesis files with this commands:

geth --datadir data/node1/ init genesis.json
geth --datadir data/node2/ init genesis.json

After that i started both nodes with this commands:

geth --datadir="data/node1" --networkid "1001" --nodiscover console --unlock "d460f5cc1dd0efec245ca8a87afd5c1ba1456f7e" --rpc --rpcport "8000" --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi "eth,net,web3,miner,debug,personal,rpc" --syncmode "full"

geth --datadir="data/node2" --networkid "1001" --nodiscover console --unlock "1200f5a866b0889a816d808a82b4f3be30ba6ba2" --rpc --rpcport "8000" --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi "eth,net,web3,miner,debug,personal,rpc" --syncmode "full"

To find out the enode i wrote on the machine without prebalance:

admin.nodeInfo.enode

gives me this output:

"enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c85157251129127600c955c1d1a3b3e9fb54330f120@127.0.0.1:30303?discport=0"

And executed this command on the main machine after copying the enode:

admin.addPeer("enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c85157251129127600c955c1d1a3b3e9fb54330f120@127.0.0.1:30303?discport=0")

i also tried this command:

admin.addPeer("enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c85157251129127600c955c1d1a3b3e9fb54330f120@127.0.0.1:30303")

Can u help me please to connect the peers of different machines that i can run a private PoA Ethereum!

Thanks anyways :)

1

Since you are trying to connect two machines you have to use their external ip not 127.0.0.1

For example if the ip is 192.168.1.99 then the command should be:

admin.addPeer("enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c85157251129127600c955c1d1a3b3e9fb54330f120@192.168.1.99:30303")

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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