NEAR主网缺失的测试网专属区块:如何认知及通过主网归档RPC获取详情
First, let's break down what these testnet-only blocks are and how to properly access their data:
What Are Testnet-Exclusive Blocks?
These are blocks that exist only on the NEAR Testnet—they have no connection to or presence on the NEAR Mainnet. NEAR's Testnet and Mainnet are completely separate, independent blockchains: they run on distinct validator sets, maintain their own unique chain states, and store block data in entirely isolated databases. There’s no cross-network sync or overlap between their datasets.
Why Your Mainnet RPC Query Failed
When you tried fetching block height 73685420 via the Mainnet archival RPC (https://archival-rpc.mainnet.near.org), the UNKNOWN_BLOCK error is totally expected. Mainnet archival nodes only store data from the Mainnet chain—they have zero records of Testnet blocks, so they can’t retrieve something that never existed in their database.
How to Get Details for This Testnet Block
To access data for a testnet-exclusive block, you need to use NEAR’s Testnet archival RPC endpoint instead of the Mainnet one. Here’s how to adjust your query:
Replace the Mainnet RPC URL with the Testnet archival RPC: https://archival-rpc.testnet.near.org
Here’s the modified curl command that will return the block details you’re looking for:
curl --location --request POST 'https://archival-rpc.testnet.near.org' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "id": "dontcare", "method": "block", "params": { "block_id": 73685420 } }'
This query targets the Testnet’s archival node, which holds the block data you need. A quick reminder: while you can view the block in the Testnet Explorer, using the Testnet RPC is the right approach if you need programmatic access to structured block data for development or analysis. The Mainnet will never have access to Testnet-specific chain data, as the two networks operate entirely independently.
内容的提问来源于stack exchange,提问作者Swornatoya Lenka

