deployer

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVarPrefix             = "DEPLOYER"
	L1RPCURLFlagName         = "l1-rpc-url"
	CacheDirFlagName         = "cache-dir"
	L1ChainIDFlagName        = "l1-chain-id"
	ArtifactsLocatorFlagName = "artifacts-locator"
	L2ChainIDsFlagName       = "l2-chain-ids"
	WorkdirFlagName          = "workdir"
	OutdirFlagName           = "outdir"
	PrivateKeyFlagName       = "private-key"
	IntentTypeFlagName       = "intent-type"
	EtherscanAPIKeyFlagName  = "etherscan-api-key"
	InputFileFlagName        = "input-file"
	ContractNameFlagName     = "contract-name"
)

Variables

View Source
var (
	L1RPCURLFlag = &cli.StringFlag{
		Name: L1RPCURLFlagName,
		Usage: "RPC URL for the L1 chain. Must be set for live chains. " +
			"Must be blank for chains deploying to local allocs files.",
		EnvVars: []string{
			"L1_RPC_URL",
		},
	}
	ArtifactsLocatorFlag = &cli.StringFlag{
		Name:    ArtifactsLocatorFlagName,
		Usage:   "Locator for artifacts.",
		EnvVars: PrefixEnvVar("ARTIFACTS_LOCATOR"),
		Value:   artifacts.EmbeddedLocatorString,
	}
	CacheDirFlag = &cli.StringFlag{
		Name: CacheDirFlagName,
		Usage: "Cache directory. " +
			"If set, the deployer will attempt to cache downloaded artifacts in the specified directory.",
		EnvVars: PrefixEnvVar("CACHE_DIR"),
		Value:   EnsureDefaultCacheDir(),
	}
	L1ChainIDFlag = &cli.Uint64Flag{
		Name:    L1ChainIDFlagName,
		Usage:   "Chain ID of the L1 chain.",
		EnvVars: PrefixEnvVar("L1_CHAIN_ID"),
		Value:   11155111,
	}
	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"),
	}
	DeploymentTargetFlag = &cli.StringFlag{
		Name:    "deployment-target",
		Usage:   fmt.Sprintf("Where to deploy L1 contracts. Options: %s, %s, %s, %s", DeploymentTargetLive, DeploymentTargetGenesis, DeploymentTargetCalldata, DeploymentTargetNoop),
		EnvVars: PrefixEnvVar("DEPLOYMENT_TARGET"),
		Value:   string(DeploymentTargetLive),
	}
	OpProgramSvcUrlFlag = &cli.StringFlag{
		Name:    "op-program-svc-url",
		Usage:   "URL of the OP Program SVC",
		EnvVars: PrefixEnvVar("OP_PROGRAM_SVC_URL"),
	}
	IntentTypeFlag = &cli.StringFlag{
		Name: IntentTypeFlagName,
		Usage: fmt.Sprintf("Intent config type to use. Options: %s (default), %s, %s",
			state.IntentTypeStandard,
			state.IntentTypeCustom,
			state.IntentTypeStandardOverrides),
		EnvVars: PrefixEnvVar("INTENT_TYPE"),
		Value:   string(state.IntentTypeStandard),
		Aliases: []string{
			"intent-config-type",
		},
	}
	EtherscanAPIKeyFlag = &cli.StringFlag{
		Name:     EtherscanAPIKeyFlagName,
		Usage:    "etherscan API key for contract verification.",
		EnvVars:  PrefixEnvVar("ETHERSCAN_API_KEY"),
		Required: true,
	}
	InputFileFlag = &cli.StringFlag{
		Name:    InputFileFlagName,
		Usage:   "filepath of input file for command",
		EnvVars: PrefixEnvVar("INPUT_FILE"),
	}
	ContractNameFlag = &cli.StringFlag{
		Name:    ContractNameFlagName,
		Usage:   "(optional) contract name matching a field within the input file",
		EnvVars: PrefixEnvVar("CONTRACT_NAME"),
	}
)
View Source
var GlobalFlags = append([]cli.Flag{CacheDirFlag}, oplog.CLIFlags(EnvVarPrefix)...)
View Source
var UpgradeFlags = []cli.Flag{
	L1RPCURLFlag,
	PrivateKeyFlag,
	DeploymentTargetFlag,
}

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 EnsureDefaultCacheDir added in v1.13.7

func EnsureDefaultCacheDir() string

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
	DeploymentTarget DeploymentTarget
	Logger           log.Logger
	CacheDir         string

	PreStateBuilder pipeline.PreStateBuilder
	// contains filtered or unexported fields
}

func (*ApplyConfig) Check

func (a *ApplyConfig) Check() error

type ApplyPipelineOpts added in v1.10.0

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

type DeploymentTarget added in v1.11.0

type DeploymentTarget string
const (
	DeploymentTargetLive     DeploymentTarget = "live"
	DeploymentTargetGenesis  DeploymentTarget = "genesis"
	DeploymentTargetCalldata DeploymentTarget = "calldata"
	DeploymentTargetNoop     DeploymentTarget = "noop"
)

func NewDeploymentTarget added in v1.11.0

func NewDeploymentTarget(s string) (DeploymentTarget, error)

type InitConfig

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

func (*InitConfig) Check

func (c *InitConfig) Check() error

Directories

Path Synopsis
v3_0_0
Package v3_0_0 implements the upgrade to v3.0.0 (U14).
Package v3_0_0 implements the upgrade to v3.0.0 (U14).
v4_0_0
Package v4_0_0 implements the upgrade to v4.0.0 (U16).
Package v4_0_0 implements the upgrade to v4.0.0 (U16).

Jump to

Keyboard shortcuts

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