Skip to content

Commit

Permalink
chore(solver): disable on mainnet (#3058)
Browse files Browse the repository at this point in the history
Disable solver on mainnet.

issue: none
  • Loading branch information
kevinhalliday authored Feb 13, 2025
1 parent 3b7e54f commit f72fa40
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion solver/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,29 @@ func chainVerFromID(id uint64) xchain.ChainVersion {

// Run starts the solver service.
func Run(ctx context.Context, cfg Config) error {
log.Info(ctx, "Starting solver v2 service")
log.Info(ctx, "Starting solver service")

buildinfo.Instrument(ctx)

// Start monitoring first, so app is "up"
monitorChan := serveMonitoring(cfg.MonitoringAddr)

// if mainnet, just run monitoring and api (/live only)
if cfg.Network == netconf.Mainnet {
log.Info(ctx, "Serving API", "address", cfg.APIAddr)
apiChan := serveAPI(cfg.APIAddr, map[string]http.Handler{})

select {
case <-ctx.Done():
log.Info(ctx, "Shutdown detected, stopping...")
return nil
case err := <-monitorChan:
return err
case err := <-apiChan:
return err
}
}

portalReg, err := makePortalRegistry(cfg.Network, cfg.RPCEndpoints)
if err != nil {
return err
Expand Down

0 comments on commit f72fa40

Please sign in to comment.