|
@ -11,9 +11,9 @@ import ( |
|
|
"github.com/tendermint/tendermint/libs/log" |
|
|
"github.com/tendermint/tendermint/libs/log" |
|
|
|
|
|
|
|
|
abci "github.com/tendermint/tendermint/abci/types" |
|
|
abci "github.com/tendermint/tendermint/abci/types" |
|
|
cmn "github.com/tendermint/tendermint/libs/common" |
|
|
|
|
|
|
|
|
|
|
|
cfg "github.com/tendermint/tendermint/config" |
|
|
cfg "github.com/tendermint/tendermint/config" |
|
|
|
|
|
cmn "github.com/tendermint/tendermint/libs/common" |
|
|
nm "github.com/tendermint/tendermint/node" |
|
|
nm "github.com/tendermint/tendermint/node" |
|
|
"github.com/tendermint/tendermint/p2p" |
|
|
"github.com/tendermint/tendermint/p2p" |
|
|
"github.com/tendermint/tendermint/privval" |
|
|
"github.com/tendermint/tendermint/privval" |
|
@ -64,14 +64,17 @@ func makePathname() string { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func randPort() int { |
|
|
func randPort() int { |
|
|
return int(cmn.RandUint16()/2 + 10000) |
|
|
|
|
|
|
|
|
port, err := cmn.GetFreePort() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
panic(err) |
|
|
|
|
|
} |
|
|
|
|
|
return port |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func makeAddrs() (string, string, string) { |
|
|
func makeAddrs() (string, string, string) { |
|
|
start := randPort() |
|
|
|
|
|
return fmt.Sprintf("tcp://0.0.0.0:%d", start), |
|
|
|
|
|
fmt.Sprintf("tcp://0.0.0.0:%d", start+1), |
|
|
|
|
|
fmt.Sprintf("tcp://0.0.0.0:%d", start+2) |
|
|
|
|
|
|
|
|
return fmt.Sprintf("tcp://0.0.0.0:%d", randPort()), |
|
|
|
|
|
fmt.Sprintf("tcp://0.0.0.0:%d", randPort()), |
|
|
|
|
|
fmt.Sprintf("tcp://0.0.0.0:%d", randPort()) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// GetConfig returns a config for the test cases as a singleton
|
|
|
// GetConfig returns a config for the test cases as a singleton
|
|
|