Skip to content

Commit

Permalink
fix: disallow the standalone rpc from running db migrations (#207)
Browse files Browse the repository at this point in the history
The standalone RPC server requires a "primary" Sidecar instance. That
primary Sidecar is responsible, not only for indexing data, but also
applying any migrations on startup
  • Loading branch information
seanmcgary authored Jan 29, 2025
2 parents 87ee26d + 268e215 commit 587936a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cmd/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/Layr-Labs/sidecar/internal/logger"
"github.com/Layr-Labs/sidecar/internal/metrics"
"github.com/Layr-Labs/sidecar/pkg/eigenState/stateManager"
"github.com/Layr-Labs/sidecar/pkg/postgres/migrations"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -79,11 +78,6 @@ var rpcCmd = &cobra.Command{
l.Fatal("Failed to create gorm instance", zap.Error(err))
}

migrator := migrations.NewMigrator(pg.Db, grm, l, cfg)
if err = migrator.MigrateAll(); err != nil {
l.Fatal("Failed to migrate", zap.Error(err))
}

contractStore := postgresContractStore.NewPostgresContractStore(grm, l, cfg)
if err := contractStore.InitializeCoreContracts(); err != nil {
log.Fatalf("Failed to initialize core contracts: %v", err)
Expand Down

0 comments on commit 587936a

Please sign in to comment.