From 884ef211f7b0115b1aac604e2b528b8bcfd4025b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 1 Jul 2021 00:25:24 +0000 Subject: [PATCH] Document slotsUpdates (#18335) (#18339) * Add slotsUpdates to jsonrpc docs * Re-add unstable section (cherry picked from commit dfb62964997498f7a45e28b62dde926537236203) Co-authored-by: Tyera Eulberg --- docs/src/developing/clients/jsonrpc-api.md | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/docs/src/developing/clients/jsonrpc-api.md b/docs/src/developing/clients/jsonrpc-api.md index a8a3336790f546..c7bb6ef864879c 100644 --- a/docs/src/developing/clients/jsonrpc-api.md +++ b/docs/src/developing/clients/jsonrpc-api.md @@ -81,6 +81,15 @@ gives a convenient interface for the RPC methods. - [slotSubscribe](jsonrpc-api.md#slotsubscribe) - [slotUnsubscribe](jsonrpc-api.md#slotunsubscribe) +### Unstable Methods + +Unstable methods may see breaking changes in patch releases and may not be supported in perpetuity. + +- [slotsUpdatesSubscribe](jsonrpc-api.md#slotsupdatessubscribe---unstable) +- [slotsUpdatesUnsubscribe](jsonrpc-api.md#slotsupdatesunsubscribe) +- [voteSubscribe](jsonrpc-api.md#votesubscribe---unstable-disabled-by-default) +- [voteUnsubscribe](jsonrpc-api.md#voteunsubscribe) + ### Deprecated Methods - [getConfirmedBlock](jsonrpc-api.md#getconfirmedblock) @@ -3857,6 +3866,87 @@ Result: {"jsonrpc": "2.0","result": true,"id": 1} ``` +### slotsUpdatesSubscribe - Unstable + +**This subscription is unstable; the format of this subscription may change in +the future and it may not always be supported** + +Subscribe to receive a notification from the validator on a variety of updates +on every slot + +#### Parameters: + +None + +#### Results: + +- `integer` - subscription id \(needed to unsubscribe\) + +#### Example: + +Request: +```json +{"jsonrpc":"2.0", "id":1, "method":"slotsUpdatesSubscribe"} + +``` + +Result: +```json +{"jsonrpc": "2.0","result": 0,"id": 1} +``` + +#### Notification Format: + +```bash +{ + "jsonrpc": "2.0", + "method": "slotsUpdatesNotification", + "params": { + "result": { + "parent": 75, + "slot": 76, + "timestamp": 1625081266243, + "type": "optimisticConfirmation" + }, + "subscription": 0 + } +} +``` + +Types: +- "firstShredReceived" +- "completed" +- "createdBank" +- "frozen" +- "dead" +- "optimisticConfirmation" +- "root" + +### slotsUpdatesUnsubscribe + +Unsubscribe from slot-update notifications + +#### Parameters: + +- `` - subscription id to cancel + +#### Results: + +- `` - unsubscribe success message + +#### Example: + +Request: +```json +{"jsonrpc":"2.0", "id":1, "method":"slotsUpdatesUnsubscribe", "params":[0]} + +``` + +Result: +```json +{"jsonrpc": "2.0","result": true,"id": 1} +``` + ### rootSubscribe Subscribe to receive notification anytime a new root is set by the validator.