From 341ab33628dbd1b14bc81b0cdeda84c53a3f07d4 Mon Sep 17 00:00:00 2001 From: Sergey Kroshnin Date: Fri, 8 May 2020 23:13:07 +0300 Subject: [PATCH] Websocket bootstrap subscription & attempt ID (#211) * Websocket bootstrap subscription & attempt ID * available since v21.0 * Update websockets.md --- docs/commands/rpc-protocol.md | 12 ++++++ docs/integration-guides/websockets.md | 55 ++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/docs/commands/rpc-protocol.md b/docs/commands/rpc-protocol.md index 7d3cb2ee9..3e374af53 100644 --- a/docs/commands/rpc-protocol.md +++ b/docs/commands/rpc-protocol.md @@ -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 @@ -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 @@ -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 diff --git a/docs/integration-guides/websockets.md b/docs/integration-guides/websockets.md index 93440a7f6..2ab38696a 100644 --- a/docs/integration-guides/websockets.md +++ b/docs/integration-guides/websockets.md @@ -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 @@ -589,4 +590,56 @@ No filters are currently available for the `new_unconfirmed_block` topic. "subtype": "receive" } } -``` \ No newline at end of file +``` + +--- + +#### 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