Skip to content

Peer Exchange Protocol #7

Description

@Stebalien

Not to be confused with #3.

We should have a global peer exchange protocol for exchanging information on peers wiling to perform some service and/or speak some protocol. This would implement the discovery (https://github.com/libp2p/go-libp2p-discovery/) interface and could be run in parallel to a dht-based discovery service to widen a search.

Basic protocol proposal:

message Request {
    // Service descriptions (arbitrary strings).
    repeated string services = 0;

    // Number of peers to return (0 means unlimited).
    int32 limit = 1;
}

message Response {
    repeated Peer peers = 0
}

message Peer {
    // Peer id
    bytes id = 0;

    // Addresses for the peer.
    repeated string addresses = 1

    // List of services the peer supports. Empty means "unspecified".
    //
    // TODO: Should we use numbers and index into some table? Maybe index
    // into the table from the request?
    repeated string services = 2
    
    // Timestamp when the peer was last seen.
    // 0 for currently connected
    uint64 lastSeen = 3;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions