subnet

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: BSD-3-Clause Imports: 42 Imported by: 2

Documentation

Overview

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.

Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

View Source
const (
	WriteReadReadPerms = 0o644
)

Variables

View Source
var ErrNoSubnetAuthKeysInWallet = errors.New("wallet does not contain subnet auth keys")

Functions

func GetEndpoints added in v0.1.4

func GetEndpoints(clusterInfo *rpcpb.ClusterInfo) []string

GetEndpoints get a human readable list of endpoints from clusterinfo

func GetOwners added in v1.0.0

func GetOwners(network models.Network, subnetID ids.ID) ([]string, uint32, error)

func SetDefaultSnapshot added in v0.1.4

func SetDefaultSnapshot(snapshotsDir string, force bool) error

Initialize default snapshot with bootstrap snapshot archive If force flag is set to true, overwrite the default snapshot if it exists

Types

type LocalDeployer added in v0.2.2

type LocalDeployer struct {
	// contains filtered or unexported fields
}

func NewLocalDeployer added in v0.1.3

func NewLocalDeployer(app *application.Avalanche, avagoVersion string, vmBin string) *LocalDeployer

func (*LocalDeployer) BackendStartedHere added in v0.2.2

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 added in v0.2.2

func (d *LocalDeployer) DeployToLocalNetwork(chain string, chainGenesis []byte, genesisPath string) (ids.ID, ids.ID, 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 added in v0.2.2

func (d *LocalDeployer) SetupLocalEnv() (string, 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 and plugin

func (*LocalDeployer) StartServer added in v0.2.2

func (d *LocalDeployer) StartServer() error

func (*LocalDeployer) WaitForHealthy added in v0.2.2

func (d *LocalDeployer) WaitForHealthy(
	ctx context.Context,
	cli client.Client,
	healthCheckInterval time.Duration,
) (*rpcpb.ClusterInfo, error)

WaitForHealthy polls continuously until the network is ready to be used

type PublicDeployer added in v0.2.0

type PublicDeployer struct {
	LocalDeployer
	// contains filtered or unexported fields
}

func NewPublicDeployer added in v0.2.0

func NewPublicDeployer(app *application.Avalanche, usingLedger bool, kc keychain.Keychain, network models.Network) *PublicDeployer

func (*PublicDeployer) AddValidator added in v0.2.0

func (d *PublicDeployer) AddValidator(
	subnetAuthKeysStrs []string,
	subnet ids.ID,
	nodeID ids.NodeID,
	weight uint64,
	startTime time.Time,
	duration time.Duration,
) (bool, *txs.Tx, error)

adds a subnet validator to 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 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 one of the subnet auth keys
  • returns the tx so that it can be later on be signed by the rest of the subnet auth keys

- if operation is not multisig (len(subnetAuthKeysStrs) == 1):

  • creates and issues an add validator tx, signing the tx with the wallet as the owner of fee outputs and the only one subnet auth key

func (*PublicDeployer) Commit added in v1.0.0

func (d *PublicDeployer) Commit(
	tx *txs.Tx,
) (ids.ID, error)

func (*PublicDeployer) Deploy added in v0.2.0

func (d *PublicDeployer) Deploy(
	controlKeys []string,
	subnetAuthKeysStrs []string,
	threshold uint32,
	chain string,
	genesis []byte,
) (bool, ids.ID, ids.ID, *txs.Tx, error)

deploys the given [chain] - verifies that the wallet is one of the subnet auth keys (so as to sign the CreateBlockchain tx) - creates a subnet using the given [controlKeys] and [threshold] as subnet authentication parameters - if operation is multisig (len(subnetAuthKeysStrs) > 1):

  • creates a 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 one of the subnet auth keys
  • returns the tx so that it can be later on be signed by the rest of the subnet auth keys

- if operation is not multisig (len(subnetAuthKeysStrs) == 1):

  • creates and issues a blockchain tx, signing the tx with the wallet as the owner of fee outputs and the only one subnet auth key
  • returns the blockchain tx id

func (*PublicDeployer) Sign added in v1.0.0

func (d *PublicDeployer) Sign(
	tx *txs.Tx,
	subnetAuthKeysStrs []string,
	subnet ids.ID,
) error

type Publisher added in v0.2.3

type Publisher interface {
	Publish(r *git.Repository, subnetName, vmName string, subnetYAML []byte, vmYAML []byte) error
	GetRepo() (*git.Repository, error)
}

func NewPublisher added in v0.2.3

func NewPublisher(repoDir, repoURL, alias string) Publisher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL