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

chore: Simplify configuration for the waku network #2404

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Feb 7, 2024

Description

Simplifies configuration, extracting cluster-id=1 parameters into a file. When cluster-id=1 is configured, then all parameters are loaded without having to specify them all. Now someone wanting to join TheWakuNetwork can do so with just:

./build/wakunode2 --cluster-id=1 --rln-relay-eth-client-address=$YOUR_ETH_NODE

Or if you want to run just one shard(s):

./build/wakunode2 --cluster-id=1 --shard=5 --rln-relay-eth-client-address=$YOUR_ETH_NODE

This should simplify this monster.

Copy link

github-actions bot commented Feb 7, 2024

This PR may contain changes to configuration options of one of the apps.

If you are introducing a breaking change (i.e. the set of options in latest release would no longer be applicable) make sure the original option is preserved with a deprecation note for 2 following releases before it is actually removed.

Please also make sure the label release-notes is added to make sure any changes to the user interface are properly announced in changelog and release notes.

Copy link

github-actions bot commented Feb 7, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2404

Built from f4b8923

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

LGTM and definitely improves config.

@@ -256,6 +258,11 @@ type
desc: "Default pubsub topic to subscribe to. Argument may be repeated."
name: "pubsub-topic" .}: seq[string]

shards* {.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking that in future the ability to configure ranges may be needed for large subscriptions (e.g. --shards:0..7,15,21..29). For now repeated arg makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mm i would say node operators don't necessarily need to specify the exact shards but the number of them they want to run. unless they are interested in a specific shard because their content topic falls in there, but in that case i expect them to provide the contentTopic and not the shard.

(but yeap, current behaviour is --shard=5 means shard 5 and not 5 shards)

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for it! 💯
Just added some minor comments that I hope you find useful

Comment on lines +17 to +20
# cluster-id=1
# Cluster configuration corresponding to The Waku Network. Note that it
# overrides existing cli configuration
proc TheWakuNetworkConf*(T: type ClusterConf): ClusterConf =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Super nitpick, I know xD but comments tend to go below proc definition


proc parseCmdArg*(T: type ShardIdx, p: string): T =
try:
ShardIdx(parseInt(p))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to ensure that the given index is within the valid boundaries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will address this in followup prs. don't want to just add a MaxAmountShards here but enforce it all over the place when a given cluster-id is chosen. and that may require some changes out of scope of this pr :)

Comment on lines +85 to +86
conf.discv5BootstrapNodes =
conf.discv5BootstrapNodes & twnClusterConf.discv5BootstrapNodes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this overriding the configuration or just appending made on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

appending, just in case someone wants to add more bootstrap nodes on top of the existing ones.

@alrevuelta alrevuelta merged commit 985d092 into master Feb 7, 2024
13 of 14 checks passed
@alrevuelta alrevuelta deleted the simplify-config branch February 7, 2024 11:42
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

3 participants