Skip to content

[ETCM-121] Refactor configs #681

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

Merged
merged 6 commits into from
Sep 24, 2020
Merged

[ETCM-121] Refactor configs #681

merged 6 commits into from
Sep 24, 2020

Conversation

ntallar
Copy link

@ntallar ntallar commented Sep 18, 2020

Description

Different changes with the objectives of:

  • Naming our current testnet to internal
  • Allow starting Mantis on different environments without having to comment/uncomment lines of configuration files

Important Changes Introduced

  • Removes private testnet configurations as there is no use case for them yet
  • Adds testnet-internal configurations
  • Lots of renamings (i.e etc.json -> etc-genesis.json, etc.conf -> etc-chain.conf)

Up-to-discussion

  • Removing "user friendly" configurations as there haven't proven to be very used or even friendly (the other changes are compatible with this if we want to have them)
  • Should we enable HTTPS on the application.conf instead?

Testing

  • Sbt dist and sbt run should work as always with trying out all the different environments (the packaged binaries now list all the environments currently supported)

@ntallar ntallar force-pushed the etcm-121-refactor-configs branch from 7329ff7 to b013bc7 Compare September 18, 2020 18:12
@ntallar ntallar force-pushed the etcm-121-refactor-configs branch 2 times, most recently from baedddd to 3d2893b Compare September 18, 2020 18:45
@mirkoAlic
Copy link
Contributor

mirkoAlic commented Sep 18, 2020

I think is the way to go =) great job!

@ntallar ntallar force-pushed the etcm-121-refactor-configs branch from 3d2893b to 8b03317 Compare September 18, 2020 18:54
@ntallar ntallar marked this pull request as ready for review September 18, 2020 18:54
@ntallar ntallar changed the title [ETCM-121] Refactor configs (WIP proposal) [ETCM-121] Refactor configs Sep 18, 2020
@mirkoAlic
Copy link
Contributor

please update the README -> https://github.com/input-output-hk/mantis#command-line-version

@ntallar ntallar mentioned this pull request Sep 18, 2020
3 tasks
@ntallar ntallar added the BREAKS CONFIG Affects the default configuration label Sep 18, 2020
@@ -0,0 +1 @@
{ include "base-chain.conf"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need base-chain?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was created as etc and eth networks share a lot of common configuration

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but base == etc. In my opinion, we don't need it

Copy link
Author

Choose a reason for hiding this comment

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

Hmm I'm also a bit on Michal's side in can be a bit confusing

In my opinion I'd just replicate the duplicated configuration in both etc-chain.conf and eth-chain.conf, just to have to check a single file to see all the configurations of a chain. This kinds of files will rarely be touched so I don't see that being too much of a problem

Copy link
Contributor

Choose a reason for hiding this comment

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

Go for it then!

Copy link
Author

Choose a reason for hiding this comment

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

Just updated them! Please check that I haven't screwed up in the middle

I noticed some ropsten configuration wasn't properly configured but I'd leave it as is to not fall down in that rabbit hole, if we ever start providing official support for it (seems to be the intent eventually) we'll fix it then

http {
mode = "https"

certificate-keystore-path = "conf/mantis.jks"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should HTTPS be pre-configured with these values or disabled by default so user can configure it on its own?

Copy link
Author

Choose a reason for hiding this comment

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

Imo for now I'd just disable it and have the user configure it on its own, we can later add it for development's purposes or provide some guide on to how the user should configure it

@kapke kapke closed this Sep 21, 2020
@kapke kapke reopened this Sep 21, 2020
@kapke
Copy link
Contributor

kapke commented Sep 21, 2020

Misclick 😅
Regarding launcher scripts - I think we should add *.bat versions of them as well. And that leads to another conclusion - should we maybe replace them with command-line argument, so we don't need to create such number of files manually?

@mmrozek
Copy link
Contributor

mmrozek commented Sep 21, 2020

@kapke, according to your last comment, maybe the generic script will be enough?
sth like:

#!/bin/bash

chain="$1"
if [ -z "$chain"]
then
  echo "You need to choose chain"
else
  shift
  ./bin/mantis -Dconfig.file=./conf/"$chain".conf "$@"
fi

@kapke
Copy link
Contributor

kapke commented Sep 21, 2020

@mmrozek I'm not sure. There are 2 issues in that approach:

  • how to name generic mantis launcher so it doesn't interfere with that one
  • there's need to write and maintain *.bat version of it

@ntallar
Copy link
Author

ntallar commented Sep 21, 2020

Maybe it's better than nothing to have the script that Michal mentioned? (maybe we could name it mantis-app or mantis-launcher). We could add the .bat version in a separate PR.

The other alternative is just removing this script, is it used by any for now?

…auncher; removed unnecessary configurations from testnet internal; removed https from app.conf
Copy link
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -0,0 +1,10 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't have execute permission

@ntallar ntallar requested a review from kapke September 22, 2020 13:20

# Custom genesis JSON file path
# null value indicates using default genesis definition that matches the main network
custom-genesis-file = null
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: should we maybe get rid of optional genesis path? (separate task for Piotr or Adiran maybe?)

Copy link
Author

Choose a reason for hiding this comment

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

Totally! Here's the task for that: https://jira.iohk.io/browse/ETCM-128

Copy link
Contributor

@kapke kapke left a comment

Choose a reason for hiding this comment

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

LGTM!

@ntallar ntallar merged commit fcdc21c into develop Sep 24, 2020
@ntallar ntallar deleted the etcm-121-refactor-configs branch September 24, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKS CONFIG Affects the default configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants