Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Key pair for the node KeyPair *keypair.KeyPair // Blockchain instance Blockchain *blockchain.Blockchain // Finite state machine for the blockchain FSM FSM // Logger Logger *log.Logger }
Config is the configuration used to initialize a ZBFT instance
type FSM ¶
type FSM interface { // Initializes the fsm with the given read-only tx store Init(store TxStore) // Prepare prepares the tx set writing the outputs back into the tx outputs Prepare(txs []*bcpb.Tx) error // Executes applies the given transactions Execute(txs []*bcpb.Tx, block *bcpb.BlockHeader, leader bool) error }
FSM implements a finite-state-machine used by zbft
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
Future represents a set of transactions that are undergoing ratification. These have not yet been applied and/or executed. It is used to signal completion of ratification and execution.
func (*Future) Ratified ¶
Ratified block until ratification is complete or time out occurs returning the ratification error or timeout err or if any
type TxStore ¶
type TxStore interface { // Returns the output associated to the given input GetTXO(txi *bcpb.TxInput) (*bcpb.TxOutput, error) }
TxStore implements a transaction store for read-only purposes
type ZBFT ¶
type ZBFT interface { // Start zbft Start() // SetGenesis is used to set the genesis block. This can only be called // once for each ledger SetGenesis(blk *bcpb.Block, txs []*bcpb.Tx) *Future // Submits message to consensus algo Step(msg zbftpb.Message) // SetTimeout sets the timeout for a given consensus round SetTimeout(d time.Duration) // ProposeTxs proposes Transactions to the ledger. They are first prepared, // added to a block then proposes to be added to the ledger ProposeTxs(txs []*bcpb.Tx) *Future // BroadcastMessages returns a read-only channel of messages that need to be // broadcasted to the network BroadcastMessages() <-chan zbftpb.Message }
ZBFT is the interface used by the user to interact with the consensus alogrithm to perform ops against it
Source Files ¶
Click to show internal directories.
Click to hide internal directories.