OSDN Git Service

Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git] / cmd / vapor / commands / init.go
diff --git a/cmd/vapor/commands/init.go b/cmd/vapor/commands/init.go
deleted file mode 100644 (file)
index 0463b9b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package commands
-
-import (
-       "os"
-       "path"
-
-       log "github.com/sirupsen/logrus"
-       "github.com/spf13/cobra"
-
-       cfg "github.com/vapor/config"
-)
-
-var initFilesCmd = &cobra.Command{
-       Use:   "init",
-       Short: "Initialize blockchain",
-       Run:   initFiles,
-}
-
-func init() {
-       initFilesCmd.Flags().String("chain_id", config.ChainID, "Select [mainnet] or [testnet] or [solonet]")
-
-       RootCmd.AddCommand(initFilesCmd)
-}
-
-func initFiles(cmd *cobra.Command, args []string) {
-       configFilePath := path.Join(config.RootDir, "config.toml")
-       if _, err := os.Stat(configFilePath); !os.IsNotExist(err) {
-               log.WithField("config", configFilePath).Info("Already exists config file.")
-               return
-       }
-
-       switch config.ChainID {
-       case "mainnet", "testnet":
-               cfg.EnsureRoot(config.RootDir, config.ChainID)
-       default:
-               cfg.EnsureRoot(config.RootDir, "solonet")
-       }
-
-       log.WithField("config", configFilePath).Info("Initialized bytom")
-}