1

I have successfully deploy the BPF and run the client on the Solana hello world example: https://github.com/solana-labs/example-helloworld. The greeted counter in the program also works as expected.

Then, I tried to inspect the transactions using Solana Explorer pointing to localhost. I can see the transactions that I made on the program's transaction history, but after few minutes (1.5-3.5 minutes), if I refresh the page, those transactions is missing.

I've tried to create my own hello program but the transaction is disappeared after few minutes in the history. I also did a simple solana transfer, but it still same.

I did search on google about this problem, but I can't find any good information. I know the state is not a problem (because the solana balance and the data contained in hello world program is correct), so I suspect the problem is from Solana Explorer, but then I tried solana transaction-history on my cli. And same as before, the transaction appeared and disappeared.

So now, I suspect that solana-test-validator remove the transaction history from ledger. But, I found that the test-ledger is growing (last time I check is 10gb).

I'm still not sure why the transaction history is missing and how to fix it, so I can inspect the transactions that I and the program make. It will make my on-chain program development easier. Thanks!

Piko Monde
  • 396
  • 1
  • 4
  • 18

1 Answers1

2

This can be confusing. The default ledger size for solana-test-validator is very small, so you'll lose transactions very quickly. You can use the --limit-ledger-size argument to make it bigger. More information from -h:

$ solana-test-validator -h
solana-test-validator 1.9.2 (src:f58b87be; feat:4100269022)
Test Validator

USAGE:
    solana-test-validator [FLAGS] [OPTIONS] --ledger <DIR>

...
...

        --limit-ledger-size <SHRED_COUNT>                    Keep this amount of shreds in root slots. [default: 10000]
Jon C
  • 7,019
  • 10
  • 17
  • Owh I see. If the ledger size is small, then why my `test-ledger` directory is growing (it can reach 10gb after few days)? – Piko Monde Jan 04 '22 at 05:49
  • After I analyze the folder in `test-ledger`, I think the `account` subdirectory is the one that grows. Meanwhile, after I increase the `limit-ledger-size`, the ledger that stored in `rocksdb` subdirectory also grows. – Piko Monde Jan 04 '22 at 08:59
  • 1
    You've understood it exactly right -- the ledger contains the accounts and also the transactions, so the accounts can keep growing, but the transactions get pruned. We may want to make that clearer in the flag though... – Jon C Jan 04 '22 at 18:38