Documentation ¶
Index ¶
- func GenesisCheckpoint(initialAppState []byte, params Params) (*checkpoint.StableCheckpoint, error)
- func PerturbMessages(params *eventmangler.ModuleParams, moduleID stdtypes.ModuleID, sys *System) error
- type ModuleConfig
- func (mc ModuleConfig) ConfigureBatchFetcher() batchfetcher.ModuleConfig
- func (mc ModuleConfig) ConfigureCheckpointing() checkpoint.ModuleConfig
- func (mc ModuleConfig) ConfigureChkpValidator() chkpvalidator.ModuleConfig
- func (mc ModuleConfig) ConfigureFakeBatchDB() fakebatchdb.ModuleConfig
- func (mc ModuleConfig) ConfigureISS() iss.ModuleConfig
- func (mc ModuleConfig) ConfigureMultisigCollector() multisigcollector.ModuleConfig
- func (mc ModuleConfig) ConfigureOrdering() ordererscommon.ModuleConfig
- func (mc ModuleConfig) ConfigurePreprepareValidator() pprepvalidator.ModuleConfig
- func (mc ModuleConfig) ConfigurePreprepareValidatorChkp() pprepvalidator.ModuleConfig
- func (mc ModuleConfig) ConfigureSimpleMempool() simplemempool.ModuleConfig
- type Params
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenesisCheckpoint ¶
func GenesisCheckpoint(initialAppState []byte, params Params) (*checkpoint.StableCheckpoint, error)
GenesisCheckpoint returns an initial stable checkpoint used for bootstrapping. It is a special checkpoint for epoch 0, corresponding to the state of the application (the serialization of which is passed as the initialAppState parameter) before applying any transactions. The associated certificate is empty (and should still be considered valid, as a special case).
func PerturbMessages ¶
func PerturbMessages(params *eventmangler.ModuleParams, moduleID stdtypes.ModuleID, sys *System) error
PerturbMessages configures the SMR system to randomly drop and delay some of the messages sent over the network. Useful for debugging and stress-testing. The params argument defines parameters of the perturbation, such as how many messages should be dropped and how the remaining messages should be delayed.
Types ¶
type ModuleConfig ¶
type ModuleConfig struct { App t.ModuleID Availability t.ModuleID BatchDB t.ModuleID BatchFetcher t.ModuleID Checkpointing t.ModuleID ChkpValidator t.ModuleID Crypto t.ModuleID Hasher t.ModuleID ISS t.ModuleID // TODO: Rename this when Trantor is generalized to use other high-level protocols Mempool t.ModuleID Net t.ModuleID Null t.ModuleID Ordering t.ModuleID PPrepValidator t.ModuleID PPrepValidatorChkp t.ModuleID Timer t.ModuleID }
func DefaultModuleConfig ¶
func DefaultModuleConfig() ModuleConfig
func (ModuleConfig) ConfigureBatchFetcher ¶
func (mc ModuleConfig) ConfigureBatchFetcher() batchfetcher.ModuleConfig
func (ModuleConfig) ConfigureCheckpointing ¶
func (mc ModuleConfig) ConfigureCheckpointing() checkpoint.ModuleConfig
func (ModuleConfig) ConfigureChkpValidator ¶
func (mc ModuleConfig) ConfigureChkpValidator() chkpvalidator.ModuleConfig
func (ModuleConfig) ConfigureFakeBatchDB ¶
func (mc ModuleConfig) ConfigureFakeBatchDB() fakebatchdb.ModuleConfig
func (ModuleConfig) ConfigureISS ¶
func (mc ModuleConfig) ConfigureISS() iss.ModuleConfig
func (ModuleConfig) ConfigureMultisigCollector ¶
func (mc ModuleConfig) ConfigureMultisigCollector() multisigcollector.ModuleConfig
func (ModuleConfig) ConfigureOrdering ¶
func (mc ModuleConfig) ConfigureOrdering() ordererscommon.ModuleConfig
func (ModuleConfig) ConfigurePreprepareValidator ¶
func (mc ModuleConfig) ConfigurePreprepareValidator() pprepvalidator.ModuleConfig
func (ModuleConfig) ConfigurePreprepareValidatorChkp ¶
func (mc ModuleConfig) ConfigurePreprepareValidatorChkp() pprepvalidator.ModuleConfig
func (ModuleConfig) ConfigureSimpleMempool ¶
func (mc ModuleConfig) ConfigureSimpleMempool() simplemempool.ModuleConfig
type Params ¶
type Params struct { Mempool *simplemempool.ModuleParams Iss *issconfig.ModuleParams Net grpc.Params Availability multisigcollector.ModuleParams }
func DefaultParams ¶
func DefaultParams(initialMembership *trantorpbtypes.Membership) Params
type System ¶
type System struct {
// contains filtered or unexported fields
}
System represents a Trantor system. It groups and configures the various Mir modules that need to work together to implement state machine replication.
func New ¶
func New( ownID stdtypes.NodeID, transport net.Transport, startingCheckpoint *checkpoint.StableCheckpoint, cryptoImpl mircrypto.Crypto, app appmodule.AppLogic, params Params, logger logging.Logger, ) (*System, error)
New creates a new SMR system. It instantiates the various Mir modules that make up the system and configures them to work together. The returned system's Start method must be called before the system can be used. The returned system's Stop method should be called when the system is no longer needed. The returned system's Modules method can be used to obtain the Mir modules to be passed to mir.NewNode.
func (*System) Modules ¶
Modules returns the Mir modules that make up the system. The return value of Modules is to be used as an argument to mir.NewNode.
func (*System) Start ¶
Start starts the operation of the modules of the SMR system. It starts the network transport and connects to the initial members of the system.
func (*System) Stop ¶
func (sys *System) Stop()
Stop stops the operation of the modules of the SMR system. Currently, it only stops the network transport, as no other modules need to be stopped.
func (*System) WithModule ¶
WithModule associates the given module ID within the SMR system with the given module. If a module with the given ID already exists, it is replaced. WithModule returns the SMR system itself (not a copy of it), so calls can be chained.