-
Notifications
You must be signed in to change notification settings - Fork 370
Conversation
ERROR com.iota.iri.IRI$IRILauncher - There was a problem parsing commandline arguments: Expected a value after parameter --testnet
|
Why did you add |
@GalRogozinski We decided that we want the same behavior for all arguments, which also includes this argument (only used twice in test cases, maybe we should remove it in another PR?) |
@kwek20 can you merge into this PR |
@karimodm I did, sort of. Also forgot to push that, sort of. |
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.
Actual boolean value passed to the new arity = 1
parameters is not honored.
} | ||
|
||
@JsonIgnore | ||
@Parameter(names = {"--fake-config"}, description = Config.Descriptions.TESTNET, arity = 1) |
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.
Is the description Config.Descriptions.TESTNET
?
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.
Ah no, good catch
* @param args the list of program startup arguments | ||
* @return <code>true</code> if this is testnet, otherwise <code>false</code> | ||
*/ | ||
private static boolean isTestnet(String[] args) { |
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.
What about parsing the boolean value passed to options that are not --testnet
. Is --remote false
treated correctly?
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.
No all other parsing happens in JCommander, but this is needed because we instantiate a different config based on testnet, so we have to check that Before using jcommander.. silly
Removing the testnet/mainnet difference is a different issue/pr i think
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.
so we have to check that Before using jcommander.. silly
A bit, but do you have a better idea?
@@ -153,7 +170,7 @@ protected void setApiHost(String apiHost) { | |||
} | |||
|
|||
@JsonIgnore | |||
@Parameter(names = {"--remote"}, description = APIConfig.Descriptions.REMOTE) | |||
@Parameter(names = {"--remote"}, description = APIConfig.Descriptions.REMOTE, arity = 1) |
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.
Is not only about setting the arity. If the user passes a false
value the functionality should be disabled.
@karimodm Can you review again please? |
Note that due to a checkstyle exception the code doesn't compile |
* @param args the list of program startup arguments | ||
* @return <code>true</code> if this is testnet, otherwise <code>false</code> | ||
*/ | ||
private static boolean isTestnet(String[] args) { |
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.
so we have to check that Before using jcommander.. silly
A bit, but do you have a better idea?
protected void setRemote(boolean remote) { | ||
this.apiHost = "0.0.0.0"; | ||
if (!remote) this.apiHost = "0.0.0.0"; | ||
this.remote = remote; |
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 had a comment that the remote
field is not used.
If you are assigning a value to it then it is kind of confusing imo. It makes it look that it is not only about setting apiHost to 0.0.0.0, but you have a field.
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.
Could we maybe remove the apiHost
attribute and make a change in the class using apiHost
to check for remote
instead and open the listening socket on 0.0.0.0
? #makegalhappy
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.
We can change getApiHost
to check the remote
field.
This means that if the user configures both then remote
will always win, which may be the desired behavior.
@kwek20,
your call if you want to do that
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.
Just gave an idea on how to turn Gal's comment around. Looks good to me though ;)
protected void setRemote(boolean remote) { | ||
this.apiHost = "0.0.0.0"; | ||
if (!remote) this.apiHost = "0.0.0.0"; | ||
this.remote = remote; |
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.
Could we maybe remove the apiHost
attribute and make a change in the class using apiHost
to check for remote
instead and open the listening socket on 0.0.0.0
? #makegalhappy
Right, for now we have the following scenarios (Defaults are bold): Travis fails due to |
Required for changes in iotaledger/iri#1295
Required for changes in iotaledger/iri#1295 Should not be merged before this PR is merged
Required for changes in iotaledger/iri#1295
Required for changes in iotaledger/iri#1295 Should not be merged before this PR is merged
iotaledger/iri#1295 - Setting --remote to 'true'
Description
Changed arity of
rescan
,revalidate
,remote
,zmq-enabled
,testnet-no-coo-validation
, to 1.--help
not changed due to expected behavior in the help command of a programAdded the following to JCommander/BasicIotaConfig:
--testnet
--fake-config
These options do not change anything but force correct usage of parameters to keep Boolean behavior uniform.
Fixes #930
Following PR need to be merged directly after:
iotaledger/iri-regression-tests#10
iotaledger/tiab#4
Type of change
How Has This Been Tested?
Unit tests, regression tests, node runs
Checklist: