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

fix(polka-storage-server): Have NodeType hold needed values #677

Open
aidan46 opened this issue Jan 15, 2025 · 1 comment
Open

fix(polka-storage-server): Have NodeType hold needed values #677

aidan46 opened this issue Jan 15, 2025 · 1 comment
Assignees
Milestone

Comments

@aidan46
Copy link
Contributor

aidan46 commented Jan 15, 2025

I feel that we could turn this abstraction around and make the NodeType contain the necessary state for the respective node type.

This would make weird configs unrepresentable and avoid the Option<PeerId>

Originally posted by @jmg-duarte in #666 (comment)

@aidan46
Copy link
Contributor Author

aidan46 commented Jan 17, 2025

There is an issue with having the NodeType hold the CLI config values. The reason is that ValueEnum is made for unit-type enums, and implementing ValueEnum is possible but makes the CLI very messy. Here is a stackoverflow thread about the same thing. We can do two things if we want this to work:

  1. Get rid of the CLI arguments that are not the key or the config file
  2. Have a different NodeType for config vs CLI argument, where the latter stays a unit-type enum. This would also mean having 2 different config structs (currently we deserialise to ConfigurationArgs if it is TOML or YAML).

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

No branches or pull requests

1 participant