curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e",
false
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e",
false
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}mainBlockGeneralGasLimit, sharedGasLimit, and timestampMillisPart for sub-second precision.
blockHash — the hash of the block to retrievefullTransactions — if true, returns full transaction objects; if false, returns only transaction hashesresult — a block object, or null if no block was found:
number — the block numberhash — the block hashparentHash — hash of the parent blocktimestamp — block timestamp in secondstimestampMillisPart — sub-second timestamp (0-999 ms), Tempo-specifictransactions — array of transaction objects or hasheseth_getBlockByHash code examplesconst Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getBlockByHash() {
const block = await web3.eth.getBlock("0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e");
console.log(block);
}
getBlockByHash()
Was this page helpful?