Skip to content

Commit

Permalink
start mev indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Aug 23, 2024
1 parent ce4ddc8 commit 233c112
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions services/chainservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ import (
"github.com/ethpandaops/dora/dbtypes"
"github.com/ethpandaops/dora/indexer/beacon"
execindexer "github.com/ethpandaops/dora/indexer/execution"
"github.com/ethpandaops/dora/indexer/mevrelay"
"github.com/ethpandaops/dora/utils"
"github.com/sirupsen/logrus"
)

type ChainService struct {
logger logrus.FieldLogger
consensusPool *consensus.Pool
executionPool *execution.Pool
beaconIndexer *beacon.Indexer
validatorNames *ValidatorNames
started bool
logger logrus.FieldLogger
consensusPool *consensus.Pool
executionPool *execution.Pool
beaconIndexer *beacon.Indexer
validatorNames *ValidatorNames
mevRelayIndexer *mevrelay.MevIndexer
started bool
}

var GlobalBeaconService *ChainService
Expand All @@ -43,14 +45,17 @@ func InitChainService(ctx context.Context, logger logrus.FieldLogger) {
consensusPool := consensus.NewPool(ctx, logger.WithField("service", "cl-pool"))
executionPool := execution.NewPool(ctx, logger.WithField("service", "el-pool"))
beaconIndexer := beacon.NewIndexer(logger.WithField("service", "cl-indexer"), consensusPool)
validatorNames := NewValidatorNames(beaconIndexer, consensusPool.GetChainState())
chainState := consensusPool.GetChainState()
validatorNames := NewValidatorNames(beaconIndexer, chainState)
mevRelayIndexer := mevrelay.NewMevIndexer(logger.WithField("service", "mev-relay"), beaconIndexer, chainState)

GlobalBeaconService = &ChainService{
logger: logger,
consensusPool: consensusPool,
executionPool: executionPool,
beaconIndexer: beaconIndexer,
validatorNames: validatorNames,
logger: logger,
consensusPool: consensusPool,
executionPool: executionPool,
beaconIndexer: beaconIndexer,
validatorNames: validatorNames,
mevRelayIndexer: mevRelayIndexer,
}
}

Expand Down Expand Up @@ -176,6 +181,9 @@ func (cs *ChainService) StartService() error {
// add execution indexers
execindexer.NewDepositIndexer(executionIndexerCtx)

// start MEV relay indexer
cs.mevRelayIndexer.StartUpdater()

return nil
}

Expand Down

0 comments on commit 233c112

Please sign in to comment.