mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 23:02:16 +00:00
cmd: dont wait for genesis. closes #562
This commit is contained in:
parent
399fb9aa70
commit
aa78fc14b5
@ -2,13 +2,11 @@ package commands
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/node"
|
"github.com/tendermint/tendermint/node"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var runNodeCmd = &cobra.Command{
|
var runNodeCmd = &cobra.Command{
|
||||||
@ -58,16 +56,7 @@ func AddNodeFlags(cmd *cobra.Command) {
|
|||||||
// with their custom priv validator and/or custom proxy.ClientCreator
|
// with their custom priv validator and/or custom proxy.ClientCreator
|
||||||
func runNode(cmd *cobra.Command, args []string) error {
|
func runNode(cmd *cobra.Command, args []string) error {
|
||||||
|
|
||||||
// Wait until the genesis doc becomes available
|
|
||||||
// This is for Mintnet compatibility.
|
|
||||||
// TODO: If Mintnet gets deprecated or genesis_file is
|
|
||||||
// always available, remove.
|
|
||||||
genDocFile := config.GenesisFile()
|
genDocFile := config.GenesisFile()
|
||||||
for !cmn.FileExists(genDocFile) {
|
|
||||||
logger.Info(cmn.Fmt("Waiting for genesis file %v...", genDocFile))
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
}
|
|
||||||
|
|
||||||
genDoc, err := types.GenesisDocFromFile(genDocFile)
|
genDoc, err := types.GenesisDocFromFile(genDocFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user