Skip to content

Commit 562f283

Browse files
Set node platform build info beat to 3 minutes (#21777)
1 parent 2d8ca3c commit 562f283

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

core/services/chainlink/node_platform.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const (
1919
nodePlatformDomain = "node-platform"
2020
nodePlatformEntity = "common.v1.NodeBuildInfo"
2121
nodePlatformDataSchema = "/node-platform/common/v1"
22+
nodePlatformBeat = 3 * time.Minute
2223
)
2324

2425
type NodePlatformBuildInfoService struct {
@@ -58,7 +59,7 @@ func NewNodePlatformBuildInfoConfig(opts ApplicationOpts) NodePlatformBuildInfoC
5859
}
5960

6061
return NodePlatformBuildInfoConfig{
61-
Beat: opts.Config.Telemetry().HeartbeatInterval(),
62+
Beat: nodePlatformBeat,
6263
Lggr: opts.Logger,
6364
CSAKeyStore: opts.KeyStore.CSA(),
6465
CommitSHA: static.Sha,

core/services/chainlink/node_platform_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,35 @@ import (
1111
"github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey"
1212
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
1313
"github.com/smartcontractkit/chainlink-common/pkg/beholder/beholdertest"
14+
commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config"
1415
"github.com/smartcontractkit/chainlink-common/pkg/services/servicetest"
1516
commonv1 "github.com/smartcontractkit/chainlink-protos/node-platform/common/v1"
1617
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
18+
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"
1719
"github.com/smartcontractkit/chainlink/v2/core/logger"
1820
"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
1921
keystoremocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks"
2022
)
2123

24+
func TestNewNodePlatformBuildInfoConfig_UsesThreeMinuteBeat(t *testing.T) {
25+
csaStore := &keystoremocks.CSA{}
26+
keyStore := &keystoremocks.Master{}
27+
keyStore.EXPECT().CSA().Return(csaStore).Once()
28+
29+
cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, _ *chainlink.Secrets) {
30+
c.Telemetry.HeartbeatInterval = commoncfg.MustNewDuration(5 * time.Second)
31+
})
32+
33+
buildInfoCfg := chainlink.NewNodePlatformBuildInfoConfig(chainlink.ApplicationOpts{
34+
Config: cfg,
35+
Logger: logger.TestLogger(t),
36+
KeyStore: keyStore,
37+
})
38+
39+
require.Equal(t, 3*time.Minute, buildInfoCfg.Beat)
40+
require.Same(t, csaStore, buildInfoCfg.CSAKeyStore)
41+
}
42+
2243
func TestNodePlatformBuildInfo_EmitsNodeBuildInfo(t *testing.T) {
2344
obs := beholdertest.NewObserver(t)
2445

0 commit comments

Comments
 (0)