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
- create new "DHT Routing API" section for DHT-specific operations
- move /routing/v1/dht/closest/{peer-id} to the new DHT section
- keep general peer lookup in "Peer Routing API" section
- update cache value to 172800 (48h) for consistency
- fix typo: "Query Paramters" -> "Query Parameters"
-`peer-id` is a [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) represented as a CIDv1 encoded with `libp2p-key` codec.
114
-
115
-
#### Query Paramters
116
-
117
-
-`closerThan` is an optional [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) represented as a CIDv1 encoded with `libp2p-key` codec.
118
-
- Returned peer records must be closer to `peer-id` than `closerThan`.
119
-
- If omitted the routing implementation should use its own [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md).
120
-
-`count` is an optional number that specifies how many peer records the requester desires.
121
-
- Minimum 1, maximum 100, default 20.
113
+
-`peer-id` is the [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) to fetch peer records for,
114
+
represented as a CIDv1 encoded with `libp2p-key` codec.
122
115
123
116
#### Response Status Codes
124
117
125
-
-`200` (OK): the response body contains peer records.
118
+
-`200` (OK): the response body contains the peer record.
126
119
-`404` (Not Found): must be returned if no matching records are found.
127
120
-`422` (Unprocessable Entity): request does not conform to schema or semantic constraints.
128
121
@@ -134,7 +127,7 @@ Each object in the `Providers` list is a record conforming to a schema, usually
134
127
- When present, `ttl` SHOULD be shorter for responses whose resolution ended in no results (e.g. 15 seconds),
135
128
and longer for responses that have results (e.g. 5 minutes).
136
129
- Implementations SHOULD include `max-ttl`, set to the maximum cache window of the underlying routing system.
137
-
For example, if Amino DHT results are returned, `stale-while-revalidate` SHOULD be set to `79200` (22h, which at the time of writing this specification, is the [Provider Record Republish Interval](https://github.com/libp2p/specs/tree/master/kad-dht#content-provider-advertisement-and-discovery)).
130
+
For example, if Amino DHT results are returned, `stale-while-revalidate` SHOULD be set to `172800` (48h, which at the time of writing this specification, is the provider record expiration window).
138
131
-`Vary: Accept`: allows intermediate caches to play nicely with the different possible content types.
139
132
140
133
#### Response Body
@@ -154,22 +147,31 @@ Each object in the `Providers` list is a record conforming to a schema, usually
154
147
}
155
148
```
156
149
157
-
The number of peer records in the responses SHOULD be limited to the `count` query parameter, which defaults to 20 if unspecified.
150
+
The `application/json`responses SHOULD be limited to 100 peers.
158
151
159
152
The client SHOULD be able to make a request with `Accept: application/x-ndjson` and get a [stream](#streaming) with more results.
160
153
161
154
Each object in the `Peers` list is a record conforming to the [Peer Schema](#peer-schema).
-`peer-id` is the [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) to fetch peer records for,
168
-
represented as a CIDv1 encoded with `libp2p-key` codec.
162
+
-`peer-id` is a [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) represented as a CIDv1 encoded with `libp2p-key` codec.
163
+
164
+
#### Query Parameters
165
+
166
+
-`closerThan` is an optional [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) represented as a CIDv1 encoded with `libp2p-key` codec.
167
+
- Returned peer records must be closer to `peer-id` than `closerThan`.
168
+
- If omitted the routing implementation should use its own [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md).
169
+
-`count` is an optional number that specifies how many peer records the requester desires.
170
+
- Minimum 1, maximum 100, default 20.
169
171
170
172
#### Response Status Codes
171
173
172
-
-`200` (OK): the response body contains the peer record.
174
+
-`200` (OK): the response body contains peer records.
173
175
-`404` (Not Found): must be returned if no matching records are found.
174
176
-`422` (Unprocessable Entity): request does not conform to schema or semantic constraints.
175
177
@@ -201,7 +203,7 @@ represented as a CIDv1 encoded with `libp2p-key` codec.
201
203
}
202
204
```
203
205
204
-
The `application/json`responses SHOULD be limited to 100 peers.
206
+
The number of peer records in the responses SHOULD be limited to the `count` query parameter, which defaults to 20 if unspecified.
205
207
206
208
The client SHOULD be able to make a request with `Accept: application/x-ndjson` and get a [stream](#streaming) with more results.
0 commit comments