You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routing/http-routing-v1.md
+91-22Lines changed: 91 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,26 @@ maturity: reliable
9
9
editors:
10
10
- name: Gus Eggert
11
11
github: guseggert
12
+
affiliation:
13
+
name: Protocol Labs
14
+
url: https://protocol.ai/
12
15
- name: Masih H. Derkani
13
16
github: masih
17
+
affiliation:
18
+
name: Protocol Labs
19
+
url: https://protocol.ai/
14
20
- name: Henrique Dias
15
21
url: https://hacdias.com/
16
22
github: hacdias
23
+
affiliation:
24
+
name: Protocol Labs
25
+
url: https://protocol.ai/
26
+
- name: Marcin Rataj
27
+
github: lidel
28
+
url: https://lidel.org/
29
+
affiliation:
30
+
name: Protocol Labs
31
+
url: https://protocol.ai/
17
32
xref:
18
33
- ipns-record
19
34
order: 0
@@ -32,7 +47,7 @@ As such, human-readable encodings of types are preferred. This specification may
32
47
33
48
- CIDs are always string-encoded using a [multibase]-encoded [CIDv1].
34
49
- Multiaddrs are string-encoded according to the [human-readable multiaddr specification][multiaddr].
35
-
- Peer IDs are string-encoded according [PeerID string representation specification][peer-id-representation].
50
+
- Peer IDs are string-encoded according [PeerID string representation specification][peer-id-representation]: either a Multihash in Base58btc, or a CIDv1 with libp2p-key (`0x72`) codec.
36
51
- Multibase bytes are string-encoded according to [the Multibase spec][multibase], and SHOULD use base64.
37
52
- Timestamps are Unix millisecond epoch timestamps.
38
53
@@ -62,19 +77,21 @@ This API uses a standard version prefix in the path, such as `/v1/...`. If a bac
This section contains a non-exhaustive list of known schemas that MAY be supported by clients and servers.
214
234
215
-
### Peer
235
+
### Peer Schema
216
236
217
237
The `peer` schema represents an arbitrary peer.
218
238
219
239
```json
220
240
{
221
241
"Schema": "peer",
222
-
"ID": "12D3K...",
242
+
"ID": "bafz...",
223
243
"Addrs": ["/ip4/..."],
224
244
"Protocols": ["transport-bitswap", ...]
245
+
...
225
246
}
226
247
```
227
248
228
-
-`ID`: the [Peer ID][peer-id].
229
-
-`Addrs`: a list of known [multiaddrs][multiaddr] for this peer. This list MAY be incomplete.
230
-
-`Protocols`: a list of protocols known to be supported by this peer.
231
-
- If empty, it means the server is missing protocol information, and the client should use `ID` and `Addrs` to connect to the peer and use the [libp2p identify protocol](https://github.com/libp2p/specs/tree/master/identify) to learn about supported ones.
249
+
-`ID`: the [Peer ID][peer-id] as Multihash in Base58btc or CIDv1 with libp2p-key codec.
250
+
-`Addrs`: an optional list of known [multiaddrs][multiaddr] for this peer.
251
+
- If missing or empty, it means the router server is missing that information, and the client should use `ID` to lookup updated peer information.
252
+
-`Protocols`: an optional list of protocols known to be supported by this peer.
253
+
- If missing or empty, it means the router server is missing that information, and the client should use `ID` and `Addrs` to lookup connect to the peer and use the [libp2p identify protocol](https://github.com/libp2p/specs/tree/master/identify) to learn about supported ones.
232
254
233
255
:::note
234
256
235
-
To allow for protocol-specific fields and future-proofing, the parser MUST allow for unknown fields,
236
-
and the clients MUST ignore unknown ones. Below is an example on how one could create a `foobar` protocol
237
-
that includes an additional field `foobar`. If the client knows the `foobar` protocol, they are free to
238
-
use the information contained in the additional field. If that is not the case, the field MUST be ignored.
257
+
To allow for protocol-specific fields and future-proofing, the parser MUST
258
+
allow for unknown fields, and the clients MUST ignore unknown ones.
259
+
260
+
Below is an example on how one could include `protocol-a` and `protocol-b`
261
+
protocols that includes an additional fields `protocol-a` and `protocol-b`.
262
+
263
+
If the client knows the protocol, they are free to use the extra binary
264
+
(base64) or JSON information contained in the additional field. If that is not
0 commit comments