syntax = "proto3"; package libp2p.pubsub.v1; //! Libp2p Pubsub protobuf definitions. //! //! Current definitions are based on libp2p Pubsub and Gossipsub specs. //! See for more details: //! - https://github.com/libp2p/specs/tree/master/pubsub/README.md#the-rpc //! - https://github.com/libp2p/specs/tree/master/pubsub/README.md#the-message //! - https://github.com/libp2p/specs/tree/master/pubsub/README.md#the-topic-descriptor //! - https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.0.md#protobuf message RPC { repeated SubOpts subscriptions = 1; repeated Message publish = 2; message SubOpts { optional bool subscribe = 1; // subscribe or unsubscribe optional string topic_id = 2; } optional ControlMessage control = 3; } message Message { optional bytes from = 1; optional bytes data = 2; optional bytes seqno = 3; string topic = 4; optional bytes signature = 5; optional bytes key = 6; } message ControlMessage { repeated ControlIHave ihave = 1; repeated ControlIWant iwant = 2; repeated ControlGraft graft = 3; repeated ControlPrune prune = 4; } message ControlIHave { optional string topic_id = 1; repeated bytes message_ids = 2; } message ControlIWant { repeated bytes message_ids = 1; } message ControlGraft { optional string topic_id = 1; } message ControlPrune { optional string topic_id = 1; repeated PeerInfo peers = 2; // gossipsub v1.1 PX optional uint64 backoff = 3; // gossipsub v1.1 backoff time (in seconds) } message PeerInfo { optional bytes peer_id = 1; optional bytes signed_peer_record = 2; }