Skip to content

Commit 63e9402

Browse files
committed
fix some formatting
1 parent 65d178b commit 63e9402

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

routing/DELEGATED_ROUTING_HTTP.md

+31-32
Original file line numberDiff line numberDiff line change
@@ -64,58 +64,57 @@ The Delegated Routing HTTP API uses the `application/json` content type by defau
6464
- This is the same as `GET /v1/providers/{CID}`, but takes a hashed CID encoded as a [multihash](https://github.com/multiformats/multihash/)
6565
- `GET /v1/ipns/{ID}`
6666
- Reframe equivalent: GetIPNS
67-
- `ID`: multibase-encoded bytes
67+
- `ID`: multibase-encoded bytes
6868
- Response
6969
- record bytes
7070
- `POST /v1/ipns`
7171
- Reframe equivalent: PutIPNS
7272
- Body
7373
```json
7474
{
75-
"Records": [
76-
{
77-
"ID": "multibase bytes",
78-
"Record": "multibase bytes"
79-
}
80-
]
75+
"Records": [
76+
{
77+
"ID": "multibase bytes",
78+
"Record": "multibase bytes"
79+
}
80+
]
8181
}
8282
```
8383
- Not idempotent (this doesn't really make sense for IPNS)
8484
- Default limit of 100 records per request
8585
- `PUT /v1/providers`
8686
- Reframe equivalent: Provide
8787
- Body
88-
```json
89-
{
90-
"Signature": "multibase bytes",
91-
"Payload": {
92-
"Keys": ["cid1", "cid2"],
93-
"Timestamp": 1234,
94-
"AdvisoryTTL": 1234,
95-
"Signature": "multibase bytes",
96-
"Provider": {
97-
"PeerID": "12D3K...",
98-
"Multiaddrs": ["/ip4/.../tcp/.../p2p/...", "/ip4/..."],
99-
"Protocols": [
100-
{
101-
"Codec": 1234,
102-
"Payload": { ... }
103-
}
104-
]
105-
}
106-
}
107-
}
108-
```
88+
```json
89+
{
90+
"Signature": "multibase bytes",
91+
"Payload": {
92+
"Keys": ["cid1", "cid2"],
93+
"Timestamp": 1234,
94+
"AdvisoryTTL": 1234,
95+
"Signature": "multibase bytes",
96+
"Provider": {
97+
"PeerID": "12D3K...",
98+
"Multiaddrs": ["/ip4/.../tcp/.../p2p/...", "/ip4/..."],
99+
"Protocols": [
100+
{
101+
"Codec": 1234,
102+
"Payload": { ... }
103+
}
104+
]
105+
}
106+
}
107+
}
108+
```
109109
- `Signature` is a multibase-encoded signature of the encoded bytes of the `Payload` field, signed using the private key of the Peer ID specified in the `Payload`. See the [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#keys) specification for the encoding of Peer IDs. Servers must verify the payload using the public key from the Peer ID. If the verification fails, the server must return a 403 status code.
110110
- Idempotent
111111
- Default limit of 100 keys per request
112112
- `GET /v1/ping`
113-
- This is absent from Reframe but is necessary for supporting e.g. the accelerated DHT client which can take many minutes to bootstrap, and light clients who want to probe multiple HTTP endpoints and use the fastest one
114113
- Returns 200 once the server is ready to accept requests
115-
- An alternate approach is w/ an orchestration dance in the server by not listening on the socket until the dependencies are ready, but this makes the “dance” easier to implement
116-
- Limits
114+
115+
## Limits
117116
- Responses with collections of results must have a default limit on the number of results that will be returned in a single response
118117
- Pagination and/or dynamic limit configuration may be added to this spec in the future, once there is a concrete requirement
119-
- Error Codes
118+
## Error Codes
120119
- A 404 must be returned if a resource was not found
121120
- A 501 must be returned if a method is not supported

0 commit comments

Comments
 (0)