Documentation
¶
Index ¶
- Constants
- type AdminApp
- type AdminOp
- func (s *AdminOp) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
- func (s *AdminOp) CheckMajor23(cmd *agtypes.AdminOPCmd) bool
- func (s *AdminOp) CheckTx(tx []byte) (bool, error)
- func (s *AdminOp) DeliverTx(tx []byte, i int) (bool, error)
- func (s *AdminOp) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
- func (s *AdminOp) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
- func (s *AdminOp) ExecTX(app AdminApp, tx []byte) error
- func (s *AdminOp) Init(p *InitParams)
- func (s *AdminOp) ParseValidator(cmd *agtypes.AdminOPCmd) (*agtypes.ValidatorAttr, error)
- func (s *AdminOp) ProcessAdminOP(cmd *agtypes.AdminOPCmd, app AdminApp) error
- func (s *AdminOp) Reload(p *ReloadParams)
- func (s *AdminOp) Reset()
- func (s *AdminOp) SetEventSwitch(sw agtypes.EventSwitch)
- func (s *AdminOp) Stop()
- type BeginBlockParams
- type BeginBlockReturns
- type EndBlockParams
- type EndBlockReturns
- type ExecBlockParams
- type ExecBlockReturns
- type IPlugin
- 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
Constants ¶
View Source
const (
PluginNoncePrefix = "pn-"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminOp ¶
type AdminOp struct {
ChangedValidators []*agtypes.ValidatorAttr
DisconnectedPeers []*p2p.Peer
AddRefuseKeys []crypto.PubKey
DeleteRefuseKeys []crypto.PubKey
// contains filtered or unexported fields
}
func (*AdminOp) BeginBlock ¶
func (s *AdminOp) BeginBlock(p *BeginBlockParams) (*BeginBlockReturns, error)
func (*AdminOp) CheckMajor23 ¶
func (s *AdminOp) CheckMajor23(cmd *agtypes.AdminOPCmd) bool
func (*AdminOp) EndBlock ¶
func (s *AdminOp) EndBlock(p *EndBlockParams) (*EndBlockReturns, error)
func (*AdminOp) ExecBlock ¶
func (s *AdminOp) ExecBlock(p *ExecBlockParams) (*ExecBlockReturns, error)
func (*AdminOp) Init ¶
func (s *AdminOp) Init(p *InitParams)
func (*AdminOp) ParseValidator ¶
func (s *AdminOp) ParseValidator(cmd *agtypes.AdminOPCmd) (*agtypes.ValidatorAttr, error)
func (*AdminOp) ProcessAdminOP ¶
func (s *AdminOp) ProcessAdminOP(cmd *agtypes.AdminOPCmd, app AdminApp) error
if power <=0, node is a peer, else if power > 0, node is a validator addnode: change node to peer update: change power value so that node to be validator remove: remove node from validators
func (*AdminOp) Reload ¶
func (s *AdminOp) Reload(p *ReloadParams)
func (*AdminOp) SetEventSwitch ¶
func (s *AdminOp) SetEventSwitch(sw agtypes.EventSwitch)
type BeginBlockParams ¶
type BeginBlockReturns ¶
type BeginBlockReturns struct {
}
type EndBlockParams ¶
type EndBlockParams struct {
Block *types.Block
ChangedValidators []*types.ValidatorAttr
NextValidatorSet *types.ValidatorSet
}
type EndBlockReturns ¶
type EndBlockReturns struct {
NextValidatorSet *types.ValidatorSet
}
type ExecBlockParams ¶
type ExecBlockParams struct {
Block *types.Block
EventSwitch types.EventSwitch
EventCache types.EventCache
ValidTxs types.Txs
InvalidTxs []types.ExecuteInvalidTx
}
type ExecBlockReturns ¶
type ExecBlockReturns struct {
}
type IPlugin ¶
type IPlugin interface {
types.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 InitParams ¶
type InitParams struct {
Logger *zap.Logger
StateDB dbm.DB
Switch *p2p.Switch
PrivKey crypto.PrivKey
RefuseList *refuse_list.RefuseList
Validators **types.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
StateDB dbm.DB
Switch *p2p.Switch
PrivKey crypto.PrivKey
RefuseList *refuse_list.RefuseList
Validators **types.ValidatorSet
}
Click to show internal directories.
Click to hide internal directories.