Documentation
¶
Index ¶
- type ChainListener
- type Manager
- type QBlock
- type QBlockTransaction
- type QChain
- func (q *QChain) AddQBlock(ctx context.Context, qBlockID ids.ID, height uint64, vertexIDs []ids.ID, ...) error
- func (q *QChain) GetFinalizedVertices(height uint64) ([]ids.ID, error)
- func (q *QChain) GetLastQBlock() (*QBlock, bool)
- func (q *QChain) GetQBlock(qBlockID ids.ID) (*QBlock, error)
- func (q *QChain) GetQBlockByHeight(height uint64) (*QBlock, error)
- func (q *QChain) Subscribe() <-chan QBlock
- func (q *QChain) Unsubscribe(ch <-chan QBlock)
- type QChainState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainListener ¶
type ChainListener struct {
// contains filtered or unexported fields
}
ChainListener allows chains to listen for Q-blocks affecting them.
func NewChainListener ¶
func NewChainListener(chainID ids.ID, qchain *QChain) *ChainListener
NewChainListener creates a listener for a specific chain.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages Q-Chain integration with P-Chain.
func NewManager ¶
NewManager creates a new Q-Chain manager.
type QBlock ¶
type QBlock struct {
// Core Q-block fields (placeholder)
QBlockID ids.ID
Height uint64
VertexIDs []ids.ID
// P-Chain integration
PChainBlockID ids.ID // P-Chain block containing this Q-block
PChainHeight uint64 // P-Chain block height
InclusionTime time.Time // When included in P-Chain
// Validator set at this height
ValidatorSet map[ids.NodeID]uint64 // NodeID -> stake weight
}
QBlock extends the core Q-block with P-Chain integration.
type QBlockTransaction ¶
type QBlockTransaction struct {
// TODO: Use quasarcore.QBlock when available
QBlockID ids.ID
Height uint64
VertexIDs []ids.ID
Signatures [][]byte // Validator signatures
}
QBlockTransaction represents a Q-block embedded in a P-Chain transaction.
type QChain ¶
type QChain struct {
// contains filtered or unexported fields
}
QChain manages Q-blocks embedded in the P-Chain. It provides network-wide quantum finality for all chains.
func (*QChain) AddQBlock ¶
func (q *QChain) AddQBlock(ctx context.Context, qBlockID ids.ID, height uint64, vertexIDs []ids.ID, pChainBlockID ids.ID, pChainHeight uint64) error
AddQBlock adds a new Q-block from Quasar consensus.
func (*QChain) GetFinalizedVertices ¶
GetFinalizedVertices returns all vertices finalized at a given height.
func (*QChain) GetLastQBlock ¶
GetLastQBlock returns the most recent Q-block.
func (*QChain) GetQBlockByHeight ¶
GetQBlockByHeight retrieves a Q-block by height.
func (*QChain) Unsubscribe ¶
Unsubscribe removes a Q-block subscription.
type QChainState ¶
type QChainState interface {
// GetQBlock retrieves a Q-block by ID.
GetQBlock(qBlockID ids.ID) (*QBlock, error)
// GetQBlockByHeight retrieves a Q-block by height.
GetQBlockByHeight(height uint64) (*QBlock, error)
// GetLastQBlock returns the most recent Q-block.
GetLastQBlock() (*QBlock, bool)
// GetFinalizedVertices returns vertices finalized at a height.
GetFinalizedVertices(height uint64) ([]ids.ID, error)
}
QChainState provides read-only access to Q-Chain state.