-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): reset CLI command takes networkId flag and only modifies if given #3690
Conversation
let networkIdMessage = '' | ||
if (flags.networkId != null) { | ||
const existingId = this.sdk.internal.get('networkId') | ||
networkIdMessage = `\n\nThe network ID will be changed from ${existingId} to the new value of ${flags.networkId}` |
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.
nit - do we still want to print this message if existingId === flags.networkId
?
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.
I was thinking about that. I don't feel super strong one way or another, but I think the explicitness is nice, so one could see if maybe they're already on the right network, or accidentally mistyped the number or something
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.
I don't have evidence to support one option being better -- I think skipping the message would be a bit unclear as to whether a change will happen or not, but I'm not sure if it's more helpful to have a message that says Your network ID will stay unchanged as ${existingId}
. I'm okay with it either way and changing it if we get user feedback.
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.
Good call - that makes it clear in all scenarios. Change incoming
let networkIdMessage = '' | ||
if (flags.networkId != null) { | ||
const existingId = this.sdk.internal.get('networkId') | ||
networkIdMessage = `\n\nThe network ID will be changed from ${existingId} to the new value of ${flags.networkId}` |
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.
I don't have evidence to support one option being better -- I think skipping the message would be a bit unclear as to whether a change will happen or not, but I'm not sure if it's more helpful to have a message that says Your network ID will stay unchanged as ${existingId}
. I'm okay with it either way and changing it if we get user feedback.
Summary
Currently, there is no way to modify your network ID unless you manually edit the internal.json file. Combined with the usage of reset changing slightly to work more like a soft reset to allow changing between networks or just reset chain data, it makes sense to only optionally re-write the network ID if passed via flag. Otherwise, leave it unmodified
Testing Plan
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.