-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protocols/rendezvous: Implement protocol (#2107)
Implement the libp2p rendezvous protocol. > A lightweight mechanism for generalized peer discovery. It can be used for bootstrap purposes, real time peer discovery, application specific routing, and so on. Co-authored-by: rishflab <rishflab@hotmail.com> Co-authored-by: Daniel Karzel <daniel@comit.network>
- Loading branch information
1 parent
c1ae8a0
commit adcfdc0
Showing
32 changed files
with
4,463 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
|
||
package envelope_proto; | ||
|
||
import "keys.proto"; | ||
|
||
// Envelope encloses a signed payload produced by a peer, along with the public | ||
// key of the keypair it was signed with so that it can be statelessly validated | ||
// by the receiver. | ||
// | ||
// The payload is prefixed with a byte string that determines the type, so it | ||
// can be deserialized deterministically. Often, this byte string is a | ||
// multicodec. | ||
message Envelope { | ||
// public_key is the public key of the keypair the enclosed payload was | ||
// signed with. | ||
keys_proto.PublicKey public_key = 1; | ||
|
||
// payload_type encodes the type of payload, so that it can be deserialized | ||
// deterministically. | ||
bytes payload_type = 2; | ||
|
||
// payload is the actual payload carried inside this envelope. | ||
bytes payload = 3; | ||
|
||
// signature is the signature produced by the private key corresponding to | ||
// the enclosed public key, over the payload, prefixing a domain string for | ||
// additional security. | ||
bytes signature = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
syntax = "proto3"; | ||
|
||
package peer_record_proto; | ||
|
||
// PeerRecord messages contain information that is useful to share with other peers. | ||
// Currently, a PeerRecord contains the public listen addresses for a peer, but this | ||
// is expected to expand to include other information in the future. | ||
// | ||
// PeerRecords are designed to be serialized to bytes and placed inside of | ||
// SignedEnvelopes before sharing with other peers. | ||
message PeerRecord { | ||
|
||
// AddressInfo is a wrapper around a binary multiaddr. It is defined as a | ||
// separate message to allow us to add per-address metadata in the future. | ||
message AddressInfo { | ||
bytes multiaddr = 1; | ||
} | ||
|
||
// peer_id contains a libp2p peer id in its binary representation. | ||
bytes peer_id = 1; | ||
|
||
// seq contains a monotonically-increasing sequence counter to order PeerRecords in time. | ||
uint64 seq = 2; | ||
|
||
// addresses is a list of public listen addresses for the peer. | ||
repeated AddressInfo addresses = 3; | ||
} |
Oops, something went wrong.