4

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 1

5

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

1
  • 2
    Thanks - this was it! For future reference - the anchor specific fix was to add [test.validator] limit_ledger_size = "10000000" (new line after [test.validator]) to Anchor.toml. Jul 21, 2022 at 20:20

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.