Skip to content

Commit

Permalink
Document slotsUpdates (#18335) (#18339)
Browse files Browse the repository at this point in the history
* Add slotsUpdates to jsonrpc docs

* Re-add unstable section

(cherry picked from commit dfb6296)

Co-authored-by: Tyera Eulberg <[email protected]>
  • Loading branch information
mergify[bot] and CriesofCarrots authored Jul 1, 2021
1 parent 896ef5a commit 884ef21
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions docs/src/developing/clients/jsonrpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:

- `<integer>` - subscription id to cancel

#### Results:

- `<bool>` - 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.
Expand Down

0 comments on commit 884ef21

Please sign in to comment.