Browse Source

tendermint init

pull/171/head
Ethan Buchman 9 years ago
parent
commit
5cbb5d2541
3 changed files with 27 additions and 2 deletions
  1. +23
    -0
      cmd/tendermint/init.go
  2. +2
    -0
      cmd/tendermint/main.go
  3. +2
    -2
      config/tendermint/config.go

+ 23
- 0
cmd/tendermint/init.go View File

@ -0,0 +1,23 @@
package main
import (
"github.com/tendermint/tendermint/types"
)
func init_files() {
privValidator := types.GenPrivValidator()
privValidator.SetFile(config.GetString("priv_validator_file"))
privValidator.Save()
//TODO: chainID
genDoc := types.GenesisDoc{
ChainID: "hi",
}
genDoc.Validators = []types.GenesisValidator{types.GenesisValidator{
PubKey: privValidator.PubKey,
Amount: 10000,
}}
genDoc.SaveAs(config.GetString("genesis_file"))
}

+ 2
- 0
cmd/tendermint/main.go View File

@ -34,6 +34,8 @@ Commands:
switch args[0] {
case "node":
node.RunNode()
case "init":
init_files()
case "show_validator":
show_validator()
case "gen_validator":


+ 2
- 2
config/tendermint/config.go View File

@ -56,7 +56,7 @@ func GetConfig(rootDir string) cfg.Config {
mapConfig.SetDefault("moniker", "anonymous")
mapConfig.SetDefault("node_laddr", "0.0.0.0:46656")
// mapConfig.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
mapConfig.SetDefault("fast_sync", true)
mapConfig.SetDefault("fast_sync", false)
mapConfig.SetDefault("skip_upnp", false)
mapConfig.SetDefault("addrbook_file", rootDir+"/addrbook.json")
mapConfig.SetDefault("priv_validator_file", rootDir+"/priv_validator.json")
@ -77,7 +77,7 @@ proxy_app = "tcp://127.0.0.1:46658"
moniker = "__MONIKER__"
node_laddr = "0.0.0.0:46656"
seeds = ""
fast_sync = true
fast_sync = false
db_backend = "leveldb"
log_level = "notice"
rpc_laddr = "0.0.0.0:46657"


Loading…
Cancel
Save