syntax = "proto3"; package raft_rpc; service RaftRpc { rpc AppendEntries(AppendEntriesRequest) returns (AppendEntriesResponse) {} rpc ForwardEntry(ForwardEntryRequest) returns (ForwardEntryResponse) {} rpc RequestVote(RequestVoteRequest) returns (RequestVoteResponse) {} rpc InstallSnapshot(SnapshotRequest) returns (SnapshotResponse) {} } message AppendEntriesRequest { uint64 term = 1; string leader_id = 2; uint64 prev_log_index = 3; uint64 prev_log_term = 4; repeated Entry entries = 5; uint64 leader_commit = 6; } message Entry { string payload = 1; uint64 term = 2; } message ForwardEntryRequest { string payload = 1; bool iswrite = 2; } message ForwardEntryResponse { string payload = 1; } message AppendEntriesResponse { uint64 term = 1; bool success = 2; } message RequestVoteRequest { uint64 term = 1; string candidate_id = 2; uint64 last_log_index = 3; uint64 last_log_term = 4; } message RequestVoteResponse { uint64 term = 1; bool vote_granted = 2; } message SnapshotRequest { uint64 term = 1; string leader_id = 2; uint64 last_included_index = 3; uint64 last_included_term = 4; uint64 offset = 5; string data = 6; bool done = 7; } message SnapshotResponse { uint64 term = 1; }