Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Pkl addresses several challenges commonly encountered with traditional configuration formats and general-purpose programming languages when managing configurations:
Limited expressiveness and reusability → tired of copy-pasting boilerplate configurations?
Validation and safety concerns → are you sure this JSON field can be omitted safely?
Scalability issues → drowning in a sea of ever-growing configurations?
blockchain.pkl
differs fromaa.pkl
innetworks/templates/
!), providing necessary tools to handle intricate configurations efficiently.Lack of advanced tooling → ever been lost in a maze of YAML files?
Impact
env-default
struct tags across all services that the config is used inpkl
struct tag. No need to keep a zoo of struct tags that span over the horizon for each field likejson:"chain_ids" yaml:"chain_ids" env:"PATHFINDER_CHAIN_IDS" env-separator:"," env-default:"1,59144,137,534352"
POC scope
This PR moves to Pkl...
A CI/CD pipeline is proposed as well to automatically re-render the configs in all necessary formats as changes are committed to
networks/
directory specifically. For now pipeline renders Pkl to JSON only but it can be easily extended to render in multiple formats in one run.Quickstart
How to render a single config (for demo purposes):
brew install pkl
curl -L -o /usr/local/bin/pkl 'https://github.com/apple/pkl/releases/download/0.27.1/pkl-linux-amd64' && chmod +x /usr/local/bin/pkl
cd networks/terminal/hackathon
pkl eval peers.pkl -f json
pkl eval peers.pkl -f yaml
TODOs (if POC is accepted)
clearsync/pkg/userop
package config intonetworks/templates/aa.pkl
.github/_workflows
→.github/workflows)
. Reason: repo is protected to prohibit non-admin users to create workflows