syntax = "proto3"; package raft; service RaftActions { rpc Info (Empty) returns (InfoResponse) {} rpc AppendEntries (AppendEntriesRequest) returns (AppendEntriesResponse) {} rpc InstallSnapshot (InstallSnapshotRequest) returns (InstallSnapshotResponse) {} rpc Vote (VoteRequest) returns (VoteResponse) {} } message Empty {} message MembershipConfig { repeated uint64 members = 1; repeated uint64 members_after_consensus = 2; } message InfoResponse { uint64 id = 1; string state = 2; uint64 current_term = 3; uint64 last_log_index = 4; uint64 last_applied = 5; optional uint64 current_leader = 6; MembershipConfig membership_config = 7; } message Entry { uint64 term = 1; uint64 index = 2; bytes payload = 3; } message AppendEntriesRequest { uint64 term = 1; uint64 leader_id = 2; uint64 prev_log_index = 3; uint64 prev_log_term = 4; repeated Entry entries = 5; uint64 leader_commit = 6; } message ConflictOpt { uint64 term = 1; uint64 index = 2; } message AppendEntriesResponse { uint64 term = 1; bool success = 2; ConflictOpt conflict_opt = 3; } message InstallSnapshotRequest { uint64 term = 1; uint64 leader_id = 2; uint64 last_included_index = 3; uint64 last_included_term = 4; uint64 offset = 5; bytes data = 6; bool done = 7; } message InstallSnapshotResponse { uint64 term = 1; } message VoteRequest { uint64 term = 1; uint64 candidate_id = 2; uint64 last_log_index = 3; uint64 last_log_term = 4; } message VoteResponse { uint64 term = 1; bool vote_granted = 2; }