Documentation ¶
Overview ¶
Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Variables
- func CheckNodeIsInSubnetValidators(subnetID ids.ID, nodeID string) (bool, error)
- func FindErrorLogs(rootDirs ...string)
- func GetChainID(network models.Network, chainName string) (ids.ID, error)
- func GetChainIDs(network models.Network, chainName string) (string, string, error)
- func GetCurrentSupply(subnetID ids.ID) error
- func GetFirstEndpoint(clusterInfo *rpcpb.ClusterInfo, chain string) string
- func GetLocallyDeployedSubnets() (map[string]struct{}, error)
- func GetLocallyDeployedSubnetsFromFile(app *application.Avalanche) ([]string, error)
- func GetPublicSubnetValidators(subnetID ids.ID, network models.Network) ([]platformvm.ClientPermissionlessValidator, error)
- func GetSubnetAirdropKeyInfo(app *application.Avalanche, subnetName string) (string, string, string, error)
- func GetSubnetValidators(subnetID ids.ID) ([]platformvm.ClientPermissionlessValidator, error)
- func HasEndpoints(clusterInfo *rpcpb.ClusterInfo) bool
- func IsSubnetValidator(subnetID ids.ID, nodeID ids.NodeID, network models.Network) (bool, error)
- func IssueAddPermissionlessDelegatorTx(kc keychain.Keychain, subnetID ids.ID, nodeID ids.NodeID, stakeAmount uint64, ...) (ids.ID, error)
- func IssueAddPermissionlessValidatorTx(kc keychain.Keychain, subnetID ids.ID, nodeID ids.NodeID, stakeAmount uint64, ...) (ids.ID, error)
- func IssuePFromXImportTx(wallet primary.Wallet, usingLedger bool, hasOnlyOneKey bool, ...) (ids.ID, error)
- func IssueRemoveSubnetValidatorTx(kc keychain.Keychain, subnetID ids.ID, nodeID ids.NodeID) (ids.ID, error)
- func IssueTransformSubnetTx(elasticSubnetConfig models.ElasticSubnetConfig, kc keychain.Keychain, ...) (ids.ID, ids.ID, error)
- func IssueXToPExportTx(wallet primary.Wallet, usingLedger bool, hasOnlyOneKey bool, assetID ids.ID, ...) (ids.ID, error)
- func SetDefaultSnapshot(snapshotsDir string, resetCurrentSnapshot bool, avagoVersion string, ...) (bool, error)
- func WaitForHealthy(ctx context.Context, cli client.Client) (*rpcpb.ClusterInfo, error)
- func WriteExtraLocalNetworkData(app *application.Avalanche, cchainTeleporterMessengerAddress string, ...) error
- type DeployInfo
- type ExtraLocalNetworkData
- type LocalDeployer
- type PublicDeployer
- func (d *PublicDeployer) AddPermissionlessDelegator(subnetID ids.ID, subnetAssetID ids.ID, nodeID ids.NodeID, stakeAmount uint64, ...) (ids.ID, error)
- func (d *PublicDeployer) AddPermissionlessValidator(subnetID ids.ID, subnetAssetID ids.ID, nodeID ids.NodeID, stakeAmount uint64, ...) (ids.ID, error)
- func (d *PublicDeployer) AddValidator(justIssueTx bool, controlKeys []string, subnetAuthKeysStrs []string, ...) (bool, *txs.Tx, []string, error)
- func (d *PublicDeployer) Commit(tx *txs.Tx, justIssueTx bool) (ids.ID, error)
- func (d *PublicDeployer) CreateAssetTx(tokenName string, tokenSymbol string, denomination byte, ...) (ids.ID, error)
- func (d *PublicDeployer) DeployBlockchain(controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, ...) (bool, ids.ID, *txs.Tx, []string, error)
- func (d *PublicDeployer) DeploySubnet(controlKeys []string, threshold uint32) (ids.ID, error)
- func (d *PublicDeployer) ExportToPChainTx(subnetAssetID ids.ID, owner *secp256k1fx.OutputOwners, assetAmount uint64) (ids.ID, error)
- func (d *PublicDeployer) ImportFromXChain(owner *secp256k1fx.OutputOwners) (ids.ID, error)
- func (d *PublicDeployer) RemoveValidator(controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, ...) (bool, *txs.Tx, []string, error)
- func (d *PublicDeployer) Sign(tx *txs.Tx, subnetAuthKeysStrs []string, subnetID ids.ID, ...) error
- func (d *PublicDeployer) TransferSubnetOwnership(controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, ...) (bool, *txs.Tx, []string, error)
- func (d *PublicDeployer) TransformSubnetTx(controlKeys []string, subnetAuthKeysStrs []string, ...) (bool, ids.ID, *txs.Tx, []string, error)
- type Publisher
Constants ¶
This section is empty.
Variables ¶
var ErrNoSubnetAuthKeysInWallet = errors.New("auth wallet does not contain subnet auth keys")
Functions ¶
func FindErrorLogs ¶
func FindErrorLogs(rootDirs ...string)
FindErrorLogs is a utility function, we will NOT do error handling, as this is supposed to be called during error handling itself we don't want to make it even more complex
func GetChainIDs ¶
func GetCurrentSupply ¶
func GetFirstEndpoint ¶
func GetFirstEndpoint(clusterInfo *rpcpb.ClusterInfo, chain string) string
GetFirstEndpoint get a human readable endpoint for the given chain
func GetLocallyDeployedSubnets ¶
Returns an error if the server cannot be contacted. You may want to ignore this error.
func GetLocallyDeployedSubnetsFromFile ¶
func GetLocallyDeployedSubnetsFromFile(app *application.Avalanche) ([]string, error)
func GetPublicSubnetValidators ¶
func GetPublicSubnetValidators(subnetID ids.ID, network models.Network) ([]platformvm.ClientPermissionlessValidator, error)
func GetSubnetAirdropKeyInfo ¶
func GetSubnetValidators ¶
func GetSubnetValidators(subnetID ids.ID) ([]platformvm.ClientPermissionlessValidator, error)
func HasEndpoints ¶
func HasEndpoints(clusterInfo *rpcpb.ClusterInfo) bool
HasEndpoints returns true if cluster info contains custom blockchains
func IsSubnetValidator ¶
func IssuePFromXImportTx ¶
func IssuePFromXImportTx( wallet primary.Wallet, usingLedger bool, hasOnlyOneKey bool, owner *secp256k1fx.OutputOwners, ) (ids.ID, error)
func IssueTransformSubnetTx ¶
func IssueXToPExportTx ¶
func SetDefaultSnapshot ¶
func SetDefaultSnapshot(snapshotsDir string, resetCurrentSnapshot bool, avagoVersion string, isSingleNode bool) (bool, error)
Initialize default snapshot with bootstrap snapshot archive If force flag is set to true, overwrite the default snapshot if it exists
func WaitForHealthy ¶
WaitForHealthy polls continuously until the network is ready to be used
func WriteExtraLocalNetworkData ¶
func WriteExtraLocalNetworkData(app *application.Avalanche, cchainTeleporterMessengerAddress string, cchainTeleporterRegistryAddress string) error
Types ¶
type DeployInfo ¶
type ExtraLocalNetworkData ¶
type ExtraLocalNetworkData struct { CChainTeleporterMessengerAddress string CChainTeleporterRegistryAddress string }
func GetExtraLocalNetworkData ¶
func GetExtraLocalNetworkData(app *application.Avalanche) (*ExtraLocalNetworkData, error)
type LocalDeployer ¶
type LocalDeployer struct {
// contains filtered or unexported fields
}
func NewLocalDeployer ¶
func NewLocalDeployer( app *application.Avalanche, avagoVersion string, avagoBinaryPath string, vmBin string, ) *LocalDeployer
uses either avagoVersion or avagoBinaryPath
func (*LocalDeployer) BackendStartedHere ¶
func (d *LocalDeployer) BackendStartedHere() bool
BackendStartedHere returns true if the backend was started by this run, or false if it found it there already
func (*LocalDeployer) DeployToLocalNetwork ¶
func (d *LocalDeployer) DeployToLocalNetwork(chain string, chainGenesis []byte, genesisPath string, subnetIDStr string) (*DeployInfo, error)
DeployToLocalNetwork does the heavy lifting: * it checks the gRPC is running, if not, it starts it * kicks off the actual deployment
func (*LocalDeployer) SetupLocalEnv ¶
func (d *LocalDeployer) SetupLocalEnv() (bool, string, error)
SetupLocalEnv also does some heavy lifting: * sets up default snapshot if not installed * checks if avalanchego is installed in the local binary path * if not, it downloads it and installs it (os - and archive dependent) * returns the location of the avalanchego path
func (*LocalDeployer) StartServer ¶
func (d *LocalDeployer) StartServer() error
type PublicDeployer ¶
type PublicDeployer struct { LocalDeployer // contains filtered or unexported fields }
func NewPublicDeployer ¶
func NewPublicDeployer(app *application.Avalanche, kc *keychain.Keychain, network models.Network) *PublicDeployer
func (*PublicDeployer) AddPermissionlessDelegator ¶
func (*PublicDeployer) AddPermissionlessValidator ¶
func (*PublicDeployer) AddValidator ¶
func (d *PublicDeployer) AddValidator( justIssueTx bool, controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, transferSubnetOwnershipTxID ids.ID, nodeID ids.NodeID, weight uint64, startTime time.Time, duration time.Duration, ) (bool, *txs.Tx, []string, error)
adds a subnet validator to the given [subnetID]
- creates an add subnet validator tx
- sets the change output owner to be a wallet address (if not, it may go to any other subnet auth address)
- signs the tx with the wallet as the owner of fee outputs and a possible subnet auth key
- if partially signed, returns the tx so that it can later on be signed by the rest of the subnet auth keys
- if fully signed, issues it
func (*PublicDeployer) CreateAssetTx ¶
func (*PublicDeployer) DeployBlockchain ¶
func (d *PublicDeployer) DeployBlockchain( controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, transferSubnetOwnershipTxID ids.ID, chain string, genesis []byte, ) (bool, ids.ID, *txs.Tx, []string, error)
creates a blockchain for the given [subnetID]
- creates a create blockchain tx
- sets the change output owner to be a wallet address (if not, it may go to any other subnet auth address)
- signs the tx with the wallet as the owner of fee outputs and a possible subnet auth key
- if partially signed, returns the tx so that it can later on be signed by the rest of the subnet auth keys
- if fully signed, issues it
func (*PublicDeployer) DeploySubnet ¶
- creates a subnet for [chain] using the given [controlKeys] and [threshold] as subnet authentication parameters
func (*PublicDeployer) ExportToPChainTx ¶
func (d *PublicDeployer) ExportToPChainTx( subnetAssetID ids.ID, owner *secp256k1fx.OutputOwners, assetAmount uint64, ) (ids.ID, error)
func (*PublicDeployer) ImportFromXChain ¶
func (d *PublicDeployer) ImportFromXChain( owner *secp256k1fx.OutputOwners, ) (ids.ID, error)
func (*PublicDeployer) RemoveValidator ¶
func (d *PublicDeployer) RemoveValidator( controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, transferSubnetOwnershipTxID ids.ID, nodeID ids.NodeID, ) (bool, *txs.Tx, []string, error)
removes a subnet validator from the given subnet - verifies that the wallet is one of the subnet auth keys (so as to sign the AddSubnetValidator tx) - if operation is multisig (len(subnetAuthKeysStrs) > 1):
- creates a remove subnet validator tx
- sets the change output owner to be a wallet address (if not, it may go to any other subnet auth address)
- signs the tx with the wallet as the owner of fee outputs and a possible subnet auth key
- if partially signed, returns the tx so that it can later on be signed by the rest of the subnet auth keys
- if fully signed, issues it
func (*PublicDeployer) TransferSubnetOwnership ¶
func (d *PublicDeployer) TransferSubnetOwnership( controlKeys []string, subnetAuthKeysStrs []string, subnetID ids.ID, transferSubnetOwnershipTxID ids.ID, newControlKeys []string, newThreshold uint32, ) (bool, *txs.Tx, []string, error)
change subnet owner for [subnetID]
- creates a transfer subnet ownership tx
- sets the change output owner to be a wallet address (if not, it may go to any other subnet auth address)
- signs the tx with the wallet as the owner of fee outputs and a possible subnet auth key
- if partially signed, returns the tx so that it can later on be signed by the rest of the subnet auth keys
- if fully signed, issues it
func (*PublicDeployer) TransformSubnetTx ¶
type Publisher ¶
type Publisher interface { Publish(r *git.Repository, subnetName, vmName string, subnetYAML []byte, vmYAML []byte) error GetRepo() (*git.Repository, error) }