I have an issue where after I run anchor test --detach
(which starts a local validator) the transactions are only available for a short time (a few minutes) via rpc. Possibly a local validator setting concerning making only recent blocks available over rpc?
1 Answer
I'm not sure about anchor test
specfically, but solana-test-validator
(which it probably wraps?) has a very low default --limit-ledger-size
value to prevent consuming excess disk space. Assuming anchor test
can pass this argument through or supports an analog, increasing the value will keep a deeper ledger history around
-
2Thanks - this was it! For future reference - the anchor specific fix was to add
[test.validator] limit_ledger_size = "10000000"
(new line after[test.validator]
) toAnchor.toml
. Jul 21, 2022 at 20:20