Closed dszlachta closed 3 months ago
The code in question is here: https://github.com/TrueBlocks/trueblocks-core/blob/develop/src/apps/chifra/pkg/rpc/is_node.go.
There's actually two functions here:
IsNodeTracing has the idea of FirstBlock
, but that value is hard coded. Perhaps we can add a per-chain config item for FirstBlock
.
I still think we should differentiate between block not found and no tracing errors. Otherwise users can get confusing message (they can miss the part about setting the first block in the documentation)
I agree. There's two different things. IsNodeArchive and IsNodeTracing. I think they may be slightly combined in the existing code. It would be more clear to end users if we separated errors.
I changed three things:
TB_<chain>_FIRSTTRACE
) to instruct the code which block to test. (Defaults to 1 if not specified.)
Currently our algorithm for detecting if the node is tracing is as follows:
But it's possible that a user's node doesn't have block X, because it's partial archive node (like it happened here: https://discord.com/channels/570963863428661248/811272718224719892/1230107993144823808)
I suggest we check if the error is related to tracing. If it's "missing block" then we exit with a proper message.