Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StartNodeCmd = &cobra.Command{ Use: "start-node", Short: "Starts an instance of SSV node", Run: func(cmd *cobra.Command, args []string) { if globalArgs.ConfigPath != "" { if err := cleanenv.ReadConfig(globalArgs.ConfigPath, &cfg); err != nil { log.Fatal("Error reading config file", err) } } else { log.Fatal("Config path is required") } logger, err := logger.Create(globalArgs.LogLevel) if err != nil { fmt.Println("Error initializing logger") } defer logger.Sync() boltDb, err := db.NewBoltDB(cfg.DbPath) if err != nil { logger.Fatal("Error connecting to database", zap.Error(err)) return } defer boltDb.Close() geoDb, err := geodata.NewGeoIP2DB(cfg.GeoDataDbPath) if err != nil { logger.Fatal("Error connecting to geo database", zap.Error(err)) return } defer geoDb.Close() events, err := eth.NewEthEvents(cmd.Context(), &cfg.EventsConfig, boltDb, logger) if err != nil { logger.Fatal("Error connecting to eth events", zap.Error(err)) return } err = events.Start() if err != nil { logger.Fatal("Error starting eth events", zap.Error(err)) return } err = events.FetchAddedOperatorEvents() if err != nil { logger.Fatal("Error fetching added operator events", zap.Error(err)) return } err = events.ListenAddedOperatorEvents() if err != nil { logger.Fatal("Error fetching added operator events", zap.Error(err)) return } forkVersion := forksprotocol.GenesisForkVersion cfg.P2pNetworkConfig.Ctx = cmd.Context() _, operatorPublicKey, err := keys.GenerateKeys() if err != nil { logger.Fatal("failed to generate operator keys", zap.Error(err)) } p2pNetwork := setupP2P(forkVersion, operatorPublicKey, boltDb, geoDb, logger) if err := p2pNetwork.Setup(); err != nil { logger.Fatal("failed to setup network", zap.Error(err)) } if err := p2pNetwork.Start(); err != nil { logger.Fatal("failed to start network", zap.Error(err)) } api := api.New(logger, boltDb) api.Start() }, }
StartNodeCmd is the command to start SSV tracker
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.