syntax = "proto3"; package dht.node; message NodeEntry { uint64 id = 1; string pub_addr = 2; } enum QueryType { Get = 0; Delete = 1; Set = 2; } enum QueryError { ValueNotProvided = 0; KeyNotFound = 1; } message KeyValueEntry { uint64 key = 1; bytes value = 2; } // DEBUG message GetNodeIdResponse { uint64 id = 1; } message GetNodeStateResponse { uint64 id = 1; repeated NodeEntry leaf_set = 2; } message GetNodeTableEntryRequest { uint32 row = 1; uint32 column = 2; } message GetNodeTableEntryResponse { optional NodeEntry node = 1; } // MAIN REQUESTS message JoinRequest { uint64 id = 1; string pub_addr = 2; uint32 hops = 3; uint32 matched_digits = 4; repeated NodeEntry routing_table = 5; } message JoinResponse { uint64 id = 1; string pub_addr = 2; uint32 hops = 3; repeated NodeEntry leaf_set = 4; repeated NodeEntry routing_table = 5; } message LeaveRequest { uint64 id = 1; } message QueryRequest { uint64 from_id = 1; uint32 matched_digits = 2; uint32 hops = 3; QueryType query_type = 4; uint64 key = 5; optional bytes value = 6; } message QueryResponse { uint64 from_id = 1; uint32 hops = 2; uint64 key = 3; optional bytes value = 4; optional QueryError error = 5; } message TransferKeysRequest { uint64 id = 1; } // UPDATE NEIGHBORS message AnnounceArrivalRequest { uint64 id = 1; string pub_addr = 2; } message FixLeafSetRequest { uint64 id = 1; string pub_addr = 2; }