Skip to content

Commit

Permalink
chore(monitor): remove emitcache (#2159)
Browse files Browse the repository at this point in the history
Removes `emitcache` from `monitor` since we now use arhive xchain RPC
providers.

issue: #2104
  • Loading branch information
corverroos authored Oct 14, 2024
1 parent 4b2464e commit af07856
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 997 deletions.
27 changes: 1 addition & 26 deletions monitor/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/omni-network/omni/contracts/bindings"
"github.com/omni-network/omni/halo/genutil/evm/predeploys"
"github.com/omni-network/omni/lib/buildinfo"
"github.com/omni-network/omni/lib/cchain"
cprovider "github.com/omni-network/omni/lib/cchain/provider"
"github.com/omni-network/omni/lib/errors"
"github.com/omni-network/omni/lib/ethclient"
Expand Down Expand Up @@ -91,7 +90,7 @@ func Run(ctx context.Context, cfg Config) error {
return errors.Wrap(err, "start AVS sync")
}

if err := startXMonitor(ctx, cfg, network, ethClients, cprov, xprov); err != nil {
if err := xmonitor.Start(ctx, network, xprov, cprov, ethClients); err != nil {
return errors.Wrap(err, "start xchain monitor")
}

Expand Down Expand Up @@ -140,30 +139,6 @@ func startIndexer(
return indexer.Start(ctx, network, xprov, db)
}

// startXMonitor starts the xchain offset/head monitoring.
func startXMonitor(
ctx context.Context,
cfg Config,
network netconf.Network,
ethClients map[uint64]ethclient.Client,
cprov cchain.Provider,
xprov xchain.Provider,
) error {
var db dbm.DB
if cfg.DBDir == "" {
log.Warn(ctx, "No --db-dir provided, using in-memory DB", nil)
db = dbm.NewMemDB()
} else {
var err error
db, err = dbm.NewGoLevelDB("emitcache", cfg.DBDir, nil)
if err != nil {
return errors.Wrap(err, "new golevel db")
}
}

return xmonitor.Start(ctx, network, xprov, cprov, ethClients, db)
}

// serveMonitoring starts a goroutine that serves the monitoring API. It
// returns a channel that will receive an error if the server fails to start.
func serveMonitoring(address string) <-chan error {
Expand Down
220 changes: 0 additions & 220 deletions monitor/xmonitor/emitcache/emitcursor.cosmos_orm.go

This file was deleted.

Loading

0 comments on commit af07856

Please sign in to comment.