producer_plugin

package
v0.0.0-...-c626c17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PERSISTED = EnumTxCategory(iota)
	UNEXPIRED_UNPERSISTED
	EXPIRED
)
View Source
const ProducerPlug = PluginTypeName("ProducerPlugin")

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumTxCategory

type EnumTxCategory int

type GreylistParams

type GreylistParams struct {
	Accounts []common.AccountName
}

type PendingBlockMode

type PendingBlockMode int

type ProducerPlugin

type ProducerPlugin struct {
	AbstractPlugin
	// contains filtered or unexported fields
}

func NewProducerPlugin

func NewProducerPlugin(io *asio.IoContext) *ProducerPlugin

func (*ProducerPlugin) AddGreylistAccounts

func (p *ProducerPlugin) AddGreylistAccounts(params GreylistParams)

func (*ProducerPlugin) GetGreylist

func (p *ProducerPlugin) GetGreylist() GreylistParams

func (*ProducerPlugin) GetRuntimeOptions

func (p *ProducerPlugin) GetRuntimeOptions() RuntimeOptions

func (*ProducerPlugin) GetWhitelistBlacklist

func (p *ProducerPlugin) GetWhitelistBlacklist() WhitelistAndBlacklist

func (*ProducerPlugin) IsProducerKey

func (p *ProducerPlugin) IsProducerKey(key ecc.PublicKey) bool

func (*ProducerPlugin) Pause

func (p *ProducerPlugin) Pause()

func (*ProducerPlugin) Paused

func (p *ProducerPlugin) Paused() bool

func (*ProducerPlugin) PluginInitialize

func (p *ProducerPlugin) PluginInitialize(c *cli.Context)

func (*ProducerPlugin) PluginShutdown

func (p *ProducerPlugin) PluginShutdown()

func (*ProducerPlugin) PluginStartup

func (p *ProducerPlugin) PluginStartup()

func (*ProducerPlugin) RemoveGreylistAccounts

func (p *ProducerPlugin) RemoveGreylistAccounts(params GreylistParams)

func (*ProducerPlugin) Resume

func (p *ProducerPlugin) Resume()

func (*ProducerPlugin) SetProgramOptions

func (p *ProducerPlugin) SetProgramOptions(options *[]cli.Flag)

func (*ProducerPlugin) SetWhitelistBlacklist

func (p *ProducerPlugin) SetWhitelistBlacklist(params WhitelistAndBlacklist)

func (*ProducerPlugin) SignCompact

func (p *ProducerPlugin) SignCompact(key *ecc.PublicKey, digest crypto.Sha256) *ecc.Signature

func (*ProducerPlugin) UpdateRuntimeOptions

func (p *ProducerPlugin) UpdateRuntimeOptions(options RuntimeOptions)

type ProducerPluginImpl

type ProducerPluginImpl struct {
	Chain *chain.Controller

	ProductionEnabled   bool
	ProductionPaused    bool
	ProductionSkipFlags uint32

	SignatureProviders map[ecc.PublicKey]signatureProviderType
	Producers          AccountNameSet
	Timer              *common.Timer
	ProducerWatermarks map[common.AccountName]uint32
	PendingBlockMode   PendingBlockMode

	PersistentTransactions  *TransactionIdWithExpiryIndex
	BlacklistedTransactions *TransactionIdWithExpiryIndex

	MaxTransactionTimeMs      int32
	MaxIrreversibleBlockAgeUs common.Microseconds
	ProduceTimeOffsetUs       int32
	LastBlockTimeOffsetUs     int32
	IrreversibleBlockTime     common.TimePoint
	KeosdProviderTimeoutUs    common.Microseconds

	LastSignedBlockTime common.TimePoint
	StartTime           common.TimePoint
	LastSignedBlockNum  uint32

	Self *ProducerPlugin

	PendingIncomingTransactions []pendingIncomingTransaction

	// keep a expected ratio between defer txn and incoming txn
	IncomingTrxWeight  float64
	IncomingDeferRadio float64

	TransactionAckChannel *include.Channel
	// contains filtered or unexported fields
}

func NewProducerPluginImpl

func NewProducerPluginImpl(io *asio.IoContext) *ProducerPluginImpl

func (*ProducerPluginImpl) CalculateNextBlockTime

func (impl *ProducerPluginImpl) CalculateNextBlockTime(producerName common.AccountName, currentBlockTime types.BlockTimeStamp) *common.TimePoint

func (*ProducerPluginImpl) CalculatePendingBlockTime

func (impl *ProducerPluginImpl) CalculatePendingBlockTime() common.TimePoint

func (*ProducerPluginImpl) GetIrreversibleBlockAge

func (impl *ProducerPluginImpl) GetIrreversibleBlockAge() common.Microseconds

func (*ProducerPluginImpl) MaybeProduceBlock

func (impl *ProducerPluginImpl) MaybeProduceBlock() bool

func (*ProducerPluginImpl) OnBlock

func (impl *ProducerPluginImpl) OnBlock(bsp *types.BlockState)

func (*ProducerPluginImpl) OnIncomingBlock

func (impl *ProducerPluginImpl) OnIncomingBlock(block *types.SignedBlock)

func (*ProducerPluginImpl) OnIncomingTransactionAsync

func (impl *ProducerPluginImpl) OnIncomingTransactionAsync(trx *types.PackedTransaction, persistUntilExpired bool, next func(interface{}))

func (*ProducerPluginImpl) OnIrreversibleBlock

func (impl *ProducerPluginImpl) OnIrreversibleBlock(lib *types.SignedBlock)

func (*ProducerPluginImpl) ProduceBlock

func (impl *ProducerPluginImpl) ProduceBlock()

func (*ProducerPluginImpl) ProductionDisabledByPolicy

func (impl *ProducerPluginImpl) ProductionDisabledByPolicy() bool

func (*ProducerPluginImpl) ScheduleDelayedProductionLoop

func (impl *ProducerPluginImpl) ScheduleDelayedProductionLoop(currentBlockTime types.BlockTimeStamp)

func (*ProducerPluginImpl) ScheduleProductionLoop

func (impl *ProducerPluginImpl) ScheduleProductionLoop()

func (*ProducerPluginImpl) StartBlock

func (impl *ProducerPluginImpl) StartBlock() (StartBlockResult, bool)

type RuntimeOptions

type RuntimeOptions struct {
	MaxTransactionTime      *int32
	MaxIrreversibleBlockAge *int32
	ProduceTimeOffsetUs     *int32
	LastBlockTimeOffsetUs   *int32
	SubjectiveCpuLeewayUs   *int32
	IncomingDeferRadio      *float64
}

type StartBlockResult

type StartBlockResult int

type WhitelistAndBlacklist

type WhitelistAndBlacklist struct {
	ActorWhitelist    *AccountNameSet
	ActorBlacklist    *AccountNameSet
	ContractWhitelist *AccountNameSet
	ContractBlacklist *AccountNameSet
	ActionBlacklist   *NamePairSet
	KeyBlacklist      *PublicKeySet
}

type WhitelistAndBlacklistParam

type WhitelistAndBlacklistParam struct {
	ActorWhitelist    []common.AccountName
	ActorBlacklist    []common.AccountName
	ContractWhitelist []common.AccountName
	ContractBlacklist []common.AccountName
	ActionBlacklist   []common.NamePair
	KeyBlacklist      []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL