diff --git a/config/config.go b/config/config.go index 38ea4ba0f..dc3eff7d1 100644 --- a/config/config.go +++ b/config/config.go @@ -415,8 +415,8 @@ func DefaultRPCConfig() *RPCConfig { // TestRPCConfig returns a configuration for testing the RPC server func TestRPCConfig() *RPCConfig { cfg := DefaultRPCConfig() - cfg.ListenAddress = "tcp://0.0.0.0:36657" - cfg.GRPCListenAddress = "tcp://0.0.0.0:36658" + cfg.ListenAddress = "tcp://127.0.0.1:36657" + cfg.GRPCListenAddress = "tcp://127.0.0.1:36658" cfg.Unsafe = true return cfg } @@ -584,7 +584,7 @@ func DefaultP2PConfig() *P2PConfig { // TestP2PConfig returns a configuration for testing the peer-to-peer layer func TestP2PConfig() *P2PConfig { cfg := DefaultP2PConfig() - cfg.ListenAddress = "tcp://0.0.0.0:36656" + cfg.ListenAddress = "tcp://127.0.0.1:36656" cfg.FlushThrottleTimeout = 10 * time.Millisecond cfg.AllowDuplicateIP = true return cfg diff --git a/consensus/wal_generator.go b/consensus/wal_generator.go index 64ac95210..244edd536 100644 --- a/consensus/wal_generator.go +++ b/consensus/wal_generator.go @@ -125,9 +125,9 @@ func randPort() int { 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://127.0.0.1:%d", start), + fmt.Sprintf("tcp://127.0.0.1:%d", start+1), + fmt.Sprintf("tcp://127.0.0.1:%d", start+2) } // getConfig returns a config for test cases diff --git a/p2p/netaddress.go b/p2p/netaddress.go index ed5b703e7..c71f3ce7f 100644 --- a/p2p/netaddress.go +++ b/p2p/netaddress.go @@ -48,7 +48,7 @@ func NewNetAddress(id ID, addr net.Addr) *NetAddress { if flag.Lookup("test.v") == nil { // normal run panic(fmt.Sprintf("Only TCPAddrs are supported. Got: %v", addr)) } else { // in testing - netAddr := NewNetAddressIPPort(net.IP("0.0.0.0"), 0) + netAddr := NewNetAddressIPPort(net.IP("127.0.0.1"), 0) netAddr.ID = id return netAddr } diff --git a/rpc/lib/rpc_test.go b/rpc/lib/rpc_test.go index fbf041f57..5b95666a7 100644 --- a/rpc/lib/rpc_test.go +++ b/rpc/lib/rpc_test.go @@ -28,7 +28,7 @@ import ( // Client and Server should work over tcp or unix sockets const ( - tcpAddr = "tcp://0.0.0.0:47768" + tcpAddr = "tcp://127.0.0.1:47768" unixSocket = "/tmp/rpc_test.sock" unixAddr = "unix://" + unixSocket diff --git a/rpc/lib/test/main.go b/rpc/lib/test/main.go index 891f9388d..a7141048c 100644 --- a/rpc/lib/test/main.go +++ b/rpc/lib/test/main.go @@ -37,7 +37,7 @@ func main() { rpcserver.RegisterRPCFuncs(mux, routes, cdc, logger) config := rpcserver.DefaultConfig() - listener, err := rpcserver.Listen("0.0.0.0:8008", config) + listener, err := rpcserver.Listen("tcp://127.0.0.1:8008", config) if err != nil { tmos.Exit(err.Error()) } diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 0b25b2e5f..46aea59e1 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -85,9 +85,9 @@ func randPort() int { } func makeAddrs() (string, string, string) { - 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()) + return fmt.Sprintf("tcp://127.0.0.1:%d", randPort()), + fmt.Sprintf("tcp://127.0.0.1:%d", randPort()), + fmt.Sprintf("tcp://127.0.0.1:%d", randPort()) } func createConfig() *cfg.Config {