Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
539a16e3
Commit
539a16e3
authored
Mar 27, 2023
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backwards compatibility with flags
parent
9055d49a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
flags.go
op-batcher/flags/flags.go
+4
-4
flags.go
op-proposer/flags/flags.go
+4
-2
cli.go
op-service/txmgr/cli.go
+29
-2
No files found.
op-batcher/flags/flags.go
View file @
539a16e3
...
...
@@ -15,8 +15,7 @@ import (
const
envVarPrefix
=
"OP_BATCHER"
var
(
/* Required flags */
// Required flags
L1EthRpcFlag
=
cli
.
StringFlag
{
Name
:
"l1-eth-rpc"
,
Usage
:
"HTTP provider URL for L1"
,
...
...
@@ -51,8 +50,7 @@ var (
EnvVar
:
opservice
.
PrefixEnvVar
(
envVarPrefix
,
"POLL_INTERVAL"
),
}
/* Optional flags */
// Optional flags
MaxChannelDurationFlag
=
cli
.
Uint64Flag
{
Name
:
"max-channel-duration"
,
Usage
:
"The maximum duration of L1-blocks to keep a channel open. 0 to disable."
,
...
...
@@ -88,6 +86,8 @@ var (
Usage
:
"Initialize the batcher in a stopped state. The batcher can be started using the admin_startBatcher RPC"
,
EnvVar
:
opservice
.
PrefixEnvVar
(
envVarPrefix
,
"STOPPED"
),
}
// Legacy Flags
SequencerHDPathFlag
=
txmgr
.
SequencerHDPathFlag
)
var
requiredFlags
=
[]
cli
.
Flag
{
...
...
op-proposer/flags/flags.go
View file @
539a16e3
...
...
@@ -14,7 +14,7 @@ import (
const
envVarPrefix
=
"OP_PROPOSER"
var
(
/
* Required Flags */
/
/ Required Flags
L1EthRpcFlag
=
cli
.
StringFlag
{
Name
:
"l1-eth-rpc"
,
Usage
:
"HTTP provider URL for L1"
,
...
...
@@ -40,12 +40,14 @@ var (
Required
:
true
,
EnvVar
:
opservice
.
PrefixEnvVar
(
envVarPrefix
,
"POLL_INTERVAL"
),
}
/
* Optional flags */
/
/ Optional flags
AllowNonFinalizedFlag
=
cli
.
BoolFlag
{
Name
:
"allow-non-finalized"
,
Usage
:
"Allow the proposer to submit proposals for L2 blocks derived from non-finalized L1 blocks."
,
EnvVar
:
opservice
.
PrefixEnvVar
(
envVarPrefix
,
"ALLOW_NON_FINALIZED"
),
}
// Legacy Flags
L2OutputHDPathFlag
=
txmgr
.
L2OutputHDPathFlag
)
var
requiredFlags
=
[]
cli
.
Flag
{
...
...
op-service/txmgr/cli.go
View file @
539a16e3
...
...
@@ -28,6 +28,21 @@ const (
ResubmissionTimeoutFlagName
=
"resubmission-timeout"
)
var
(
SequencerHDPathFlag
=
cli
.
StringFlag
{
Name
:
"sequencer-hd-path"
,
Usage
:
"DEPRECATED: The HD path used to derive the sequencer wallet from the "
+
"mnemonic. The mnemonic flag must also be set."
,
EnvVar
:
"OP_BATCHER_SEQUENCER_HD_PATH"
,
}
L2OutputHDPathFlag
=
cli
.
StringFlag
{
Name
:
"l2-output-hd-path"
,
Usage
:
"DEPRECATED:The HD path used to derive the l2output wallet from the "
+
"mnemonic. The mnemonic flag must also be set."
,
EnvVar
:
"OP_PROPOSER_L2_OUTPUT_HD_PATH"
,
}
)
func
CLIFlags
(
envPrefix
string
)
[]
cli
.
Flag
{
return
append
([]
cli
.
Flag
{
cli
.
StringFlag
{
...
...
@@ -40,6 +55,8 @@ func CLIFlags(envPrefix string) []cli.Flag {
Usage
:
"The HD path used to derive the sequencer wallet from the mnemonic. The mnemonic flag must also be set."
,
EnvVar
:
opservice
.
PrefixEnvVar
(
envPrefix
,
"HD_PATH"
),
},
SequencerHDPathFlag
,
L2OutputHDPathFlag
,
cli
.
StringFlag
{
Name
:
"private-key"
,
Usage
:
"The private key to use with the service. Must not be used with mnemonic."
,
...
...
@@ -69,7 +86,9 @@ func CLIFlags(envPrefix string) []cli.Flag {
type
CLIConfig
struct
{
L1RPCURL
string
Mnemonic
string
HDPath
string
SequencerHDPath
string
L2OutputHDPath
string
PrivateKey
string
SignerCLIConfig
client
.
CLIConfig
NumConfirmations
uint64
...
...
@@ -91,7 +110,9 @@ func ReadCLIConfig(ctx *cli.Context) CLIConfig {
return
CLIConfig
{
L1RPCURL
:
ctx
.
GlobalString
(
L1RPCFlagName
),
Mnemonic
:
ctx
.
GlobalString
(
MnemonicFlagName
),
SequencerHDPath
:
ctx
.
GlobalString
(
HDPathFlagName
),
HDPath
:
ctx
.
GlobalString
(
HDPathFlagName
),
SequencerHDPath
:
ctx
.
GlobalString
(
SequencerHDPathFlag
.
Name
),
L2OutputHDPath
:
ctx
.
GlobalString
(
L2OutputHDPathFlag
.
Name
),
PrivateKey
:
ctx
.
GlobalString
(
PrivateKeyFlagName
),
SignerCLIConfig
:
client
.
ReadCLIConfig
(
ctx
),
NumConfirmations
:
ctx
.
GlobalUint64
(
NumConfirmationsFlagName
),
...
...
@@ -120,8 +141,14 @@ func NewConfig(cfg CLIConfig, l log.Logger) (Config, error) {
if
err
!=
nil
{
return
Config
{},
err
}
hdPath
:=
cfg
.
HDPath
if
hdPath
==
""
&&
cfg
.
SequencerHDPath
!=
""
{
hdPath
=
cfg
.
SequencerHDPath
}
else
if
hdPath
==
""
&&
cfg
.
L2OutputHDPath
!=
""
{
hdPath
=
cfg
.
L2OutputHDPath
}
signerFactory
,
from
,
err
:=
opcrypto
.
SignerFactoryFromConfig
(
l
,
cfg
.
PrivateKey
,
cfg
.
Mnemonic
,
cfg
.
SequencerHD
Path
,
cfg
.
SignerCLIConfig
)
signerFactory
,
from
,
err
:=
opcrypto
.
SignerFactoryFromConfig
(
l
,
cfg
.
PrivateKey
,
cfg
.
Mnemonic
,
hd
Path
,
cfg
.
SignerCLIConfig
)
if
err
!=
nil
{
return
Config
{},
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment