utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: GPL-3.0, LGPL-3.0 Imports: 30 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Timeout to boot the AvalancheGo node
	BootAvalancheNodeTimeout = 5 * time.Minute

	// Timeout for the health API to check the AvalancheGo is ready
	HealthCheckTimeout = 5 * time.Second

	DefaultLocalNodeURI = "http://127.0.0.1:9650"
)

Variables

View Source
var DefaultChainConfig = tmpnet.FlagsMap{
	"log-level":         "debug",
	"warp-api-enabled":  true,
	"local-txs-enabled": true,
}

Functions

func CreateNewSubnet

func CreateNewSubnet(ctx context.Context, genesisFilePath string) string

CreateNewSubnet creates a new subnet and Subnet-EVM blockchain with the given genesis file. returns the ID of the new created blockchain.

func GetDefaultChainURI added in v0.5.2

func GetDefaultChainURI(blockchainID string) string

GetDefaultChainURI returns the default chain URI for a given blockchainID

func GetFilesAndAliases added in v0.5.3

func GetFilesAndAliases(dir string) (map[string]string, error)

GetFilesAndAliases returns a map of aliases to file paths in given [dir].

func IssueTxsToActivateProposerVMFork added in v0.5.4

func IssueTxsToActivateProposerVMFork(
	ctx context.Context, chainID *big.Int, fundedKey *ecdsa.PrivateKey,
	client ethclient.Client,
) error

IssueTxsToActivateProposerVMFork issues transactions at the current timestamp, which should be after the ProposerVM activation time (aka ApricotPhase4). This should generate a PostForkBlock because its parent block (genesis) has a timestamp (0) that is greater than or equal to the fork activation time of 0. Therefore, subsequent blocks should be built with BuildBlockWithContext.

func NewTmpnetNetwork added in v0.6.2

func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap, subnets ...*tmpnet.Subnet) *tmpnet.Network

func NewTmpnetNodes added in v0.6.2

func NewTmpnetNodes(count int) []*tmpnet.Node

func NewTmpnetSubnet added in v0.6.2

func NewTmpnetSubnet(name string, genesisPath string, chainConfig tmpnet.FlagsMap, nodes ...*tmpnet.Node) *tmpnet.Subnet

Create the configuration that will enable creation and access to a subnet created on a temporary network.

func RegisterNodeRun added in v0.5.2

func RegisterNodeRun()

RegisterNodeRun registers a before suite that starts an AvalancheGo process to use for the e2e tests and an after suite that stops the AvalancheGo process

func RegisterPingTest added in v0.5.2

func RegisterPingTest()

func RunCommand

func RunCommand(bin string, args ...string) (*cmd.Cmd, error)

RunCommand starts the command [bin] with the given [args] and returns the command to the caller TODO cmd package mentions we can do this more efficiently with cmd.NewCmdOptions rather than looping and calling Status().

func RunHardhatTests

func RunHardhatTests(ctx context.Context, blockchainID string, execPath string, testPath string)

RunHardhatTests runs the hardhat tests in the given [testPath] on the blockchain with [blockchainID] [execPath] is the path where the test command is executed

func RunHardhatTestsCustomURI added in v0.5.7

func RunHardhatTestsCustomURI(ctx context.Context, chainURI string, execPath string, testPath string)

Types

type SubnetSuite added in v0.5.3

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

func CreateSubnetsSuite added in v0.5.3

func CreateSubnetsSuite(genesisFiles map[string]string) *SubnetSuite

CreateSubnetsSuite creates subnets for given [genesisFiles], and registers a before suite that starts an AvalancheGo process to use for the e2e tests. genesisFiles is a map of test aliases to genesis file paths.

func (*SubnetSuite) GetBlockchainID added in v0.5.3

func (s *SubnetSuite) GetBlockchainID(alias string) string

func (*SubnetSuite) SetBlockchainIDs added in v0.5.3

func (s *SubnetSuite) SetBlockchainIDs(blockchainIDs map[string]string)

Jump to

Keyboard shortcuts

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