app

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 74 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppAddressTCP  = "tcp://127.0.0.1:30000"
	AppAddressUNIX = "unix:///var/run/app.sock"

	PrivvalKeyFile   = "config/priv_validator_key.json"
	PrivvalStateFile = "data/priv_validator_state.json"
)
View Source
const (
	EnvInfraType       = "INFRASTRUCTURE_TYPE"
	EnvInfraFile       = "INFRASTRUCTURE_FILE"
	EnvE2EManifest     = "E2E_MANIFEST"
	EnvE2ENode         = "E2E_NODE"
	EnvE2ERPCEndpoints = "E2E_RPC_ENDPOINTS"
	EnvE2EDeployInfo   = "E2E_DEPLOY_INFO"
)

Variables

This section is empty.

Functions

func CleanInfra

func CleanInfra(ctx context.Context, def Definition) error

CleanInfra stops and removes the infra containers.

func CleanupDir

func CleanupDir(ctx context.Context, dir string) error

CleanupDir cleans up a testnet directory.

func Create3Deploy

func Create3Deploy(ctx context.Context, def Definition, cfg Create3DeployConfig) error

Create3Deploy deploys the Omni Create3 contracts.

func Deploy

func Deploy(ctx context.Context, def Definition, cfg DeployConfig) (*pingpong.XDapp, error)

Deploy a new e2e network. It also starts all services in order to deploy private portals. It also returns an optional deployed ping pong contract is enabled.

func DeployAVSAndCreate3 added in v0.1.3

func DeployAVSAndCreate3(ctx context.Context, def Definition) error

DeployAVSAndCreate3 deploys a create3 contract and the Omni AVS contract.

func E2ETest

func E2ETest(ctx context.Context, def Definition, cfg E2ETestConfig) error

E2ETest runs a full e2e test.

func FundEOAAccounts added in v0.1.4

func FundEOAAccounts(ctx context.Context, def Definition) error

FundEOAAccounts funds the EOAs that need funding to their target balance.

func FundValidatorsForTesting

func FundValidatorsForTesting(ctx context.Context, def Definition) error

FundValidatorsForTesting funds validators in ephemeral networks: devnet and staging. This is required by load generation for periodic validator self-delegation.

func LoadManifest

func LoadManifest(path string) (types.Manifest, error)

LoadManifest loads a manifest from disk.

func LogMetrics

func LogMetrics(ctx context.Context, def Definition) error

func MakeConfig

func MakeConfig(node *e2e.Node, nodeDir string) (*config.Config, error)

MakeConfig generates a CometBFT config for a node.

func MonitorCProvider

func MonitorCProvider(ctx context.Context, node *e2e.Node, network netconf.Network) error

func MonitorCursors

func MonitorCursors(ctx context.Context, portals map[uint64]netman.Portal, network netconf.Network) error

func NoNodesTestnet

func NoNodesTestnet(manifest types.Manifest, infd types.InfrastructureData, cfg DefinitionConfig) (types.Testnet, error)

func SendXMsgs

func SendXMsgs(ctx context.Context, netman netman.Manager, backends ethbackend.Backends, count int) error

SendXMsgs sends <count> xmsgs from every chain to every other chain, then waits for them to be mined.

func Setup

func Setup(ctx context.Context, def Definition, depCfg DeployConfig) error

Setup sets up the testnet configuration.

func SetupOnlyMonitor

func SetupOnlyMonitor(ctx context.Context, def Definition) error

func StartInitial

func StartInitial(ctx context.Context, testnet *e2e.Testnet, p infra.Provider) error

StartInitial starts the initial nodes (start_at==0).

func StartMonitoringReceipts

func StartMonitoringReceipts(ctx context.Context, def Definition) func() error

StartMonitoringReceipts starts goroutines that streams all xblock receipts ensuring all are successful. It returns a stopfunc that returns an error if any failed receipt was detected before the stopfunc was called.

func StartRemaining

func StartRemaining(ctx context.Context, testnet *e2e.Testnet, p infra.Provider) error

StartRemaining starts the remaining nodes (start_at>0).

func StartSendingXMsgs

func StartSendingXMsgs(ctx context.Context, netman netman.Manager, backends ethbackend.Backends, batches ...int) <-chan error

func StartValidatorUpdates

func StartValidatorUpdates(ctx context.Context, def Definition) func() error

func Test

func Test(ctx context.Context, def Definition, verbose bool) error

Test runs test cases under tests/.

func TestnetFromManifest

func TestnetFromManifest(ctx context.Context, manifest types.Manifest, infd types.InfrastructureData, cfg DefinitionConfig) (types.Testnet, error)

func Upgrade

func Upgrade(ctx context.Context, def Definition, cfg DeployConfig, upgradeCfg types.UpgradeConfig) error

Upgrade generates all local artifacts, but only copies the docker-compose file to the VMs. It them calls docker-compose up.

func Wait

func Wait(ctx context.Context, testnet *e2e.Testnet, blocks int64) error

Wait waits for a number of blocks to be produced, and for all nodes to catch up with it.

func WaitAllSubmissions

func WaitAllSubmissions(ctx context.Context, portals map[uint64]netman.Portal, minimum uint64) error

func WaitUntil

func WaitUntil(ctx context.Context, testnet *e2e.Testnet, height int64) error

WaitUntil waits until a given height has been reached.

Types

type Create3DeployConfig

type Create3DeployConfig struct {
	ChainID uint64 // chain id of the chain to deploy to
}

func (Create3DeployConfig) Validate

func (cfg Create3DeployConfig) Validate() error

Validate validates the Create3DeployConfig.

type Definition

type Definition struct {
	Manifest types.Manifest
	Testnet  types.Testnet // Note that testnet is the cometBFT term.
	Infra    types.InfraProvider
	Cfg      DefinitionConfig // Original config used to construct the Definition.
	// contains filtered or unexported fields
}

Definition defines a e2e network. All (sub)commands of the e2e cli requires a definition operate. Armed with a definition, a e2e network can be deployed, started, tested, stopped, etc.

func MakeDefinition

func MakeDefinition(ctx context.Context, cfg DefinitionConfig, commandName string) (Definition, error)

func (Definition) Backends

func (d Definition) Backends() ethbackend.Backends

Backends returns the backends.

func (Definition) DeployInfos

func (d Definition) DeployInfos() types.DeployInfos

DeployInfos returns the deploy information of the OmniPortal and OmniAVS contracts.

func (Definition) InitLazyNetwork

func (d Definition) InitLazyNetwork() error

InitLazyNetwork initializes the lazy network, which is the backends and netman.

func (Definition) Netman

func (d Definition) Netman() netman.Manager

Netman returns the netman.

type DefinitionConfig

type DefinitionConfig struct {
	AgentSecrets agent.Secrets

	ManifestFile  string
	InfraProvider string

	// Secrets (not required for devnet)
	DeployKeyFile string
	FireAPIKey    string
	FireKeyPath   string
	RPCOverrides  map[string]string // map[chainName]rpcURL1,rpcURL2,...

	InfraDataFile string // Not required for docker provider
	OmniImgTag    string // OmniImgTag is the docker image tag used for halo and relayer.

	ExplorerDBConn string // ExplorerDBConn is the connection string for the explorer database.
	GraphQLURL     string // GraphQLURL is the host for the GraphQL server.

	TracingEndpoint string
	TracingHeaders  string
}

DefinitionConfig is the configuration required to create a full Definition.

func DefaultDefinitionConfig

func DefaultDefinitionConfig(ctx context.Context) DefinitionConfig

DefaultDefinitionConfig returns a default configuration for a Definition.

type DeployConfig

type DeployConfig struct {
	PingPongN uint64 // Number of hops per ping pong.
	PingPongP uint64 // Number of parallel ping pongs to start per edge.
	// contains filtered or unexported fields
}

func DefaultDeployConfig

func DefaultDeployConfig() DeployConfig

type E2ETestConfig

type E2ETestConfig struct {
	Preserve bool
}

E2ETestConfig is the configuration required to run a full e2e test.

func DefaultE2ETestConfig

func DefaultE2ETestConfig() E2ETestConfig

DefaultE2ETestConfig returns a default configuration for a e2e test.

Directories

Path Synopsis
Package eoa defines well-known (non-fireblocks) eoa private keys used in an omni network.
Package eoa defines well-known (non-fireblocks) eoa private keys used in an omni network.

Jump to

Keyboard shortcuts

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