-
Notifications
You must be signed in to change notification settings - Fork 78
[ETCM-491] Extend generated bash script with absolute path configs #871
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
Conversation
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.
Looks good overall, but wouldn't there be a problem for a MS Windows OS?
Just to be sure, because that OS won't treat / as a file separator
Maybe there should also be batScriptDefines...
Yes good catch 👍 |
aakoshh
left a comment
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.
Awesome, thanks for following up on this!
|
I was actually thinking that it might be a good idea to use this option to add script file that does what Just have to make sure that all the other launchers don't get hijacked by this logic, so maybe it could check if the first argument looks like a |
|
Ok this seems to work as expected now with bash script. I haven't had the opportunity to test the Windows batch file. |
|
I would propose that executing just the start script If we want to require a "chain" parameter I'll have to add a known issue because doing something like |
|
Tested on Mac - works nicely. |
| CHAIN_PARAM="-Dconfig.file=$CONFIG_FILE" | ||
| fi | ||
|
|
||
| ./bin/mantis ${CHAIN_PARAM:+"$CHAIN_PARAM"} "$@" |
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 does this fallback from CHAIN_PARAM to itself achieve?
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 found this is the way in bash to not add anything if CHAIN_PARAM is not set. Otherwise it adds the empty string and makes the command fail
|
If I understand it correctly it will launch I can imagine someone would find that confusing if they tried to add some setting to the "default etc" config and not seeing any effect. |
Right. Maybe I'll explicitly set the config to etc.conf if the user doesn't choose any chain. |
Description
See #851
Proposed Solution
As @aakoshh commented in the issue, one solution is to extend the the generated bash script file so that we can set the config files paths correctly.
Testing
These instructions should work for Unix and for Windows (just by changing
/to\).sbt disttarget/universal:cd target/universalunzip mantis-3.2.1.zipShould use etc by default (this is the test for the original issue)
mantis-3.2.1/bin/mantis- Check that it starts the client and connects to etc network.Should use given chain
mantis-3.2.1/bin/mantis-launcher sagano- Check that it starts and connects to sagano testnet.Should not break other scripts
All of the following should be valid and work as usual
mantis-3.2.1/bin/mantis-vm 8080mantis-3.2.1/bin/eckeygen 8mantis-3.2.1/bin/signatureValidator f0b91b55bdea6a6da2bcbd1270451e9ca014747b97e190a5a4275bad8eeda7436ab8081f0df5741a86a1bfb62798221103fff5898c4f768b707ff34b110329ed 6bf862422f0103d8ca6847019c0113c9b343a2489c2dc3fc67d853e87d98f68e5a5be1d021ec706197960912037d46bde44c3534a4ff562fd48e664f32c1392d1c 5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2mantis-3.2.1/bin/faucet-server