From 9463537cccd4edff18fcd4df56bdaf3e35440fff Mon Sep 17 00:00:00 2001 From: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com> Date: Fri, 4 Dec 2020 09:57:27 +0200 Subject: [PATCH] Add Admin API (#267) * Add Admin API --- specs/waku/v2/waku-v2-rpc-api.md | 28 ++++++++++++++++++++++++++++ wordlist.txt | 2 ++ 2 files changed, 30 insertions(+) diff --git a/specs/waku/v2/waku-v2-rpc-api.md b/specs/waku/v2/waku-v2-rpc-api.md index e72c00f5..cb757b91 100644 --- a/specs/waku/v2/waku-v2-rpc-api.md +++ b/specs/waku/v2/waku-v2-rpc-api.md @@ -284,6 +284,34 @@ The `get_waku_v2_filter_v1_messages` method returns a list of messages that were - **`Array`[[`WakuMessage`](#WakuMessage)]** - the latest `messages` on the polled content `topic` or an [error](https://www.jsonrpc.org/specification#error_object) on failure. +## Admin API + +The Admin API provides privileged accesses to the internal operations of a Waku v2 node. + +### Types + +The following structured types are defined for use on the Admin API: + +#### WakuPeer + +`WakuPeer` is an `Object` containing the following fields: +| Field | Type | Inclusion | Description | +| ----: | :--: | :--: |----------- | +| `multiaddr` | `String` | mandatory | Multiaddress containing this peer's location and identity | +| `protocol` | `String` | mandatory | Protocol that this peer is registered for | +| `connected` | `bool` | mandatory | `true` if peer has active connection for this `protocol`, `false` if not | + +### `get_waku_v2_admin_v1_peers` + +The `get_waku_v2_admin_v1_peers` method returns an array of peers registered on this node. Since a Waku v2 node may open either continuous or ad hoc connections, depending on the negotiated protocol, these peers may have different connected states. The same peer MAY appear twice in the returned array, if it is registered for more than one protocol. + +#### Parameters + +none + +#### Response +- **`Array`[[`WakuPeer`](#WakuPeer)]** - Array of peers registered on this node + # Example usage ## Store API diff --git a/wordlist.txt b/wordlist.txt index 71b7d435..11790f14 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -70,6 +70,7 @@ HistoryQuery historyResponse HistoryResponse HistoryRPC +hoc html http https @@ -205,6 +206,7 @@ waku WakuFilter WakuInfo WakuMessage +WakuPeer WakuRelay WakuRelayMessage WakuStore