debug_getRawBlock
https://api.triport.io/v1/ethReturns the RLP-encoded bytes of an entire Ethereum block, identified by block number or block hash.
debug_getRawBlock returns the raw, RLP-encoded serialization of a full block —
header plus the body (transactions and uncles) — exactly as it is stored and
gossiped on the wire. The result is a single 0x-prefixed hex string.
Use this when you need the canonical byte representation of a block rather than
the decoded JSON object that eth_getBlockByNumber
returns: for example to recompute the block hash locally, to re-import a block
into another client, or to verify block contents against an independent encoder.
This is a debug-namespace method and is available on the Pro tier and
above. It is rate limited per tier (5 RPS on Pro, 15 RPS on Business) with a
short burst allowance; there is no daily quota.
Parameters
A single positional parameter.
blockstringrequired0x-prefixed hex block number, a block tag (latest, earliest, safe, finalized, pending), or a 0x-prefixed 32-byte block hash.Response
Response fields
| Field | Type | Description |
|---|---|---|
result | string | The 0x-prefixed, RLP-encoded bytes of the full block (header + transactions + uncles). |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your API key's tier is below Pro; this debug-namespace method is not enabled for it. |
-32003 | rate_limited | You exceeded your tier's request rate (5 RPS on Pro, 15 RPS on Business) including burst. Retry after a short back-off. |
See the shared error envelope reference for the full error object shape and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/eth", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "debug_getRawBlock",
params: ["0x10D4F"],
}),
});
const { result } = await res.json();
console.log(result); // "0xf90211a0..."TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const rawBlock: string = await triport.eth.request("debug_getRawBlock", [
"0x10D4F",
]);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
raw_block = triport.eth.request("debug_getRawBlock", ["0x10D4F"])
print(raw_block) # "0xf90211a0..."Notes
- The
blockargument accepts a hex block number, a block tag, or a 32-byte block hash — pass whichever you have. - The result is RLP bytes, not JSON. To work with decoded fields, use
eth_getBlockByNumberoreth_getBlockByHashinstead. - For just the encoded header, see
debug_getRawHeader; for an individual encoded transaction, seedebug_getRawTransaction.