The raft consensus component for CITA Cloud.
It uses raft-rs as the raft implementation.
cargo build --release
You may find more details in runner_k8s and runner_consul
docker build -t citacloud/consensus_raft .
Please check the ConsensusService
and Consensus2ControllerService
in cita_cloud_proto
which defines the service that consensus should implement.
The main workflow for consensus service is as follow:
The proof, for example, is the nonce for POW consensus, and is empty for non-byzantine consensus like this raft implementation. It will be used later by peers' controller to validate the corresponding block when they sync the missing blocks from others.
To communicate with other peers, you need to:
NetworkMsgHandlerService
which handles the messages from peers.RegisterNetworkMsgHandler,
which tells the network to forward the messages you are concerned about.After all of that, you can send your messages to others by SendMsg
or Broadcast provided by the network service.
Content type
Image
Digest
sha256:ccb30b169…
Size
38.7 MB
Last updated
over 3 years ago
docker pull citacloud/consensus_raft:v6.6.5