[cmd] Turn off strict routability when using testnet cmd (#1493)

* [cmd] Turn off strict routability when using testnet cmd

Refs https://github.com/tendermint/tendermint/pull/1454

* use "testnet" instead of "it"
This commit is contained in:
Anton Kaliaev 2018-04-26 16:52:11 +02:00 committed by GitHub
parent 63f8c58009
commit 0d9004a854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,18 @@ func init() {
var TestnetFilesCmd = &cobra.Command{ var TestnetFilesCmd = &cobra.Command{
Use: "testnet", Use: "testnet",
Short: "Initialize files for a Tendermint testnet", Short: "Initialize files for a Tendermint testnet",
RunE: testnetFiles, Long: `testnet will create "v" + "n" number of directories and populate each with
necessary files (private validator, genesis, config, etc.).
Note, strict routability for addresses is turned off in the config file.
Optionally, it will fill in persistent_peers list in config file using either hostnames or IPs.
Example:
tendermint testnet --v 4 --o ./output --populate-persistent-peers --starting-ip-address 192.168.10.2
`,
RunE: testnetFiles,
} }
func testnetFiles(cmd *cobra.Command, args []string) error { func testnetFiles(cmd *cobra.Command, args []string) error {
@ -162,6 +173,7 @@ func populatePersistentPeersInConfigAndWriteIt(config *cfg.Config) error {
nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i)) nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i))
config.SetRoot(nodeDir) config.SetRoot(nodeDir)
config.P2P.PersistentPeers = persistentPeersList config.P2P.PersistentPeers = persistentPeersList
config.P2P.AddrBookStrict = false
// overwrite default config // overwrite default config
cfg.WriteConfigFile(filepath.Join(nodeDir, "config", "config.toml"), config) cfg.WriteConfigFile(filepath.Join(nodeDir, "config", "config.toml"), config)