0

I am trying to setup node following the official documentation.

Here is what I have so far:

Downloaded snapshot and extracted contents to /srv/node

Wrote genesis state locally:

geth --datadir node init genesis.json

Launched node

geth --config ./config.toml --datadir ./node  --cache 18000 --rpc.allow-unprotected-txs --txlookuplimit 0

Upon attaching to geth instance, the banner says:

instance: Geth/v1.1.0-beta-b67a129e-20210524/linux-amd64/go1.16.4
at block: 0 (Mon Apr 20 2020 13:46:54 GMT+0000 (UTC))
 modules: eth:1.0 rpc:1.0 web3:1.0

Similarly, web3.eth.getBlockNumber says 0:

> web3.eth.getBlockNumber(function(error,block){console.log(block)})
0

However, web3.eth.syncing shows that the node is syncing:

> web3.eth.syncing
{
  currentBlock: 6279550,
  highestBlock: 7815710,
  knownStates: 333255025,
  pulledStates: 333255025,
  startingBlock: 4935824
}
> web3.eth.syncing
{
  currentBlock: 6280072,
  highestBlock: 7815710,
  knownStates: 333255025,
  pulledStates: 333255025,
  startingBlock: 4935824
}

Where did I go wrong?

1
  • I suspect that given that I use snapshot, I was not supposed to run geth --datadir node init genesis.json, though if that's the case, then this was not clear from the documentation. – Gajus May 29 at 0:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.