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 { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

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

Runtime Info

Pallet
System
Storage Kind
Plain
First Version
v101
Current Version
v411