Skip to content

Commit

Permalink
Merge pull request #60 from ethpandaops/feat/cleanup-consensus
Browse files Browse the repository at this point in the history
feat(consensus): Remove eth2client
  • Loading branch information
samcm authored Dec 14, 2022
2 parents 9e43355 + 77e82cb commit 25b0778
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ module github.com/ethpandaops/ethereum-metrics-exporter
go 1.17

require (
github.com/attestantio/go-eth2-client v0.14.5
github.com/ethereum/go-ethereum v1.10.17
github.com/onrik/ethrpc v1.0.0
github.com/prometheus/client_golang v1.13.0
github.com/rs/zerolog v1.27.0
github.com/samcm/beacon v0.12.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.4.0
Expand All @@ -16,6 +14,7 @@ require (

require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/attestantio/go-eth2-client v0.14.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand Down Expand Up @@ -50,6 +49,7 @@ require (
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 // indirect
github.com/r3labs/sse/v2 v2.7.4 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rs/zerolog v1.27.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand Down
17 changes: 0 additions & 17 deletions pkg/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import (
"strings"
"time"

eth2client "github.com/attestantio/go-eth2-client"
ehttp "github.com/attestantio/go-eth2-client/http"
"github.com/ethpandaops/ethereum-metrics-exporter/pkg/exporter/disk"
"github.com/ethpandaops/ethereum-metrics-exporter/pkg/exporter/execution"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/zerolog"
"github.com/samcm/beacon"
"github.com/samcm/beacon/api"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -49,8 +45,6 @@ type exporter struct {

// Clients
beacon beacon.Node
client eth2client.Service
api api.ConsensusClient
}

func (e *exporter) Init(ctx context.Context) error {
Expand Down Expand Up @@ -137,17 +131,6 @@ func (e *exporter) Serve(ctx context.Context, port int) error {
}

func (e *exporter) bootstrapConsensusClients(ctx context.Context) error {
client, err := ehttp.New(ctx,
ehttp.WithAddress(e.config.Consensus.URL),
ehttp.WithLogLevel(zerolog.Disabled),
)
if err != nil {
return err
}

e.client = client
e.api = api.NewConsensusClient(ctx, e.log, e.config.Consensus.URL, *http.DefaultClient)

opts := *beacon.DefaultOptions().
EnableDefaultBeaconSubscription().
EnablePrometheusMetrics().
Expand Down

0 comments on commit 25b0778

Please sign in to comment.