I have a private network setup with geth and a few machines (2 full nodes for mining and a light node). The three devices have the following IPs:
- MINER1 - 10.42.0.40
- MINER2 - 10.42.0.250
- LIGHT-NODE - 10.42.0.150
I followed the suggested setup as follows:
Setup account from a new directory e.g.
~/miner1
geth --datadir="./" account new
Create a common genesis.json block file for all participating devices (I can confirm this is the same file used on all devices)
{ "config": { "chainID" : 10, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "nonce": "0x01", "difficulty": "0x20000", "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", "coinbase": "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x00", "gasLimit": "0x2FEFD8", "alloc": { }
}
Initiate the genesis block with
geth --datadir="./" init genesisblock.json
Startup the node
Full Node MINER1
geth --datadir="./" --identity "MINER1" --networkid 2008 --rpc --rpcaddr 0.0.0.0 --rpcport 8501 --nodiscover --minerthreads="1" --mine --unlock 0 console
Full Node MINER2
geth --datadir="./" --identity "MINER2" --networkid 2008 --rpc --rpcaddr 0.0.0.0 --rpcport 8502 --nodiscover --minerthreads="1" --mine --unlock 0 console
Light Node (Raspberry Pi)
geth --verbosity 6 --datadir="./" --cache=32 --syncmode=light --networkid 2008 --rpc --rpccorsdomain 0.0.0.0 --rpcport="8503" --nodiscover --unlock 0 console
- Perform manual discovery using
admin.addPeer("enodeURL")
Run from MINER1 to add MINER2
admin.addPeer("enode://a90cdb6f0c48b60052fc995fb3a2ae45de28baec009ba526418d46ff0a1e9005f6a79883f6b821b964acc[email protected]:30303")
This works perfectly and can be seen using admin.peers
that the two miner nodes are able to synchronize
- Perform the same manual discovery on the light node to add MINER1 and MINER2
admin.addPeer("enode://a902f3231e561546896f4619bb7129e67f3b46ee4bc6a86e35ca1f575444e9f25dcb65bf0e09b02fd27[email protected]:30303")
admin.addPeer("enode://a90cdb6f0c48b60052fc995fb3a2ae45de28baec009ba526418d46ff0a1e9005f6a79883f6b821b964ac[email protected]:30303")
This results in a true
response from the console but waiting and running admin.peers
returns no peers - []
Using the --verbosity 6
command line argument I receive the following information after running the admin.addPeer("enodeURL")
command:
DEBUG[02-10|16:30:21] Adding static node node=enode://a902f3231e561546896f4619bb7129e67f3b46ee4bc6a86e35ca1f575444e9f25dcb65bf0e09b02fd2714ce59bbb496a7783486d39eca4a17327ae1bacb3c699@10.42.0.40:30303
TRACE[02-10|16:30:21] New dial task task="staticdial a902f3231e561546 10.42.0.40:30303"
TRACE[02-10|16:30:21] Rejected peer id=a902f3231e561546 addr=10.42.0.40:30303 conn=staticdial err="useless peer"
TRACE[02-10|16:30:21] Dial task done task="staticdial a902f3231e561546 10.42.0.40:30303"
TRACE[02-10|16:30:21] New dial task task="wait for dial hist expire (29.999612993s)"
DEBUG[02-10|16:30:40] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
TRACE[02-10|16:30:51] Dial task done task="wait for dial hist expire (29.999612993s)"
TRACE[02-10|16:30:52] New dial task task="staticdial a902f3231e561546 10.42.0.40:30303"
TRACE[02-10|16:30:52] Rejected peer id=a902f3231e561546 addr=10.42.0.40:30303 conn=staticdial err="useless peer"
TRACE[02-10|16:30:52] Dial task done task="staticdial a902f3231e561546 10.42.0.40:30303"
TRACE[02-10|16:30:52] New dial task task="wait for dial hist expire (29.999654995s)"
DEBUG[02-10|16:31:00] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
DEBUG[02-10|16:31:20] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
As you can see I get a Rejected peer with err="useless peer"
in the trace.
Running net.listening
returns true
and I am able to ping the MINER1 and MINER2 hosts from the light node.
Upon running the geth commands I am warned about no UPNP enabled on the network:
DEBUG[02-10|16:28:42] Couldn't add port mapping proto=tcp extport=30303 intport=30303 interface="UPnP or NAT-PMP" err="no UPnP or NAT-PMP router discovered"
but this shouldn't affect the private network on the LAN when I do not plan on my network communicating over the internet/WAN should it?
Is anyone able to shed any light on why I am unable to attach my light node to the full nodes on my private network?
Thanks in advance for any help you guys can provide, it's much appreciated!