2

I have a node synched in normal mode up until number=5143444

Node started with

geth --datadir "./"
--rpc 
--rpcaddr 0.0.0.0 
--ws 
--wsaddr 0.0.0.0 
--wsorigins="*" 
--maxpeers 100 
--maxpendpeers 10 
console

I'm trying to test the geth traces (compared to parity traces) but it seems I cannot get old transactions.

I've tried running trace on a recent transaction and it works

> debug.traceTransaction("0x59ae735c0291ec79460968d01dbd5b4adf007571bfaa308b8ab1005bb5e3f500")
{
  failed: false,
  gas: 21000,
  returnValue: "",
  structLogs: []
}

But if I try running trace on an older transaction (from block 1580796), I get this

> debug.traceTransaction("0x8e5b38db03e0941677ba65275d78fe18df999c11a7be1921831082121ae73390")
Error: required historical state unavailable
    at web3.js:3143:20
    at web3.js:6347:15
    at web3.js:5081:36
    at <anonymous>:1:1

I know with parity I need to specifically set tracing and archive on:

--tracing=on
--pruning=archive

And this creates a HUGE database. Is there something similar for geth? The command line options don't seem to have anything about this

2

In order to have available all of the information you need to sync your node with --syncmode full

4
  • Hi there, I tried the following command but still got the same error: geth --cache=1024 --rpc --rpcapi "eth,net,web3,debug" console --syncmode full. Any idea on that? – lllllllllllll Nov 28 '18 at 16:52
  • Was the node fully synchronized when you tried it? – Daniel Luca CleanUnicorn Nov 29 '18 at 10:05
  • Yes, I use eth.syncing to check the current block, then check a block that is order than the current one. – lllllllllllll Nov 29 '18 at 10:16
  • this answer is incorrect. You need archival node to trace old transactions. Full node only tracks 128 states in memory and some trace log info to be able to reconstruct few weeks of old states. But a transaction year old won't traceable because states are pruned. – Nulik Jun 15 at 22:59
2

You must set gcmode=archive when start geth.

1
  • this is the correct answer. Though as of today you need 8 Terabytes of SSD storage to have archival node. One could get help from bcache and use 1GB SSD disk with 8TB backing device – Nulik Jun 15 at 23:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.