The plume.blocks table contains all blocks in the Plume blockchain.

Table Schema

Column NameData TypeDescription
numberdecimal(38,0)Block number
hashstringBlock hash
parent_hashstringParent block hash
noncestringBlock nonce
sha3_unclesstringSHA3 of uncles
logs_bloomstringBloom filter for logs
transactions_rootstringRoot of transactions trie
state_rootstringRoot of state trie
receipts_rootstringRoot of receipts trie
minerstringAddress of miner
difficultydecimal(38,0)Block difficulty
total_difficultydecimal(38,0)Total difficulty
sizedecimal(38,0)Block size
extra_datastringExtra data
gas_limitdecimal(38,0)Gas limit
gas_useddecimal(38,0)Gas used
timestamptimestampBlock timestamp
transaction_countdecimal(38,0)Number of transactions
base_fee_per_gasdecimal(38,0)Base fee per gas

Sample Query

-- Get the average block time and gas usage for the last 24 hours
SELECT 
    DATE_TRUNC('hour', timestamp) as hour,
    AVG(EXTRACT(EPOCH FROM (timestamp - LAG(timestamp) OVER (ORDER BY timestamp)))) as avg_block_time,
    AVG(gas_used) as avg_gas_used
FROM plume.blocks
WHERE timestamp >= NOW() - INTERVAL '24' HOUR
GROUP BY hour
ORDER BY hour;