Skip to content

Commit 2a65ca4

Browse files
jvmaiacburgdorf
authored andcommitted
merge --nodekey and --nodekey-path
1 parent 455678e commit 2a65ca4

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

trinity/cli_parser.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,7 @@ def __call__(self,
264264
'--nodekey',
265265
help=(
266266
"Hexadecimal encoded private key to use for the nodekey"
267-
)
268-
)
269-
chain_parser.add_argument(
270-
'--nodekey-path',
271-
help=(
272-
"The filesystem path to the file which contains the nodekey"
267+
" or the filesystem path to the file which contains the nodekey"
273268
)
274269
)
275270

trinity/utils/chains.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,11 @@ def construct_trinity_config_params(
135135
if args.data_dir is not None:
136136
yield 'data_dir', args.data_dir
137137

138-
if args.nodekey_path and args.nodekey:
139-
raise ValueError("Cannot provide both nodekey_path and nodekey")
140-
elif args.nodekey_path is not None:
141-
yield 'nodekey_path', args.nodekey_path
142-
elif args.nodekey is not None:
143-
yield 'nodekey', decode_hex(args.nodekey)
138+
if args.nodekey is not None:
139+
if os.path.isfile(args.nodekey):
140+
yield 'nodekey_path', args.nodekey
141+
else:
142+
yield 'nodekey', decode_hex(args.nodekey)
144143

145144
if args.sync_mode is not None:
146145
yield 'sync_mode', args.sync_mode

0 commit comments

Comments
 (0)