6 "github.com/spf13/cobra"
8 "github.com/bytom/types"
9 cmn "github.com/tendermint/tmlibs/common"
12 var initFilesCmd = &cobra.Command {
14 Short: "Initialize blockchain",
19 RootCmd.AddCommand(initFilesCmd)
22 func initFiles(cmd *cobra.Command, args []string) {
23 genFile := config.GenesisFile()
25 if _, err := os.Stat(genFile); os.IsNotExist(err) {
26 genDoc := types.GenesisDoc{
27 ChainID: cmn.Fmt("bytom"),
30 genDoc.SaveAs(genFile)
33 logger.Info("Initialized bytom", "genesis", config.GenesisFile())