run

package
v0.37.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "run",
	Short: "Runs the EVM Gateway Node",
	Run: func(*cobra.Command, []string) {

		if _, exists := os.LookupEnv("MULTIKEY_MODE"); exists {
			bootstrap.RunCreateMultiKeyAccount()
			return
		}

		if err := parseConfigFromFlags(); err != nil {
			log.Err(err).Msg("failed to parse flags")
			os.Exit(1)
		}

		ctx, cancel := context.WithCancel(context.Background())
		ready := make(chan struct{})
		go func() {
			if err := bootstrap.Run(ctx, cfg, ready); err != nil {
				log.Err(err).Msg("failed to run bootstrap")
				cancel()
				os.Exit(1)
			}
		}()

		<-ready

		osSig := make(chan os.Signal, 1)
		signal.Notify(osSig, syscall.SIGINT, syscall.SIGTERM)

		<-osSig
		log.Info().Msg("OS Signal to shutdown received, shutting down")
		cancel()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL