Documentation
¶
Index ¶
- Constants
- func ToPbPlugin(iplugin IPlugin) (pb *sttpb.Plugin, err error)
- func ToPbPlugins(plugins []IPlugin) ([]*sttpb.Plugin, error)
- type BeginBlockParams
- type BeginBlockReturns
- type EndBlockParams
- type EndBlockReturns
- type ExecBlockParams
- type ExecBlockReturns
- type Hypocrites
- type IBroadcastable
- type IPlugin
- type IPunishable
- type IValidatorsContainer
- type InitParams
- type QueryCachePlugin
- 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
- type 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
- 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
- type 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()
Constants ¶
View Source
const (
PluginNoncePrefix = "pn-"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BeginBlockParams ¶
type BeginBlockParams struct {
Block *agtypes.BlockCache
}
type BeginBlockReturns ¶
type BeginBlockReturns struct { }
type EndBlockParams ¶
type EndBlockParams struct { Block *agtypes.BlockCache ChangedValidators []*agtypes.ValidatorAttr NextValidatorSet *agtypes.ValidatorSet }
type EndBlockReturns ¶
type EndBlockReturns struct {
NextValidatorSet *agtypes.ValidatorSet
}
type ExecBlockParams ¶
type ExecBlockParams struct { Block *agtypes.BlockCache EventSwitch agtypes.EventSwitch EventCache agtypes.EventCache ValidTxs agtypes.Txs InvalidTxs []agtypes.ExecuteInvalidTx }
type ExecBlockReturns ¶
type ExecBlockReturns struct { }
type Hypocrites ¶
type IBroadcastable ¶
type IPlugin ¶
type IPlugin interface { agtypes.Eventable // DeliverTx return false means the tx won't be pass on to proxy app DeliverTx(tx []byte, i int) (bool, error) // CheckTx return false means the tx won't be pass on to proxy app CheckTx(tx []byte) (bool, error) // BeginBlock just mock the abci Blockaware interface BeginBlock(*BeginBlockParams) (*BeginBlockReturns, error) // ExecBlock receives block ExecBlock(*ExecBlockParams) (*ExecBlockReturns, error) // EndBlock just mock the abci Blockaware interface EndBlock(*EndBlockParams) (*EndBlockReturns, error) // Reset is called when u don't need to maintain the plugin status Reset() // InitPlugin custom the initialization of the plugin Init(*InitParams) // Reload reloads private fields of the plugin Reload(*ReloadParams) Stop() }
IPlugin defines the behavior of the core plugins
func PluginFromPbData ¶
type IPunishable ¶
type IValidatorsContainer ¶
type IValidatorsContainer interface {
GetValidators() (*agtypes.ValidatorSet, *agtypes.ValidatorSet)
}
type InitParams ¶
type InitParams struct { Logger *zap.Logger DB db.DB Switch *p2p.Switch PrivKey crypto.PrivKeyEd25519 RefuseList *refuse_list.RefuseList Validators **agtypes.ValidatorSet }
type QueryCachePlugin ¶
type QueryCachePlugin struct {
// contains filtered or unexported fields
}
func (*QueryCachePlugin) BeginBlock ¶
func (qc *QueryCachePlugin) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
func (*QueryCachePlugin) DeliverTx ¶
func (qc *QueryCachePlugin) DeliverTx(tx []byte, i int) (bool, error)
func (*QueryCachePlugin) EndBlock ¶
func (qc *QueryCachePlugin) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
func (*QueryCachePlugin) ExecBlock ¶
func (qc *QueryCachePlugin) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
func (*QueryCachePlugin) ExecutionResult ¶
func (qc *QueryCachePlugin) ExecutionResult(txHash []byte) (*types.TxExecutionResult, error)
func (*QueryCachePlugin) Init ¶
func (qc *QueryCachePlugin) Init(p *InitParams)
func (*QueryCachePlugin) Reload ¶
func (qc *QueryCachePlugin) Reload(p *ReloadParams)
func (*QueryCachePlugin) Reset ¶
func (qc *QueryCachePlugin) Reset()
func (*QueryCachePlugin) SetEventSwitch ¶
func (qc *QueryCachePlugin) SetEventSwitch(sw types.EventSwitch)
func (*QueryCachePlugin) Stop ¶
func (qc *QueryCachePlugin) Stop()
type ReloadParams ¶
type ReloadParams struct { Logger *zap.Logger DB db.DB Switch *p2p.Switch PrivKey crypto.PrivKeyEd25519 RefuseList *refuse_list.RefuseList Validators **agtypes.ValidatorSet }
type Specialop ¶
type Specialop struct { ChangedValidators []*agtypes.ValidatorAttr DisconnectedPeers []*p2p.Peer AddRefuseKeys [][32]byte DeleteRefuseKeys [][32]byte // contains filtered or unexported fields }
func NewSpecialop ¶
func (*Specialop) BeginBlock ¶
func (s *Specialop) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
func (*Specialop) CheckMajor23 ¶
func (s *Specialop) CheckMajor23(cmd *agtypes.SpecialOPCmd) bool
func (*Specialop) EndBlock ¶
func (s *Specialop) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
func (*Specialop) ExecBlock ¶
func (s *Specialop) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
func (*Specialop) Init ¶
func (s *Specialop) Init(p *InitParams)
func (*Specialop) ParseValidator ¶
func (s *Specialop) ParseValidator(cmd *agtypes.SpecialOPCmd) (*agtypes.ValidatorAttr, error)
func (*Specialop) ProcessSpecialOP ¶
func (s *Specialop) ProcessSpecialOP(cmd *agtypes.SpecialOPCmd) error
func (*Specialop) Reload ¶
func (s *Specialop) Reload(p *ReloadParams)
func (*Specialop) SetEventSwitch ¶
func (s *Specialop) SetEventSwitch(sw agtypes.EventSwitch)
func (*Specialop) SignSpecialOP ¶
func (s *Specialop) SignSpecialOP(cmd *agtypes.SpecialOPCmd) (sig crypto.SignatureEd25519, res error)
type SuspectPlugin ¶
type SuspectPlugin struct { Hypocrites Hypocrites Suspects Suspects // contains filtered or unexported fields }
func (*SuspectPlugin) AddHypocrite ¶
func (sp *SuspectPlugin) AddHypocrite(pk string, hypo *agtypes.Hypocrite)
func (*SuspectPlugin) BeginBlock ¶
func (sp *SuspectPlugin) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
func (*SuspectPlugin) DeliverTx ¶
func (sp *SuspectPlugin) DeliverTx(tx []byte, i int) (bool, error)
func (*SuspectPlugin) EndBlock ¶
func (sp *SuspectPlugin) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
func (*SuspectPlugin) ExecBlock ¶
func (sp *SuspectPlugin) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
func (*SuspectPlugin) Init ¶
func (sp *SuspectPlugin) Init(p *InitParams)
func (*SuspectPlugin) Reload ¶
func (sp *SuspectPlugin) Reload(p *ReloadParams)
func (*SuspectPlugin) ReportBadVote ¶
func (sp *SuspectPlugin) ReportBadVote(pk crypto.PubKey, evidence interface{})
func (*SuspectPlugin) ReportPeerError ¶
func (sp *SuspectPlugin) ReportPeerError(pubkey crypto.PubKey, reason interface{})
func (*SuspectPlugin) Reset ¶
func (sp *SuspectPlugin) Reset()
func (*SuspectPlugin) SetBroadcastable ¶
func (sp *SuspectPlugin) SetBroadcastable(a IBroadcastable)
func (*SuspectPlugin) SetEventSwitch ¶
func (sp *SuspectPlugin) SetEventSwitch(sw agtypes.EventSwitch)
func (*SuspectPlugin) SetPunishable ¶
func (sp *SuspectPlugin) SetPunishable(p func() IPunishable)
func (*SuspectPlugin) SetValidatorsContainer ¶
func (sp *SuspectPlugin) SetValidatorsContainer(c IValidatorsContainer)
func (*SuspectPlugin) Stop ¶
func (sp *SuspectPlugin) Stop()
type VoteChannel ¶
type VoteChannel struct {
// contains filtered or unexported fields
}
func NewVoteChannelPlugin ¶
func NewVoteChannelPlugin(plugins []IPlugin) *VoteChannel
func (*VoteChannel) BeginBlock ¶
func (v *VoteChannel) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
func (*VoteChannel) EndBlock ¶
func (v *VoteChannel) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
func (*VoteChannel) ExecBlock ¶
func (v *VoteChannel) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
func (*VoteChannel) Init ¶
func (v *VoteChannel) Init(p *InitParams)
func (*VoteChannel) Reload ¶
func (v *VoteChannel) Reload(p *ReloadParams)
func (*VoteChannel) Reset ¶
func (v *VoteChannel) Reset()
func (*VoteChannel) SetEventSwitch ¶
func (v *VoteChannel) SetEventSwitch(sw anntypes.EventSwitch)
func (v *VoteChannel) GetVoteDB() db.DB { return v.db }
func (*VoteChannel) SetPlugins ¶
func (v *VoteChannel) SetPlugins(ps []IPlugin)
func (*VoteChannel) Stop ¶
func (v *VoteChannel) Stop()
Click to show internal directories.
Click to hide internal directories.