mirror of https://github.com/vacp2p/rfc-index.git
Update and rename RPC.md to rpc.md
This commit is contained in:
parent
d637b10156
commit
87b56de18e
|
@ -7,13 +7,13 @@ tags: waku-core
|
|||
editor: Hanno Cornelius <hanno@status.im>
|
||||
---
|
||||
|
||||
# Introduction
|
||||
## Introduction
|
||||
|
||||
This specification describes the JSON-RPC API that Waku v2 nodes MAY adhere to. Refer to the [Waku v2 specification](/spec/10/) for more information on Waku v2.
|
||||
This specification describes the JSON-RPC API that Waku v2 nodes MAY adhere to. Refer to the [Waku v2 specification](../10/waku2.md) for more information on Waku v2.
|
||||
|
||||
# Wire Protocol
|
||||
## Wire Protocol
|
||||
|
||||
## Transport
|
||||
### Transport
|
||||
|
||||
Nodes SHOULD expose an accessible [JSON-RPC](https://www.jsonrpc.org/specification) API. The JSON-RPC version SHOULD be `2.0`. Below is an example request:
|
||||
|
||||
|
@ -26,7 +26,7 @@ Nodes SHOULD expose an accessible [JSON-RPC](https://www.jsonrpc.org/specificati
|
|||
}
|
||||
```
|
||||
|
||||
### Fields
|
||||
#### Fields
|
||||
|
||||
| Field | Description |
|
||||
| --------- | --------------------------------------------------- |
|
||||
|
@ -35,7 +35,7 @@ Nodes SHOULD expose an accessible [JSON-RPC](https://www.jsonrpc.org/specificati
|
|||
| `params` | An array of parameters for the request |
|
||||
| `id` | The request ID |
|
||||
|
||||
## Types
|
||||
### Types
|
||||
|
||||
In this specification, the primitive types `Boolean`, `String`, `Number` and `Null`, as well as the structured types `Array` and `Object`, are to be interpreted according to the [JSON-RPC specification](https://www.jsonrpc.org/specification#conventions). It also adopts the same capitalisation conventions.
|
||||
|
||||
|
@ -43,7 +43,7 @@ The following structured types are defined for use throughout the document:
|
|||
|
||||
### WakuMessage
|
||||
|
||||
Refer to [`Waku Message` specification](/spec/14/) for more information.
|
||||
Refer to [`Waku Message` specification](../14/message.md) for more information.
|
||||
|
||||
`WakuMessage` is an `Object` containing the following fields:
|
||||
|
||||
|
@ -53,7 +53,7 @@ Refer to [`Waku Message` specification](/spec/14/) for more information.
|
|||
| `contentTopic` | `String` | optional | Message content topic for optional content-based filtering |
|
||||
| `version` | `Number` | optional | Message version. Used to indicate type of payload encryption. Default version is 0 (no payload encryption). |
|
||||
| `timestamp` | `Number` | optional | The time at which the message is generated by its sender. This field holds the Unix epoch time in nanoseconds as a 64-bits integer value. |
|
||||
| `ephemeral` | `Boolean` | optional | This flag indicates the transient nature of the message. Indicates if the message is eligible to be stored by the `store` protocol, [13/WAKU2-STORE](/spec/13/). |
|
||||
| `ephemeral` | `Boolean` | optional | This flag indicates the transient nature of the message. Indicates if the message is eligible to be stored by the `store` protocol, [13/WAKU2-STORE](../13/store.md). |
|
||||
|
||||
## Method naming
|
||||
|
||||
|
@ -115,7 +115,7 @@ none
|
|||
|
||||
## Relay API
|
||||
|
||||
Refer to the [Waku Relay specification](/specs/11/) for more information on the relaying of messages.
|
||||
Refer to the [Waku Relay specification](../11/relay.md) for more information on the relaying of messages.
|
||||
|
||||
### `post_waku_v2_relay_v1_message`
|
||||
|
||||
|
@ -176,7 +176,7 @@ The `get_waku_v2_relay_v1_messages` method returns a list of messages that were
|
|||
|
||||
## Relay Private API
|
||||
|
||||
The Private API provides functionality to encrypt/decrypt `WakuMessage` payloads using either symmetric or asymmetric cryptography. This allows backwards compatibility with [Waku v1 nodes](/specs/6/).
|
||||
The Private API provides functionality to encrypt/decrypt `WakuMessage` payloads using either symmetric or asymmetric cryptography. This allows backwards compatibility with [Waku v1 nodes](../6/waku1.md).
|
||||
It is the API client's responsibility to keep track of the keys used for encrypted communication. Since keys must be cached by the client and provided to the node to encrypt/decrypt payloads, a Private API SHOULD NOT be exposed on non-local or untrusted nodes.
|
||||
|
||||
### Types
|
||||
|
@ -287,7 +287,7 @@ Before returning the messages, the server decrypts the message payloads using th
|
|||
|
||||
## Store API
|
||||
|
||||
Refer to the [Waku Store specification](https://github.com/vacp2p/specs/blob/master/specs/waku/v2/waku-store.md) for more information on message history retrieval.
|
||||
Refer to the [Waku Store specification](../13/store.md) for more information on message history retrieval.
|
||||
|
||||
### Types
|
||||
|
||||
|
@ -340,8 +340,8 @@ The `get_waku_v2_store_v1_messages` method retrieves historical messages on spec
|
|||
| ----: | :---: | :---: |----------- |
|
||||
| `pubsubTopic` | `String` | optional | The pubsub topic on which a [`WakuMessage`](#wakumessage) is published |
|
||||
| `contentFilters` | `Array`[[`ContentFilter`](#contentfilter)] | optional | Array of content filters to query for historical messages |
|
||||
| `startTime` | `Number`| optional | The inclusive lower bound on the [`timestamp`](/spec/14#message-attributes) of queried [`WakuMessage`s](#wakumessage). This field holds the Unix epoch time in nanoseconds as a 64-bits integer value. |
|
||||
| `endTime` | `Number` | optional | The inclusive upper bound on the [`timestamp`](/spec/14#message-attributes) of queried [`WakuMessage`s](#wakumessage). This field holds the Unix epoch time in nanoseconds as a 64-bits integer value. |
|
||||
| `startTime` | `Number`| optional | The inclusive lower bound on the [`timestamp`](../14/message.md/#message-attributes) of queried [`WakuMessage`s](#wakumessage). This field holds the Unix epoch time in nanoseconds as a 64-bits integer value. |
|
||||
| `endTime` | `Number` | optional | The inclusive upper bound on the [`timestamp`](../14/message.md/#message-attributes) of queried [`WakuMessage`s](#wakumessage). This field holds the Unix epoch time in nanoseconds as a 64-bits integer value. |
|
||||
| `pagingOptions` | [`PagingOptions`](#pagingoptions) | optional | Pagination information |
|
||||
|
||||
#### Response
|
||||
|
@ -350,7 +350,7 @@ The `get_waku_v2_store_v1_messages` method retrieves historical messages on spec
|
|||
|
||||
## Filter API
|
||||
|
||||
Refer to the [Waku Filter specification](/specs/12/) for more information on content filtering.
|
||||
Refer to the [Waku Filter specification](../12/filter.md) for more information on content filtering.
|
||||
|
||||
### Types
|
||||
|
||||
|
@ -366,7 +366,7 @@ The following structured types are defined for use on the Filter API:
|
|||
|
||||
### `post_waku_v2_filter_v1_subscription`
|
||||
|
||||
The `post_waku_v2_filter_v1_subscription` method creates a subscription in a [light node](/spec/12/#rationale) for messages that matches a content filter and, optionally, a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor).
|
||||
The `post_waku_v2_filter_v1_subscription` method creates a subscription in a [light node](../12/filter.md/#rationale) for messages that matches a content filter and, optionally, a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor).
|
||||
|
||||
#### Parameters
|
||||
|
||||
|
@ -381,7 +381,7 @@ The `post_waku_v2_filter_v1_subscription` method creates a subscription in a [li
|
|||
|
||||
### `delete_waku_v2_filter_v1_subscription`
|
||||
|
||||
The `delete_waku_v2_filter_v1_subscription` method removes subscriptions in a [light node](/spec/12/#rationale) matching a content filter and, optionally, a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor).
|
||||
The `delete_waku_v2_filter_v1_subscription` method removes subscriptions in a [light node](../12/filter.md/#rationale) matching a content filter and, optionally, a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor).
|
||||
|
||||
#### Parameters
|
||||
|
||||
|
@ -453,11 +453,11 @@ The `post_waku_v2_admin_v1_peers` method connects a node to a list of peers.
|
|||
- **`Bool`** - `true` on success or an [error](https://www.jsonrpc.org/specification#error_object) on failure.
|
||||
|
||||
|
||||
# Example usage
|
||||
## Example usage
|
||||
|
||||
## Store API
|
||||
### Store API
|
||||
|
||||
### `get_waku_v2_store_v1_messages`
|
||||
#### `get_waku_v2_store_v1_messages`
|
||||
|
||||
This method is part of the `store` API and the specific resources to retrieve are (historical) `messages`. The protocol (`waku`) is on `v2`, whereas the Store API definition is on `v1`.
|
||||
|
||||
|
@ -626,14 +626,14 @@ This method is part of the `store` API and the specific resources to retrieve ar
|
|||
}
|
||||
```
|
||||
|
||||
# References
|
||||
## Copyright
|
||||
|
||||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
|
||||
|
||||
## References
|
||||
|
||||
1. [JSON-RPC specification](https://www.jsonrpc.org/specification)
|
||||
1. [LibP2P Addressing](https://docs.libp2p.io/concepts/addressing/)
|
||||
1. [LibP2P PubSub specification - topic descriptor](https://github.com/libp2p/specs/tree/master/pubsub#the-topic-descriptor)
|
||||
1. [Waku v2 specification](/specs/10/)
|
||||
1. [Waku v2 specification](../10/waku2.md)
|
||||
1. [IETF RFC 4648 - The Base16, Base32, and Base64 Data Encodings](https://datatracker.ietf.org/doc/html/rfc4648)
|
||||
|
||||
# Copyright
|
||||
|
||||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
|
Loading…
Reference in New Issue