deployer

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVarPrefix               = "DEPLOYER"
	L1RPCURLFlagName           = "l1-rpc-url"
	L1ChainIDFlagName          = "l1-chain-id"
	L2ChainIDsFlagName         = "l2-chain-ids"
	WorkdirFlagName            = "workdir"
	OutdirFlagName             = "outdir"
	PrivateKeyFlagName         = "private-key"
	DeploymentStrategyFlagName = "deployment-strategy"
)

Variables

View Source
var (
	L1RPCURLFlag = &cli.StringFlag{
		Name: L1RPCURLFlagName,
		Usage: "RPC URL for the L1 chain. Must be set for live chains. " +
			"Can be blank for chains deploying to local allocs files.",
		EnvVars: []string{
			"L1_RPC_URL",
		},
	}
	L1ChainIDFlag = &cli.Uint64Flag{
		Name:    L1ChainIDFlagName,
		Usage:   "Chain ID of the L1 chain.",
		EnvVars: PrefixEnvVar("L1_CHAIN_ID"),
		Value:   900,
	}
	L2ChainIDsFlag = &cli.StringFlag{
		Name:    L2ChainIDsFlagName,
		Usage:   "Comma-separated list of L2 chain IDs to deploy.",
		EnvVars: PrefixEnvVar("L2_CHAIN_IDS"),
	}
	WorkdirFlag = &cli.StringFlag{
		Name:    WorkdirFlagName,
		Usage:   "Directory storing intent and stage. Defaults to the current directory.",
		EnvVars: PrefixEnvVar("WORKDIR"),
		Value:   cwd(),
		Aliases: []string{
			OutdirFlagName,
		},
	}
	PrivateKeyFlag = &cli.StringFlag{
		Name:    PrivateKeyFlagName,
		Usage:   "Private key of the deployer account.",
		EnvVars: PrefixEnvVar("PRIVATE_KEY"),
	}
	DeploymentStrategyFlag = &cli.StringFlag{
		Name:    DeploymentStrategyFlagName,
		Usage:   fmt.Sprintf("Deployment strategy to use. Options: %s, %s", state.DeploymentStrategyLive, state.DeploymentStrategyGenesis),
		EnvVars: PrefixEnvVar("DEPLOYMENT_STRATEGY"),
		Value:   string(state.DeploymentStrategyLive),
	}
)
View Source
var ApplyFlags = []cli.Flag{
	L1RPCURLFlag,
	WorkdirFlag,
	PrivateKeyFlag,
}
View Source
var GlobalFlags = append([]cli.Flag{}, oplog.CLIFlags(EnvVarPrefix)...)

Functions

func Apply

func Apply(ctx context.Context, cfg ApplyConfig) error

func ApplyCLI

func ApplyCLI() func(cliCtx *cli.Context) error

func ApplyPipeline

func ApplyPipeline(
	ctx context.Context,
	opts ApplyPipelineOpts,
) error

func Init

func Init(cfg InitConfig) error

func InitCLI

func InitCLI() func(ctx *cli.Context) error

func PrefixEnvVar

func PrefixEnvVar(name string) []string

Types

type ApplyConfig

type ApplyConfig struct {
	L1RPCUrl   string
	Workdir    string
	PrivateKey string
	Logger     log.Logger
	// contains filtered or unexported fields
}

func (*ApplyConfig) Check

func (a *ApplyConfig) Check() error

func (*ApplyConfig) CheckLive

func (a *ApplyConfig) CheckLive() error

type ApplyPipelineOpts added in v1.10.0

type ApplyPipelineOpts struct {
	L1RPCUrl           string
	DeployerPrivateKey *ecdsa.PrivateKey
	Intent             *state.Intent
	State              *state.State
	Logger             log.Logger
	StateWriter        pipeline.StateWriter
}

type InitConfig

type InitConfig struct {
	DeploymentStrategy state.DeploymentStrategy
	L1ChainID          uint64
	Outdir             string
	L2ChainIDs         []common.Hash
}

func (*InitConfig) Check

func (c *InitConfig) Check() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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