diff --git a/pkg/cannon/ethereum/beacon.go b/pkg/cannon/ethereum/beacon.go index 29d8c588..c8b6b215 100644 --- a/pkg/cannon/ethereum/beacon.go +++ b/pkg/cannon/ethereum/beacon.go @@ -42,8 +42,9 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus. opts.BeaconSubscription.Enabled = false node := beacon.NewNode(log, &beacon.Config{ - Name: name, - Addr: config.BeaconNodeAddress, + Name: name, + Addr: config.BeaconNodeAddress, + Headers: config.BeaconNodeHeaders, }, "xatu_cannon", opts) metadata := services.NewMetadataService(log, node) diff --git a/pkg/cannon/ethereum/config.go b/pkg/cannon/ethereum/config.go index c16f15b2..d583387e 100644 --- a/pkg/cannon/ethereum/config.go +++ b/pkg/cannon/ethereum/config.go @@ -16,6 +16,8 @@ type Config struct { BlockCacheSize uint64 `yaml:"blockCacheSize" default:"1000"` // BlockCacheTTL is the time to live for blocks in the cache. BlockCacheTTL human.Duration `yaml:"blockCacheTtl" default:"1h"` + // BeaconNodeHeaders is a map of headers to send to the beacon node. + BeaconNodeHeaders map[string]string `yaml:"beaconNodeHeaders"` } func (c *Config) Validate() error { diff --git a/pkg/sentry/ethereum/beacon.go b/pkg/sentry/ethereum/beacon.go index a2593321..345e9734 100644 --- a/pkg/sentry/ethereum/beacon.go +++ b/pkg/sentry/ethereum/beacon.go @@ -33,8 +33,9 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus. opts.HealthCheck.SuccessfulResponses = 1 node := beacon.NewNode(log, &beacon.Config{ - Name: name, - Addr: config.BeaconNodeAddress, + Name: name, + Addr: config.BeaconNodeAddress, + Headers: config.BeaconNodeHeaders, }, "xatu_sentry", opts) metadata := services.NewMetadataService(log, node) diff --git a/pkg/sentry/ethereum/config.go b/pkg/sentry/ethereum/config.go index ee6f3297..2a6b4134 100644 --- a/pkg/sentry/ethereum/config.go +++ b/pkg/sentry/ethereum/config.go @@ -8,6 +8,8 @@ type Config struct { // OverrideNetworkName is the name of the network to use for the sentry. // If not set, the network name will be retrieved from the beacon node. OverrideNetworkName string `yaml:"overrideNetworkName" default:""` + // BeaconNodeHeaders is a map of headers to send to the beacon node. + BeaconNodeHeaders map[string]string `yaml:"beaconNodeHeaders"` } func (c *Config) Validate() error {