Documentation ¶
Index ¶
- Constants
- 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 ReloadParams
- 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
Constants ¶
View Source
const (
PluginNoncePrefix = "pn-"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeginBlockParams ¶
type BeginBlockParams struct {
Block *agtypes.BlockCache
}
type BeginBlockReturns ¶
type BeginBlockReturns struct { }
type EndBlockParams ¶
type EndBlockParams struct {
Block *agtypes.BlockCache
}
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
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 ReloadParams ¶
type ReloadParams struct { Logger *zap.Logger DB db.DB Switch *p2p.Switch PrivKey crypto.PrivKeyEd25519 RefuseList *refuse_list.RefuseList Validators **agtypes.ValidatorSet }
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()
Click to show internal directories.
Click to hide internal directories.