Documentation ¶
Index ¶
- Constants
- Variables
- type APIBlockchain
- type APISubnet
- type AbortBlock
- type AddDelegatorArgs
- type AddSubnetValidatorArgs
- type AddValidatorArgs
- type AtomicBlock
- type Block
- type Client
- type ClientOwner
- type ClientPrimaryDelegator
- type ClientPrimaryValidator
- type ClientStaker
- type ClientSubnet
- type CommitBlock
- type CommonBlock
- func (b *CommonBlock) Accept() error
- func (b *CommonBlock) Bytes() []byte
- func (b *CommonBlock) Height() uint64
- func (b *CommonBlock) ID() ids.ID
- func (b *CommonBlock) Parent() ids.ID
- func (b *CommonBlock) Reject() error
- func (b *CommonBlock) Status() choices.Status
- func (b *CommonBlock) Timestamp() time.Time
- func (b *CommonBlock) Verify() error
- type CommonDecisionBlock
- type CreateBlockchainArgs
- type CreateSubnetArgs
- type DoubleDecisionBlock
- type ExportAVAXArgs
- type ExportKeyArgs
- type ExportKeyReply
- type Factory
- type GetBalanceRequest
- type GetBalanceResponse
- type GetBlockchainStatusArgs
- type GetBlockchainStatusReply
- type GetBlockchainsResponse
- type GetCurrentSupplyReply
- type GetCurrentValidatorsArgs
- type GetCurrentValidatorsReply
- type GetHeightResponse
- type GetMaxStakeAmountArgs
- type GetMaxStakeAmountReply
- type GetMinStakeReply
- type GetPendingValidatorsArgs
- type GetPendingValidatorsReply
- type GetRewardUTXOsReply
- type GetStakeArgs
- type GetStakeReply
- type GetStakingAssetIDArgs
- type GetStakingAssetIDResponse
- type GetSubnetsArgs
- type GetSubnetsResponse
- type GetTimestampReply
- type GetTotalStakeArgs
- type GetTotalStakeReply
- type GetTxStatusArgs
- type GetTxStatusResponse
- type GetValidatorsAtArgs
- type GetValidatorsAtReply
- type ImportAVAXArgs
- type ImportKeyArgs
- type Index
- type InternalState
- type Mempool
- type MockInternalState
- func (m *MockInternalState) Abort()
- func (m *MockInternalState) AddBlock(block Block)
- func (m *MockInternalState) AddChain(createChainTx *txs.Tx)
- func (m *MockInternalState) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO)
- func (m *MockInternalState) AddSubnet(createSubnetTx *txs.Tx)
- func (m *MockInternalState) AddTx(tx *txs.Tx, status status.Status)
- func (m *MockInternalState) AddUTXO(utxo *avax.UTXO)
- func (m *MockInternalState) Close() error
- func (m *MockInternalState) Commit() error
- func (m *MockInternalState) CommitBatch() (database.Batch, error)
- func (m *MockInternalState) DeleteCurrentDelegator(staker *state.Staker)
- func (m *MockInternalState) DeleteCurrentValidator(staker *state.Staker)
- func (m *MockInternalState) DeletePendingDelegator(staker *state.Staker)
- func (m *MockInternalState) DeletePendingValidator(staker *state.Staker)
- func (m *MockInternalState) DeleteUTXO(utxoID ids.ID)
- func (m *MockInternalState) DoneInit() error
- func (m *MockInternalState) EXPECT() *MockInternalStateMockRecorder
- func (m *MockInternalState) GetBlock(blockID ids.ID) (Block, error)
- func (m *MockInternalState) GetChains(subnetID ids.ID) ([]*txs.Tx, error)
- func (m *MockInternalState) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (state.StakerIterator, error)
- func (m *MockInternalState) GetCurrentStakerIterator() (state.StakerIterator, error)
- func (m *MockInternalState) GetCurrentSupply() uint64
- func (m *MockInternalState) GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*state.Staker, error)
- func (m *MockInternalState) GetLastAccepted() ids.ID
- func (m *MockInternalState) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (state.StakerIterator, error)
- func (m *MockInternalState) GetPendingStakerIterator() (state.StakerIterator, error)
- func (m *MockInternalState) GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*state.Staker, error)
- func (m *MockInternalState) GetRewardUTXOs(txID ids.ID) ([]*avax.UTXO, error)
- func (m *MockInternalState) GetStartTime(nodeID ids.NodeID) (time.Time, error)
- func (m *MockInternalState) GetSubnets() ([]*txs.Tx, error)
- func (m *MockInternalState) GetTimestamp() time.Time
- func (m *MockInternalState) GetTx(txID ids.ID) (*txs.Tx, status.Status, error)
- func (m *MockInternalState) GetUTXO(utxoID ids.ID) (*avax.UTXO, error)
- func (m *MockInternalState) GetUptime(nodeID ids.NodeID) (time.Duration, time.Time, error)
- func (m *MockInternalState) GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*state.ValidatorWeightDiff, error)
- func (m *MockInternalState) Load() error
- func (m *MockInternalState) PutCurrentDelegator(staker *state.Staker)
- func (m *MockInternalState) PutCurrentValidator(staker *state.Staker)
- func (m *MockInternalState) PutPendingDelegator(staker *state.Staker)
- func (m *MockInternalState) PutPendingValidator(staker *state.Staker)
- func (m *MockInternalState) SetCurrentSupply(cs uint64)
- func (m *MockInternalState) SetHeight(height uint64)
- func (m *MockInternalState) SetLastAccepted(arg0 ids.ID)
- func (m *MockInternalState) SetTimestamp(tm time.Time)
- func (m *MockInternalState) SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error
- func (m *MockInternalState) ShouldInit() (bool, error)
- func (m *MockInternalState) SyncGenesis(genesisBlkID ids.ID, genesisState *genesis.State) error
- func (m *MockInternalState) UTXOIDs(addr []byte, previous ids.ID, limit int) ([]ids.ID, error)
- func (m *MockInternalState) ValidatorSet(subnetID ids.ID) (validators.Set, error)
- func (m *MockInternalState) Write(height uint64) error
- type MockInternalStateMockRecorder
- func (mr *MockInternalStateMockRecorder) Abort() *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddBlock(block interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddTx(tx, status interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) Close() *gomock.Call
- func (mr *MockInternalStateMockRecorder) Commit() *gomock.Call
- func (mr *MockInternalStateMockRecorder) CommitBatch() *gomock.Call
- func (mr *MockInternalStateMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) DoneInit() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetBlock(blockID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetChains(subnetID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetCurrentStakerIterator() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetCurrentSupply() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetLastAccepted() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetPendingStakerIterator() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetStartTime(nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetSubnets() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetTimestamp() *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetTx(txID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetUptime(nodeID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) GetValidatorWeightDiffs(height, subnetID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) Load() *gomock.Call
- func (mr *MockInternalStateMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) SetHeight(height interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) SetUptime(nodeID, upDuration, lastUpdated interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) ShouldInit() *gomock.Call
- func (mr *MockInternalStateMockRecorder) SyncGenesis(genesisBlkID, genesisState interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) UTXOIDs(addr, previous, limit interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) ValidatorSet(subnetID interface{}) *gomock.Call
- func (mr *MockInternalStateMockRecorder) Write(height interface{}) *gomock.Call
- type ProposalBlock
- type SampleValidatorsArgs
- type SampleValidatorsReply
- type Service
- func (service *Service) AddDelegator(_ *http.Request, args *AddDelegatorArgs, reply *api.JSONTxIDChangeAddr) error
- func (service *Service) AddSubnetValidator(_ *http.Request, args *AddSubnetValidatorArgs, ...) error
- func (service *Service) AddValidator(_ *http.Request, args *AddValidatorArgs, reply *api.JSONTxIDChangeAddr) error
- func (service *Service) CreateAddress(_ *http.Request, args *api.UserPass, response *api.JSONAddress) error
- func (service *Service) CreateBlockchain(_ *http.Request, args *CreateBlockchainArgs, response *api.JSONTxIDChangeAddr) error
- func (service *Service) CreateSubnet(_ *http.Request, args *CreateSubnetArgs, response *api.JSONTxIDChangeAddr) error
- func (service *Service) ExportAVAX(_ *http.Request, args *ExportAVAXArgs, response *api.JSONTxIDChangeAddr) error
- func (service *Service) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error
- func (service *Service) GetBalance(_ *http.Request, args *GetBalanceRequest, response *GetBalanceResponse) error
- func (service *Service) GetBlock(_ *http.Request, args *api.GetBlockArgs, response *api.GetBlockResponse) error
- func (service *Service) GetBlockchainStatus(_ *http.Request, args *GetBlockchainStatusArgs, ...) error
- func (service *Service) GetBlockchains(_ *http.Request, args *struct{}, response *GetBlockchainsResponse) error
- func (service *Service) GetCurrentSupply(_ *http.Request, _ *struct{}, reply *GetCurrentSupplyReply) error
- func (service *Service) GetCurrentValidators(_ *http.Request, args *GetCurrentValidatorsArgs, ...) error
- func (service *Service) GetHeight(r *http.Request, args *struct{}, response *GetHeightResponse) error
- func (service *Service) GetMaxStakeAmount(_ *http.Request, args *GetMaxStakeAmountArgs, reply *GetMaxStakeAmountReply) error
- func (service *Service) GetMinStake(_ *http.Request, _ *struct{}, reply *GetMinStakeReply) error
- func (service *Service) GetPendingValidators(_ *http.Request, args *GetPendingValidatorsArgs, ...) error
- func (service *Service) GetRewardUTXOs(_ *http.Request, args *api.GetTxArgs, reply *GetRewardUTXOsReply) error
- func (service *Service) GetStake(_ *http.Request, args *GetStakeArgs, response *GetStakeReply) error
- func (service *Service) GetStakingAssetID(_ *http.Request, args *GetStakingAssetIDArgs, ...) error
- func (service *Service) GetSubnets(_ *http.Request, args *GetSubnetsArgs, response *GetSubnetsResponse) error
- func (service *Service) GetTimestamp(_ *http.Request, args *struct{}, reply *GetTimestampReply) error
- func (service *Service) GetTotalStake(_ *http.Request, args *GetTotalStakeArgs, reply *GetTotalStakeReply) error
- func (service *Service) GetTx(_ *http.Request, args *api.GetTxArgs, response *api.GetTxReply) error
- func (service *Service) GetTxStatus(_ *http.Request, args *GetTxStatusArgs, response *GetTxStatusResponse) error
- func (service *Service) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, response *api.GetUTXOsReply) error
- func (service *Service) GetValidatorsAt(_ *http.Request, args *GetValidatorsAtArgs, reply *GetValidatorsAtReply) error
- func (service *Service) ImportAVAX(_ *http.Request, args *ImportAVAXArgs, response *api.JSONTxIDChangeAddr) error
- func (service *Service) ImportKey(r *http.Request, args *ImportKeyArgs, reply *api.JSONAddress) error
- func (service *Service) IssueTx(_ *http.Request, args *api.FormattedTx, response *api.JSONTxID) error
- func (service *Service) ListAddresses(_ *http.Request, args *api.UserPass, response *api.JSONAddresses) error
- func (service *Service) SampleValidators(_ *http.Request, args *SampleValidatorsArgs, reply *SampleValidatorsReply) error
- func (service *Service) ValidatedBy(_ *http.Request, args *ValidatedByArgs, response *ValidatedByResponse) error
- func (service *Service) Validates(_ *http.Request, args *ValidatesArgs, response *ValidatesResponse) error
- type StandardBlock
- type VM
- func (m *VM) AcceptBlock(b Block) error
- func (m *VM) AcceptTx(tx *txs.Tx) error
- func (n VM) AppGossip(nodeID ids.NodeID, msgBytes []byte) error
- func (n VM) AppRequest(nodeID ids.NodeID, requestID uint32, deadline time.Time, msgBytes []byte) error
- func (n VM) AppRequestFailed(nodeID ids.NodeID, requestID uint32) error
- func (n VM) AppResponse(nodeID ids.NodeID, requestID uint32, msgBytes []byte) error
- func (vm *VM) BuildBlock() (snowman.Block, error)
- func (vm *VM) Clock() *mockable.Clock
- func (vm *VM) CodecRegistry() codec.Registry
- func (vm *VM) Connected(vdrID ids.NodeID, _ *version.Application) error
- func (vm *VM) CreateHandlers() (map[string]*common.HTTPHandler, error)
- func (vm *VM) CreateStaticHandlers() (map[string]*common.HTTPHandler, error)
- func (vm *VM) Disconnected(vdrID ids.NodeID) error
- func (vm *VM) GetBlock(blkID ids.ID) (snowman.Block, error)
- func (vm *VM) GetCurrentHeight() (uint64, error)
- func (vm *VM) GetMinimumHeight() (uint64, error)
- func (vm *VM) GetValidatorSet(height uint64, subnetID ids.ID) (map[ids.NodeID]uint64, error)
- func (n VM) GossipTx(tx *txs.Tx) error
- func (vm *VM) HealthCheck() (interface{}, error)
- func (vm *VM) Initialize(ctx *snow.Context, dbManager manager.Manager, genesisBytes []byte, ...) error
- func (vm *VM) LastAccepted() (ids.ID, error)
- func (vm *VM) Logger() logging.Logger
- func (vm *VM) ParseBlock(b []byte) (snowman.Block, error)
- func (vm *VM) Preferred() (Block, error)
- func (vm *VM) SetPreference(blkID ids.ID) error
- func (vm *VM) SetState(state snow.State) error
- func (vm *VM) Shutdown() error
- func (vm *VM) Version() (string, error)
- type ValidatedByArgs
- type ValidatedByResponse
- type ValidatesArgs
- type ValidatesResponse
Constants ¶
const ( // TargetTxSize is the maximum number of bytes a transaction can use to be // allowed into the mempool. TargetTxSize = 64 * units.KiB // TargetBlockSize is maximum number of transaction bytes to place into a // StandardBlock TargetBlockSize = 128 * units.KiB )
const MinConnectedStake = .80
MinConnectedStake is the minimum percentage of the Primary Network's that this node must be connected to to be considered healthy
Variables ¶
var ( Codec codec.Manager GenesisCodec codec.Manager )
Codecs do serialization and deserialization
Functions ¶
This section is empty.
Types ¶
type APIBlockchain ¶
type APIBlockchain struct { // Blockchain's ID ID ids.ID `json:"id"` // Blockchain's (non-unique) human-readable name Name string `json:"name"` // Subnet that validates the blockchain SubnetID ids.ID `json:"subnetID"` // Virtual Machine the blockchain runs VMID ids.ID `json:"vmID"` }
APIBlockchain is the representation of a blockchain used in API calls
type APISubnet ¶
type APISubnet struct { // ID of the subnet ID ids.ID `json:"id"` // Each element of [ControlKeys] the address of a public key. // A transaction to add a validator to this subnet requires // signatures from [Threshold] of these keys to be valid. ControlKeys []string `json:"controlKeys"` Threshold json.Uint32 `json:"threshold"` }
APISubnet is a representation of a subnet used in API calls
type AbortBlock ¶ added in v1.4.5
type AbortBlock struct { DoubleDecisionBlock `serialize:"true"` // contains filtered or unexported fields }
AbortBlock being accepted results in the proposal of its parent (which must be a proposal block) being rejected.
func (*AbortBlock) Accept ¶ added in v1.6.4
func (a *AbortBlock) Accept() error
func (*AbortBlock) Verify ¶ added in v1.4.5
func (a *AbortBlock) Verify() error
Verify this block performs a valid state transition.
The parent block must be a proposal ¶
This function also sets onAcceptState if the verification passes.
type AddDelegatorArgs ¶ added in v0.8.0
type AddDelegatorArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader platformapi.Staker RewardAddress string `json:"rewardAddress"` }
AddDelegatorArgs are the arguments to AddDelegator
type AddSubnetValidatorArgs ¶ added in v0.8.0
type AddSubnetValidatorArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader platformapi.Staker // ID of subnet to validate SubnetID string `json:"subnetID"` }
AddSubnetValidatorArgs are the arguments to AddSubnetValidator
type AddValidatorArgs ¶ added in v0.8.0
type AddValidatorArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader platformapi.Staker // The address the staking reward, if applicable, will go to RewardAddress string `json:"rewardAddress"` DelegationFeeRate json.Float32 `json:"delegationFeeRate"` }
AddValidatorArgs are the arguments to AddValidator
type AtomicBlock ¶
type AtomicBlock struct { CommonDecisionBlock `serialize:"true"` Tx *txs.Tx `serialize:"true" json:"tx"` // contains filtered or unexported fields }
AtomicBlock being accepted results in the atomic transaction contained in the block to be accepted and committed to the chain.
func (*AtomicBlock) Accept ¶
func (ab *AtomicBlock) Accept() error
func (*AtomicBlock) Reject ¶ added in v1.0.2
func (ab *AtomicBlock) Reject() error
func (*AtomicBlock) Verify ¶
func (ab *AtomicBlock) Verify() error
Verify this block performs a valid state transition.
The parent block must be a decision block ¶
This function also sets onAcceptDB database if the verification passes.
type Client ¶ added in v1.0.6
type Client interface { // GetHeight returns the current block height of the P Chain GetHeight(ctx context.Context, options ...rpc.Option) (uint64, error) // ExportKey returns the private key corresponding to [address] from [user]'s account ExportKey(ctx context.Context, user api.UserPass, address ids.ShortID, options ...rpc.Option) (*crypto.PrivateKeySECP256K1R, error) // ImportKey imports the specified [privateKey] to [user]'s keystore ImportKey(ctx context.Context, user api.UserPass, privateKey *crypto.PrivateKeySECP256K1R, options ...rpc.Option) (ids.ShortID, error) // GetBalance returns the balance of [addrs] on the P Chain GetBalance(ctx context.Context, addrs []ids.ShortID, options ...rpc.Option) (*GetBalanceResponse, error) // CreateAddress creates a new address for [user] CreateAddress(ctx context.Context, user api.UserPass, options ...rpc.Option) (ids.ShortID, error) // ListAddresses returns an array of platform addresses controlled by [user] ListAddresses(ctx context.Context, user api.UserPass, options ...rpc.Option) ([]ids.ShortID, error) // GetUTXOs returns the byte representation of the UTXOs controlled by [addrs] GetUTXOs( ctx context.Context, addrs []ids.ShortID, limit uint32, startAddress ids.ShortID, startUTXOID ids.ID, options ...rpc.Option, ) ([][]byte, ids.ShortID, ids.ID, error) // GetAtomicUTXOs returns the byte representation of the atomic UTXOs controlled by [addrs] // from [sourceChain] GetAtomicUTXOs( ctx context.Context, addrs []ids.ShortID, sourceChain string, limit uint32, startAddress ids.ShortID, startUTXOID ids.ID, options ...rpc.Option, ) ([][]byte, ids.ShortID, ids.ID, error) // GetSubnets returns information about the specified subnets GetSubnets(context.Context, []ids.ID, ...rpc.Option) ([]ClientSubnet, error) // GetStakingAssetID returns the assetID of the asset used for staking on // subnet corresponding to [subnetID] GetStakingAssetID(context.Context, ids.ID, ...rpc.Option) (ids.ID, error) // GetCurrentValidators returns the list of current validators for subnet with ID [subnetID] GetCurrentValidators(ctx context.Context, subnetID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option) ([]ClientPrimaryValidator, error) // GetPendingValidators returns the list of pending validators for subnet with ID [subnetID] GetPendingValidators(ctx context.Context, subnetID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option) ([]interface{}, []interface{}, error) // GetCurrentSupply returns an upper bound on the supply of AVAX in the system GetCurrentSupply(ctx context.Context, options ...rpc.Option) (uint64, error) // SampleValidators returns the nodeIDs of a sample of [sampleSize] validators from the current validator set for subnet with ID [subnetID] SampleValidators(ctx context.Context, subnetID ids.ID, sampleSize uint16, options ...rpc.Option) ([]ids.NodeID, error) // AddValidator issues a transaction to add a validator to the primary network // and returns the txID AddValidator( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, rewardAddress ids.ShortID, nodeID ids.NodeID, stakeAmount, startTime, endTime uint64, delegationFeeRate float32, options ...rpc.Option, ) (ids.ID, error) // AddDelegator issues a transaction to add a delegator to the primary network // and returns the txID AddDelegator( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, rewardAddress ids.ShortID, nodeID ids.NodeID, stakeAmount, startTime, endTime uint64, options ...rpc.Option, ) (ids.ID, error) // AddSubnetValidator issues a transaction to add validator [nodeID] to subnet // with ID [subnetID] and returns the txID AddSubnetValidator( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, subnetID ids.ID, nodeID ids.NodeID, stakeAmount, startTime, endTime uint64, options ...rpc.Option, ) (ids.ID, error) // CreateSubnet issues a transaction to create [subnet] and returns the txID CreateSubnet( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, controlKeys []ids.ShortID, threshold uint32, options ...rpc.Option, ) (ids.ID, error) // ExportAVAX issues an ExportTx transaction and returns the txID ExportAVAX( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, to ids.ShortID, toChainIDAlias string, amount uint64, options ...rpc.Option, ) (ids.ID, error) // ImportAVAX issues an ImportTx transaction and returns the txID ImportAVAX( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, to ids.ShortID, sourceChain string, options ...rpc.Option, ) (ids.ID, error) // CreateBlockchain issues a CreateBlockchain transaction and returns the txID CreateBlockchain( ctx context.Context, user api.UserPass, from []ids.ShortID, changeAddr ids.ShortID, subnetID ids.ID, vmID string, fxIDs []string, name string, genesisData []byte, options ...rpc.Option, ) (ids.ID, error) // GetBlockchainStatus returns the current status of blockchain with ID: [blockchainID] GetBlockchainStatus(ctx context.Context, blockchainID string, options ...rpc.Option) (status.BlockchainStatus, error) // ValidatedBy returns the ID of the Subnet that validates [blockchainID] ValidatedBy(ctx context.Context, blockchainID ids.ID, options ...rpc.Option) (ids.ID, error) // Validates returns the list of blockchains that are validated by the subnet with ID [subnetID] Validates(ctx context.Context, subnetID ids.ID, options ...rpc.Option) ([]ids.ID, error) // GetBlockchains returns the list of blockchains on the platform GetBlockchains(ctx context.Context, options ...rpc.Option) ([]APIBlockchain, error) // IssueTx issues the transaction and returns its txID IssueTx(ctx context.Context, tx []byte, options ...rpc.Option) (ids.ID, error) // GetTx returns the byte representation of the transaction corresponding to [txID] GetTx(ctx context.Context, txID ids.ID, options ...rpc.Option) ([]byte, error) // GetTxStatus returns the status of the transaction corresponding to [txID] GetTxStatus(ctx context.Context, txID ids.ID, options ...rpc.Option) (*GetTxStatusResponse, error) // AwaitTxDecided polls [GetTxStatus] until a status is returned that // implies the tx may be decided. AwaitTxDecided( ctx context.Context, txID ids.ID, freq time.Duration, options ...rpc.Option, ) (*GetTxStatusResponse, error) // GetStake returns the amount of nAVAX that [addrs] have cumulatively // staked on the Primary Network. GetStake(ctx context.Context, addrs []ids.ShortID, options ...rpc.Option) (uint64, [][]byte, error) // GetMinStake returns the minimum staking amount in nAVAX for validators // and delegators respectively GetMinStake(ctx context.Context, options ...rpc.Option) (uint64, uint64, error) // GetTotalStake returns the total amount (in nAVAX) staked on the network GetTotalStake(ctx context.Context, subnetID ids.ID, options ...rpc.Option) (uint64, error) // GetMaxStakeAmount returns the maximum amount of nAVAX staking to the named // node during the time period. GetMaxStakeAmount( ctx context.Context, subnetID ids.ID, nodeID ids.NodeID, startTime uint64, endTime uint64, options ...rpc.Option, ) (uint64, error) // GetRewardUTXOs returns the reward UTXOs for a transaction GetRewardUTXOs(context.Context, *api.GetTxArgs, ...rpc.Option) ([][]byte, error) // GetTimestamp returns the current chain timestamp GetTimestamp(ctx context.Context, options ...rpc.Option) (time.Time, error) // GetValidatorsAt returns the weights of the validator set of a provided subnet // at the specified height. GetValidatorsAt(ctx context.Context, subnetID ids.ID, height uint64, options ...rpc.Option) (map[ids.NodeID]uint64, error) // GetBlock returns the block with the given id. GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error) }
Client interface for interacting with the P Chain endpoint
type ClientOwner ¶ added in v1.7.11
ClientOwner is the repr. of a reward owner sent over client
type ClientPrimaryDelegator ¶ added in v1.7.11
type ClientPrimaryDelegator struct { ClientStaker RewardOwner *ClientOwner PotentialReward *uint64 }
ClientPrimaryDelegator is the repr. of a primary network delegator sent over client
type ClientPrimaryValidator ¶ added in v1.7.11
type ClientPrimaryValidator struct { ClientStaker // The owner the staking reward, if applicable, will go to RewardOwner *ClientOwner PotentialReward *uint64 DelegationFee float32 Uptime *float32 Connected *bool // The delegators delegating to this validator Delegators []ClientPrimaryDelegator }
ClientPrimaryValidator is the repr. of a primary network validator sent over client
type ClientStaker ¶ added in v1.7.11
type ClientStaker struct { // the txID of the transaction that added this staker. TxID ids.ID // the Unix time when they start staking StartTime uint64 // the Unix time when they are done staking EndTime uint64 // the validator weight when sampling validators Weight *uint64 // the amount of tokens being staked. StakeAmount *uint64 // the node ID of the staker NodeID ids.NodeID }
ClientStaker is the representation of a staker sent via client.
type ClientSubnet ¶ added in v1.7.11
type ClientSubnet struct { // ID of the subnet ID ids.ID // Each element of [ControlKeys] the address of a public key. // A transaction to add a validator to this subnet requires // signatures from [Threshold] of these keys to be valid. ControlKeys []ids.ShortID Threshold uint32 }
ClientSubnet is a representation of a subnet used in client methods
type CommitBlock ¶ added in v1.4.5
type CommitBlock struct { DoubleDecisionBlock `serialize:"true"` // contains filtered or unexported fields }
CommitBlock being accepted results in the proposal of its parent (which must be a proposal block) being enacted.
func (*CommitBlock) Accept ¶ added in v1.6.4
func (c *CommitBlock) Accept() error
func (*CommitBlock) Verify ¶ added in v1.4.5
func (c *CommitBlock) Verify() error
Verify this block performs a valid state transition.
The parent block must be a proposal ¶
This function also sets onAcceptState if the verification passes.
type CommonBlock ¶
type CommonBlock struct { PrntID ids.ID `serialize:"true" json:"parentID"` // parent's ID Hght uint64 `serialize:"true" json:"height"` // This block's height. The genesis block is at height 0. // contains filtered or unexported fields }
CommonBlock contains fields and methods common to all blocks in this VM.
func (*CommonBlock) Accept ¶ added in v1.4.5
func (b *CommonBlock) Accept() error
func (*CommonBlock) Bytes ¶ added in v1.4.5
func (b *CommonBlock) Bytes() []byte
Bytes returns the binary representation of this block
func (*CommonBlock) Height ¶ added in v1.4.5
func (b *CommonBlock) Height() uint64
Height returns this block's height. The genesis block has height 0.
func (*CommonBlock) ID ¶ added in v1.4.5
func (b *CommonBlock) ID() ids.ID
ID returns the ID of this block
func (*CommonBlock) Parent ¶
func (b *CommonBlock) Parent() ids.ID
Parent returns this block's parent's ID
func (*CommonBlock) Reject ¶
func (b *CommonBlock) Reject() error
func (*CommonBlock) Status ¶ added in v1.4.5
func (b *CommonBlock) Status() choices.Status
Status returns the status of this block
func (*CommonBlock) Timestamp ¶ added in v1.5.3
func (b *CommonBlock) Timestamp() time.Time
Timestamp returns this block's time.
func (*CommonBlock) Verify ¶ added in v1.2.2
func (b *CommonBlock) Verify() error
type CommonDecisionBlock ¶
type CommonDecisionBlock struct { CommonBlock `serialize:"true"` // contains filtered or unexported fields }
CommonDecisionBlock contains the fields and methods common to all decision blocks
func (*CommonDecisionBlock) Reject ¶ added in v1.4.5
func (cdb *CommonDecisionBlock) Reject() error
type CreateBlockchainArgs ¶
type CreateBlockchainArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader // ID of Subnet that validates the new blockchain SubnetID ids.ID `json:"subnetID"` // ID of the VM the new blockchain is running VMID string `json:"vmID"` // IDs of the FXs the VM is running FxIDs []string `json:"fxIDs"` // Human-readable name for the new blockchain, not necessarily unique Name string `json:"name"` // Genesis state of the blockchain being created GenesisData string `json:"genesisData"` // Encoding format to use for genesis data Encoding formatting.Encoding `json:"encoding"` }
CreateBlockchainArgs is the arguments for calling CreateBlockchain
type CreateSubnetArgs ¶
type CreateSubnetArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader // The ID member of APISubnet is ignored APISubnet }
CreateSubnetArgs are the arguments to CreateSubnet
type DoubleDecisionBlock ¶ added in v0.8.0
type DoubleDecisionBlock struct {
CommonDecisionBlock `serialize:"true"`
}
DoubleDecisionBlock contains the accept for a pair of blocks
func (*DoubleDecisionBlock) Accept ¶ added in v0.8.0
func (ddb *DoubleDecisionBlock) Accept() error
type ExportAVAXArgs ¶ added in v0.8.0
type ExportAVAXArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader // Amount of AVAX to send Amount json.Uint64 `json:"amount"` // Chain the funds are going to. Optional. Used if To address does not include the chainID. TargetChain string `json:"targetChain"` // ID of the address that will receive the AVAX. This address may include the // chainID, which is used to determine what the destination chain is. To string `json:"to"` }
ExportAVAXArgs are the arguments to ExportAVAX
type ExportKeyArgs ¶ added in v0.8.0
ExportKeyArgs are arguments for ExportKey
type ExportKeyReply ¶ added in v0.8.0
type ExportKeyReply struct { // The decrypted PrivateKey for the Address provided in the arguments PrivateKey *crypto.PrivateKeySECP256K1R `json:"privateKey"` }
ExportKeyReply is the response for ExportKey
type GetBalanceRequest ¶ added in v1.7.4
type GetBalanceResponse ¶ added in v0.8.0
type GetBlockchainStatusArgs ¶
type GetBlockchainStatusArgs struct {
BlockchainID string `json:"blockchainID"`
}
GetBlockchainStatusArgs is the arguments for calling GetBlockchainStatus [BlockchainID] is the ID of or an alias of the blockchain to get the status of.
type GetBlockchainStatusReply ¶
type GetBlockchainStatusReply struct {
Status status.BlockchainStatus `json:"status"`
}
GetBlockchainStatusReply is the reply from calling GetBlockchainStatus [Status] is the blockchain's status.
type GetBlockchainsResponse ¶
type GetBlockchainsResponse struct { // blockchains that exist Blockchains []APIBlockchain `json:"blockchains"` }
GetBlockchainsResponse is the response from a call to GetBlockchains
type GetCurrentSupplyReply ¶ added in v0.8.0
GetCurrentSupplyReply are the results from calling GetCurrentSupply
type GetCurrentValidatorsArgs ¶
type GetCurrentValidatorsArgs struct { // Subnet we're listing the validators of // If omitted, defaults to primary network SubnetID ids.ID `json:"subnetID"` // NodeIDs of validators to request. If [NodeIDs] // is empty, it fetches all current validators. If // some nodeIDs are not currently validators, they // will be omitted from the response. NodeIDs []ids.NodeID `json:"nodeIDs"` }
GetCurrentValidatorsArgs are the arguments for calling GetCurrentValidators
type GetCurrentValidatorsReply ¶
type GetCurrentValidatorsReply struct {
Validators []interface{} `json:"validators"`
}
GetCurrentValidatorsReply are the results from calling GetCurrentValidators. Each validator contains a list of delegators to itself.
type GetHeightResponse ¶ added in v0.8.0
type GetMaxStakeAmountArgs ¶ added in v1.0.0
type GetMaxStakeAmountArgs struct { SubnetID ids.ID `json:"subnetID"` NodeID ids.NodeID `json:"nodeID"` StartTime json.Uint64 `json:"startTime"` EndTime json.Uint64 `json:"endTime"` }
GetMaxStakeAmountArgs is the request for calling GetMaxStakeAmount.
type GetMaxStakeAmountReply ¶ added in v1.0.0
GetMaxStakeAmountReply is the response from calling GetMaxStakeAmount.
type GetMinStakeReply ¶ added in v0.8.0
type GetMinStakeReply struct { // The minimum amount of tokens one must bond to be a validator MinValidatorStake json.Uint64 `json:"minValidatorStake"` // Minimum stake, in nAVAX, that can be delegated on the primary network MinDelegatorStake json.Uint64 `json:"minDelegatorStake"` }
GetMinStakeReply is the response from calling GetMinStake.
type GetPendingValidatorsArgs ¶
type GetPendingValidatorsArgs struct { // Subnet we're getting the pending validators of // If omitted, defaults to primary network SubnetID ids.ID `json:"subnetID"` // NodeIDs of validators to request. If [NodeIDs] // is empty, it fetches all pending validators. If // some requested nodeIDs are not pending validators, // they are omitted from the response. NodeIDs []ids.NodeID `json:"nodeIDs"` }
GetPendingValidatorsArgs are the arguments for calling GetPendingValidators
type GetPendingValidatorsReply ¶
type GetPendingValidatorsReply struct { Validators []interface{} `json:"validators"` Delegators []interface{} `json:"delegators"` }
GetPendingValidatorsReply are the results from calling GetPendingValidators. Unlike GetCurrentValidatorsReply, each validator has a null delegator list.
type GetRewardUTXOsReply ¶ added in v1.4.5
type GetRewardUTXOsReply struct { // Number of UTXOs returned NumFetched json.Uint64 `json:"numFetched"` // The UTXOs UTXOs []string `json:"utxos"` // Encoding specifies the encoding format the UTXOs are returned in Encoding formatting.Encoding `json:"encoding"` }
GetRewardUTXOsReply defines the GetRewardUTXOs replies returned from the API
type GetStakeArgs ¶ added in v1.2.1
type GetStakeArgs struct { api.JSONAddresses Encoding formatting.Encoding `json:"encoding"` }
type GetStakeReply ¶ added in v0.8.0
type GetStakeReply struct { Staked json.Uint64 `json:"staked"` // String representation of staked outputs // Each is of type avax.TransferableOutput Outputs []string `json:"stakedOutputs"` // Encoding of [Outputs] Encoding formatting.Encoding `json:"encoding"` }
GetStakeReply is the response from calling GetStake.
type GetStakingAssetIDArgs ¶ added in v0.8.0
GetStakingAssetIDArgs are the arguments to GetStakingAssetID
type GetStakingAssetIDResponse ¶ added in v0.8.0
GetStakingAssetIDResponse is the response from calling GetStakingAssetID
type GetSubnetsArgs ¶
type GetSubnetsArgs struct { // IDs of the subnets to retrieve information about // If omitted, gets all subnets IDs []ids.ID `json:"ids"` }
GetSubnetsArgs are the arguments to GetSubnet
type GetSubnetsResponse ¶
type GetSubnetsResponse struct { // Each element is a subnet that exists // Null if there are no subnets other than the primary network Subnets []APISubnet `json:"subnets"` }
GetSubnetsResponse is the response from calling GetSubnets
type GetTimestampReply ¶ added in v1.5.1
GetTimestampReply is the response from GetTimestamp
type GetTotalStakeArgs ¶ added in v1.7.11
type GetTotalStakeArgs struct { // Subnet we're getting the total stake // If omitted returns Primary network weight SubnetID ids.ID `json:"subnetID"` }
GetTotalStakeArgs are the arguments for calling GetTotalStake
type GetTotalStakeReply ¶ added in v1.0.6
type GetTotalStakeReply struct { Stake json.Uint64 `json:"stake,omitempty"` Weight json.Uint64 `json:"weight,omitempty"` }
GetTotalStakeReply is the response from calling GetTotalStake.
type GetTxStatusArgs ¶ added in v0.8.0
type GetTxStatusResponse ¶ added in v1.0.4
type GetValidatorsAtArgs ¶ added in v1.5.3
type GetValidatorsAtArgs struct { Height json.Uint64 `json:"height"` SubnetID ids.ID `json:"subnetID"` }
GetValidatorsAtArgs is the response from GetValidatorsAt
type GetValidatorsAtReply ¶ added in v1.5.3
GetValidatorsAtReply is the response from GetValidatorsAt
type ImportAVAXArgs ¶ added in v0.8.0
type ImportAVAXArgs struct { // User, password, from addrs, change addr api.JSONSpendHeader // Chain the funds are coming from SourceChain string `json:"sourceChain"` // The address that will receive the imported funds To string `json:"to"` }
ImportAVAXArgs are the arguments to ImportAVAX
type ImportKeyArgs ¶ added in v0.8.0
type ImportKeyArgs struct { api.UserPass PrivateKey *crypto.PrivateKeySECP256K1R `json:"privateKey"` }
ImportKeyArgs are arguments for ImportKey
type Index ¶ added in v0.8.0
type Index struct { Address string `json:"address"` // The address as a string UTXO string `json:"utxo"` // The UTXO ID as a string }
Index is an address and an associated UTXO. Marks a starting or stopping point when fetching UTXOs. Used for pagination.
type InternalState ¶ added in v1.4.5
type InternalState interface { state.State SetHeight(height uint64) GetBlock(blockID ids.ID) (Block, error) AddBlock(block Block) Abort() Commit() error CommitBatch() (database.Batch, error) Close() error }
func NewState ¶ added in v1.7.14
func NewState(vm *VM, db database.Database, genesis []byte, metrics prometheus.Registerer) (InternalState, error)
type Mempool ¶ added in v1.0.2
type Mempool interface { Add(tx *txs.Tx) error Has(txID ids.ID) bool Get(txID ids.ID) *txs.Tx AddDecisionTx(tx *txs.Tx) AddProposalTx(tx *txs.Tx) HasDecisionTxs() bool HasProposalTx() bool RemoveDecisionTxs(txs []*txs.Tx) RemoveProposalTx(tx *txs.Tx) PopDecisionTxs(maxTxsBytes int) []*txs.Tx PopProposalTx() *txs.Tx // Note: dropped txs are added to droppedTxIDs but not // not evicted from unissued decision/proposal txs. // This allows previously dropped txs to be possibly // reissued. MarkDropped(txID ids.ID, reason string) GetDropReason(txID ids.ID) (string, bool) }
func NewMempool ¶ added in v1.6.0
func NewMempool(namespace string, registerer prometheus.Registerer) (Mempool, error)
type MockInternalState ¶ added in v1.7.6
type MockInternalState struct {
// contains filtered or unexported fields
}
MockInternalState is a mock of InternalState interface.
func NewMockInternalState ¶ added in v1.7.6
func NewMockInternalState(ctrl *gomock.Controller) *MockInternalState
NewMockInternalState creates a new mock instance.
func (*MockInternalState) Abort ¶ added in v1.7.6
func (m *MockInternalState) Abort()
Abort mocks base method.
func (*MockInternalState) AddBlock ¶ added in v1.7.6
func (m *MockInternalState) AddBlock(block Block)
AddBlock mocks base method.
func (*MockInternalState) AddChain ¶ added in v1.7.6
func (m *MockInternalState) AddChain(createChainTx *txs.Tx)
AddChain mocks base method.
func (*MockInternalState) AddRewardUTXO ¶ added in v1.7.6
func (m *MockInternalState) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO)
AddRewardUTXO mocks base method.
func (*MockInternalState) AddSubnet ¶ added in v1.7.6
func (m *MockInternalState) AddSubnet(createSubnetTx *txs.Tx)
AddSubnet mocks base method.
func (*MockInternalState) AddTx ¶ added in v1.7.6
func (m *MockInternalState) AddTx(tx *txs.Tx, status status.Status)
AddTx mocks base method.
func (*MockInternalState) AddUTXO ¶ added in v1.7.6
func (m *MockInternalState) AddUTXO(utxo *avax.UTXO)
AddUTXO mocks base method.
func (*MockInternalState) Close ¶ added in v1.7.6
func (m *MockInternalState) Close() error
Close mocks base method.
func (*MockInternalState) Commit ¶ added in v1.7.6
func (m *MockInternalState) Commit() error
Commit mocks base method.
func (*MockInternalState) CommitBatch ¶ added in v1.7.6
func (m *MockInternalState) CommitBatch() (database.Batch, error)
CommitBatch mocks base method.
func (*MockInternalState) DeleteCurrentDelegator ¶ added in v1.7.15
func (m *MockInternalState) DeleteCurrentDelegator(staker *state.Staker)
DeleteCurrentDelegator mocks base method.
func (*MockInternalState) DeleteCurrentValidator ¶ added in v1.7.15
func (m *MockInternalState) DeleteCurrentValidator(staker *state.Staker)
DeleteCurrentValidator mocks base method.
func (*MockInternalState) DeletePendingDelegator ¶ added in v1.7.15
func (m *MockInternalState) DeletePendingDelegator(staker *state.Staker)
DeletePendingDelegator mocks base method.
func (*MockInternalState) DeletePendingValidator ¶ added in v1.7.15
func (m *MockInternalState) DeletePendingValidator(staker *state.Staker)
DeletePendingValidator mocks base method.
func (*MockInternalState) DeleteUTXO ¶ added in v1.7.6
func (m *MockInternalState) DeleteUTXO(utxoID ids.ID)
DeleteUTXO mocks base method.
func (*MockInternalState) DoneInit ¶ added in v1.7.14
func (m *MockInternalState) DoneInit() error
DoneInit mocks base method.
func (*MockInternalState) EXPECT ¶ added in v1.7.6
func (m *MockInternalState) EXPECT() *MockInternalStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockInternalState) GetBlock ¶ added in v1.7.6
func (m *MockInternalState) GetBlock(blockID ids.ID) (Block, error)
GetBlock mocks base method.
func (*MockInternalState) GetCurrentDelegatorIterator ¶ added in v1.7.15
func (m *MockInternalState) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (state.StakerIterator, error)
GetCurrentDelegatorIterator mocks base method.
func (*MockInternalState) GetCurrentStakerIterator ¶ added in v1.7.15
func (m *MockInternalState) GetCurrentStakerIterator() (state.StakerIterator, error)
GetCurrentStakerIterator mocks base method.
func (*MockInternalState) GetCurrentSupply ¶ added in v1.7.6
func (m *MockInternalState) GetCurrentSupply() uint64
GetCurrentSupply mocks base method.
func (*MockInternalState) GetCurrentValidator ¶ added in v1.7.15
func (m *MockInternalState) GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*state.Staker, error)
GetCurrentValidator mocks base method.
func (*MockInternalState) GetLastAccepted ¶ added in v1.7.6
func (m *MockInternalState) GetLastAccepted() ids.ID
GetLastAccepted mocks base method.
func (*MockInternalState) GetPendingDelegatorIterator ¶ added in v1.7.15
func (m *MockInternalState) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (state.StakerIterator, error)
GetPendingDelegatorIterator mocks base method.
func (*MockInternalState) GetPendingStakerIterator ¶ added in v1.7.15
func (m *MockInternalState) GetPendingStakerIterator() (state.StakerIterator, error)
GetPendingStakerIterator mocks base method.
func (*MockInternalState) GetPendingValidator ¶ added in v1.7.15
func (m *MockInternalState) GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*state.Staker, error)
GetPendingValidator mocks base method.
func (*MockInternalState) GetRewardUTXOs ¶ added in v1.7.6
GetRewardUTXOs mocks base method.
func (*MockInternalState) GetStartTime ¶ added in v1.7.6
GetStartTime mocks base method.
func (*MockInternalState) GetSubnets ¶ added in v1.7.6
func (m *MockInternalState) GetSubnets() ([]*txs.Tx, error)
GetSubnets mocks base method.
func (*MockInternalState) GetTimestamp ¶ added in v1.7.6
func (m *MockInternalState) GetTimestamp() time.Time
GetTimestamp mocks base method.
func (*MockInternalState) GetValidatorWeightDiffs ¶ added in v1.7.6
func (m *MockInternalState) GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*state.ValidatorWeightDiff, error)
GetValidatorWeightDiffs mocks base method.
func (*MockInternalState) Load ¶ added in v1.7.14
func (m *MockInternalState) Load() error
Load mocks base method.
func (*MockInternalState) PutCurrentDelegator ¶ added in v1.7.15
func (m *MockInternalState) PutCurrentDelegator(staker *state.Staker)
PutCurrentDelegator mocks base method.
func (*MockInternalState) PutCurrentValidator ¶ added in v1.7.15
func (m *MockInternalState) PutCurrentValidator(staker *state.Staker)
PutCurrentValidator mocks base method.
func (*MockInternalState) PutPendingDelegator ¶ added in v1.7.15
func (m *MockInternalState) PutPendingDelegator(staker *state.Staker)
PutPendingDelegator mocks base method.
func (*MockInternalState) PutPendingValidator ¶ added in v1.7.15
func (m *MockInternalState) PutPendingValidator(staker *state.Staker)
PutPendingValidator mocks base method.
func (*MockInternalState) SetCurrentSupply ¶ added in v1.7.6
func (m *MockInternalState) SetCurrentSupply(cs uint64)
SetCurrentSupply mocks base method.
func (*MockInternalState) SetHeight ¶ added in v1.7.6
func (m *MockInternalState) SetHeight(height uint64)
SetHeight mocks base method.
func (*MockInternalState) SetLastAccepted ¶ added in v1.7.6
func (m *MockInternalState) SetLastAccepted(arg0 ids.ID)
SetLastAccepted mocks base method.
func (*MockInternalState) SetTimestamp ¶ added in v1.7.6
func (m *MockInternalState) SetTimestamp(tm time.Time)
SetTimestamp mocks base method.
func (*MockInternalState) SetUptime ¶ added in v1.7.6
func (m *MockInternalState) SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error
SetUptime mocks base method.
func (*MockInternalState) ShouldInit ¶ added in v1.7.14
func (m *MockInternalState) ShouldInit() (bool, error)
ShouldInit mocks base method.
func (*MockInternalState) SyncGenesis ¶ added in v1.7.14
SyncGenesis mocks base method.
func (*MockInternalState) ValidatorSet ¶ added in v1.7.15
func (m *MockInternalState) ValidatorSet(subnetID ids.ID) (validators.Set, error)
ValidatorSet mocks base method.
func (*MockInternalState) Write ¶ added in v1.7.14
func (m *MockInternalState) Write(height uint64) error
Write mocks base method.
type MockInternalStateMockRecorder ¶ added in v1.7.6
type MockInternalStateMockRecorder struct {
// contains filtered or unexported fields
}
MockInternalStateMockRecorder is the mock recorder for MockInternalState.
func (*MockInternalStateMockRecorder) Abort ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) Abort() *gomock.Call
Abort indicates an expected call of Abort.
func (*MockInternalStateMockRecorder) AddBlock ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddBlock(block interface{}) *gomock.Call
AddBlock indicates an expected call of AddBlock.
func (*MockInternalStateMockRecorder) AddChain ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
AddChain indicates an expected call of AddChain.
func (*MockInternalStateMockRecorder) AddRewardUTXO ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
AddRewardUTXO indicates an expected call of AddRewardUTXO.
func (*MockInternalStateMockRecorder) AddSubnet ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
AddSubnet indicates an expected call of AddSubnet.
func (*MockInternalStateMockRecorder) AddTx ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddTx(tx, status interface{}) *gomock.Call
AddTx indicates an expected call of AddTx.
func (*MockInternalStateMockRecorder) AddUTXO ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
AddUTXO indicates an expected call of AddUTXO.
func (*MockInternalStateMockRecorder) Close ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockInternalStateMockRecorder) Commit ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) Commit() *gomock.Call
Commit indicates an expected call of Commit.
func (*MockInternalStateMockRecorder) CommitBatch ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) CommitBatch() *gomock.Call
CommitBatch indicates an expected call of CommitBatch.
func (*MockInternalStateMockRecorder) DeleteCurrentDelegator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.
func (*MockInternalStateMockRecorder) DeleteCurrentValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.
func (*MockInternalStateMockRecorder) DeletePendingDelegator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
DeletePendingDelegator indicates an expected call of DeletePendingDelegator.
func (*MockInternalStateMockRecorder) DeletePendingValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
DeletePendingValidator indicates an expected call of DeletePendingValidator.
func (*MockInternalStateMockRecorder) DeleteUTXO ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
DeleteUTXO indicates an expected call of DeleteUTXO.
func (*MockInternalStateMockRecorder) DoneInit ¶ added in v1.7.14
func (mr *MockInternalStateMockRecorder) DoneInit() *gomock.Call
DoneInit indicates an expected call of DoneInit.
func (*MockInternalStateMockRecorder) GetBlock ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetBlock(blockID interface{}) *gomock.Call
GetBlock indicates an expected call of GetBlock.
func (*MockInternalStateMockRecorder) GetChains ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetChains(subnetID interface{}) *gomock.Call
GetChains indicates an expected call of GetChains.
func (*MockInternalStateMockRecorder) GetCurrentDelegatorIterator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator.
func (*MockInternalStateMockRecorder) GetCurrentStakerIterator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetCurrentStakerIterator() *gomock.Call
GetCurrentStakerIterator indicates an expected call of GetCurrentStakerIterator.
func (*MockInternalStateMockRecorder) GetCurrentSupply ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetCurrentSupply() *gomock.Call
GetCurrentSupply indicates an expected call of GetCurrentSupply.
func (*MockInternalStateMockRecorder) GetCurrentValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentValidator indicates an expected call of GetCurrentValidator.
func (*MockInternalStateMockRecorder) GetLastAccepted ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetLastAccepted() *gomock.Call
GetLastAccepted indicates an expected call of GetLastAccepted.
func (*MockInternalStateMockRecorder) GetPendingDelegatorIterator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator.
func (*MockInternalStateMockRecorder) GetPendingStakerIterator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetPendingStakerIterator() *gomock.Call
GetPendingStakerIterator indicates an expected call of GetPendingStakerIterator.
func (*MockInternalStateMockRecorder) GetPendingValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
GetPendingValidator indicates an expected call of GetPendingValidator.
func (*MockInternalStateMockRecorder) GetRewardUTXOs ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
GetRewardUTXOs indicates an expected call of GetRewardUTXOs.
func (*MockInternalStateMockRecorder) GetStartTime ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetStartTime(nodeID interface{}) *gomock.Call
GetStartTime indicates an expected call of GetStartTime.
func (*MockInternalStateMockRecorder) GetSubnets ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetSubnets() *gomock.Call
GetSubnets indicates an expected call of GetSubnets.
func (*MockInternalStateMockRecorder) GetTimestamp ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetTimestamp() *gomock.Call
GetTimestamp indicates an expected call of GetTimestamp.
func (*MockInternalStateMockRecorder) GetTx ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetTx(txID interface{}) *gomock.Call
GetTx indicates an expected call of GetTx.
func (*MockInternalStateMockRecorder) GetUTXO ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
GetUTXO indicates an expected call of GetUTXO.
func (*MockInternalStateMockRecorder) GetUptime ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetUptime(nodeID interface{}) *gomock.Call
GetUptime indicates an expected call of GetUptime.
func (*MockInternalStateMockRecorder) GetValidatorWeightDiffs ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) GetValidatorWeightDiffs(height, subnetID interface{}) *gomock.Call
GetValidatorWeightDiffs indicates an expected call of GetValidatorWeightDiffs.
func (*MockInternalStateMockRecorder) Load ¶ added in v1.7.14
func (mr *MockInternalStateMockRecorder) Load() *gomock.Call
Load indicates an expected call of Load.
func (*MockInternalStateMockRecorder) PutCurrentDelegator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
PutCurrentDelegator indicates an expected call of PutCurrentDelegator.
func (*MockInternalStateMockRecorder) PutCurrentValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
PutCurrentValidator indicates an expected call of PutCurrentValidator.
func (*MockInternalStateMockRecorder) PutPendingDelegator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
PutPendingDelegator indicates an expected call of PutPendingDelegator.
func (*MockInternalStateMockRecorder) PutPendingValidator ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
PutPendingValidator indicates an expected call of PutPendingValidator.
func (*MockInternalStateMockRecorder) SetCurrentSupply ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
SetCurrentSupply indicates an expected call of SetCurrentSupply.
func (*MockInternalStateMockRecorder) SetHeight ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) SetHeight(height interface{}) *gomock.Call
SetHeight indicates an expected call of SetHeight.
func (*MockInternalStateMockRecorder) SetLastAccepted ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call
SetLastAccepted indicates an expected call of SetLastAccepted.
func (*MockInternalStateMockRecorder) SetTimestamp ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
SetTimestamp indicates an expected call of SetTimestamp.
func (*MockInternalStateMockRecorder) SetUptime ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) SetUptime(nodeID, upDuration, lastUpdated interface{}) *gomock.Call
SetUptime indicates an expected call of SetUptime.
func (*MockInternalStateMockRecorder) ShouldInit ¶ added in v1.7.14
func (mr *MockInternalStateMockRecorder) ShouldInit() *gomock.Call
ShouldInit indicates an expected call of ShouldInit.
func (*MockInternalStateMockRecorder) SyncGenesis ¶ added in v1.7.14
func (mr *MockInternalStateMockRecorder) SyncGenesis(genesisBlkID, genesisState interface{}) *gomock.Call
SyncGenesis indicates an expected call of SyncGenesis.
func (*MockInternalStateMockRecorder) UTXOIDs ¶ added in v1.7.6
func (mr *MockInternalStateMockRecorder) UTXOIDs(addr, previous, limit interface{}) *gomock.Call
UTXOIDs indicates an expected call of UTXOIDs.
func (*MockInternalStateMockRecorder) ValidatorSet ¶ added in v1.7.15
func (mr *MockInternalStateMockRecorder) ValidatorSet(subnetID interface{}) *gomock.Call
ValidatorSet indicates an expected call of ValidatorSet.
func (*MockInternalStateMockRecorder) Write ¶ added in v1.7.14
func (mr *MockInternalStateMockRecorder) Write(height interface{}) *gomock.Call
Write indicates an expected call of Write.
type ProposalBlock ¶
type ProposalBlock struct { CommonBlock `serialize:"true"` Tx *txs.Tx `serialize:"true" json:"tx"` // contains filtered or unexported fields }
ProposalBlock is a proposal to change the chain's state.
A proposal may be to:
- Advance the chain's timestamp (*AdvanceTimeTx)
- Remove a staker from the staker set (*RewardStakerTx)
- Add a new staker to the set of pending (future) stakers (*AddValidatorTx, *AddDelegatorTx, *AddSubnetValidatorTx)
The proposal will be enacted (change the chain's state) if the proposal block is accepted and followed by an accepted Commit block
func (*ProposalBlock) Accept ¶ added in v0.8.0
func (pb *ProposalBlock) Accept() error
func (*ProposalBlock) Options ¶
func (pb *ProposalBlock) Options() ([2]snowman.Block, error)
Options returns the possible children of this block in preferential order.
func (*ProposalBlock) Reject ¶ added in v1.0.2
func (pb *ProposalBlock) Reject() error
func (*ProposalBlock) Verify ¶
func (pb *ProposalBlock) Verify() error
Verify this block is valid.
The parent block must be a decision block ¶
If this block is valid, this function also sets pas.onCommit and pas.onAbort.
type SampleValidatorsArgs ¶
type SampleValidatorsArgs struct { // Number of validators in the sample Size json.Uint16 `json:"size"` // ID of subnet to sample validators from // If omitted, defaults to the primary network SubnetID ids.ID `json:"subnetID"` }
SampleValidatorsArgs are the arguments for calling SampleValidators
type SampleValidatorsReply ¶
SampleValidatorsReply are the results from calling Sample
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines the API calls that can be made to the platform chain
func (*Service) AddDelegator ¶ added in v0.8.0
func (service *Service) AddDelegator(_ *http.Request, args *AddDelegatorArgs, reply *api.JSONTxIDChangeAddr) error
AddDelegator creates and signs and issues a transaction to add a delegator to the primary network
func (*Service) AddSubnetValidator ¶ added in v0.8.0
func (service *Service) AddSubnetValidator(_ *http.Request, args *AddSubnetValidatorArgs, response *api.JSONTxIDChangeAddr) error
AddSubnetValidator creates and signs and issues a transaction to add a validator to a subnet other than the primary network
func (*Service) AddValidator ¶ added in v0.8.0
func (service *Service) AddValidator(_ *http.Request, args *AddValidatorArgs, reply *api.JSONTxIDChangeAddr) error
AddValidator creates and signs and issues a transaction to add a validator to the primary network
func (*Service) CreateAddress ¶ added in v0.8.0
func (service *Service) CreateAddress(_ *http.Request, args *api.UserPass, response *api.JSONAddress) error
CreateAddress creates an address controlled by [args.Username] Returns the newly created address
func (*Service) CreateBlockchain ¶
func (service *Service) CreateBlockchain(_ *http.Request, args *CreateBlockchainArgs, response *api.JSONTxIDChangeAddr) error
CreateBlockchain issues a transaction to create a new blockchain
func (*Service) CreateSubnet ¶
func (service *Service) CreateSubnet(_ *http.Request, args *CreateSubnetArgs, response *api.JSONTxIDChangeAddr) error
CreateSubnet creates and signs and issues a transaction to create a new subnet
func (*Service) ExportAVAX ¶ added in v0.8.0
func (service *Service) ExportAVAX(_ *http.Request, args *ExportAVAXArgs, response *api.JSONTxIDChangeAddr) error
ExportAVAX exports AVAX from the P-Chain to the X-Chain It must be imported on the X-Chain to complete the transfer
func (*Service) ExportKey ¶ added in v0.8.0
func (service *Service) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error
ExportKey returns a private key from the provided user
func (*Service) GetBalance ¶ added in v0.8.0
func (service *Service) GetBalance(_ *http.Request, args *GetBalanceRequest, response *GetBalanceResponse) error
GetBalance gets the balance of an address
func (*Service) GetBlock ¶ added in v1.7.6
func (service *Service) GetBlock(_ *http.Request, args *api.GetBlockArgs, response *api.GetBlockResponse) error
func (*Service) GetBlockchainStatus ¶
func (service *Service) GetBlockchainStatus(_ *http.Request, args *GetBlockchainStatusArgs, reply *GetBlockchainStatusReply) error
GetBlockchainStatus gets the status of a blockchain with the ID [args.BlockchainID].
func (*Service) GetBlockchains ¶
func (service *Service) GetBlockchains(_ *http.Request, args *struct{}, response *GetBlockchainsResponse) error
GetBlockchains returns all of the blockchains that exist
func (*Service) GetCurrentSupply ¶ added in v0.8.0
func (service *Service) GetCurrentSupply(_ *http.Request, _ *struct{}, reply *GetCurrentSupplyReply) error
GetCurrentSupply returns an upper bound on the supply of AVAX in the system
func (*Service) GetCurrentValidators ¶
func (service *Service) GetCurrentValidators(_ *http.Request, args *GetCurrentValidatorsArgs, reply *GetCurrentValidatorsReply) error
GetCurrentValidators returns current validators and delegators
func (*Service) GetHeight ¶ added in v0.8.0
func (service *Service) GetHeight(r *http.Request, args *struct{}, response *GetHeightResponse) error
GetHeight returns the height of the last accepted block
func (*Service) GetMaxStakeAmount ¶ added in v1.0.0
func (service *Service) GetMaxStakeAmount(_ *http.Request, args *GetMaxStakeAmountArgs, reply *GetMaxStakeAmountReply) error
GetMaxStakeAmount returns the maximum amount of nAVAX staking to the named node during the time period.
func (*Service) GetMinStake ¶ added in v0.8.0
func (service *Service) GetMinStake(_ *http.Request, _ *struct{}, reply *GetMinStakeReply) error
GetMinStake returns the minimum staking amount in nAVAX.
func (*Service) GetPendingValidators ¶
func (service *Service) GetPendingValidators(_ *http.Request, args *GetPendingValidatorsArgs, reply *GetPendingValidatorsReply) error
GetPendingValidators returns the list of pending validators
func (*Service) GetRewardUTXOs ¶ added in v1.4.5
func (service *Service) GetRewardUTXOs(_ *http.Request, args *api.GetTxArgs, reply *GetRewardUTXOsReply) error
GetRewardUTXOs returns the UTXOs that were rewarded after the provided transaction's staking period ended.
func (*Service) GetStake ¶ added in v0.8.0
func (service *Service) GetStake(_ *http.Request, args *GetStakeArgs, response *GetStakeReply) error
GetStake returns the amount of nAVAX that [args.Addresses] have cumulatively staked on the Primary Network.
This method assumes that each stake output has only owner This method assumes only AVAX can be staked This method only concerns itself with the Primary Network, not subnets TODO: Improve the performance of this method by maintaining this data in a data structure rather than re-calculating it by iterating over stakers
func (*Service) GetStakingAssetID ¶ added in v0.8.0
func (service *Service) GetStakingAssetID(_ *http.Request, args *GetStakingAssetIDArgs, response *GetStakingAssetIDResponse) error
GetStakingAssetID returns the assetID of the token used to stake on the provided subnet
func (*Service) GetSubnets ¶
func (service *Service) GetSubnets(_ *http.Request, args *GetSubnetsArgs, response *GetSubnetsResponse) error
GetSubnets returns the subnets whose ID are in [args.IDs] The response will include the primary network
func (*Service) GetTimestamp ¶ added in v1.5.1
func (service *Service) GetTimestamp(_ *http.Request, args *struct{}, reply *GetTimestampReply) error
GetTimestamp returns the current timestamp on chain.
func (*Service) GetTotalStake ¶ added in v1.0.3
func (service *Service) GetTotalStake(_ *http.Request, args *GetTotalStakeArgs, reply *GetTotalStakeReply) error
GetTotalStake returns the total amount staked on the Primary Network
func (*Service) GetTxStatus ¶ added in v0.8.0
func (service *Service) GetTxStatus(_ *http.Request, args *GetTxStatusArgs, response *GetTxStatusResponse) error
GetTxStatus gets a tx's status
func (*Service) GetUTXOs ¶ added in v0.8.0
func (service *Service) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, response *api.GetUTXOsReply) error
GetUTXOs returns the UTXOs controlled by the given addresses
func (*Service) GetValidatorsAt ¶ added in v1.5.3
func (service *Service) GetValidatorsAt(_ *http.Request, args *GetValidatorsAtArgs, reply *GetValidatorsAtReply) error
GetValidatorsAt returns the weights of the validator set of a provided subnet at the specified height.
func (*Service) ImportAVAX ¶ added in v0.8.0
func (service *Service) ImportAVAX(_ *http.Request, args *ImportAVAXArgs, response *api.JSONTxIDChangeAddr) error
ImportAVAX issues a transaction to import AVAX from the X-chain. The AVAX must have already been exported from the X-Chain.
func (*Service) ImportKey ¶ added in v0.8.0
func (service *Service) ImportKey(r *http.Request, args *ImportKeyArgs, reply *api.JSONAddress) error
ImportKey adds a private key to the provided user
func (*Service) IssueTx ¶
func (service *Service) IssueTx(_ *http.Request, args *api.FormattedTx, response *api.JSONTxID) error
IssueTx issues a tx
func (*Service) ListAddresses ¶ added in v0.8.0
func (service *Service) ListAddresses(_ *http.Request, args *api.UserPass, response *api.JSONAddresses) error
ListAddresses returns the addresses controlled by [args.Username]
func (*Service) SampleValidators ¶
func (service *Service) SampleValidators(_ *http.Request, args *SampleValidatorsArgs, reply *SampleValidatorsReply) error
SampleValidators returns a sampling of the list of current validators
func (*Service) ValidatedBy ¶
func (service *Service) ValidatedBy(_ *http.Request, args *ValidatedByArgs, response *ValidatedByResponse) error
ValidatedBy returns the ID of the Subnet that validates [args.BlockchainID]
func (*Service) Validates ¶
func (service *Service) Validates(_ *http.Request, args *ValidatesArgs, response *ValidatesResponse) error
Validates returns the IDs of the blockchains validated by [args.SubnetID]
type StandardBlock ¶
type StandardBlock struct { CommonDecisionBlock `serialize:"true"` Txs []*txs.Tx `serialize:"true" json:"txs"` // contains filtered or unexported fields }
StandardBlock being accepted results in the transactions contained in the block to be accepted and committed to the chain.
func (*StandardBlock) Accept ¶ added in v1.7.0
func (sb *StandardBlock) Accept() error
func (*StandardBlock) Reject ¶ added in v1.0.2
func (sb *StandardBlock) Reject() error
func (*StandardBlock) Verify ¶
func (sb *StandardBlock) Verify() error
Verify this block performs a valid state transition.
The parent block must be a decision block ¶
This function also sets onAcceptDB database if the verification passes.
type VM ¶
type VM struct { Factory avax.AddressManager avax.AtomicUTXOManager // contains filtered or unexported fields }
func (*VM) AcceptBlock ¶ added in v1.4.5
TODO: use a visitor here
func (VM) AppRequest ¶ added in v1.5.3
func (VM) AppRequestFailed ¶ added in v1.5.3
func (VM) AppResponse ¶ added in v1.5.3
func (*VM) BuildBlock ¶
BuildBlock builds a block to be added to consensus
func (*VM) CodecRegistry ¶ added in v1.0.6
func (*VM) CreateHandlers ¶
func (vm *VM) CreateHandlers() (map[string]*common.HTTPHandler, error)
CreateHandlers returns a map where: * keys are API endpoint extensions * values are API handlers
func (*VM) CreateStaticHandlers ¶
func (vm *VM) CreateStaticHandlers() (map[string]*common.HTTPHandler, error)
CreateStaticHandlers returns a map where: * keys are API endpoint extensions * values are API handlers
func (*VM) GetCurrentHeight ¶ added in v1.6.0
GetCurrentHeight returns the height of the last accepted block
func (*VM) GetMinimumHeight ¶ added in v1.7.10
GetMinimumHeight returns the height of the most recent block beyond the horizon of our recentlyAccepted window.
Because the time between blocks is arbitrary, we're only guaranteed that the window's configured TTL amount of time has passed once an element expires from the window.
To try to always return a block older than the window's TTL, we return the parent of the oldest element in the window (as an expired element is always guaranteed to be sufficiently stale). If we haven't expired an element yet in the case of a process restart, we default to the lastAccepted block's height which is likely (but not guaranteed) to also be older than the window's configured TTL.
func (*VM) GetValidatorSet ¶ added in v1.5.3
GetValidatorSet returns the validator set at the specified height for the provided subnetID.
func (*VM) HealthCheck ¶ added in v1.2.1
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx *snow.Context, dbManager manager.Manager, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, toEngine chan<- common.Message, _ []*common.Fx, appSender common.AppSender, ) error
Initialize this blockchain. [vm.ChainManager] and [vm.vdrMgr] must be set before this function is called.
func (*VM) LastAccepted ¶ added in v1.4.5
LastAccepted returns the block most recently accepted
func (*VM) SetPreference ¶
SetPreference sets the preferred block to be the one with ID [blkID]
type ValidatedByArgs ¶
type ValidatedByArgs struct { // ValidatedBy returns the ID of the Subnet validating the blockchain with this ID BlockchainID ids.ID `json:"blockchainID"` }
ValidatedByArgs is the arguments for calling ValidatedBy
type ValidatedByResponse ¶
type ValidatedByResponse struct { // ID of the Subnet validating the specified blockchain SubnetID ids.ID `json:"subnetID"` }
ValidatedByResponse is the reply from calling ValidatedBy
type ValidatesArgs ¶
ValidatesArgs are the arguments to Validates
type ValidatesResponse ¶
ValidatesResponse is the response from calling Validates
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package fx is a generated GoMock package.
|
Package fx is a generated GoMock package. |
Package state is a generated GoMock package.
|
Package state is a generated GoMock package. |