Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket bootstrap subscription & attempt ID #211

Merged
merged 6 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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