Documentation
¶
Index ¶
- type BootstrapConfig
- type Config
- type DAGVM
- type Engine
- type State
- type Transitive
- func (t *Transitive) Chits(vdr ids.ShortID, requestID uint32, votes ids.Set) error
- func (t *Transitive) Context() *snow.Context
- func (b *Transitive) CurrentAcceptedFrontier() ids.Set
- func (b *Transitive) FilterAccepted(containerIDs ids.Set) ids.Set
- func (b *Transitive) ForceAccepted(acceptedContainerIDs ids.Set) error
- func (t *Transitive) Get(vdr ids.ShortID, requestID uint32, vtxID ids.ID) error
- func (t *Transitive) GetAncestors(vdr ids.ShortID, requestID uint32, vtxID ids.ID) error
- func (b *Transitive) GetAncestorsFailed(vdr ids.ShortID, requestID uint32) error
- func (t *Transitive) GetFailed(vdr ids.ShortID, requestID uint32) error
- func (t *Transitive) Gossip() error
- func (t *Transitive) Initialize(config Config) error
- func (b *Transitive) MultiPut(vdr ids.ShortID, requestID uint32, vtxs [][]byte) error
- func (t *Transitive) Notify(msg common.Message) error
- func (t *Transitive) PullQuery(vdr ids.ShortID, requestID uint32, vtxID ids.ID) error
- func (t *Transitive) PushQuery(vdr ids.ShortID, requestID uint32, vtxID ids.ID, vtxBytes []byte) error
- func (t *Transitive) Put(vdr ids.ShortID, requestID uint32, vtxID ids.ID, vtxBytes []byte) error
- func (t *Transitive) QueryFailed(vdr ids.ShortID, requestID uint32) error
- func (t *Transitive) Shutdown() error
- type VMTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootstrapConfig ¶
type BootstrapConfig struct {
common.Config
// VtxBlocked tracks operations that are blocked on vertices
// TxBlocked tracks operations that are blocked on transactions
VtxBlocked, TxBlocked *queue.Jobs
State State
VM DAGVM
}
BootstrapConfig ...
type Config ¶
type Config struct {
BootstrapConfig
Params avalanche.Parameters
Consensus avalanche.Consensus
}
Config wraps all the parameters needed for an avalanche engine
type DAGVM ¶
type DAGVM interface {
common.VM
// Return any transactions that have not been sent to consensus yet
PendingTxs() []snowstorm.Tx
// Convert a stream of bytes to a transaction or return an error
ParseTx(tx []byte) (snowstorm.Tx, error)
// Retrieve a transaction that was submitted previously
GetTx(ids.ID) (snowstorm.Tx, error)
}
DAGVM defines the minimum functionality that an avalanche VM must implement
type State ¶
type State interface {
// Create a new vertex from the contents of a vertex
BuildVertex(parentIDs ids.Set, txs []snowstorm.Tx) (avalanche.Vertex, error)
// Attempt to convert a stream of bytes into a vertex
ParseVertex(vertex []byte) (avalanche.Vertex, error)
// GetVertex attempts to load a vertex by hash from storage
GetVertex(vtxID ids.ID) (avalanche.Vertex, error)
// Edge returns a list of accepted vertex IDs with no accepted children
Edge() (vtxIDs []ids.ID)
}
State defines the persistant storage that is required by the consensus engine
type Transitive ¶
type Transitive struct {
Config
// contains filtered or unexported fields
}
Transitive implements the Engine interface by attempting to fetch all transitive dependencies.
func (*Transitive) Context ¶
func (t *Transitive) Context() *snow.Context
Context implements the Engine interface
func (*Transitive) CurrentAcceptedFrontier ¶
CurrentAcceptedFrontier returns the set of vertices that this node has accepted that have no accepted children
func (*Transitive) FilterAccepted ¶
FilterAccepted returns the IDs of vertices in [containerIDs] that this node has accepted
func (*Transitive) ForceAccepted ¶
ForceAccepted starts bootstrapping. Process the vertices in [accepterContainerIDs].
func (*Transitive) GetAncestors ¶ added in v0.5.3
GetAncestors implements the Engine interface
func (*Transitive) GetAncestorsFailed ¶ added in v0.5.3
GetAncestorsFailed is called when a GetAncestors message we sent fails
func (*Transitive) GetFailed ¶
func (t *Transitive) GetFailed(vdr ids.ShortID, requestID uint32) error
GetFailed implements the Engine interface
func (*Transitive) Gossip ¶ added in v0.5.0
func (t *Transitive) Gossip() error
Gossip implements the Engine interface
func (*Transitive) Initialize ¶
func (t *Transitive) Initialize(config Config) error
Initialize implements the Engine interface
func (*Transitive) MultiPut ¶ added in v0.5.3
MultiPut handles the receipt of multiple containers. Should be received in response to a GetAncestors message to [vdr] with request ID [requestID]. Expects vtxs[0] to be the vertex requested in the corresponding GetAncestors.
func (*Transitive) Notify ¶
func (t *Transitive) Notify(msg common.Message) error
Notify implements the Engine interface
func (*Transitive) PushQuery ¶
func (t *Transitive) PushQuery(vdr ids.ShortID, requestID uint32, vtxID ids.ID, vtxBytes []byte) error
PushQuery implements the Engine interface
func (*Transitive) QueryFailed ¶
func (t *Transitive) QueryFailed(vdr ids.ShortID, requestID uint32) error
QueryFailed implements the Engine interface
func (*Transitive) Shutdown ¶
func (t *Transitive) Shutdown() error
Shutdown implements the Engine interface
type VMTest ¶
type VMTest struct {
common.VMTest
CantPendingTxs, CantParseTx, CantIssueTx, CantGetTx bool
PendingTxsF func() []snowstorm.Tx
ParseTxF func([]byte) (snowstorm.Tx, error)
IssueTxF func([]byte, func(choices.Status), func(choices.Status)) (ids.ID, error)
GetTxF func(ids.ID) (snowstorm.Tx, error)
}
VMTest ...