-
Notifications
You must be signed in to change notification settings - Fork 32
Dependencies
Each node communicates with the other nodes by broadcasting messages. To receive messages from Comm nodes must implement the OnReceive(m Message) method.
Comm {
Broadcast(m Message)
Send(targetID uint64, m Message)
}Consensus proposals are different for each application, however, they are all batches of clients' requests and they may contain metadata. The Assembler builds an application specific Proposal that the leader will later propose for consensus.
The Assembler is input with metadata that is application specific, and a batch of requests.
It returns a proposal that consists of some of the requests, and a remainder of the requests that could be proposed again in a new proposal.
Assembler {
AssembleProposal(metadata []byte, requests [][]byte) (nextProp Proposal, remainder [][]byte)
}Each node must store some information on disk.
Storage {
...
}To support different types of signatures, this library is dependent on a Signer.
Signer {
Sign([]byte) []byte
}A Verifier is used to validate the proposals suggested by a leader and to verify signatures.
Verifier {
VerifyProposal(proposal Proposal) error
VerifyRequest(val []byte) error
VerifyConsenterSig(signer uint, signature []byte, m []byte) error
VerificationSequence() uint64
}RequestInspector inspects requests and derives properties from them, such as a unique request ID, or a unique ID of the client that issued the request.
RequestInspector {
RequestID(req []byte) RequestInfo
}RequestInfo {
ID string
ClientID string
}A Synchronizer reaches the cluster nodes and fetches blocks in order to sync the replica's state.
An invocation of Sync() blocks indefinitely until the replica's state is synchronized to the latest verification sequence.
Synchronizer {
Sync()
}