EventCount

Storage Plain v101 → current

Number of events in the current block .

Explore chain
Queried by: developersanalytics

The Big Picture

Lightweight way to know how busy a block was.

Use Cases

  • Quick check of block activity level

From Chain Metadata

The number of events in the `Events<T>` list.

Purpose & Usage

Purpose

Track event count without reading all events.

Common Query Patterns

  • Single value query

Stored Value

value (u32)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query EventCount storage (no keys - plain value)
const result = await api.query
  [stringCamelCase("System")]
  [stringCamelCase("EventCount")]();
console.log("EventCount:", result.toHuman());

Runtime Info

Pallet
System
Storage Kind
Plain
First Version
v101
Current Version
v393