basecoind init --testnet (closes #718)

This commit is contained in:
Christopher Goes
2018-03-29 12:04:52 +02:00
parent 2e5943e1bf
commit 27d24610ab
4 changed files with 69 additions and 15 deletions
+4 -6
View File
@@ -10,6 +10,7 @@ import (
abci "github.com/tendermint/abci/types"
"github.com/tendermint/tmlibs/cli"
cmn "github.com/tendermint/tmlibs/common"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
@@ -28,14 +29,11 @@ var (
// defaultOptions sets up the app_options for the
// default genesis file
func defaultOptions(args []string) (json.RawMessage, error) {
func defaultOptions(args []string) (json.RawMessage, string, cmn.HexBytes, error) {
addr, secret, err := server.GenerateCoinKey()
if err != nil {
return nil, err
return nil, "", nil, err
}
fmt.Println("Secret phrase to access coins:")
fmt.Println(secret)
opts := fmt.Sprintf(`{
"accounts": [{
"address": "%s",
@@ -47,7 +45,7 @@ func defaultOptions(args []string) (json.RawMessage, error) {
]
}]
}`, addr)
return json.RawMessage(opts), nil
return json.RawMessage(opts), secret, addr, nil
}
func generateApp(rootDir string, logger log.Logger) (abci.Application, error) {