Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Add --ropsten command line argument #197

Merged
merged 3 commits into from
Oct 28, 2018

Conversation

jvirtanen
Copy link
Contributor

PR description

Add a command line argument to connect to Ropsten.

Fixed Issue(s)

Closes #186.

"enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303",
"enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303")
.map(DefaultPeer::fromURI)
.collect(toList()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are based on the Starting Pantheon page in the Wiki.

@@ -59,6 +59,7 @@

private static final Logger LOG = LogManager.getLogger();
public static final int MAINNET_NETWORK_ID = 1;
public static final int ROPSTEN_NETWORK_ID = 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is MainnetPantheonController a reasonable place to define this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really fit all that well. I suspect it would be better if all three of MainNet, Rinkeby and Ropsten network IDs were moved to the EthNetworkConfig class. It already has the statics for genesis configs and is the only place those constants are used.

@ajsutton ajsutton self-assigned this Oct 28, 2018
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really helpful, thanks for submitting. Functionally all looks good, just the couple of minor tweaks and it should be good to go.

rinkeby ? EthNetworkConfig.rinkeby() : EthNetworkConfig.mainnet();
rinkeby
? EthNetworkConfig.rinkeby()
: ropsten ? EthNetworkConfig.ropsten() : EthNetworkConfig.mainnet();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this a full if/else instead of the nested ternary if please?

@jvirtanen jvirtanen force-pushed the ropsten-command-line-argument branch from 4423ba3 to 8e9089c Compare October 28, 2018 08:57
@jvirtanen
Copy link
Contributor Author

@ajsutton Thank you for the review! All comments should be addressed now.

@ajsutton
Copy link
Contributor

Awesome, thanks. I've also added a error message if both --ropsten and --rinkeby are specified for good measure.

@ajsutton ajsutton merged commit b9e5d74 into PegaSysEng:master Oct 28, 2018
@jvirtanen jvirtanen deleted the ropsten-command-line-argument branch October 28, 2018 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants