Documentation ¶
Index ¶
- type Plugin
- func (p *Plugin) ApplyBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) ApplyBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) ApplyTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) Close() error
- func (p *Plugin) GetBotTransactionIdentifiers(id tbtypes.BotID) (ids []types.TransactionID, err error)
- func (p *Plugin) GetRecordForID(id tbtypes.BotID) (record *tbtypes.BotRecord, err error)
- func (p *Plugin) GetRecordForKey(key types.PublicKey) (record *tbtypes.BotRecord, err error)
- func (p *Plugin) GetRecordForName(name tbtypes.BotName) (record *tbtypes.BotRecord, err error)
- func (p *Plugin) InitPlugin(metadata *persist.Metadata, bucket *bolt.Bucket, ...) (persist.Metadata, error)
- func (p *Plugin) RevertBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) RevertBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) RevertTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error
- func (p *Plugin) TransactionValidatorVersionFunctionMapping() map[types.TransactionVersion][]modules.PluginTransactionValidationFunction
- func (p *Plugin) TransactionValidators() []modules.PluginTransactionValidationFunction
- type PluginOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is a struct defines the 3bot plugin
func NewPlugin ¶
func NewPlugin(registryPool types.UnlockHash, oneCoin types.Currency, opts *PluginOptions) *Plugin
NewPlugin creates a new 3bot Plugin.
func (*Plugin) ApplyBlock ¶
func (p *Plugin) ApplyBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error
ApplyBlock applies a block's 3bot transactions to the 3Bot bucket.
func (*Plugin) ApplyBlockHeader ¶
func (p *Plugin) ApplyBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error
ApplyBlockHeader applies a block's header data to the 3Bot bucket.
func (*Plugin) ApplyTransaction ¶
func (p *Plugin) ApplyTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error
ApplyTransaction applies a 3Bot transactions to the 3Bot bucket.
func (*Plugin) GetBotTransactionIdentifiers ¶
func (p *Plugin) GetBotTransactionIdentifiers(id tbtypes.BotID) (ids []types.TransactionID, err error)
GetBotTransactionIdentifiers returns the identifiers of all transactions that created and updated the given bot's record.
The transaction identifiers are returned in the (stable) order as defined by the blockchain.
func (*Plugin) GetRecordForID ¶
GetRecordForID returns the record mapped to the given BotID.
func (*Plugin) GetRecordForKey ¶
GetRecordForKey returns the record mapped to the given Key.
func (*Plugin) GetRecordForName ¶
GetRecordForName returns the record mapped to the given Name.
func (*Plugin) InitPlugin ¶
func (p *Plugin) InitPlugin(metadata *persist.Metadata, bucket *bolt.Bucket, storage modules.PluginViewStorage, unregisterCallback modules.PluginUnregisterCallback) (persist.Metadata, error)
InitPlugin initializes the Bucket for the first time
func (*Plugin) RevertBlock ¶
func (p *Plugin) RevertBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error
RevertBlock reverts a block's 3Bot transaction from the 3Bot bucket
func (*Plugin) RevertBlockHeader ¶
func (p *Plugin) RevertBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error
RevertBlockHeader applies a block's header data to the 3Bot bucket.
func (*Plugin) RevertTransaction ¶
func (p *Plugin) RevertTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error
RevertTransaction reverts a 3Bot transactions to the 3Bot bucket.
func (*Plugin) TransactionValidatorVersionFunctionMapping ¶
func (p *Plugin) TransactionValidatorVersionFunctionMapping() map[types.TransactionVersion][]modules.PluginTransactionValidationFunction
TransactionValidatorVersionFunctionMapping returns all tx validators linked to this plugin
func (*Plugin) TransactionValidators ¶
func (p *Plugin) TransactionValidators() []modules.PluginTransactionValidationFunction
TransactionValidators returns all tx validators linked to this plugin
type PluginOptions ¶
type PluginOptions struct {
HackMinimumBlockHeightSinceDoubleRegistrationsAreForbidden types.BlockHeight
}
opt-in features for the plugin