Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/specs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a6bf57cf1f0a88b015a47d6f4efbf6b596d34c2a
Choose a base ref
..
head repository: ipfs/specs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7e4489ecced27081e462bd585a4134a952efd1e9
Choose a head ref
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/routing/http-routing-v1.md
6 changes: 4 additions & 2 deletions src/routing/http-routing-v1.md
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ Each object in the `Providers` list is a record conforming to a schema, usually

## Peer Routing API

### `GET /routing/v1/closest-peers/{peer-id}?closerThan`
### `GET /routing/v1/closest-peers/{peer-id}?closerThan&count`

#### Path Parameters

@@ -117,6 +117,8 @@ Each object in the `Providers` list is a record conforming to a schema, usually
- `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.
- Returned peer records must be closer to `peer-id` than `closerThan`.
- If omitted the routing implementation should use it's own [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md).
- `count` is an optional number that specifies how many peer records the requester desires.
- Minimum 1, maximum 100, default 20.

#### Response Status Codes

@@ -152,7 +154,7 @@ Each object in the `Providers` list is a record conforming to a schema, usually
}
```

The `application/json` responses SHOULD be limited to 20 peers.
The number of peer records in the responses SHOULD be limited to the `count` query parameter, which defaults to 20 if unspecified.

The client SHOULD be able to make a request with `Accept: application/x-ndjson` and get a [stream](#streaming) with more results.