Search code examples
blockchainsolidityget-headersblockchain.info-api

Local Node (Geth) failed to sync from TestNet


Dear all Blockchain experts,

I have created a local node by using Geth, this is the startup command.

  • geth --testnet --rpc --rpcaddr "localhost" --rpcport "8545" --rpcapi "web3,eth,net,personal" --rpccorsdomain "*" --datadir "./data" --identity "localnode" --fast

Upon the local node up and running. Immediately, I created two personal accounts and stored it into the Keystore folder.

Then, I have transfered the ether from my Testnet's account to the local node's account via MetaMasks. Something really odd here is I still can see the local node's account ether value is ZERO.

I even deleted the chaindata folder and re-started the geth client console.

Please advise and much appreciate.

Thank you.


Solution

  • Unfortunately, you had successfully synced your local GEth but with a different network other than the one you checking your Ether at!

    This confusion happen because there was an attack on Ropesten network that has been corrected by some nodes but the other nodes still having the old data. And when you run your command:

    geth --testnet --rpc --rpcaddr "localhost" --rpcport "8545" --rpcapi "web3,eth,net,personal" --rpccorsdomain "*" --datadir "./data" --identity "localnode" --fast

    You are not specifying in the command any specific node to connect to. And by mistake you are connected to node(s) that is still running on the old deprecated obsolete network blockchain data!

    And deleting the "chaindata" folder, will not inform GEth to try with other nodes. Because, it will pick the same nodes from the folder "nodes".

    To choose new nodes to sync with, you have either to:

    • Delete the "nodes" folder and also specify an updated nodes to be used by GEth using "--bootnodes" option.
    • Or, add the nodes even after sync using the command: "admin.addPeer('enode://ADDRESS@IP:PORT')". this is after you attach to Geth in terminal using "geth attach ipc:/home/developer/.ethereum/testnet/geth.ipc"

    However, because there is no clear listing on which nodes had been forked and updated to correct the hack, and because of many other issues like the large size of the full network node, I recommend using Parity to connect to the correct Ropsten nodes' network.

    To use parity I recommend following one of those links:

    So, thanks to Parity! You can specify your desired network using "--chain" easily by running: "parity --chain ropsten"