6 cmn "github.com/tendermint/tmlibs/common"
9 /****** these are for production settings ***********/
10 func EnsureRoot(rootDir string, network string) {
11 cmn.EnsureDir(rootDir, 0700)
12 cmn.EnsureDir(rootDir+"/data", 0700)
14 configFilePath := path.Join(rootDir, "config.toml")
16 // Write default config file if missing.
17 if !cmn.FileExists(configFilePath) {
18 cmn.MustWriteFile(configFilePath, []byte(selectNetwork(network)), 0644)
22 var defaultConfigTmpl = `# This is a TOML config file.
23 # For more information, see https://github.com/toml-lang/toml
25 db_backend = "leveldb"
26 api_addr = "0.0.0.0:9888"
30 var mainNetConfigTmpl = `chain_id = "mainnet"
32 laddr = "tcp://0.0.0.0:46657"
33 seeds = "45.79.213.28:46657,198.74.61.131:46657,212.111.41.245:46657,47.100.214.154:46657,47.100.109.199:46657,47.100.105.165:46657"
36 var testNetConfigTmpl = `chain_id = "wisdom"
38 laddr = "tcp://0.0.0.0:46656"
39 seeds = "52.83.107.224:46656,52.83.251.197:46656"
42 var soloNetConfigTmpl = `chain_id = "solonet"
44 laddr = "tcp://0.0.0.0:46658"
48 var vaporNetConfigTmpl = `chain_id = "vapor"
50 laddr = "tcp://0.0.0.0:56659"
54 // Select network seeds to merge a new string.
55 func selectNetwork(network string) string {
58 return defaultConfigTmpl + mainNetConfigTmpl
60 return defaultConfigTmpl + testNetConfigTmpl
62 return defaultConfigTmpl + vaporNetConfigTmpl
64 return defaultConfigTmpl + soloNetConfigTmpl