Skip to content

Commit

Permalink
fix: Use WS client for event subscriptions (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyodar authored Apr 18, 2024
1 parent aa68e8e commit d2894d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ func NewAggregator(ctx context.Context, config *config.Config, logger logging.Lo
return nil, err
}

ethWsClient, err := eth.NewClient(config.EthWsRpcUrl)
if err != nil {
logger.Errorf("Cannot create ws ethclient", "err", err)
return nil, err
}

avsReader, err := chainio.BuildAvsReaderFromConfig(config, ethHttpClient, logger)
if err != nil {
logger.Error("Cannot create avsReader", "err", err)
Expand Down Expand Up @@ -135,7 +141,7 @@ func NewAggregator(ctx context.Context, config *config.Config, logger logging.Lo
return nil, err
}

avsSubscriber, err := chainio.BuildAvsSubscriber(config.SFFLRegistryCoordinatorAddr, config.OperatorStateRetrieverAddr, ethHttpClient, logger)
avsSubscriber, err := chainio.BuildAvsSubscriber(config.SFFLRegistryCoordinatorAddr, config.OperatorStateRetrieverAddr, ethWsClient, logger)
if err != nil {
logger.Error("Cannot create AvsSubscriber", "err", err)
return nil, err
Expand Down

0 comments on commit d2894d2

Please sign in to comment.