Documentation
¶
Overview ¶
Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Variables
- func FormatLocalAddress(ctx *consensusctx.Context, addr ids.ShortID) (string, error)
- func ParseAddress(ctx *consensusctx.Context, addrStr string) (ids.ID, ids.ShortID, error)
- func ParseLocalAddress(ctx *consensusctx.Context, addrStr string) (ids.ShortID, error)
- func ParseServiceAddress(ctx *consensusctx.Context, addrStr string) (ids.ShortID, error)
- type BlockFetcher
- type FormattedTx
- type LuxAPI
- func (service *LuxAPI) GetAtomicTx(r *http.Request, args *api.GetTxArgs, reply *FormattedTx) error
- func (service *LuxAPI) GetAtomicTxStatus(r *http.Request, args *api.JSONTxID, reply *client.GetAtomicTxStatusReply) error
- func (service *LuxAPI) GetUTXOs(r *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error
- func (service *LuxAPI) IssueTx(r *http.Request, args *api.FormattedTx, response *api.JSONTxID) error
- func (service *LuxAPI) Version(r *http.Request, _ *struct{}, reply *VersionReply) error
- type VM
- func (vm *VM) BuildBlock(ctx context.Context) (block.Block, error)
- func (vm *VM) BuildBlockWithContext(ctx context.Context, proposerVMBlockCtx *block.Context) (block.Block, error)
- func (vm *VM) Clock() *mockable.Clock
- func (vm *VM) CodecRegistry() codec.Registry
- func (vm *VM) CreateHandlers(ctx context.Context) (map[string]http.Handler, error)
- func (vm *VM) CurrentRules() extras.Rules
- func (vm *VM) GetAtomicTx(txID ids.ID) (*atomic.Tx, atomic.Status, uint64, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtxIntf interface{}, dbIntf interface{}, ...) error
- func (vm *VM) Logger() log.Logger
- func (vm *VM) NewExportTx(assetID ids.ID, amount uint64, chainID ids.ID, to ids.ShortID, ...) (*atomic.Tx, error)
- func (vm *VM) NewImportTx(chainID ids.ID, to common.Address, baseFee *big.Int, ...) (*atomic.Tx, error)
- func (vm *VM) SetState(ctx context.Context, state uint32) error
- func (vm *VM) Shutdown(context.Context) error
- type VerifierBackend
- type VersionReply
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingUTXOs = errors.New("missing UTXOs") ErrEmptyBlock = errors.New("empty block") )
var ( ErrAssetIDMismatch = errors.New("asset IDs in the input don't match the utxo") ErrConflictingAtomicInputs = errors.New("invalid block due to conflicting atomic inputs") )
Functions ¶
func FormatLocalAddress ¶
FormatLocalAddress takes in a raw address and produces the formatted address
func ParseAddress ¶
ParseAddress takes in an address and produces the ID of the chain it's for the ID of the address
func ParseLocalAddress ¶
ParseLocalAddress takes in an address for this chain and produces the ID
func ParseServiceAddress ¶
ParseServiceAddress get address ID from address string, being it either localized (using address manager, doing also components validations), or not localized. If both attempts fail, reports error from localized address parsing
Types ¶
type BlockFetcher ¶
type BlockFetcher interface {
// GetExtendedBlock returns the VMBlock for the given ID or an error if the block is not found
GetExtendedBlock(context.Context, ids.ID) (extension.ExtendedBlock, error)
// LastAcceptedExtendedBlock returns the last accepted VM block
LastAcceptedExtendedBlock() extension.ExtendedBlock
}
type FormattedTx ¶
type FormattedTx struct {
api.FormattedTx
BlockHeight *json.Uint64 `json:"blockHeight,omitempty"`
}
type LuxAPI ¶
type LuxAPI struct {
// contains filtered or unexported fields
}
LuxAPI offers Lux network related API methods
func (*LuxAPI) GetAtomicTx ¶
GetAtomicTx returns the specified transaction
func (*LuxAPI) GetAtomicTxStatus ¶
func (service *LuxAPI) GetAtomicTxStatus(r *http.Request, args *api.JSONTxID, reply *client.GetAtomicTxStatusReply) error
GetAtomicTxStatus returns the status of the specified transaction
func (*LuxAPI) GetUTXOs ¶
func (service *LuxAPI) GetUTXOs(r *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error
GetUTXOs gets all utxos for passed in addresses
type VM ¶
type VM struct {
extension.InnerVM
Ctx *consensusctx.Context
// TODO: unexport these fields
SecpCache secp256k1.RecoverCacheType
Fx secp256k1fx.Fx
AtomicMempool *txpool.Mempool
// [atomicTxRepository] maintains two indexes on accepted atomic txs.
// - txID to accepted atomic tx
// - block height to list of atomic txs accepted on block at that height
// TODO: unexport these fields
AtomicTxRepository *atomicstate.AtomicRepository
// [atomicBackend] abstracts verification and processing of atomic transactions
AtomicBackend *atomicstate.AtomicBackend
AtomicTxPushGossiper *luxdssip.PushGossiper[*atomic.Tx]
AtomicTxPullGossiper luxdssip.Gossiper
// contains filtered or unexported fields
}
func (*VM) BuildBlockWithContext ¶
func (*VM) CodecRegistry ¶
CodecRegistry implements the secp256k1fx interface
func (*VM) CreateHandlers ¶
func (*VM) CurrentRules ¶
CurrentRules returns the chain rules for the current block.
func (*VM) GetAtomicTx ¶
getAtomicTx returns the requested transaction, status, and height. If the status is Unknown, then the returned transaction will be nil.
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx context.Context, chainCtxIntf interface{}, dbIntf interface{}, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, toEngineIntf interface{}, fxsIntf []interface{}, appSenderIntf interface{}, ) error
Initialize implements the quasarman.ChainVM interface
func (*VM) NewExportTx ¶
func (vm *VM) NewExportTx( assetID ids.ID, amount uint64, chainID ids.ID, to ids.ShortID, baseFee *big.Int, keys []*secp256k1.PrivateKey, ) (*atomic.Tx, error)
newExportTx returns a new ExportTx
func (*VM) NewImportTx ¶
type VerifierBackend ¶
type VerifierBackend struct {
Ctx *consensusctx.Context
Fx fx.Fx
Rules extras.Rules
Bootstrapped bool
BlockFetcher BlockFetcher
SecpCache secp256k1.RecoverCacheType
}
func NewVerifierBackend ¶
func NewVerifierBackend(vm *VM, rules extras.Rules) *VerifierBackend
func (*VerifierBackend) SemanticVerify ¶
func (b *VerifierBackend) SemanticVerify(tx *atomic.Tx, parent extension.ExtendedBlock, baseFee *big.Int) error
SemanticVerify checks the semantic validity of atomic transactions.
type VersionReply ¶
type VersionReply struct {
Version string `json:"version"`
}