func (app *BaseApp) Initialize(cmd *cobra.Command) {
	signalChan := make(chan os.Signal, 1)
	signal.Notify(signalChan, os.Interrupt)
	go func() {
		for range signalChan {
			log.Info("Received an interrupt, stopping services...\n")
			Cancel()
		}
	}()
	conf, err := parseConfig()
	if err != nil {
		log.Panic("Panic: ", err.Error())
	}
	app.Config = conf
	EnsureCLIFlags(cmd, app.Config)
	setupLogging(app.Config)
}
Initialize loads config, sets logger  and listens to Ctrl ^C
package cmd
import (
	"context"
	"fmt"
	"os"
	"os/signal"
	"reflect"
	bc "github.com/libonomy/libonomy-p2p/config"
	"github.com/libonomy/libonomy-p2p/filesystem"
	"github.com/libonomy/libonomy-p2p/log"
	"github.com/spf13/cobra"
	"github.com/spf13/pflag"
	"github.com/spf13/viper"
)
var (
	Version string
	Branch string
	Commit string
	Ctx, cancel = context.WithCancel(context.Background())
	Cancel = cancel
)
type BaseApp struct {
	Config *bc.Config
}
func NewBaseApp() *BaseApp {
	dc := bc.DefaultConfig()
	return &BaseApp{Config: &dc}
}