System-wide configuration tree
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.9k
- Forks
- 1.3k
- Avg merge
- 13d 21h
- Merged PRs (30d)
- 1
Description
Different aspects like dialer limits (#525), timeouts, wait periods, frequencies of periodic GC processes, etc. should be configurable. Possible directions:
- Have the constructors for each module (e.g.
NewSwarm()) accept specific configuration structs (e.g.SwarmConfig). This doesn't play well with profile/default configurations (e.g.BasicHost,libp2p.New), as the user does not interact with those constructors. - Continue using the current functional-like
Optionsflag model. Does not scale well, is leaky, and relies on accessors being available along the chain.- Currently we're using this for two things: (a) dependency injection and (b) configuration.
- Hopefully (a) will be superseded by the host/service abstraction, and (b) by what we decide herein.
- The host/service abstraction injects a
ConfigurationContextin all modules, that models configuration keys like a tree, like the IPFS configuration. Modules can interrogate the context to find configuration values for themselves. The API can be type-safe, or just a map.- Every large project needs to deal with injecting configuration at one point or another; there are a lot of examples in the Go sphere we can draw inspiration from (including IPFS), and also to explore tradeoffs.
- Things to think about: default values, types, serialisation (reading/writing configuration to/from JSON/YAML), hierarchy, key naming, etc.
In general I like the way IPFS does this, but it should only be one input in our discussion. In fact, we should speak to the IPFS community to explore any shortcomings they have experienced with their choice.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the issue's three configuration approaches and inspecting the mentioned entry points, including NewSwarm(), BasicHost, and libp2p.New, along with the current Options flow. Compare the IPFS configuration model linked in the issue and document decisions for defaults, types, serialization, hierarchy, and key naming. Done means a maintainer-approved system-wide configuration design, not a localized code edit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100