Skip to content

pkg/config: config enhancements #48

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

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,219 changes: 1,219 additions & 0 deletions CONFIG.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package chainlink_evm

import (
_ "embed"
"testing"

"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/chainlink-evm/pkg/config/toml"
)

var (
//go:embed CONFIG.md
configMD string
)

//go:generate go run ./pkg/scmd/config-docs
func TestConfigDocs(t *testing.T) {
cfg, err := toml.GenerateDocs()
assert.NoError(t, err, "invalid config docs")
assert.Equal(t, configMD, cfg, "CONFIG.md is out of date. Run 'go generate .' to regenerate.")
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/jackc/pgtype v1.14.4
github.com/jmoiron/sqlx v1.4.0
github.com/jpillora/backoff v1.0.0
github.com/kylelemons/godebug v1.1.0
github.com/leanovate/gopter v0.2.11
github.com/lib/pq v1.10.9
github.com/onsi/gomega v1.36.2
Expand All @@ -19,7 +20,7 @@ require (
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.63.0
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250502210357-2df484128afa
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250502210357-2df484128afa
Expand Down Expand Up @@ -116,7 +117,6 @@ require (
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/marcboeker/go-duckdb v1.8.3 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJV
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065 h1:8UsqHv+LkrO2KdXbfZd5qejsy4Z4Xz5/DNVfUGT6gTM=
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065/go.mod h1:vHs/mPpAztdKJtzRKLnmLinmpS78fBh9sAuyKqQrQ+I=
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331 h1:+bN5yuawZeQeVw7vG+Me7kXLFK1vcesVeku3mdgRwqI=
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331/go.mod h1:UGZVg18zzyJ1KimGM5SSmxG5jb7aCSq3OwQQKfhHGyE=
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882 h1:teDwTZ0GXlxQ65lgVbB44ffbIHlEh4N8wW7zav4lt9c=
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882/go.mod h1:NVoJQoPYr6BorpaXTusoIH1IYTySCmanQ8Q1yv3mNh4=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250502210357-2df484128afa h1:WJNO3646oVvLQtPf+8YUoAOjBWg6XbGUctnOPLp4ZTE=
Expand Down
24 changes: 24 additions & 0 deletions pkg/cmd/config-docs/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"flag"
"fmt"
"log"
"os"
"path/filepath"

"github.com/smartcontractkit/chainlink-evm/pkg/config/toml"
)

var outDir = flag.String("o", "", "output directory")

func main() {
s, err := toml.GenerateDocs()
if err != nil {
log.Fatalln("Failed to generate docs:", err)
}
if err = os.WriteFile(filepath.Join(*outDir, "CONFIG.md"), []byte(s), 0600); err != nil {
fmt.Fprintf(os.Stderr, "failed to write config docs: %v\n", err)
os.Exit(1)
}
}
Loading
Loading