Skip to content

Commit e0c3649

Browse files
committed
pkg/config: config enhancements
1 parent 21113ff commit e0c3649

File tree

11 files changed

+2340
-14
lines changed

11 files changed

+2340
-14
lines changed

CONFIG.md

Lines changed: 1219 additions & 0 deletions
Large diffs are not rendered by default.

config_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package chainlink_evm
2+
3+
import (
4+
_ "embed"
5+
"testing"
6+
7+
"github.com/stretchr/testify/assert"
8+
9+
"github.com/smartcontractkit/chainlink-evm/pkg/config/toml"
10+
)
11+
12+
var (
13+
//go:embed CONFIG.md
14+
configMD string
15+
)
16+
17+
//go:generate go run ./pkg/scmd/config-docs
18+
func TestConfigDocs(t *testing.T) {
19+
cfg, err := toml.GenerateDocs()
20+
assert.NoError(t, err, "invalid config docs")
21+
assert.Equal(t, configMD, cfg, "CONFIG.md is out of date. Run 'go generate .' to regenerate.")
22+
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/jackc/pgtype v1.14.4
1111
github.com/jmoiron/sqlx v1.4.0
1212
github.com/jpillora/backoff v1.0.0
13+
github.com/kylelemons/godebug v1.1.0
1314
github.com/leanovate/gopter v0.2.11
1415
github.com/lib/pq v1.10.9
1516
github.com/onsi/gomega v1.36.2
@@ -19,7 +20,7 @@ require (
1920
github.com/prometheus/client_model v0.6.1
2021
github.com/prometheus/common v0.63.0
2122
github.com/shopspring/decimal v1.4.0
22-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065
23+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331
2324
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882
2425
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250502210357-2df484128afa
2526
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250502210357-2df484128afa
@@ -116,7 +117,6 @@ require (
116117
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
117118
github.com/kr/pretty v0.3.1 // indirect
118119
github.com/kr/text v0.2.0 // indirect
119-
github.com/kylelemons/godebug v1.1.0 // indirect
120120
github.com/leodido/go-urn v1.4.0 // indirect
121121
github.com/mailru/easyjson v0.7.7 // indirect
122122
github.com/marcboeker/go-duckdb v1.8.3 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,8 @@ github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJV
612612
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
613613
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
614614
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
615-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065 h1:8UsqHv+LkrO2KdXbfZd5qejsy4Z4Xz5/DNVfUGT6gTM=
616-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065/go.mod h1:vHs/mPpAztdKJtzRKLnmLinmpS78fBh9sAuyKqQrQ+I=
615+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331 h1:+bN5yuawZeQeVw7vG+Me7kXLFK1vcesVeku3mdgRwqI=
616+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331/go.mod h1:UGZVg18zzyJ1KimGM5SSmxG5jb7aCSq3OwQQKfhHGyE=
617617
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882 h1:teDwTZ0GXlxQ65lgVbB44ffbIHlEh4N8wW7zav4lt9c=
618618
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882/go.mod h1:NVoJQoPYr6BorpaXTusoIH1IYTySCmanQ8Q1yv3mNh4=
619619
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250502210357-2df484128afa h1:WJNO3646oVvLQtPf+8YUoAOjBWg6XbGUctnOPLp4ZTE=

pkg/cmd/config-docs/main.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
import (
4+
"flag"
5+
"fmt"
6+
"log"
7+
"os"
8+
"path/filepath"
9+
10+
"github.com/smartcontractkit/chainlink-evm/pkg/config/toml"
11+
)
12+
13+
var outDir = flag.String("o", "", "output directory")
14+
15+
func main() {
16+
s, err := toml.GenerateDocs()
17+
if err != nil {
18+
log.Fatalln("Failed to generate docs:", err)
19+
}
20+
if err = os.WriteFile(filepath.Join(*outDir, "CONFIG.md"), []byte(s), 0600); err != nil {
21+
fmt.Fprintf(os.Stderr, "failed to write config docs: %v\n", err)
22+
os.Exit(1)
23+
}
24+
}

0 commit comments

Comments
 (0)