Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

grandpa_subscribeJustifications - Avail

Example code for the grandpa_subscribeJustifications WebSocket method. Complete guide on how to use grandpa_subscribeJustifications WebSocket in GetBlock Web3 documentation.

Streams GRANDPA finality justifications as blocks are finalized. WebSocket only. A justification is the cryptographic proof that a block is finalized, used by light clients and bridges.

Parameters

This method takes no parameters; send an empty params array.

Subscribe

wscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

# then send:
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "grandpa_subscribeJustifications",
    "params": []
}

Subscription ID

The initial response returns the subscription id used to correlate and cancel the stream:

Notifications

While subscribed, the node pushes a notification per update:

Notification Fields

Field
Type
Description

result

string

Hex-encoded GRANDPA justification for a finalized block

Use Cases

  • Light Clients: Verify finality independently

  • Bridges: Relay finality proofs to another chain

  • Audits: Record finality justifications

Error Handling

Error
Message
Description

-32603 / Internal error

Subscription error

The subscription could not be established

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?