config

package
v0.0.0-...-b27245e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForkCommandName = "fork"
	DocsCommandName = "docs"

	AdminPortFlagName = "admin.port"

	L1ForkHeightFlagName = "l1.fork.height"
	L1PortFlagName       = "l1.port"
	L1HostFlagName       = "l1.host"

	ChainsFlagName         = "chains"
	NetworkFlagName        = "network"
	L2StartingPortFlagName = "l2.starting.port"
	L2HostFlagName         = "l2.host"

	LogsDirectoryFlagName = "logs.directory"

	InteropEnabledFlagName   = "interop.enabled"
	InteropAutoRelayFlagName = "interop.autorelay"
	InteropDelayFlagName     = "interop.delay"

	OdysseyEnabledFlagName = "odyssey.enabled"
)

Variables

View Source
var (
	DefaultSecretsConfig = SecretsConfig{
		Accounts:       10,
		Mnemonic:       "test test test test test test test test test test test junk",
		DerivationPath: accounts.DefaultRootDerivationPath,
	}
)

Functions

func BaseCLIFlags

func BaseCLIFlags(envPrefix string) []cli.Flag

func DefaultSecretsConfigAsString

func DefaultSecretsConfigAsString() string

Note: The default secrets config is used everywhere

func ForkCLIFlags

func ForkCLIFlags(envPrefix string) []cli.Flag

func OPChainByName

func OPChainByName(superchain *registry.Superchain, name string) *registry.ChainConfig
func PrintDocLinks()

Types

type CLIConfig

type CLIConfig struct {
	AdminPort uint64

	L1Port         uint64
	L2StartingPort uint64

	InteropAutoRelay bool
	InteropDelay     uint64

	OdysseyEnabled bool

	LogsDirectory string

	ForkConfig *ForkCLIConfig

	L1Host string
	L2Host string
}

func ReadCLIConfig

func ReadCLIConfig(ctx *cli.Context) (*CLIConfig, error)

func (*CLIConfig) Check

func (c *CLIConfig) Check() error

Check runs validatation on the cli configuration

type Chain

type Chain interface {
	// Properties
	Endpoint() string
	LogPath() string
	Config() *ChainConfig
	EthClient() *ethclient.Client

	// Additional methods
	SimulatedLogs(ctx context.Context, tx *types.Transaction) ([]types.Log, error)
	SetCode(ctx context.Context, result interface{}, address common.Address, code string) error
	SetStorageAt(ctx context.Context, result interface{}, address common.Address, storageSlot string, storageValue string) error
	SetBalance(ctx context.Context, result interface{}, address common.Address, value *big.Int) error
	SetIntervalMining(ctx context.Context, result interface{}, interval int64) error

	// Lifecycle
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

type ChainConfig

type ChainConfig struct {
	Name    string
	Host    string
	Port    uint64
	ChainID uint64

	GenesisJSON   []byte
	SecretsConfig SecretsConfig

	// Optional Config
	ForkConfig *ForkConfig

	// Optional Config (L1 chain if nil)
	L2Config *L2Config

	// Optional
	StartingTimestamp uint64

	// Optional
	LogsDirectory string

	// Optional
	OdysseyEnabled bool
}

type ForkCLIConfig

type ForkCLIConfig struct {
	L1ForkHeight uint64
	Network      string
	Chains       []string

	InteropEnabled bool
	OdysseyEnabled bool
}

type ForkConfig

type ForkConfig struct {
	RPCUrl      string
	BlockNumber uint64
}

type L2Config

type L2Config struct {
	L1ChainID     uint64
	L1Addresses   *registry.AddressList
	DependencySet []uint64
}

type NetworkConfig

type NetworkConfig struct {
	L1Config ChainConfig

	L2StartingPort uint64
	L2Configs      []ChainConfig

	// Signaled higher up as a way to generally
	// check if Interop is enabled
	InteropEnabled   bool
	InteropAutoRelay bool
	InteropDelay     uint64
}

func GetDefaultNetworkConfig

func GetDefaultNetworkConfig(startingTimestamp uint64, logsDirectory string) NetworkConfig

type SecretsConfig

type SecretsConfig struct {
	Accounts       uint64
	Mnemonic       string
	DerivationPath accounts.DerivationPath
}

Jump to

Keyboard shortcuts

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