I've read countless posts referencing some form of "Synchronisation failed, dropping peer err='retrieved hash chain is invalid'" and of the few that had solutions, none of them worked for me.
I started using this tutorial, from which I used Geth to create a private PoW network with two local miner nodes on my PC (Windows 10). Initially things went swimmingly; I got the two miner nodes synced and mining properly, and was able to add a RPi into the mix and eventually deploy a smart contract using truffle that the RPi would then monitor through Python. Recently I got 2 more RPi's, but upon following the same steps as for the first RPi I was not able to sync them with my blockchain.
My chain is fewer than 50 blocks, yet I have been unable to get this up and running as I originally did no matter what I try. I've tried fast and full sync, I've added peers using a static-nodes.json file and the admin.addPeer() method, I've updated geth on each node/machine to 1.8.27-stable. All nodes are connected to a network switch and I can ping/ssh into any of them with no problems. I've deleted the geth folder/reset my database countless times and used several simple genesis.json files to no avail. I've gone back to trying to successfully sync a single RPi node, but even that seems to be hit or miss. Any ideas? Otherwise I might just try Parity instead.
I'll leave some of the commands/files I'm using for reference.
{
"config": {
"chainId": 2424,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x200",
"alloc": {},
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xffffffff",
"alloc": {
}
}
geth --identity "miner1" --syncmode "fast" --networkid 2424 --datadir "~/Documents/Spencer/PrivateChain/miner1" --nodiscover --mine --rpc --rpcport "8042" --rpcapi "admin,db,eth,net,web3,miner,personal" --port "30303" --unlock 0 --password ~/Documents/Spencer/PrivateChain/miner1/password.sec --ipcpath "~/AppData/Roaming/Ethereum"
--
geth --identity "miner2" --syncmode "fast" --networkid 2424 --datadir "~/Documents/Spencer/PrivateChain/miner2" --nodiscover --mine --rpc --rpcport "8043" --rpcapi "admin,db,eth,net,web3,miner" --port "30304" --unlock 0 --password ~/Documents/Spencer/PrivateChain/miner2/password.sec
Maybe it would be worth trying to run the miner nodes in a Linux environment using Docker? I know Windows can be wonky sometimes...