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://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c851572[email protected]:30303?discport=0"

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

admin.addPeer("enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5b7c85157251[email protected]:30303?discport=0")

i also tried this command:

admin.addPeer("enode://2c98ce532ae14020437889ecc9af8f15fd3463ccb6262c9eec124073ab6ee8999ebe2ff97bf8559e3b5[email protected]:30303")

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

Thanks anyways :)

1 Answer 1

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")

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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