Versions in this module Expand all Collapse all v0 v0.1.0 Dec 10, 2018 Changes in this version + const PluginNoncePrefix + func ToPbPlugin(iplugin IPlugin) (pb *sttpb.Plugin, err error) + func ToPbPlugins(plugins []IPlugin) ([]*sttpb.Plugin, error) + type BeginBlockParams struct + Block *agtypes.BlockCache + type BeginBlockReturns struct + type EndBlockParams struct + Block *agtypes.BlockCache + ChangedValidators []*agtypes.ValidatorAttr + NextValidatorSet *agtypes.ValidatorSet + type EndBlockReturns struct + NextValidatorSet *agtypes.ValidatorSet + type ExecBlockParams struct + Block *agtypes.BlockCache + EventCache agtypes.EventCache + EventSwitch agtypes.EventSwitch + InvalidTxs []agtypes.ExecuteInvalidTx + ValidTxs agtypes.Txs + type ExecBlockReturns struct + type Hypocrites map[string][]*agtypes.Hypocrite + type IBroadcastable interface + BroadcastTx func([]byte) error + BroadcastTxCommit func([]byte) error + type IPlugin interface + BeginBlock func(*BeginBlockParams) (*BeginBlockReturns, error) + CheckTx func(tx []byte) (bool, error) + DeliverTx func(tx []byte, i int) (bool, error) + EndBlock func(*EndBlockParams) (*EndBlockReturns, error) + ExecBlock func(*ExecBlockParams) (*ExecBlockReturns, error) + Init func(*InitParams) + Reload func(*ReloadParams) + Reset func() + Stop func() + func PluginFromPbData(pbPlugin *sttpb.Plugin, logger *zap.Logger, statedb db.DB) (IPlugin, error) + func PluginsFromPbData(pbPlugins []*sttpb.Plugin, logger *zap.Logger, statedb db.DB) ([]IPlugin, error) + type IPunishable interface + SuspectValidator func(pubkey []byte, reason string) + type IValidatorsContainer interface + GetValidators func() (*agtypes.ValidatorSet, *agtypes.ValidatorSet) + type InitParams struct + DB db.DB + Logger *zap.Logger + PrivKey crypto.PrivKeyEd25519 + RefuseList *refuse_list.RefuseList + Switch *p2p.Switch + Validators **agtypes.ValidatorSet + type QueryCachePlugin struct + func (qc *QueryCachePlugin) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error) + func (qc *QueryCachePlugin) CheckTx(tx []byte) (bool, error) + func (qc *QueryCachePlugin) DeliverTx(tx []byte, i int) (bool, error) + func (qc *QueryCachePlugin) EndBlock(p *EndBlockParams) (*EndBlockReturns, error) + func (qc *QueryCachePlugin) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error) + func (qc *QueryCachePlugin) ExecutionResult(txHash []byte) (*types.TxExecutionResult, error) + func (qc *QueryCachePlugin) Init(p *InitParams) + func (qc *QueryCachePlugin) Reload(p *ReloadParams) + func (qc *QueryCachePlugin) Reset() + func (qc *QueryCachePlugin) SetEventSwitch(sw types.EventSwitch) + func (qc *QueryCachePlugin) Stop() + type ReloadParams struct + DB db.DB + Logger *zap.Logger + PrivKey crypto.PrivKeyEd25519 + RefuseList *refuse_list.RefuseList + Switch *p2p.Switch + Validators **agtypes.ValidatorSet + type Specialop struct + AddRefuseKeys [][32]byte + ChangedValidators []*agtypes.ValidatorAttr + DeleteRefuseKeys [][32]byte + DisconnectedPeers []*p2p.Peer + func NewSpecialop(logger *zap.Logger, statedb db.DB) *Specialop + func (s *Specialop) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error) + func (s *Specialop) CheckMajor23(cmd *agtypes.SpecialOPCmd) bool + func (s *Specialop) CheckTx(tx []byte) (bool, error) + func (s *Specialop) DeliverTx(tx []byte, i int) (bool, error) + func (s *Specialop) EndBlock(p *EndBlockParams) (*EndBlockReturns, error) + func (s *Specialop) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error) + func (s *Specialop) Init(p *InitParams) + func (s *Specialop) ParseValidator(cmd *agtypes.SpecialOPCmd) (*agtypes.ValidatorAttr, error) + func (s *Specialop) ProcessSpecialOP(cmd *agtypes.SpecialOPCmd) error + func (s *Specialop) Reload(p *ReloadParams) + func (s *Specialop) Reset() + func (s *Specialop) SetEventSwitch(sw agtypes.EventSwitch) + func (s *Specialop) SignSpecialOP(cmd *agtypes.SpecialOPCmd) (sig crypto.SignatureEd25519, res error) + func (s *Specialop) Stop() + type SuspectPlugin struct + Hypocrites Hypocrites + Suspects Suspects + func (sp *SuspectPlugin) AddHypocrite(pk string, hypo *agtypes.Hypocrite) + func (sp *SuspectPlugin) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error) + func (sp *SuspectPlugin) CheckTx(tx []byte) (bool, error) + func (sp *SuspectPlugin) DeliverTx(tx []byte, i int) (bool, error) + func (sp *SuspectPlugin) EndBlock(p *EndBlockParams) (*EndBlockReturns, error) + func (sp *SuspectPlugin) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error) + func (sp *SuspectPlugin) Init(p *InitParams) + func (sp *SuspectPlugin) Reload(p *ReloadParams) + func (sp *SuspectPlugin) ReportBadVote(pk crypto.PubKey, evidence interface{}) + func (sp *SuspectPlugin) ReportPeerError(pubkey crypto.PubKey, reason interface{}) + func (sp *SuspectPlugin) Reset() + func (sp *SuspectPlugin) SetBroadcastable(a IBroadcastable) + func (sp *SuspectPlugin) SetEventSwitch(sw agtypes.EventSwitch) + func (sp *SuspectPlugin) SetPunishable(p func() IPunishable) + func (sp *SuspectPlugin) SetValidatorsContainer(c IValidatorsContainer) + func (sp *SuspectPlugin) Stop() + type Suspects map[string][]*agtypes.Hypocrite + type VoteChannel struct + func NewVoteChannelPlugin(plugins []IPlugin) *VoteChannel + func (v *VoteChannel) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error) + func (v *VoteChannel) CheckTx(tx []byte) (bool, error) + func (v *VoteChannel) DeliverTx(tx []byte, i int) (bool, error) + func (v *VoteChannel) EndBlock(p *EndBlockParams) (*EndBlockReturns, error) + func (v *VoteChannel) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error) + func (v *VoteChannel) Init(p *InitParams) + func (v *VoteChannel) Reload(p *ReloadParams) + func (v *VoteChannel) Reset() + func (v *VoteChannel) SetEventSwitch(sw anntypes.EventSwitch) + func (v *VoteChannel) SetPlugins(ps []IPlugin) + func (v *VoteChannel) Stop()