Skip to content
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

Improve configgen command line handling a bit #440

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

dpc
Copy link
Contributor

@dpc dpc commented Aug 22, 2022

Positional arguments are not descriptive and harder to use.

@dpc dpc marked this pull request as draft August 22, 2022 04:48
@dpc
Copy link
Contributor Author

dpc commented Aug 22, 2022

Feedback (especially w.r.t naming) much appreciated.

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2022

Codecov Report

Merging #440 (096399c) into master (2cd4cb8) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
- Coverage   74.54%   74.46%   -0.09%     
==========================================
  Files          83       83              
  Lines       10550    10556       +6     
==========================================
- Hits         7865     7861       -4     
- Misses       2685     2695      +10     
Impacted Files Coverage Δ
fedimint/src/bin/configgen.rs 1.85% <0.00%> (-0.24%) ⬇️
client/client-lib/src/api.rs 81.38% <0.00%> (-1.10%) ⬇️
fedimint/src/net/peers.rs 92.91% <0.00%> (-0.27%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dpc dpc force-pushed the configgen branch 2 times, most recently from 83f8a68 to c5b457e Compare August 22, 2022 05:30
@DanGould
Copy link

Concept ACK. Much better! Consuming this script right now as well.

It makes sense for these values to have sane defaults as well. Perhaps the ones in build.sh make sense. I'm not sure what "hbbft" and "api" mean, but I'm just getting up to speed so maybe those names are good.

@DanGould
Copy link

Also, what unit are the denominations? msat? That should be labeled too

@dpc
Copy link
Contributor Author

dpc commented Aug 22, 2022

@DanGould Just seen some confusion on #general w.r.t units somewhere. 👍 on including units here and everywhere.

@dpc
Copy link
Contributor Author

dpc commented Aug 22, 2022

Ports and denominations should have a default.

@DanGould
Copy link

fyi esplora uses default ports 5000 & 5001. Best to avoid those. Esplora pairs nicely with fedimint.

@dpc
Copy link
Contributor Author

dpc commented Aug 23, 2022

There's 63k ports to choose from and it always have to be 8000, 8080, 3000 or some other x000. 🤷

Copy link
Contributor

@elsirion elsirion left a comment

Choose a reason for hiding this comment

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

Really cool! Naming looks good to me. Left one idea I'd like to discuss.

amount_tiers: Vec<Amount>,

/// Available denominations of notes issues by the federation (comma separated)
#[clap(long = "denominations", value_delimiter = ',')]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we enforce that there has to be at least one denomination? Forgetting to specify them bit me a few times …

I would have assumed that this is the default behavior, but apparently it isn't (I just tested it again) and there has been a lengthy discussion about it (didn't read it all) clap-rs/clap#1772

@dpc dpc force-pushed the configgen branch 2 times, most recently from 1865e72 to 73093ca Compare August 24, 2022 03:03
@dpc dpc marked this pull request as ready for review August 24, 2022 03:06
@dpc dpc marked this pull request as draft August 24, 2022 03:06
Positional arguments are not descriptive and harder to use.
@dpc dpc marked this pull request as ready for review August 24, 2022 03:09
@dpc dpc requested a review from elsirion August 24, 2022 03:09
@dpc
Copy link
Contributor Author

dpc commented Aug 24, 2022

--denominations are now required with at least on element, and ports get some randomish default values.

num_nodes: u16,

/// Base hbbft port
#[clap(long = "hbbft-base-port", default_value = "17240")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I checked that the port is out of the range for ephemeral ports on most systems (32768–60999 for Linux apparently).

@elsirion elsirion merged commit 85e6602 into fedimint:master Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants