0

When my Nodejs script uses web3 to query a geth node running in a private Ethereum network for an older block, I encounter the error

UnhandledPromiseRejectionWarning: Error: Returned error: missing trie node 94d3409b537ed93710c0b20e3f116e953c8284d251219f6a60de0da03207b0b8 (path )

geth Geth/v1.8.13-unstable-2e0391ea/linux-amd64/go1.10.3 has been started using the syncmode="full" parameter and it can be seen synchronizing all the blocks from the very first block

--networkid 1366 --cache 512 --syncmode="full" --port 30303 --maxpeers 50 --rpc --rpcaddr "0.0.0.0" --rpcapi "eth,personal,web3,net" --bootnodes enode://id@ip:port

Question: Is this because --trie-cache-gens is set to it's default value of 120?

What is a trie node generations?

If we need to access the entire blockchain history, what value should we set it to? Or is there another setting to adjust to allow this?

1 Answer 1

0

You will need to add the --gcmode=archive option to access arbitrary historical states. This will require a resync of the chainstate (although I think there's a way to get it to do that without downloading everything over again, and it'll prompt you for it when you first try and apply the option)

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.