go-libp2p-peerstore/pb/pstore.proto
Raúl Kripalani 4c43736fe9 pstoreds: tighten up gc-based peerstore.
Introduces custom types in protobuf to serde directly into multiaddrs
and peer IDs. Simplify purge by ordering addrs by expiry. In general,
getting this readier for merge.
2018-11-15 13:32:08 +00:00

28 lines
720 B
Protocol Buffer

syntax = "proto3";
package pstore.pb;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.benchgen_all) = true;
option (gogoproto.populate_all) = true;
// AddrBookRecord represents a record for a peer in the address book.
message AddrBookRecord {
// The peer ID.
bytes id = 1 [(gogoproto.customtype) = "ProtoPeerID"];
// The multiaddresses. This is a sorted list where element 0 expires the soonest.
repeated AddrEntry addrs = 2;
// AddrEntry represents a single multiaddress.
message AddrEntry {
bytes addr = 1 [(gogoproto.customtype) = "ProtoAddr"];
// The point in time when this address expires.
int64 expiry = 2;
// The original TTL of this address.
int64 ttl = 3;
}
}