Block Meta Subscriptions
Stream block metadata as blocks are produced, without the overhead of full transaction data or account state changes. You receive the slot, blockhash, block height, block time, reward information, and transaction count for each block.
BlockMeta subscriptions are the bandwidth-efficient alternative to full Block Subscriptions. They are ideal for monitoring chain progression, building lightweight block explorers, tracking block production timing for validator analytics, and calculating network throughput.
Filter Parameters
This subscription type accepts no filter parameters. All block metadata is streamed for the specified commitment level.
Update Payload
| Field | Type | Description |
|---|---|---|
slot | uint64 | The block slot number |
blockhash | string | The blockhash |
parent_slot | uint64 | The parent block slot |
parent_blockhash | string | The parent blockhash |
rewards | Reward[] | Validator and staking rewards for this block |
block_time | int64 | Estimated Unix timestamp of block production |
block_height | uint64 | The block height |
executed_transaction_count | uint64 | Number of transactions executed in this block |
Code Examples
Stream Block Metadata (Node.js)
1stream.write({
2 accounts: {},
3 slots: {},
4 transactions: {},
5 transactionsStatus: {},
6 blocks: {},
7 blocksMeta: {
8 meta: {} // No filter params -- receives all block metadata
9 },
10 commitment: 1,
11 entry: {},
12 accountsDataSlice: [],
13 ping: null
14});
15
16stream.on('data', (update) => {
17 if (update.blockMeta) {
18 const meta = update.blockMeta;
19 console.log('Slot:', meta.slot);
20 console.log('Blockhash:', meta.blockhash);
21 console.log('Block height:', meta.block_height);
22 console.log('Transaction count:', meta.executed_transaction_count);
23 console.log('Block time:', new Date(meta.block_time * 1000).toISOString());
24 console.log('Rewards:', meta.rewards.length);
25 }
26});Monitor Block Production (Rust)
1use yellowstone_grpc_client::GeyserGrpcClient;
2use yellowstone_grpc_proto::prelude::*;
3use std::collections::HashMap;
4use futures::StreamExt;
5
6#[tokio::main]
7async fn main() -> anyhow::Result<()> {
8 let mut client = GeyserGrpcClient::build_from_uri("http://[IP_ADDRESS]:[PORT]")
9 .connect()
10 .await?;
11
12 let mut blocks_meta = HashMap::new();
13 blocks_meta.insert("allMeta".to_string(), SubscribeRequestFilterBlocksMeta {});
14
15 let request = SubscribeRequest {
16 accounts: HashMap::new(),
17 slots: HashMap::new(),
18 transactions: HashMap::new(),
19 transactions_status: HashMap::new(),
20 blocks: HashMap::new(),
21 blocks_meta,
22 commitment: Some(CommitmentLevel::Confirmed as i32),
23 entry: HashMap::new(),
24 accounts_data_slice: vec![],
25 ping: None,
26 from_slot: None,
27 };
28
29 let (_, mut stream) = client.subscribe_with_request(Some(request)).await?;
30
31 while let Some(msg) = stream.next().await {
32 match msg?.update_oneof {
33 Some(UpdateOneof::BlockMeta(meta)) => {
34 println!("Block {} (height {}) -- {} txns | hash: {}",
35 meta.slot,
36 meta.block_height.unwrap_or_default(),
37 meta.executed_transaction_count.unwrap_or_default(),
38 meta.blockhash);
39 }
40 _ => {}
41 }
42 }
43
44 Ok(())
45}Common Use Cases
| Use Case | Filter Configuration |
|---|---|
| Chain progression monitor | Default (no filters) -- track slot/height progression |
| Block time analyzer | Parse block_time to measure slot duration and jitter |
| Network throughput tracker | Sum executed_transaction_count across blocks |
| Validator performance dashboard | Compare block times and transaction counts |
| Lightweight block explorer | Display block metadata without full transaction data |