Skip to content

Commit

Permalink
move the core components of the ocr2 monitoring into chainlink-relay
Browse files Browse the repository at this point in the history
  • Loading branch information
topliceanu committed Jan 26, 2022
1 parent 693540f commit 326666e
Show file tree
Hide file tree
Showing 40 changed files with 264 additions and 3,867 deletions.
20 changes: 17 additions & 3 deletions cmd/monitoring/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"

relayMonitoring "github.com/smartcontractkit/chainlink-relay/pkg/monitoring"
"github.com/smartcontractkit/chainlink-solana/pkg/monitoring"
"github.com/smartcontractkit/chainlink/core/logger"
"go.uber.org/zap/zapcore"
Expand All @@ -11,16 +12,17 @@ import (
func main() {
ctx := context.Background()

log := logger.NewLogger(loggerConfig{})
coreLog := logger.NewLogger(loggerConfig{})
log := logWrapper{coreLog}

solanaConfig, err := monitoring.ParseSolanaConfig()
if err != nil {
log.Fatalw("failed to parse solana specific configuration", "error", err)
}

solanaSourceFactory := monitoring.NewSolanaSourceFactory(log.With("component", "source"))
solanaSourceFactory := monitoring.NewSolanaSourceFactory(logWrapper{coreLog.With("component", "source")})

monitoring.Facade(
relayMonitoring.Facade(
ctx,
log,
solanaConfig,
Expand Down Expand Up @@ -56,3 +58,15 @@ func (l loggerConfig) LogLevel() zapcore.Level {
func (l loggerConfig) LogUnixTimestamps() bool {
return false // log timestamp in ISO8601
}

type logWrapper struct {
logger.Logger
}

func (l logWrapper) Criticalw(format string, values ...interface{}) {
l.Logger.CriticalW(format, values...)
}

func (l logWrapper) With(values ...interface{}) relayMonitoring.Logger {
return logWrapper{l.Logger.With(values...)}
}
98 changes: 0 additions & 98 deletions pkg/monitoring/avro/types.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/monitoring/chain_config.go

This file was deleted.

4 changes: 3 additions & 1 deletion pkg/monitoring/solana_config.go → pkg/monitoring/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"net/url"
"os"
"time"

relayMonitoring "github.com/smartcontractkit/chainlink-relay/pkg/monitoring"
)

type SolanaConfig struct {
Expand All @@ -16,7 +18,7 @@ type SolanaConfig struct {
PollInterval time.Duration
}

var _ ChainConfig = SolanaConfig{}
var _ relayMonitoring.ChainConfig = SolanaConfig{}

func (s SolanaConfig) GetRPCEndpoint() string { return s.RPCEndpoint }
func (s SolanaConfig) GetNetworkName() string { return s.NetworkName }
Expand Down
142 changes: 0 additions & 142 deletions pkg/monitoring/config/parse.go

This file was deleted.

51 changes: 0 additions & 51 deletions pkg/monitoring/config/types.go

This file was deleted.

12 changes: 0 additions & 12 deletions pkg/monitoring/exporter.go

This file was deleted.

Loading

0 comments on commit 326666e

Please sign in to comment.