给定一笔交易https://explorer.near.org/transactions/JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ https://explorer.near.org/transactions/JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ
当我查询 NEAR rpc 时:
http post https://rpc.mainnet.near.org jsonrpc=2.0 method=tx params:='["JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ","wasmgit.near"]' id=dontcare
然后我期望得到交易状态
相反,我得到以下响应:
{
"error": {
"code": -32000,
"data": "Transaction JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ doesn't exist",
"message": "Server error"
},
"id": "dontcare",
"jsonrpc": "2.0"
}
source: https://docs.near.org/docs/api/rpc#setup https://docs.near.org/docs/api/rpc#setup
查询历史数据(大于5epochs https://docs.near.org/docs/concepts/epoch或~2.5 天),您可以
得到数据不再可用的答复。在这种情况下,
归档 RPC 节点将帮助您:
- mainnet https://archival-rpc.mainnet.near.org https://archival-rpc.mainnet.near.org
- testnet https://archival-rpc.testnet.near.org https://archival-rpc.testnet.near.org
可以看到nearcore中定义了这个接口here https://github.com/near/nearcore/blob/bf9ae4ce8c680d3408db1935ebd0ca24c4960884/chain/jsonrpc/client/src/lib.rs#L181.
通过近cli
near --nodeUrl https://archival-rpc.mainnet.near.org \
tx-status JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ \
--accountId wasmgit.near
via http
http post https://archival-rpc.mainnet.near.org \
jsonrpc=2.0 method=tx \
params:='["JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ","wasmgit.near"]' \
id=dontcare
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)