Browse Source

do not use mask in testnet cmd (#1451)

fix node ids
pull/1454/head
Anton Kaliaev 7 years ago
committed by GitHub
parent
commit
1db2224241
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      cmd/tendermint/commands/testnet.go

+ 3
- 2
cmd/tendermint/commands/testnet.go View File

@ -136,8 +136,7 @@ func hostnameOrIP(i int) string {
os.Exit(1) os.Exit(1)
} }
ip = ip.Mask(ip.DefaultMask())
for j := 0; j <= i; j++ {
for j := 0; j < i; j++ {
ip[3]++ ip[3]++
} }
return ip.String() return ip.String()
@ -149,6 +148,8 @@ func hostnameOrIP(i int) string {
func populatePersistentPeersInConfigAndWriteIt(config *cfg.Config) error { func populatePersistentPeersInConfigAndWriteIt(config *cfg.Config) error {
persistentPeers := make([]string, nValidators+nNonValidators) persistentPeers := make([]string, nValidators+nNonValidators)
for i := 0; i < nValidators+nNonValidators; i++ { for i := 0; i < nValidators+nNonValidators; i++ {
nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i))
config.SetRoot(nodeDir)
nodeKey, err := p2p.LoadNodeKey(config.NodeKeyFile()) nodeKey, err := p2p.LoadNodeKey(config.NodeKeyFile())
if err != nil { if err != nil {
return err return err


Loading…
Cancel
Save