Skip to content

Commit

Permalink
feat(beacon): Pass through headers to beacon package
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Sep 6, 2023
1 parent c360c77 commit fc191ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/cannon/ethereum/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus.
node := beacon.NewNode(log, &beacon.Config{
Name: name,
Addr: config.BeaconNodeAddress,
Headers: config.Headers,
Headers: config.BeaconNodeHeaders,
}, "xatu_cannon", opts)

metadata := services.NewMetadataService(log, node)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cannon/ethereum/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +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"`
// Headers is a map of headers to send to the beacon node.
Headers map[string]string `yaml:"headers"`
// BeaconNodeHeaders is a map of headers to send to the beacon node.
BeaconNodeHeaders map[string]string `yaml:"beaconNodeHeaders"`
}

func (c *Config) Validate() error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/ethereum/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus.
node := beacon.NewNode(log, &beacon.Config{
Name: name,
Addr: config.BeaconNodeAddress,
Headers: config.Headers,
Headers: config.BeaconNodeHeaders,
}, "xatu_sentry", opts)

metadata := services.NewMetadataService(log, node)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sentry/ethereum/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +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:""`
// Headers is a map of headers to send to the beacon node.
Headers map[string]string `yaml:"headers"`
// BeaconNodeHeaders is a map of headers to send to the beacon node.
BeaconNodeHeaders map[string]string `yaml:"beaconNodeHeaders"`
}

func (c *Config) Validate() error {
Expand Down

0 comments on commit fc191ea

Please sign in to comment.