Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "run", Short: "Runs the EVM Gateway Node", RunE: func(command *cobra.Command, _ []string) error { ctx, cancel := context.WithCancel(command.Context()) defer cancel() if _, exists := os.LookupEnv("MULTIKEY_MODE"); exists { bootstrap.RunCreateMultiKeyAccount() return nil } if err := parseConfigFromFlags(); err != nil { return fmt.Errorf("failed to parse flags: %w", err) } done := make(chan struct{}) ready := make(chan struct{}) once := sync.Once{} closeReady := func() { once.Do(func() { close(ready) }) } go func() { defer close(done) defer closeReady() err := bootstrap.Run( ctx, cfg, closeReady, ) if err != nil && !errors.Is(err, context.Canceled) { log.Err(err).Msg("Gateway runtime error") } }() <-ready osSig := make(chan os.Signal, 1) signal.Notify(osSig, syscall.SIGINT, syscall.SIGTERM) select { case <-osSig: log.Info().Msg("OS Signal to shutdown received, shutting down") cancel() case <-done: log.Info().Msg("done, shutting down") } <-done return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.