Skip to content

Commit

Permalink
release: Sage fixes (#255)
Browse files Browse the repository at this point in the history
* fix: Add client name to sage events

* fix: Use correct ethereum package
  • Loading branch information
samcm authored Dec 8, 2023
1 parent fde9494 commit 1927247
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions example_sage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ logging: "debug" # panic,fatal,warn,info,debug,trace
metricsAddr: ":9095"
pprofAddr: ":6065" # optional. if supplied it enables pprof server

name: example-instance

armiarmaUrl: http://localhost:9099/events

# workers is the number of workers to use for processing events.
Expand Down
2 changes: 2 additions & 0 deletions pkg/sage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type Config struct {
PProfAddr *string `yaml:"pprofAddr"`
// MetricsAddr is the address to server prometheus metrics on.
MetricsAddr string `yaml:"metricsAddr" default:":9093"`
// Name is the name of the service.
Name string `yaml:"name" default:"xatu-sage"`
// Outputs configuration
Outputs []output.Config `yaml:"outputs"`
// ArmiarmaURL configuration
Expand Down
4 changes: 2 additions & 2 deletions pkg/sage/ethereum/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/ethpandaops/beacon/pkg/beacon"
"github.com/ethpandaops/xatu/pkg/sentry/ethereum/services"
"github.com/ethpandaops/xatu/pkg/sage/ethereum/services"
"github.com/go-co-op/gocron"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -40,7 +40,7 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus.
Headers: config.BeaconNodeHeaders,
}, "xatu_sentry", opts)

metadata := services.NewMetadataService(log, node)
metadata := services.NewMetadataService(log, node, config.OverrideNetworkName)
duties := services.NewDutiesService(log, node, &metadata)

svcs := []services.Service{
Expand Down
7 changes: 7 additions & 0 deletions pkg/sage/ethereum/services/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ func (m *MetadataService) Start(ctx context.Context) error {
return err
}

m.log.WithFields(logrus.Fields{
"genesis_time": m.Genesis.GenesisTime,
"network": m.Network.Name,
"deposit_chain_id": m.Spec.DepositChainID,
"config_name": m.Spec.ConfigName,
}).Info("Metadata is ready")

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sage/sage.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (a *Sage) createNewClientMeta(ctx context.Context) (*xatu.ClientMeta, error
}

return &xatu.ClientMeta{
Name: "sage",
Name: a.config.Name,
Version: xatu.Short(),
Id: a.id.String(),
Implementation: xatu.Implementation,
Expand Down

0 comments on commit 1927247

Please sign in to comment.