-
Notifications
You must be signed in to change notification settings - Fork 130
Nc 2026 network option #645
Nc 2026 network option #645
Conversation
As toString() is used to display default values in CLI description and this is not used anywhere else for RpcApi objects, it may have benn used for debug long ago, but now we can use the simple string value as return from toString. Then we are able to use the DEFAULT_JSON_RPC_APIS constant as default value directly instead of hard coded defaults string in option that was probably used because previous toString was not outputting correct representation. It may be interesting to comment when some does this sort of hack.
…values As toString() is used to display default values in CLI description and this is not used anywhere else for RpcApi objects, it may have benn used for debug long ago, but now we can use the simple string value as return from toString. Then we are able to use the DEFAULT_JSON_RPC_APIS constant as default value directly instead of hard coded defaults string in option that was probably used because previous toString was not outputting correct representation. It may be interesting to comment when some does this sort of hack.
Networks are now defined using a `--network` option that takes the cas insensitive name of an enum values as input : MAINNET, OTTOMAN, RINKEBY, ROPSTEN, GOERLI, DEV These presets are a set of network-id, genesis file and boonodes list. If the `--private-genesis-file` is provided with a valid JSON genesis file, Pantheon consider that none of these predefined networks are used and requires user to also set the `--network-id` and `--bootnodes` options. However you can also just override the `--network-id` and `--bootnodes` for a predefined network without having to provide a genesis file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to start using --network-id with external genesis files? Why can't we default to the chainId value in the genesis.json? {"config":{"chainId":42}} . I like that we have an override but except in a few cases networkId == chainId.
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/StandaloneCommand.java
Outdated
Show resolved
Hide resolved
# Conflicts: # docs/Reference/Pantheon-CLI-Syntax.md # pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java # pantheon/src/test/resources/everything_config.toml
Networks are now defined using a `--network` option that takes the cas insensitive name of an enum values as input : MAINNET, RINKEBY, ROPSTEN, GOERLI, DEV These presets are a set of network-id, genesis file and boonodes list. If the `--genesis-file` is provided with a valid JSON genesis file, Pantheon uses it instead of the default network. An empty bootnodes list is then the default value and network id is the chain id found in the genesis file. `--network-id` and `--bootnodes` options can override these defaults. You can of course also override the `--network-id` and `--bootnodes` for a predefined known network (using `--network`). Also fixes NC-2189 renaming --private-genesis-file to --genesis-file Updated a lot of doc according to the options changes
…2026_network_option # Conflicts: # docs/Reference/Pantheon-CLI-Syntax.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I still don't think that specifying a custom genesis file should affect network ID and bootnodes - it's just surprising behaviour for users, but I think that can be a follow up discussion as it's not hard to change back if we want. Worth moving forward in the mean time.
User have no reason to set `--network` and `--genesis-file` options at the same time that would lead to misunderstandings so we raise an error to prevent both options to be defined at the same time on the command line. Also fixes review feedbacks comments for the PR.
fixes NC-2026 adds a `--network` option instead of separated options Networks are now defined using a `--network` option that takes the case insensitive name of an enum values as input : MAINNET, RINKEBY, ROPSTEN, GOERLI, DEV These presets are a set of network-id, genesis file and boonodes list. If the `--genesis-file` is provided with a valid JSON genesis file, Pantheon uses it instead of the default network. An empty bootnodes list is then the default value and network id is the chain id found in the genesis file. `--network-id` and `--bootnodes` options can override these defaults. You can of course also override the `--network-id` and `--bootnodes` for a predefined known network (using `--network`). User have no reason to set `--network` and `--genesis-file` options at the same time that would lead to misunderstandings so we raise an error to prevent both options to be defined at the same time on the command line. Also fixes NC-2189 renaming --private-genesis-file to --genesis-file Updates a lot of doc according to the options changes
PR description
Enable a new way to define known network usage with a
--network
option.It removes the use of --ropsten --rinkeby --goerli --ottoman and --dev-mode options.
--network
option takes the case insensitive name of an enum values as input :MAINNET, RINKEBY, ROPSTEN, GOERLI, DEV
These presets are a set of network-id, genesis file and boonodes list.
If the
--genesis-file
is provided with a valid JSON genesis file,Pantheon uses it instead of the default network. An empty bootnodes list is then
the default value and network id is the chain id found in the genesis file.
--network-id
and--bootnodes
options can override these defaults.You can of course also override the
--network-id
and--bootnodes
for apredefined known network (using
--network
).Also fixes NC-2189 renaming --private-genesis-file to --genesis-file
Updated a lot of doc according to all these changes
This PR depends on #635 to be merged first as it includes some changes merged from this PR -> blocked label added on this PR.PR merged and closed.Fixed Issue(s)
fixes NC-2026
fixes NC-2029
fixes NC-2189