syntax = "proto3"; package raft; message ChannelOutboundMessage { string providerName = 1; uint64 peerId = 2; ChannelMessages message = 3; } message ChannelInboundMessage { string providerName = 1; ChannelMessages message = 2; } message TcpWrapperMessage { string providerName = 1; ChannelMessages message = 2; } message ChannelMessages { oneof msg { NormalMessage NormalMessage = 1; ProposalMessage ProposalMessage = 2; DefaultPeerInit DefaultPeerInit = 5; ProposalCallback ProposalCallback = 6; } } message GetValueRequest { string key = 1; uint32 index = 2; string uuid = 3; bool getAll = 4; bool getByPrefix = 5; } message GetValueResponse { GetSingleValue value = 1; GetMultipleValues values = 2; string error = 3; } message GetSingleValue { bytes value = 1; } message GetMultipleValues { repeated string keys = 1; repeated bytes values = 2; } message SetValueRequest { string key = 1; bytes value = 2; uint32 index = 3; string uuid = 4; } message SetValueResponse { bool success = 1; } message DeleteValueRequest { string key = 1; uint32 index = 2; string uuid = 3; } message DeleteValueResponse { bool success = 1; } message NormalMessage { bytes message = 1; // serialize from `Message` object in raft-rs int64 timestamp = 2; } message ProposalMessage { string uuid = 1; NormalProposal normal = 2; ConfChangeProposal confChange = 3; TransferLeaderProposal transferLeader = 4; uint64 sourcePeerId = 5; DeleteProposal delete = 6; int64 timestamp = 7; } message ProposalCallback { string uuid = 1; bool success = 2; } message NormalProposal { string key = 1; bytes value = 2; uint32 index = 3; } message DeleteProposal { string key = 1; uint32 index = 2; } message ConfChangeProposal { bytes message = 1; // serialize from `ConfChange` object in raft-rs } message TransferLeaderProposal { uint64 peerId = 1; } // raft inner messages about proprosals message InnerMessages { oneof msg { InnerChangeStorageMessage InnerChangeStorageMessage = 1; InnerDeleteStorageMessage InnerDeleteStorageMessage = 2; } } message InnerChangeStorageMessage { string key = 1; bytes value = 2; uint32 index = 3; } message InnerDeleteStorageMessage { string key = 1; uint32 index = 2; } message PeerNode { uint64 peerId = 1; string address = 2; uint32 port = 3; } message DefaultPeerInit { uint64 peerId = 1; bool isLeader = 2; }