Documentation
      ¶
    
    
  
    
  
    Overview ¶
Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Variables
 - func FormatLocalAddress(ctx *snow.Context, addr ids.ShortID) (string, error)
 - func ParseAddress(ctx *snow.Context, addrStr string) (ids.ID, ids.ShortID, error)
 - func ParseLocalAddress(ctx *snow.Context, addrStr string) (ids.ShortID, error)
 - func ParseServiceAddress(ctx *snow.Context, addrStr string) (ids.ShortID, error)
 - type AvaxAPI
 - func (service *AvaxAPI) GetAtomicTx(_ *http.Request, args *api.GetTxArgs, reply *FormattedTx) error
 - func (service *AvaxAPI) GetAtomicTxStatus(_ *http.Request, args *api.JSONTxID, reply *client.GetAtomicTxStatusReply) error
 - func (service *AvaxAPI) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error
 - func (service *AvaxAPI) IssueTx(_ *http.Request, args *api.FormattedTx, response *api.JSONTxID) error
 - func (service *AvaxAPI) Version(_ *http.Request, _ *struct{}, reply *VersionReply) error
 
- type BlockFetcher
 - type FormattedTx
 - type VM
 - func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error)
 - func (vm *VM) BuildBlockWithContext(ctx context.Context, proposerVMBlockCtx *block.Context) (snowman.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, chainCtx *snow.Context, db avalanchedatabase.Database, ...) error
 - func (vm *VM) Logger() logging.Logger
 - func (vm *VM) SetState(ctx context.Context, state snow.State) 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 ¶ added in v0.15.3
FormatLocalAddress takes in a raw address and produces the formatted address
func ParseAddress ¶ added in v0.15.3
ParseAddress takes in an address and produces the ID of the chain it's for the ID of the address
func ParseLocalAddress ¶ added in v0.15.3
ParseLocalAddress takes in an address for this chain and produces the ID
func ParseServiceAddress ¶ added in v0.15.3
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 AvaxAPI ¶ added in v0.15.3
type AvaxAPI struct {
	// contains filtered or unexported fields
}
    AvaxAPI offers Avalanche network related API methods
func (*AvaxAPI) GetAtomicTx ¶ added in v0.15.3
GetAtomicTx returns the specified transaction
func (*AvaxAPI) GetAtomicTxStatus ¶ added in v0.15.3
func (service *AvaxAPI) GetAtomicTxStatus(_ *http.Request, args *api.JSONTxID, reply *client.GetAtomicTxStatusReply) error
GetAtomicTxStatus returns the status of the specified transaction
func (*AvaxAPI) GetUTXOs ¶ added in v0.15.3
func (service *AvaxAPI) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error
GetUTXOs gets all utxos for passed in addresses
type BlockFetcher ¶
type BlockFetcher interface {
	// GetExtendedBlock returns the ExtendedBlock 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 ¶ added in v0.15.3
type FormattedTx struct {
	api.FormattedTx
	BlockHeight *json.Uint64 `json:"blockHeight,omitempty"`
}
    type VM ¶
type VM struct {
	extension.InnerVM
	Ctx *snow.Context
	// TODO: unexport these fields
	SecpCache *secp256k1.RecoverCache
	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 *avalanchegossip.PushGossiper[*atomic.Tx]
	// contains filtered or unexported fields
}
    func (*VM) BuildBlock ¶ added in v0.15.3
func (*VM) BuildBlockWithContext ¶ added in v0.15.3
func (*VM) CodecRegistry ¶ added in v0.15.3
CodecRegistry implements the secp256k1fx interface
func (*VM) CreateHandlers ¶ added in v0.15.3
func (*VM) CurrentRules ¶ added in v0.15.3
CurrentRules returns the chain rules for the current block.
func (*VM) GetAtomicTx ¶ added in v0.15.3
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, chainCtx *snow.Context, db avalanchedatabase.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, fxs []*avalanchecommon.Fx, appSender avalanchecommon.AppSender, ) error
Initialize implements the snowman.ChainVM interface
type VerifierBackend ¶
type VerifierBackend struct {
	Ctx          *snow.Context
	Fx           *secp256k1fx.Fx
	Rules        extras.Rules
	Bootstrapped bool
	BlockFetcher BlockFetcher
	SecpCache    *secp256k1.RecoverCache
}
    func NewVerifierBackend ¶ added in v0.15.3
func NewVerifierBackend(vm *VM, rules extras.Rules) *VerifierBackend
func (*VerifierBackend) SemanticVerify ¶ added in v0.15.3
func (b *VerifierBackend) SemanticVerify(tx *atomic.Tx, parent extension.ExtendedBlock, baseFee *big.Int) error
SemanticVerify checks the semantic validity of atomic transactions.
type VersionReply ¶ added in v0.15.3
type VersionReply struct {
	Version string `json:"version"`
}