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

Add support for dynamic network definitions #18

Merged
merged 13 commits into from
Jul 25, 2024
Merged

Conversation

jclapis
Copy link
Member

@jclapis jclapis commented Jul 16, 2024

For the bulk of the Smart Node (and NMC's) life, the list of networks has been baked directly into the source. This prevents people from adding support for custom network definitions, which is a problem for things like testing. This PR changes that so network definitions can be loaded dynamically (i.e., from disk or something) instead of being baked into the source. The original network definitions are left as global variables for reference but are otherwise no longer used.

Note this also enables dynamic parameter defaults for each config setting based on the network definition. Parameters now have a general-purpose "all networks" default, but that can be overwritten by including a default for that parameter in the new network settings struct.

Side effects / other changes rolled into the PR for convenience:

  • ServiceProvider has been changed to an interface to support mocking (Fornax has already approved that in dev, but since this is targeting main it'll show up in the diff list again)
  • Some client version updates from dev
  • The Uinteger and ByteArray types have been moved from the beacon.client package into utils, which is a more appropriate place for general-purpose types like that. The move lets other package use them without needing to import the client package, which is not compatible with stuff that has CGO disabled.

@0xfornax 0xfornax merged commit dfd914e into main Jul 25, 2024
3 checks passed
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.

2 participants