简体   繁体   English

solana-test-validator 中缺少交易历史记录

[英]Missing transaction history in solana-test-validator

I have successfully deploy the BPF and run the client on the Solana hello world example: https://github.com/solana-labs/example-helloworld .我已成功部署 BPF 并在 Solana hello world 示例上运行客户端: 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.然后,我尝试使用指向 localhost 的Solana Explorer检查交易。 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.我可以在程序的交易历史记录中看到我所做的交易,但几分钟后(1.5-3.5 分钟),如果我刷新页面,这些交易就会丢失。

I've tried to create my own hello program but the transaction is disappeared after few minutes in the history.我试图创建自己的 hello 程序,但交易在历史记录中几分钟后就消失了。 I also did a simple solana transfer, but it still same.我也做了一个简单的 solana 转移,但还是一样。

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.我知道 state 不是问题(因为 solana 余额和 hello world 程序中包含的数据是正确的),所以我怀疑问题出在Solana Explorer上,但后来我在 cli 上尝试solana transaction-history And same as before, the transaction appeared and disappeared.和之前一样,交易出现又消失。

So now, I suspect that solana-test-validator remove the transaction history from ledger.所以现在,我怀疑solana-test-validator会从账本中删除交易历史。 But, I found that the test-ledger is growing (last time I check is 10gb).但是,我发现test-ledger正在增长(上次我检查的是 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!谢谢!

This can be confusing.这可能会令人困惑。 The default ledger size for solana-test-validator is very small, so you'll lose transactions very quickly. solana-test-validator的默认分类帐大小非常小,因此您会很快丢失交易。 You can use the --limit-ledger-size argument to make it bigger.您可以使用--limit-ledger-size参数使其更大。 More information from -h :来自-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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM