From b8ec85e09ff30583034c3c7143a8bafcfe029d65 Mon Sep 17 00:00:00 2001 From: Daniel Norman <1992255+2color@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:56:41 +0100 Subject: [PATCH 1/3] chore: clarify accepted Peer IDs --- src/routing/http-routing-v1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routing/http-routing-v1.md b/src/routing/http-routing-v1.md index 8108a247..164c3a71 100644 --- a/src/routing/http-routing-v1.md +++ b/src/routing/http-routing-v1.md @@ -148,7 +148,7 @@ Each object in the `Providers` list is a record conforming to a schema, usually #### 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, -represented as a CIDv1 encoded with `libp2p-key` codec. +represented as either a Multihash in Base58btc, or a CIDv1 with libp2p-key (`0x72`) codec. #### Request Query Parameters From d3e9251f5b31d5a0b852d5619552f00848177e15 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 5 Nov 2024 02:49:00 +0100 Subject: [PATCH 2/3] chore: mention bases, fix lint --- src/routing/http-routing-v1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routing/http-routing-v1.md b/src/routing/http-routing-v1.md index 164c3a71..54775c10 100644 --- a/src/routing/http-routing-v1.md +++ b/src/routing/http-routing-v1.md @@ -148,7 +148,7 @@ Each object in the `Providers` list is a record conforming to a schema, usually #### 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, -represented as either a Multihash in Base58btc, or a CIDv1 with libp2p-key (`0x72`) codec. +represented as either a Multihash in Base58btc, or a CIDv1 with libp2p-key (`0x72`) codec (in Base36 or Base32). #### Request Query Parameters From c168c57e7a32e7692fde75bfe66b8f29dd2feaa3 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 5 Nov 2024 02:53:30 +0100 Subject: [PATCH 3/3] chore: apply similar to cid argument --- src/routing/http-routing-v1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routing/http-routing-v1.md b/src/routing/http-routing-v1.md index 54775c10..bb58c754 100644 --- a/src/routing/http-routing-v1.md +++ b/src/routing/http-routing-v1.md @@ -52,7 +52,7 @@ As such, human-readable encodings of types are preferred. This specification may - CIDs are always string-encoded using a [multibase]-encoded [CIDv1]. - Multiaddrs are string-encoded according to the [human-readable multiaddr specification][multiaddr]. -- 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. +- 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 in Base36 or Base32. - Multibase bytes are string-encoded according to [the Multibase spec][multibase], and SHOULD use base64. - Timestamps are Unix millisecond epoch timestamps. @@ -68,7 +68,7 @@ This API uses a standard version prefix in the path, such as `/v1/...`. If a bac #### Path Parameters -- `cid` is the [CID](https://github.com/multiformats/cid) to fetch provider records for. +- `cid` is the [CID](https://github.com/multiformats/cid) to fetch provider records for (preferably normalized to a CIDv1 in Base32, to maximize HTTP cache hits). #### Request Query Parameters