Skip to content

Commit 88015c5

Browse files
committed
pkg/config: config enhancements
1 parent 16bf64f commit 88015c5

File tree

11 files changed

+2336
-14
lines changed

11 files changed

+2336
-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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/prometheus/client_model v0.6.1
2020
github.com/prometheus/common v0.63.0
2121
github.com/shopspring/decimal v1.4.0
22-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250429205337-7ee5f91ed065
22+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250430133340-d04a3b64e331
2323
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882
2424
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250421203809-e0f5602c126c
2525
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250421203809-e0f5602c126c

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-20250421203809-e0f5602c126c h1:LYnQDyMoqj0R38IlsCCjPDuQMVW4AUbw4manX+56WC4=

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)