{"modulePath":"github.com/ethereum-optimism/optimism","version":"v1.21.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stack\n\n## Functions\n\n```go\nfunc ChainIDFromContext(ctx context.Context) eth.ChainID\n```\nChainIDFromContext extracts the chain ID from the context.\n\n```go\nfunc ChainIDSelector(chainID eth.ChainID) logfilter.Selector\n```\nChainIDSelector creates a log-filter that applies the given inner log-filter only if it matches the given chainID. This can be composed with logfilter package utils like logfilter.MuteAll or logfilter.Level to adjust logging for a specific chain ID.\n\n```go\nfunc ContextWithChainID(ctx context.Context, chainID eth.ChainID) context.Context\n```\nContextWithChainID annotates the context with the given chainID of service\n\n## Types\n\n```go\ntype Common interface {\n\tT() devtest.T\n\tLogger() log.Logger\n\tName() string\n\n\t// Label retrieves a label by key.\n\t// If the label does not exist, it returns an empty string.\n\tLabel(key string) string\n\n\t// SetLabel sets a label by key.\n\t// Note that labels added by tests are not visible to other tests against the same backend.\n\tSetLabel(key, value string)\n}\n```\n\n```go\ntype Conductor interface {\n\tCommon\n\tChainID() eth.ChainID\n\n\tRpcAPI() conductorRpc.API\n\n\t// ProxyRPC exposes the conductor's RPC endpoint for raw calls. With RPC\n\t// proxying enabled, op-conductor forwards execution (eth_*), rollup\n\t// (optimism_*), and admin (admin_*) requests to its sequencer while it is\n\t// the leader, so batchers and proposers can follow the active sequencer.\n\tProxyRPC() client.RPC\n\n\t// ConsensusEndpoint is the Raft consensus address of this conductor, used\n\t// when (re-)adding it to a cluster.\n\tConsensusEndpoint() string\n}\n```\n\n```go\ntype ControlledLifecycle interface {\n\tStartControlled(ctx context.Context) error\n\tStopControlled(ctx context.Context) error\n\tRunning() bool\n}\n```\n\n```go\ntype ELNode interface {\n\tCommon\n\tChainID() eth.ChainID\n\tEthClient() apis.EthClient\n\tUserRPC() string\n\tTransactionTimeout() time.Duration\n}\n```\n\n```go\ntype Keys interface {\n\tSecret(key devkeys.Key) *ecdsa.PrivateKey\n\tAddress(key devkeys.Key) common.Address\n}\n```\n\n```go\ntype L1CLNode interface {\n\tCommon\n\tChainID() eth.ChainID\n\n\tBeaconHTTPAddr() string\n\tBeaconClient() apis.BeaconClient\n}\n```\nL1CLNode is a L1 ethereum consensus-layer node, aka Beacon node. This node may not be a full beacon node, and instead run a mock L1 consensus node.\n\n```go\ntype L1ELNode interface {\n\tELNode\n}\n```\nL1ELNode is a L1 ethereum execution-layer node\n\n```go\ntype L1Network interface {\n\tNetwork\n\n\tChainConfig() *params.ChainConfig\n\n\tL1ELNodes() []L1ELNode\n\tL1CLNodes() []L1CLNode\n}\n```\nL1Network represents a L1 chain, a collection of configuration and node resources.\n\n```go\ntype L2Batcher interface {\n\tCommon\n\tChainID() eth.ChainID\n\tActivityAPI() apis.BatcherActivity\n}\n```\nL2Batcher represents an L2 batch-submission service, posting L2 data of an L2 to L1.\n\n```go\ntype L2CLNode interface {\n\tCommon\n\tChainID() eth.ChainID\n\n\tClientRPC() client.RPC\n\tRollupAPI() apis.RollupClient\n\tP2PAPI() apis.P2PClient\n\tUserRPC() string\n\n\t// ELs returns the engine(s) that this L2CLNode is connected to.\n\t// This may be empty, if the L2CL is not connected to any.\n\tELs() []L2ELNode\n\n\tELClient() apis.EthClient\n}\n```\nL2CLNode is a L2 ethereum consensus-layer node\n\n```go\ntype L2Challenger interface {\n\tCommon\n\tChainID() eth.ChainID\n\tConfig() *config.Config\n}\n```\n\n```go\ntype L2Deployment interface {\n\tSystemConfigProxyAddr() common.Address\n\tDisputeGameFactoryProxyAddr() common.Address\n\tL1StandardBridgeProxyAddr() common.Address\n}\n```\n\n```go\ntype L2ELNode interface {\n\tL2EthClient() apis.L2EthClient\n\tL2EngineClient() apis.EngineClient\n\n\tELNode\n}\n```\nL2ELNode is a L2 ethereum execution-layer node\n\n```go\ntype L2Network interface {\n\tNetwork\n\t// ChainConfig returns the chain's OP Stack fork schedule and genesis configuration. Its\n\t// EIP-1559 parameters are the genesis values: from Holocene, the parameters in effect are\n\t// set by the SystemConfig and carried in each block's extraData.\n\tChainConfig() *opparams.ChainConfig\n\tRollupConfig() *rollup.Config\n\tDeployment() L2Deployment\n\tKeys() Keys\n\n\tL1() L1Network\n\n\tL2Batchers() []L2Batcher\n\tL2Proposers() []L2Proposer\n\tL2Challengers() []L2Challenger\n\tL2CLNodes() []L2CLNode\n\tL2ELNodes() []L2ELNode\n\tConductors() []Conductor\n}\n```\nL2Network represents a L2 chain, a collection of configuration and node resources.\n\n```go\ntype L2Proposer interface {\n\tCommon\n\tChainID() eth.ChainID\n}\n```\nL2Proposer is a L2 output proposer, posting claims of L2 state to L1.\n\n```go\ntype Lifecycle interface {\n\tStart()\n\tStop()\n}\n```\n\n```go\ntype Network interface {\n\tCommon\n\n\tChainID() eth.ChainID\n\n\tSyncTesters() []SyncTester\n}\n```\nNetwork is an interface to an ethereum chain and its resources, with common properties between L1 and L2. For L1 or L2 specifics, see L1Network and L2Network extensions. A network hosts configuration resources and tracks participating nodes.\n\n```go\ntype SuperchainDeployment interface {\n\tSuperchainConfigAddr() common.Address\n}\n```\n\n```go\ntype Supernode interface {\n\tCommon\n\tClientRPC() client.RPC\n\tQueryAPI() apis.SupernodeQueryAPI\n\tUserRPC() string\n}\n```\n\n```go\ntype SupernodeTestControl interface {\n\t// InteropActivity returns the current interop activity, or nil if the\n\t// supernode is stopped or interop is not configured. Do not cache the\n\t// pointer across RestartWithFreshDataDir.\n\tInteropActivity() *interop.Interop\n\n\t// RestartWithFreshDataDir stops the supernode, deletes its on-disk\n\t// data directory, and starts a fresh supernode against the same chain\n\t// containers, virtual nodes, and externally-visible RPC address.\n\tRestartWithFreshDataDir() error\n\n\t// Stop halts the supernode while preserving its data directory and RPC\n\t// address; Start brings it back up. Used by sync tests that need to halt\n\t// the verifier, mutate external state, and resume.\n\tStop()\n\tStart()\n}\n```\nSupernodeTestControl is the integration-test surface on a running supernode. See op-supernode/supernode/activity/interop for the methods available on the InteropActivity pointer.\n\n```go\ntype SyncTester interface {\n\tCommon\n\tChainID() eth.ChainID\n\tAPI() apis.SyncTester\n\n\tAPIWithSession(sessionID string) apis.SyncTester\n}\n```\n\n```go\ntype TestSequencer interface {\n\tCommon\n\n\tAdminAPI() apis.TestSequencerAdminAPI\n\tBuildAPI() apis.TestSequencerBuildAPI\n\tControlAPI(chainID eth.ChainID) apis.TestSequencerControlAPI\n}\n```\nTestSequencer\n\n```go\ntype Wipeable interface {\n\t// Wipe discards the node's chain data. The node must be stopped.\n\tWipe()\n}\n```\nWipeable is implemented by nodes whose chain data can be discarded, so that the next Start begins from genesis. Stop alone does not guarantee this: whether a node keeps its data across a restart depends on the implementation.\n\n","path":"github.com/ethereum-optimism/optimism/op-devstack/stack","name":"stack","synopsis":"","isRedistributable":true}
