Loading

get_block

Table function

Retrieves block metadata via eth_getBlockBy* endpoints using the canonical schema.

get_block(TRANSPORT)

Fetches the latest head block without expanding transaction bodies.

Parameters

NameType
transportTRANSPORT

Result columns

NameType
hashBYTES32
parent_hashBYTES32
minerADDRESS
numberBLOCK_NUMBER
timestampTIMESTAMP
sizeBIGINT
gas_limitGAS
gas_usedGAS
base_fee_per_gasBIGINT
difficultyBIGINT
total_difficultyUINT256
transactions_rootBYTES32
state_rootBYTES32
receipts_rootBYTES32
logs_bloomBYTES256
sha3_unclesBYTES32
extra_dataBLOB
nonceBLOB
blob_gas_usedBIGINT
excess_blob_gasBIGINT
parent_beacon_block_rootBYTES32
withdrawals_rootBYTES32
transactionsBYTES32[]
transactions_fullSTRUCT(hash BYTES32, block_hash BYTES32, block_number BLOCK_NUMBER, transaction_index INTEGER, "from" ADDRESS, "to" ADDRESS, "value" UINT256, gas GAS, gas_price BIGINT, max_fee_per_gas BIGINT, max_priority_fee_per_gas BIGINT, "input" BLOB, nonce BIGINT, "type" INTEGER, v INTEGER, r BYTES32, s BYTES32)[]
1
SELECT number, hash
2
FROM get_block(
3
$transport -- transport
4
);
Notebook ready in readonly mode.

get_block(TRANSPORT, BIGINT)

Fetches a specific block by height, accepting decimal integers that are converted to hex tags.

Parameters

NameType
transportTRANSPORT
block_numberBIGINT

Result columns

NameType
hashBYTES32
parent_hashBYTES32
minerADDRESS
numberBLOCK_NUMBER
timestampTIMESTAMP
sizeBIGINT
gas_limitGAS
gas_usedGAS
base_fee_per_gasBIGINT
difficultyBIGINT
total_difficultyUINT256
transactions_rootBYTES32
state_rootBYTES32
receipts_rootBYTES32
logs_bloomBYTES256
sha3_unclesBYTES32
extra_dataBLOB
nonceBLOB
blob_gas_usedBIGINT
excess_blob_gasBIGINT
parent_beacon_block_rootBYTES32
withdrawals_rootBYTES32
transactionsBYTES32[]
transactions_fullSTRUCT(hash BYTES32, block_hash BYTES32, block_number BLOCK_NUMBER, transaction_index INTEGER, "from" ADDRESS, "to" ADDRESS, "value" UINT256, gas GAS, gas_price BIGINT, max_fee_per_gas BIGINT, max_priority_fee_per_gas BIGINT, "input" BLOB, nonce BIGINT, "type" INTEGER, v INTEGER, r BYTES32, s BYTES32)[]
1
SELECT number, hash
2
FROM get_block(
3
$transport, -- transport
4
4200000 -- block_number
5
);
Notebook ready in readonly mode.

get_block(TRANSPORT, VARCHAR)

Accepts canonical tags (latest, safe, finalized) or a 0x-prefixed block hash.

Parameters

NameType
transportTRANSPORT
block_tag_or_hashVARCHAR

Result columns

NameType
hashBYTES32
parent_hashBYTES32
minerADDRESS
numberBLOCK_NUMBER
timestampTIMESTAMP
sizeBIGINT
gas_limitGAS
gas_usedGAS
base_fee_per_gasBIGINT
difficultyBIGINT
total_difficultyUINT256
transactions_rootBYTES32
state_rootBYTES32
receipts_rootBYTES32
logs_bloomBYTES256
sha3_unclesBYTES32
extra_dataBLOB
nonceBLOB
blob_gas_usedBIGINT
excess_blob_gasBIGINT
parent_beacon_block_rootBYTES32
withdrawals_rootBYTES32
transactionsBYTES32[]
transactions_fullSTRUCT(hash BYTES32, block_hash BYTES32, block_number BLOCK_NUMBER, transaction_index INTEGER, "from" ADDRESS, "to" ADDRESS, "value" UINT256, gas GAS, gas_price BIGINT, max_fee_per_gas BIGINT, max_priority_fee_per_gas BIGINT, "input" BLOB, nonce BIGINT, "type" INTEGER, v INTEGER, r BYTES32, s BYTES32)[]
1
SELECT number, hash
2
FROM get_block(
3
$transport, -- transport
4
'safe' -- block_tag_or_hash
5
);
Notebook ready in readonly mode.

get_block(TRANSPORT, BIGINT, BOOLEAN)

Fetches a block by height and expands the transactions array when include_transactions is true.

Parameters

NameType
transportTRANSPORT
block_numberBIGINT
include_transactionsBOOLEAN

Result columns

NameType
hashBYTES32
parent_hashBYTES32
minerADDRESS
numberBLOCK_NUMBER
timestampTIMESTAMP
sizeBIGINT
gas_limitGAS
gas_usedGAS
base_fee_per_gasBIGINT
difficultyBIGINT
total_difficultyUINT256
transactions_rootBYTES32
state_rootBYTES32
receipts_rootBYTES32
logs_bloomBYTES256
sha3_unclesBYTES32
extra_dataBLOB
nonceBLOB
blob_gas_usedBIGINT
excess_blob_gasBIGINT
parent_beacon_block_rootBYTES32
withdrawals_rootBYTES32
transactionsBYTES32[]
transactions_fullSTRUCT(hash BYTES32, block_hash BYTES32, block_number BLOCK_NUMBER, transaction_index INTEGER, "from" ADDRESS, "to" ADDRESS, "value" UINT256, gas GAS, gas_price BIGINT, max_fee_per_gas BIGINT, max_priority_fee_per_gas BIGINT, "input" BLOB, nonce BIGINT, "type" INTEGER, v INTEGER, r BYTES32, s BYTES32)[]
1
SELECT number, transactions
2
FROM get_block(
3
$transport, -- transport
4
4200000, -- block_number
5
true -- include_transactions
6
);
Notebook ready in readonly mode.

get_block(TRANSPORT, VARCHAR, BOOLEAN)

Fetches a tag- or hash-addressed block and optionally returns full transaction payloads.

Parameters

NameType
transportTRANSPORT
block_tag_or_hashVARCHAR
include_transactionsBOOLEAN

Result columns

NameType
hashBYTES32
parent_hashBYTES32
minerADDRESS
numberBLOCK_NUMBER
timestampTIMESTAMP
sizeBIGINT
gas_limitGAS
gas_usedGAS
base_fee_per_gasBIGINT
difficultyBIGINT
total_difficultyUINT256
transactions_rootBYTES32
state_rootBYTES32
receipts_rootBYTES32
logs_bloomBYTES256
sha3_unclesBYTES32
extra_dataBLOB
nonceBLOB
blob_gas_usedBIGINT
excess_blob_gasBIGINT
parent_beacon_block_rootBYTES32
withdrawals_rootBYTES32
transactionsBYTES32[]
transactions_fullSTRUCT(hash BYTES32, block_hash BYTES32, block_number BLOCK_NUMBER, transaction_index INTEGER, "from" ADDRESS, "to" ADDRESS, "value" UINT256, gas GAS, gas_price BIGINT, max_fee_per_gas BIGINT, max_priority_fee_per_gas BIGINT, "input" BLOB, nonce BIGINT, "type" INTEGER, v INTEGER, r BYTES32, s BYTES32)[]
1
SELECT number, transactions
2
FROM get_block(
3
$transport, -- transport
4
'finalized', -- block_tag_or_hash
5
true -- include_transactions
6
);
Notebook ready in readonly mode.