Reputation: 5683
Given a transaction https://explorer.near.org/transactions/JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ
When I query NEAR rpc:
http post https://rpc.mainnet.near.org jsonrpc=2.0 method=tx params:='["JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ","wasmgit.near"]' id=dontcare
Then I expect to get the transaction status
Instead I get the following response:
{
"error": {
"code": -32000,
"data": "Transaction JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ doesn't exist",
"message": "Server error"
},
"id": "dontcare",
"jsonrpc": "2.0"
}
Upvotes: 4
Views: 662
Reputation: 11
I, too, faced challenges in obtaining archival transactions at one point in time.
To access these transactions, I utilized their public Postgres SQL database, available at the following link: Postgres SQL with near txs
However, this solution is not suitable for production purposes, as the database frequently experienced downtime (at least a year ago) and occasionally suffered from excessively long timeouts (I can provide the query if needed).
In the end, I opted for Cryptomation.com, a service analogous to Scan services but with support for the Near Network.
Upvotes: 1
Reputation: 1401
source: https://docs.near.org/docs/api/rpc#setup
Querying historical data (older than 5 epochs or ~2.5 days), you may get responses that the data is not available anymore. In that case, archival RPC nodes will come to your rescue:
You can see this interface defined in nearcore here.
via near-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
Upvotes: 4