Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sage): Client name #277

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading