Documentation
¶
Index ¶
- Constants
- type AtomicTransaction
- type AtomicTxStatus
- type AtomicTxUpdate
- type Block
- func (b *Block) Accept(context.Context) error
- func (b *Block) Bytes() []byte
- func (b *Block) Height() uint64
- func (b *Block) ID() ids.ID
- func (b *Block) Parent() ids.ID
- func (b *Block) Reject(context.Context) error
- func (b *Block) Status() choices.Status
- func (b *Block) Timestamp() time.Time
- func (b *Block) Verify(ctx context.Context) error
- type BridgeContract
- type EthCheckpoint
- type Factory
- type StateRootSubmission
- type SubTransaction
- type SubTxUpdate
- type TxStatus
- type VM
- func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (vm *VM) BuildBlock(ctx context.Context) (chain.Block, error)
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error)
- func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *common.AppError) error
- func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (chain.Block, error)
- func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)
- func (vm *VM) HealthCheck(context.Context) (any, error)
- func (vm *VM) ImportEthereumBlock(header *types.Header, proof []byte) error
- func (vm *VM) Initialize(ctx context.Context, chainCtx *snow.Context, db database.Database, ...) error
- func (vm *VM) LastAccepted(context.Context) (ids.ID, error)
- func (vm *VM) ParseBlock(ctx context.Context, blockBytes []byte) (chain.Block, error)
- func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error
- func (vm *VM) SetState(ctx context.Context, state snow.State) error
- func (vm *VM) Shutdown(context.Context) error
- func (vm *VM) SubmitAtomicTx(atomicTx *AtomicTransaction) error
- func (vm *VM) Version(context.Context) (string, error)
Constants ¶
const (
Name = "bridgevm"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicTransaction ¶
type AtomicTransaction struct {
ID ids.ID `json:"id"`
Status AtomicTxStatus `json:"status"`
SubTxs []SubTransaction `json:"subTxs"`
Creator ids.ShortID `json:"creator"`
CreatedAt int64 `json:"createdAt"`
CompletedAt int64 `json:"completedAt,omitempty"`
CommitProofs map[string][]byte `json:"commitProofs"`
}
AtomicTransaction represents a cross-chain atomic transaction
type AtomicTxStatus ¶
type AtomicTxStatus uint8
AtomicTxStatus represents the status of an atomic transaction
const ( AtomicPending AtomicTxStatus = iota AtomicLocked AtomicCommitting AtomicCommitted AtomicAborted )
type AtomicTxUpdate ¶
type AtomicTxUpdate struct {
TxID ids.ID `json:"txId"`
NewStatus AtomicTxStatus `json:"newStatus"`
SubTxUpdate *SubTxUpdate `json:"subTxUpdate,omitempty"`
}
AtomicTxUpdate represents an update to an atomic transaction
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents a block in the Bridge Chain
type BridgeContract ¶
type BridgeContract struct {
ChainName string `json:"chainName"`
Address ethcommon.Address `json:"address"`
ABI string `json:"abi"`
DeployBlock uint64 `json:"deployBlock"`
}
BridgeContract represents a bridge contract on external chains
type EthCheckpoint ¶
type EthCheckpoint struct {
BlockNumber uint64 `json:"blockNumber"`
BlockHash ethcommon.Hash `json:"blockHash"`
StateRoot ethcommon.Hash `json:"stateRoot"`
Timestamp uint64 `json:"timestamp"`
Validators [][]byte `json:"validators"`
}
EthCheckpoint represents an Ethereum checkpoint
type StateRootSubmission ¶
type StateRootSubmission struct {
ChainID ids.ID `json:"chainId"`
BlockHeight uint64 `json:"blockHeight"`
StateRoot ethcommon.Hash `json:"stateRoot"`
BlockHash ids.ID `json:"blockHash"`
EthTxHash ethcommon.Hash `json:"ethTxHash,omitempty"`
Submitted bool `json:"submitted"`
}
StateRootSubmission represents a state root submission to Ethereum
type SubTransaction ¶
type SubTransaction struct {
ChainID ids.ID `json:"chainId"`
TxData []byte `json:"txData"`
Status TxStatus `json:"status"`
Result []byte `json:"result,omitempty"`
}
SubTransaction represents a transaction on a specific chain
type SubTxUpdate ¶
type SubTxUpdate struct {
ChainID ids.ID `json:"chainId"`
Index int `json:"index"`
Status TxStatus `json:"status"`
Result []byte `json:"result,omitempty"`
}
SubTxUpdate represents an update to a sub-transaction
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM implements the chain.ChainVM interface for the Bridge Chain (B-Chain) This chain serves as Lux's interoperability hub and Ethereum anchor
func (*VM) AppRequest ¶
func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte) error
AppRequest implements the common.AppHandler interface
func (*VM) AppRequestFailed ¶
func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *common.AppError) error
AppRequestFailed implements the common.AppHandler interface
func (*VM) AppResponse ¶
func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
AppResponse implements the common.AppHandler interface
func (*VM) BuildBlock ¶
BuildBlock implements the chain.ChainVM interface
func (*VM) Connected ¶
func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
Connected implements the validators.Connector interface
func (*VM) CreateHandlers ¶
CreateHandlers implements the common.VM interface
func (*VM) CrossChainAppRequest ¶
func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, msg []byte) error
CrossChainAppRequest implements the common.VM interface
func (*VM) CrossChainAppRequestFailed ¶
func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *common.AppError) error
CrossChainAppRequestFailed implements the common.VM interface
func (*VM) CrossChainAppResponse ¶
func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
CrossChainAppResponse implements the common.VM interface
func (*VM) Disconnected ¶
Disconnected implements the validators.Connector interface
func (*VM) GetBlockIDAtHeight ¶
GetBlockIDAtHeight implements the chain.ChainVM interface
func (*VM) HealthCheck ¶
HealthCheck implements the health.Checker interface
func (*VM) ImportEthereumBlock ¶
ImportEthereumBlock imports an Ethereum block header
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx context.Context, chainCtx *snow.Context, db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, toEngine chan<- common.Message, fxs []*common.Fx, appSender common.AppSender, ) error
Initialize implements the common.VM interface
func (*VM) LastAccepted ¶
LastAccepted implements the chain.ChainVM interface
func (*VM) ParseBlock ¶
ParseBlock implements the chain.ChainVM interface
func (*VM) SetPreference ¶
SetPreference implements the chain.ChainVM interface
func (*VM) SubmitAtomicTx ¶
func (vm *VM) SubmitAtomicTx(atomicTx *AtomicTransaction) error
SubmitAtomicTx submits a new atomic transaction