From 647c8422fbb4b158f63228d18210e2a507b59ffc Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 21 Apr 2022 19:07:10 -0400 Subject: [PATCH 1/2] spec(reframe): draft for getting peer records --- REFRAME.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/REFRAME.md b/REFRAME.md index e805df9bd..c704fec96 100644 --- a/REFRAME.md +++ b/REFRAME.md @@ -76,6 +76,7 @@ type Request union { | "FindProvidersRequest" FindProvidersRequest | "GetIPNSRequest" GetIPNSRequest | "PutIPNSRequest" PutIPNSRequest + | "GetPeerAddressesRequest" GetPeerAddressesRequest } ``` @@ -87,6 +88,7 @@ type Response union { | "FindProvidersResponse" FindProvidersResponse | "GetIPNSResponse" GetIPNSResponse | "PutIPNSResponse" PutIPNSResponse + | "GetPeerAddressesResponse" GetPeerAddressesResponse | "Error" Error } ``` @@ -280,6 +282,45 @@ Response: {"PutIPNSResponse : {}"} ``` +#### GetPeerAddresses + +A message for getting the addresses of a libp2p peer + +```ipldsch + type GetPeerAddressesRequest struct { + ID Bytes # libp2p PeerID + RecordTypes [String] + } + + type Multiaddresses [Bytes] # Each element in the list is the binary representation of a complete multiaddr without a peerID suffix + type Libp2pSignedPeerRecord Bytes # https://github.com/libp2p/specs/blob/8c967a22bfbaff1ae41072b358fdba7c5883b6a4/RFC/0003-routing-records.md + + type PeerRecordType union { + | Multiaddresses "multiaddrs" + | Libp2pSignedPeerRecord "769" // the libp2p signed peer record entry interpreted as decimal https://github.com/multiformats/multicodec/blob/f5dd49f35b26b447aa380e9a491f195fd49d912c/table.csv#L129 + | Any default + } representation keyed + + type GetPeerAddressesResponse struct { + Records [PeerRecordType] + } +``` + +##### DAG-JSON Examples + +Request: // TODO +``` +{"GetPeerAddressesRequest" : { + "ID" : {"/":{"bytes":"AXIUBPnagss"}}, + "Record" : {"/":{"bytes":"AXIUBPnagss"}} +}} +``` + +Response: // TODO +``` +{"GetPeerAddressesResponse : {}"} +``` + # Method Upgrade Paths It is acknowledged that the initial methods and mechanisms of this protocol will likely need to change over time and that we should prepare for how to do so without the need to wholesale replace this protocol with an alternative. From fac8b2dfd59b84fc53a2a4b4776e8e2b94d664d7 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 21 Apr 2022 19:07:35 -0400 Subject: [PATCH 2/2] spec(reframe): fix typos --- REFRAME.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/REFRAME.md b/REFRAME.md index c704fec96..82c257a22 100644 --- a/REFRAME.md +++ b/REFRAME.md @@ -173,8 +173,8 @@ Note: While the Key is a CID it is highly recommended that server implementation } type TransferProtocol union { - | Bitswap "2304" # Table entry interpretted as decimal string https://github.com/multiformats/multicodec/blob/f5dd49f35b26b447aa380e9a491f195fd49d912c/table.csv#L133 - | GraphSync-FILv1 "2320" # Table entry interpretted as decimal string https://github.com/multiformats/multicodec/blob/f5dd49f35b26b447aa380e9a491f195fd49d912c/table.csv#L134 + | Bitswap "2304" # Table entry interpreted as decimal string https://github.com/multiformats/multicodec/blob/f5dd49f35b26b447aa380e9a491f195fd49d912c/table.csv#L133 + | GraphSync-FILv1 "2320" # Table entry interpreted as decimal string https://github.com/multiformats/multicodec/blob/f5dd49f35b26b447aa380e9a491f195fd49d912c/table.csv#L134 | Any default } representation keyed