api

package
v2.3.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 4 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	// Deliver delivers the given proposal and signatures.
	// After the call returns we assume that this proposal is stored in persistent memory.
	// It returns whether this proposal was a reconfiguration and the current config.
	Deliver(proposal bft.Proposal, signature []bft.Signature) bft.Reconfig
}

Application delivers the consented proposal and corresponding signatures.

type Assembler

type Assembler interface {
	// AssembleProposal creates a proposal which includes
	// the given requests (when permitting) and metadata.
	AssembleProposal(metadata []byte, requests [][]byte) bft.Proposal
}

Assembler creates proposals.

type Comm

type Comm interface {
	// SendConsensus sends the consensus protocol related message m to the node with id targetID.
	SendConsensus(targetID uint64, m *protos.Message)
	// SendTransaction sends the given client's request to the node with id targetID.
	SendTransaction(targetID uint64, request []byte)
	// Nodes returns a set of ids of participating nodes.
	// In case you need to change or keep this slice, create a copy.
	Nodes() []uint64
}

Comm enables the communications between the nodes.

type Logger

type Logger interface {
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Panicf(template string, args ...interface{})
}

Logger defines the contract for logging.

type MembershipNotifier

type MembershipNotifier interface {
	//MembershipChange returns true if there was a membership change in the last proposal.
	MembershipChange() bool
}

MembershipNotifier notifies if there was a membership change in the last proposal.

type RequestInspector

type RequestInspector interface {
	// RequestID returns info about the given request.
	RequestID(req []byte) bft.RequestInfo
}

RequestInspector extracts info (i.e. request id and client id) from a given request.

type Signer

type Signer interface {
	// Sign signs on the given data and returns the signature.
	Sign([]byte) []byte
	// SignProposal signs on the given proposal and returns a composite Signature.
	SignProposal(proposal bft.Proposal, auxiliaryInput []byte) *bft.Signature
}

Signer signs on the given data.

type Synchronizer

type Synchronizer interface {
	// Sync blocks indefinitely until the replica's state is synchronized to the latest decision,
	// and returns it with info about reconfiguration.
	Sync() bft.SyncResponse
}

Synchronizer reaches the cluster nodes and fetches blocks in order to sync the replica's state.

type Verifier

type Verifier interface {
	// VerifyProposal verifies the given proposal and returns the included requests' info.
	VerifyProposal(proposal bft.Proposal) ([]bft.RequestInfo, error)
	// VerifyRequest verifies the given request and returns its info.
	VerifyRequest(val []byte) (bft.RequestInfo, error)
	// VerifyConsenterSig verifies the signature for the given proposal.
	// It returns the auxiliary data in the signature.
	VerifyConsenterSig(signature bft.Signature, prop bft.Proposal) ([]byte, error)
	// VerifySignature verifies the signature.
	VerifySignature(signature bft.Signature) error
	// VerificationSequence returns the current verification sequence.
	VerificationSequence() uint64
	// RequestsFromProposal returns from the given proposal the included requests' info
	RequestsFromProposal(proposal bft.Proposal) []bft.RequestInfo
	// AuxiliaryData extracts the auxiliary data from a signature's message
	AuxiliaryData([]byte) []byte
}

Verifier validates data and verifies signatures.

type WriteAheadLog

type WriteAheadLog interface {
	// Append appends a data item to the end of the WAL
	// and indicate whether this entry is a truncation point.
	Append(entry []byte, truncateTo bool) error
}

WriteAheadLog is a write ahead log.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL