Skip to content

Commit

Permalink
Websocket bootstrap subscription & attempt ID (#211)
Browse files Browse the repository at this point in the history
* Websocket bootstrap subscription & attempt ID

* available since v21.0

* Update websockets.md
  • Loading branch information
SergiySW authored May 8, 2020
1 parent 6bf5f74 commit 341ab33
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/commands/rpc-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,10 @@ Initialize bootstrap to specific **IP address** and **port**. Not compatible wit
_version 20.0+_
Default "false". If "true", frontier confirmation will not be performed for this bootstrap. Normally not to be changed.

**Optional "id"**
_version 21.0+_
String, empty by default. Set specific ID for new bootstrap attempt for better tracking.

---

### bootstrap_any
Expand All @@ -929,6 +933,10 @@ Initialize multi-connection bootstrap to random peers. Not compatible with launc
_version 20.0+_
Boolean, false by default. Manually force closing of all current bootstraps

**Optional "id"**
_version 21.0+_
String, empty by default. Set specific ID for new bootstrap attempt for better tracking.

---

### bootstrap_lazy
Expand All @@ -952,6 +960,10 @@ Initialize lazy bootstrap with given block **hash**. Not compatible with launch

Boolean, false by default. Manually force closing of all current bootstraps

**Optional "id"**
_version 21.0+_
String, empty by default. Set specific ID for new bootstrap attempt for better tracking.

---

### bootstrap_status
Expand Down
55 changes: 54 additions & 1 deletion docs/integration-guides/websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ Notes:
- If work generation fails, the notification is similar to the work cancelled notification, except `"reason": "failure"`
- When work generation is done locally it will show `"source": "local"`

---

### Node telemetry

Expand Down Expand Up @@ -589,4 +590,56 @@ No filters are currently available for the `new_unconfirmed_block` topic.
"subtype": "receive"
}
}
```
```

---

#### Bootstrap

This subscription is available since _v21.0_

##### Subscribing

To subscribe to bootstrap attempts start/exit notifications:
```json
{
"action": "subscribe",
"topic": "bootstrap"
}
```

##### Filtering options

No filters are currently available for the `bootstrap` topic.

##### Sample Results

```json
{
"topic": "bootstrap",
"time": "1561661740065",
"message": {
"reason": "started",
"id": "C9FF2347C4DF512A7F6B514CC4A0F79A",
"mode": "legacy"
}
}
```

```json
{
"topic": "bootstrap",
"time": "1561661740565",
"message": {
"reason": "exited",
"id": "C9FF2347C4DF512A7F6B514CC4A0F79A",
"mode": "legacy",
"total_blocks": "1000000",
"duration": "500"
}
}
```

Notes:

- The duration is in seconds

0 comments on commit 341ab33

Please sign in to comment.