Documentation
¶
Index ¶
- type ChainAdapter
- func (ca *ChainAdapter) Accepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (ca *ChainAdapter) AcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (ca *ChainAdapter) AcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs []ids.ID) error
- func (ca *ChainAdapter) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
- func (ca *ChainAdapter) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (ca *ChainAdapter) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (ca *ChainAdapter) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
- func (ca *ChainAdapter) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, ...) error
- func (ca *ChainAdapter) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (ca *ChainAdapter) Context() *core.Context
- func (ca *ChainAdapter) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (ca *ChainAdapter) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- func (ca *ChainAdapter) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (ca *ChainAdapter) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (ca *ChainAdapter) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (ca *ChainAdapter) GetAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (ca *ChainAdapter) GetAcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, heights []uint64) error
- func (ca *ChainAdapter) GetAncestor(blkID ids.ID, height uint64) (ids.ID, error)
- func (ca *ChainAdapter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (ca *ChainAdapter) GetBlock(blkID ids.ID) (chain.Block, error)
- func (ca *ChainAdapter) GetStateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (ca *ChainAdapter) GetVM() interface{}
- func (ca *ChainAdapter) Gossip() error
- func (ca *ChainAdapter) Halt()
- func (ca *ChainAdapter) HealthCheck(ctx context.Context) (interface{}, error)
- func (ca *ChainAdapter) Initialize(ctx context.Context, params chain.Parameters) error
- func (ca *ChainAdapter) LastAccepted() (ids.ID, uint64)
- func (ca *ChainAdapter) Notify(ctx context.Context, msg core.Message) error
- func (ca *ChainAdapter) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkID ids.ID, ...) error
- func (ca *ChainAdapter) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkBytes []byte, ...) error
- func (ca *ChainAdapter) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
- func (ca *ChainAdapter) QueryFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (ca *ChainAdapter) Shutdown(ctx context.Context) error
- func (ca *ChainAdapter) Start(ctx context.Context, startReqID uint32) error
- func (ca *ChainAdapter) StateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) error
- func (ca *ChainAdapter) Stop(ctx context.Context) error
- func (ca *ChainAdapter) Timeout() error
- func (ca *ChainAdapter) VerifyHeightIndex() error
- type Config
- type DAGAdapter
- func (da *DAGAdapter) Accepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (da *DAGAdapter) AcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (da *DAGAdapter) AcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs []ids.ID) error
- func (da *DAGAdapter) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
- func (da *DAGAdapter) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (da *DAGAdapter) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (da *DAGAdapter) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
- func (da *DAGAdapter) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, ...) error
- func (da *DAGAdapter) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (da *DAGAdapter) Context() *core.Context
- func (da *DAGAdapter) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (da *DAGAdapter) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- func (da *DAGAdapter) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (da *DAGAdapter) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (da *DAGAdapter) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (da *DAGAdapter) GetAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (da *DAGAdapter) GetAcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, heights []uint64) error
- func (da *DAGAdapter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (da *DAGAdapter) GetStateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (da *DAGAdapter) GetVM() interface{}
- func (da *DAGAdapter) GetVertex(vtxID ids.ID) (dag.Vertex, error)
- func (da *DAGAdapter) GetVtx(vtxID ids.ID) (dag.Vertex, error)
- func (da *DAGAdapter) Gossip() error
- func (da *DAGAdapter) Halt()
- func (da *DAGAdapter) HealthCheck(ctx context.Context) (interface{}, error)
- func (da *DAGAdapter) Initialize(ctx context.Context, params dag.Parameters) error
- func (da *DAGAdapter) Issued(vtx dag.Vertex) bool
- func (da *DAGAdapter) Notify(ctx context.Context, msg core.Message) error
- func (da *DAGAdapter) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID, ...) error
- func (da *DAGAdapter) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte, ...) error
- func (da *DAGAdapter) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
- func (da *DAGAdapter) QueryFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (da *DAGAdapter) Shutdown(ctx context.Context) error
- func (da *DAGAdapter) Start(ctx context.Context, startReqID uint32) error
- func (da *DAGAdapter) StateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) error
- func (da *DAGAdapter) Stop(ctx context.Context) error
- func (da *DAGAdapter) StopVertexAccepted() bool
- func (da *DAGAdapter) Timeout() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainAdapter ¶
type ChainAdapter struct {
// contains filtered or unexported fields
}
ChainAdapter adapts the external consensus protocol (nova) to the node's chain.Engine interface
func NewChainAdapter ¶
func NewChainAdapter() *ChainAdapter
NewChainAdapter creates a new adapter for linear chain consensus
func (*ChainAdapter) Accepted ¶
func (ca *ChainAdapter) Accepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs []ids.ID) error
Accepted handles accepted blocks notification
func (*ChainAdapter) AcceptedFrontier ¶
func (ca *ChainAdapter) AcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
AcceptedFrontier handles an accepted frontier message
func (*ChainAdapter) AcceptedStateSummary ¶
func (ca *ChainAdapter) AcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs []ids.ID) error
AcceptedStateSummary is called when the requested state summary is received
func (*ChainAdapter) Ancestors ¶
func (ca *ChainAdapter) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
Ancestors is called when a container and its ancestors are received
func (*ChainAdapter) AppRequest ¶
func (ca *ChainAdapter) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, msg []byte) error
AppRequest is called when an application request is received
func (*ChainAdapter) AppResponse ¶
func (ca *ChainAdapter) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
AppResponse is called when an application response is received
func (*ChainAdapter) Chits ¶
func (ca *ChainAdapter) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID) error
Chits handles chits (votes) from a node
func (*ChainAdapter) Connected ¶
func (ca *ChainAdapter) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
Connected handles a node connection event
func (*ChainAdapter) Context ¶
func (ca *ChainAdapter) Context() *core.Context
Context returns the engine's context
func (*ChainAdapter) CrossChainAppRequest ¶
func (ca *ChainAdapter) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, msg []byte) error
CrossChainAppRequest is called when a cross-chain application request is received
func (*ChainAdapter) CrossChainAppResponse ¶
func (ca *ChainAdapter) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
CrossChainAppResponse is called when a cross-chain application response is received
func (*ChainAdapter) Disconnected ¶
Disconnected handles a node disconnection event
func (*ChainAdapter) Get ¶
func (ca *ChainAdapter) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
Get retrieves a container and its ancestors
func (*ChainAdapter) GetAccepted ¶
func (ca *ChainAdapter) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs []ids.ID) error
GetAccepted returns accepted blocks
func (*ChainAdapter) GetAcceptedFrontier ¶
func (ca *ChainAdapter) GetAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
GetAcceptedFrontier returns the accepted frontier
func (*ChainAdapter) GetAcceptedStateSummary ¶
func (ca *ChainAdapter) GetAcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, heights []uint64) error
GetAcceptedStateSummary retrieves the state summary for the given block heights
func (*ChainAdapter) GetAncestor ¶
GetAncestor retrieves an ancestor block at the given height
func (*ChainAdapter) GetAncestors ¶
func (ca *ChainAdapter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
GetAncestors retrieves a container and its ancestors
func (*ChainAdapter) GetStateSummaryFrontier ¶
func (ca *ChainAdapter) GetStateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
GetStateSummaryFrontier returns the state summary frontier
func (*ChainAdapter) GetVM ¶
func (ca *ChainAdapter) GetVM() interface{}
GetVM returns the VM associated with this engine
func (*ChainAdapter) Gossip ¶
func (ca *ChainAdapter) Gossip() error
Gossip handles a gossip message
func (*ChainAdapter) HealthCheck ¶
func (ca *ChainAdapter) HealthCheck(ctx context.Context) (interface{}, error)
HealthCheck returns the engine's health status
func (*ChainAdapter) Initialize ¶
func (ca *ChainAdapter) Initialize(ctx context.Context, params chain.Parameters) error
Initialize initializes the chain consensus engine
func (*ChainAdapter) LastAccepted ¶
func (ca *ChainAdapter) LastAccepted() (ids.ID, uint64)
LastAccepted returns the ID of the last accepted block
func (*ChainAdapter) PullQuery ¶
func (ca *ChainAdapter) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkID ids.ID, requestedHeight uint64) error
PullQuery sends a query for a block ID
func (*ChainAdapter) PushQuery ¶
func (ca *ChainAdapter) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkBytes []byte, requestedHeight uint64) error
PushQuery sends a query for a block
func (*ChainAdapter) Put ¶
func (ca *ChainAdapter) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
Put is called when a container is received
func (*ChainAdapter) QueryFailed ¶
QueryFailed handles a failed query
func (*ChainAdapter) Shutdown ¶
func (ca *ChainAdapter) Shutdown(ctx context.Context) error
Shutdown the engine
func (*ChainAdapter) Start ¶
func (ca *ChainAdapter) Start(ctx context.Context, startReqID uint32) error
Start starts the consensus engine
func (*ChainAdapter) StateSummaryFrontier ¶
func (ca *ChainAdapter) StateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) error
StateSummaryFrontier is called when the state summary frontier is received
func (*ChainAdapter) Stop ¶
func (ca *ChainAdapter) Stop(ctx context.Context) error
Stop stops the consensus engine
func (*ChainAdapter) Timeout ¶
func (ca *ChainAdapter) Timeout() error
Timeout handles a timeout event
func (*ChainAdapter) VerifyHeightIndex ¶
func (ca *ChainAdapter) VerifyHeightIndex() error
VerifyHeightIndex returns whether height index is enabled
type Config ¶
type Config struct {
VM vertex.LinearizableVM
Sender sender.Sender
Validators validators.State
}
Config contains the configuration for a DAG consensus engine
type DAGAdapter ¶
type DAGAdapter struct {
// contains filtered or unexported fields
}
DAGAdapter adapts the external consensus protocol (nebula) to the node's dag.Engine interface
func NewDAGAdapter ¶
func NewDAGAdapter() *DAGAdapter
NewDAGAdapter creates a new adapter for DAG consensus
func (*DAGAdapter) Accepted ¶
func (da *DAGAdapter) Accepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs []ids.ID) error
Accepted handles accepted vertices notification
func (*DAGAdapter) AcceptedFrontier ¶
func (da *DAGAdapter) AcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
AcceptedFrontier handles an accepted frontier message
func (*DAGAdapter) AcceptedStateSummary ¶
func (da *DAGAdapter) AcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs []ids.ID) error
AcceptedStateSummary is called when the requested state summary is received
func (*DAGAdapter) Ancestors ¶
func (da *DAGAdapter) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
Ancestors is called when a container and its ancestors are received
func (*DAGAdapter) AppRequest ¶
func (da *DAGAdapter) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, msg []byte) error
AppRequest is called when an application request is received
func (*DAGAdapter) AppResponse ¶
func (da *DAGAdapter) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
AppResponse is called when an application response is received
func (*DAGAdapter) Chits ¶
func (da *DAGAdapter) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID) error
Chits handles chits (votes) from a node
func (*DAGAdapter) Connected ¶
func (da *DAGAdapter) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
Connected handles a node connection event
func (*DAGAdapter) Context ¶
func (da *DAGAdapter) Context() *core.Context
Context returns the engine's context
func (*DAGAdapter) CrossChainAppRequest ¶
func (da *DAGAdapter) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, msg []byte) error
CrossChainAppRequest is called when a cross-chain application request is received
func (*DAGAdapter) CrossChainAppResponse ¶
func (da *DAGAdapter) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
CrossChainAppResponse is called when a cross-chain application response is received
func (*DAGAdapter) Disconnected ¶
Disconnected handles a node disconnection event
func (*DAGAdapter) Get ¶
func (da *DAGAdapter) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
Get retrieves a container and its ancestors
func (*DAGAdapter) GetAccepted ¶
func (da *DAGAdapter) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs []ids.ID) error
GetAccepted returns accepted vertices
func (*DAGAdapter) GetAcceptedFrontier ¶
func (da *DAGAdapter) GetAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
GetAcceptedFrontier returns the accepted frontier
func (*DAGAdapter) GetAcceptedStateSummary ¶
func (da *DAGAdapter) GetAcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, heights []uint64) error
GetAcceptedStateSummary retrieves the state summary for the given block heights
func (*DAGAdapter) GetAncestors ¶
func (da *DAGAdapter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
GetAncestors retrieves a container and its ancestors
func (*DAGAdapter) GetStateSummaryFrontier ¶
func (da *DAGAdapter) GetStateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
GetStateSummaryFrontier returns the state summary frontier
func (*DAGAdapter) GetVM ¶
func (da *DAGAdapter) GetVM() interface{}
GetVM returns the VM associated with this engine
func (*DAGAdapter) HealthCheck ¶
func (da *DAGAdapter) HealthCheck(ctx context.Context) (interface{}, error)
HealthCheck returns the engine's health status
func (*DAGAdapter) Initialize ¶
func (da *DAGAdapter) Initialize(ctx context.Context, params dag.Parameters) error
Initialize initializes the DAG consensus engine
func (*DAGAdapter) Issued ¶
func (da *DAGAdapter) Issued(vtx dag.Vertex) bool
Issued returns true if the vertex has been issued
func (*DAGAdapter) PullQuery ¶
func (da *DAGAdapter) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID, requestedHeight uint64) error
PullQuery sends a query for a vertex ID
func (*DAGAdapter) PushQuery ¶
func (da *DAGAdapter) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte, requestedHeight uint64) error
PushQuery sends a query for a vertex
func (*DAGAdapter) Put ¶
func (da *DAGAdapter) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
Put is called when a container is received
func (*DAGAdapter) QueryFailed ¶
QueryFailed handles a failed query
func (*DAGAdapter) Shutdown ¶
func (da *DAGAdapter) Shutdown(ctx context.Context) error
Shutdown the engine
func (*DAGAdapter) Start ¶
func (da *DAGAdapter) Start(ctx context.Context, startReqID uint32) error
Start starts the consensus engine
func (*DAGAdapter) StateSummaryFrontier ¶
func (da *DAGAdapter) StateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) error
StateSummaryFrontier is called when the state summary frontier is received
func (*DAGAdapter) Stop ¶
func (da *DAGAdapter) Stop(ctx context.Context) error
Stop stops the consensus engine
func (*DAGAdapter) StopVertexAccepted ¶
func (da *DAGAdapter) StopVertexAccepted() bool
StopVertexAccepted returns true if all new vertices should be rejected