func handleSignals(listeners []context.CancelFunc) {
	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
	go func() {
		sig := <-sigs
		color.Red("received signal", "signal", sig)
		SignalReceived = true
		for _, listener := range listeners {
			listener()
		}
	}()
}
handleSignals handles OS signals so we can ensure we close database
correctly. We call multiple sigListeners because we
may need to cancel more than 1 context.
package cmd
import (
	"context"
	"os"
	"os/signal"
	"syscall"
	"github.com/fatih/color"
	"github.com/spf13/cobra"
)
var (
	rootCmd = &cobra.Command{
		Use:   "rosetta-ethereum",
		Short: "Ethereum implementation of the Rosetta API",
	}
	SignalReceived = false
)
func Execute() error {
	return rootCmd.Execute()
}
func init() {
	rootCmd.AddCommand(runCmd)
	rootCmd.AddCommand(utilsBootstrapCmd)
}