From c1eaebfbf7764c7f3a32812207184abed614befb Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 29 May 2023 11:15:13 +0200 Subject: [PATCH] wip: ipip 0417 --- src/ipips/ipip-0417.md | 54 ++++++++++++++++++++++++++++++++ src/routing/http-routing-v1.md | 57 ++++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 src/ipips/ipip-0417.md diff --git a/src/ipips/ipip-0417.md b/src/ipips/ipip-0417.md new file mode 100644 index 000000000..cf895682d --- /dev/null +++ b/src/ipips/ipip-0417.md @@ -0,0 +1,54 @@ +--- +title: "IPIP-0417: TODO" +date: 2023-05-29 +ipip: proposal +editors: + - name: Henrique Dias + github: hacdias + url: https://hacdias.com/ +relatedIssues: + - https://github.com/ipfs/specs/pull/410 + - https://github.com/ipfs/kubo/pull/9877 +order: 417 +tags: ['ipips'] +--- + +## Summary + +TODO + +## Motivation + +TODO + +## Detailed design + +TODO + +## Test fixtures + +TODO + +## Design rationale + +TODO + +### User benefit + +TODO + +### Compatibility + +TODO + +### Security + +TODO + +### Alternatives + +TODO + +### Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/routing/http-routing-v1.md b/src/routing/http-routing-v1.md index f8a6dd58d..bcfcab162 100644 --- a/src/routing/http-routing-v1.md +++ b/src/routing/http-routing-v1.md @@ -106,6 +106,22 @@ Response limit: 100 providers Each object in the `Providers` list is a *read provider record*. +### `GET /routing/v1/peers/{peer-id}` + +#### Path Parameters + +- `peer-id` is the [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md) to fetch peer records for. + +#### Response Status Codes + +- `200` (OK): the response body contains the peer record. +- `404` (Not Found): must be returned if no matching records are found. +- `422` (Unprocessable Entity): request does not conform to schema or semantic constraints. + +#### Response Body + +A [`peer` schema record](#peer). + ### `GET /routing/v1/ipns/{name}` #### Path Parameters @@ -148,9 +164,9 @@ with one *read provider record* per line: ```json -{"Protocol": "", "Schema": "", ...} -{"Protocol": "", "Schema": "", ...} -{"Protocol": "", "Schema": "", ...} +{"Schema": "", ...} +{"Schema": "", ...} +{"Schema": "", ...} ... ``` @@ -183,15 +199,38 @@ Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, OPTIONS ``` +## Known Schemas + +This section contains a non-exhaustive list of known schemas that MAY be supported by clients and servers. + +### Peer + +The `peer` schema represents an arbitrary peer. + + +```json +{ + "Schema": "peer", + "ID": "12D3K...", + "Addrs": ["/ip4/..."], + "Protocols": ["transport-bitswap", ...] +} +``` + +- `ID`: the [Peer ID](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md). +- `Addrs`: a list of known [multiaddrs][multiaddr] for this peer. This list MAY be incomplete. +- `Protocols`: an OPTIONAL field with the transports known to be used by this peer. If empty, it means the server does not know and the client can use the `identify` protocol to learn more. + + ## Known Transfer Protocols This section contains a non-exhaustive list of known transfer protocols (by name) that may be supported by clients and servers. ### Bitswap -Multicodec name: `transport-bitswap` -Schema: `bitswap` -Specification: [ipfs/specs/BITSWAP.md](https://github.com/ipfs/specs/blob/main/BITSWAP.md) +- Multicodec name: `transport-bitswap` +- Schema: `bitswap` +- Specification: [ipfs/specs/BITSWAP.md](https://github.com/ipfs/specs/blob/main/BITSWAP.md) #### Bitswap Read Provider Records @@ -212,9 +251,9 @@ The server should respect a passed `transport` query parameter by filtering agai ### Filecoin Graphsync -Multicodec name: `transport-graphsync-filecoinv1` -Schema: `graphsync-filecoinv1` -Specification: [ipfs/go-graphsync/blob/main/docs/architecture.md](https://github.com/ipfs/go-graphsync/blob/main/docs/architecture.md) +- Multicodec name: `transport-graphsync-filecoinv1` +- Schema: `graphsync-filecoinv1` +- Specification: [ipfs/go-graphsync/blob/main/docs/architecture.md](https://github.com/ipfs/go-graphsync/blob/main/docs/architecture.md) #### Filecoin Graphsync Read Provider Records