Documentation ¶
Index ¶
- Constants
- Variables
- type Acceptor
- type ConsensusContext
- type Context
- type ContextInitializable
- type EventDispatcher
- type EventDispatcherTracker
- func (evd *EventDispatcherTracker) Accept(ctx *ConsensusContext, containerID ids.ID, container []byte) error
- func (evd *EventDispatcherTracker) IsAccepted(containerID ids.ID) (int, bool)
- func (evd *EventDispatcherTracker) IsIssued(containerID ids.ID) (int, bool)
- func (evd *EventDispatcherTracker) IsRejected(containerID ids.ID) (int, bool)
- func (evd *EventDispatcherTracker) Issue(ctx *ConsensusContext, containerID ids.ID, container []byte) error
- func (evd *EventDispatcherTracker) Reject(ctx *ConsensusContext, containerID ids.ID, container []byte) error
- type Issuer
- type Rejector
- type State
- type SubnetLookup
Constants ¶
const ( Bootstrapping = iota + 1 NormalOp )
Variables ¶
var ErrUnknownState = errors.New("unknown node state")
Functions ¶
This section is empty.
Types ¶
type Acceptor ¶ added in v1.7.6
type Acceptor interface {
Accept(ctx *ConsensusContext, containerID ids.ID, container []byte) error
}
Acceptor is implemented when a struct is monitoring if a message is accepted
type ConsensusContext ¶ added in v1.7.6
type ConsensusContext struct { *Context Registerer prometheus.Registerer DecisionDispatcher EventDispatcher ConsensusDispatcher EventDispatcher // contains filtered or unexported fields }
func DefaultConsensusContextTest ¶ added in v1.7.6
func DefaultConsensusContextTest() *ConsensusContext
func (*ConsensusContext) Executing ¶ added in v1.7.6
func (ctx *ConsensusContext) Executing(b bool)
Executing marks this chain as executing or not. Set to "true" if there's an ongoing transaction.
func (*ConsensusContext) GetState ¶ added in v1.7.6
func (ctx *ConsensusContext) GetState() State
func (*ConsensusContext) IsExecuting ¶ added in v1.7.6
func (ctx *ConsensusContext) IsExecuting() bool
IsExecuting returns true iff this chain is still executing transactions.
func (*ConsensusContext) IsValidatorOnly ¶ added in v1.7.6
func (ctx *ConsensusContext) IsValidatorOnly() bool
IsValidatorOnly returns true iff this chain is available only to validators
func (*ConsensusContext) SetState ¶ added in v1.7.6
func (ctx *ConsensusContext) SetState(newState State)
func (*ConsensusContext) SetValidatorOnly ¶ added in v1.7.6
func (ctx *ConsensusContext) SetValidatorOnly()
SetValidatorOnly marks this chain as available only to validators
type Context ¶
type Context struct { NetworkID uint32 SubnetID ids.ID ChainID ids.ID NodeID ids.ShortID XChainID ids.ID AVAXAssetID ids.ID Log logging.Logger Lock sync.RWMutex Keystore keystore.BlockchainKeystore BCLookup ids.AliaserReader SNLookup SubnetLookup Metrics metrics.OptionalGatherer // snowman++ attributes ValidatorState validators.State // interface for P-Chain validators StakingLeafSigner crypto.Signer // block signer StakingCertLeaf *x509.Certificate // block certificate }
Context is information about the current execution. [NetworkID] is the ID of the network this context exists within. [ChainID] is the ID of the chain this context exists within. [NodeID] is the ID of this node
func DefaultContextTest ¶
func DefaultContextTest() *Context
type ContextInitializable ¶ added in v1.7.6
type ContextInitializable interface { // InitCtx initializes an object provided a *Context object InitCtx(ctx *Context) }
ContextInitializable represents an object that can be initialized given a *Context object
type EventDispatcher ¶ added in v1.7.6
type EventDispatcher interface { Issuer // If the returned error is non-nil, the chain associated with [ctx] should shut // down and not commit [container] or any other container to its database as accepted. // Accept must be called before [containerID] is committed to the VM as accepted. Acceptor Rejector }
type EventDispatcherTracker ¶ added in v1.7.6
type EventDispatcherTracker struct {
// contains filtered or unexported fields
}
EventDispatcherTracker tracks the dispatched events by its ID and counts. Useful for testing.
func NewEventDispatcherTracker ¶ added in v1.7.6
func NewEventDispatcherTracker() *EventDispatcherTracker
func (*EventDispatcherTracker) Accept ¶ added in v1.7.6
func (evd *EventDispatcherTracker) Accept(ctx *ConsensusContext, containerID ids.ID, container []byte) error
func (*EventDispatcherTracker) IsAccepted ¶ added in v1.7.6
func (evd *EventDispatcherTracker) IsAccepted(containerID ids.ID) (int, bool)
func (*EventDispatcherTracker) IsIssued ¶ added in v1.7.6
func (evd *EventDispatcherTracker) IsIssued(containerID ids.ID) (int, bool)
func (*EventDispatcherTracker) IsRejected ¶ added in v1.7.6
func (evd *EventDispatcherTracker) IsRejected(containerID ids.ID) (int, bool)
func (*EventDispatcherTracker) Issue ¶ added in v1.7.6
func (evd *EventDispatcherTracker) Issue(ctx *ConsensusContext, containerID ids.ID, container []byte) error
func (*EventDispatcherTracker) Reject ¶ added in v1.7.6
func (evd *EventDispatcherTracker) Reject(ctx *ConsensusContext, containerID ids.ID, container []byte) error
type Issuer ¶ added in v1.7.6
type Issuer interface {
Issue(ctx *ConsensusContext, containerID ids.ID, container []byte) error
}
Issuer is implemented when a struct is monitoring if a message is issued
type Rejector ¶ added in v1.7.6
type Rejector interface {
Reject(ctx *ConsensusContext, containerID ids.ID, container []byte) error
}
Rejector is implemented when a struct is monitoring if a message is rejected
Directories ¶
Path | Synopsis |
---|---|
consensus
|
|
engine
|
|
avalanche/state
Package state manages the meta-data required by consensus for an avalanche dag.
|
Package state manages the meta-data required by consensus for an avalanche dag. |
networking
|
|