diff --git a/consensus/tendermint/config.go b/consensus/tendermint/config.go index d736e4baa1d41839fd702fad4c288942d81784be..92acbf9c802881f413254796798c0f636847e467 100644 --- a/consensus/tendermint/config.go +++ b/consensus/tendermint/config.go @@ -20,10 +20,11 @@ type BurrowTendermintConfig struct { } func DefaultBurrowTendermintConfig() *BurrowTendermintConfig { - //tmDefaultConfig := tm_config.DefaultConfig() + tmDefaultConfig := tm_config.DefaultConfig() return &BurrowTendermintConfig{ - ListenAddress: "tcp://127.0.0.1:26656", //stmDefaultConfig.P2P.ListenAddress, - TendermintRoot: ".burrow", + ListenAddress: tmDefaultConfig.P2P.ListenAddress, + ExternalAddress: tmDefaultConfig.P2P.ExternalAddress, + TendermintRoot: ".burrow", } } @@ -39,7 +40,7 @@ func (btc *BurrowTendermintConfig) TendermintConfig() *tm_config.Config { conf.P2P.Seeds = btc.Seeds conf.P2P.PersistentPeers = btc.PersistentPeers conf.P2P.ListenAddress = btc.ListenAddress - conf.P2P.ExternalAddress = btc.ListenAddress + conf.P2P.ExternalAddress = btc.ExternalAddress conf.Moniker = btc.Moniker // Unfortunately this stops metrics from being used at all conf.Instrumentation.Prometheus = false diff --git a/integration/integration.go b/integration/integration.go index ae3cf0ba6d26a78322eff97254531ee718c07442..69267521513c2ac9b14ec1f9aebf9283f44d451d 100644 --- a/integration/integration.go +++ b/integration/integration.go @@ -163,6 +163,7 @@ func NewTestConfig(genesisDoc *genesis.GenesisDoc) *config.BurrowConfig { cnf.Tendermint.Moniker = name cnf.Tendermint.TendermintRoot = fmt.Sprintf(".burrow_%s", name) cnf.Tendermint.ListenAddress = GetTCPLocalAddress() + cnf.Tendermint.ExternalAddress = cnf.Tendermint.ListenAddress cnf.RPC.GRPC.ListenAddress = GetLocalAddress() cnf.RPC.Metrics.ListenAddress = GetTCPLocalAddress() cnf.RPC.TM.ListenAddress = GetTCPLocalAddress() diff --git a/rpc/config.go b/rpc/config.go index 44acb555525c94fa93c0a686b434845322f417d2..23bfbdbb763c48fae661f22ae9d686147866b45d 100644 --- a/rpc/config.go +++ b/rpc/config.go @@ -1,5 +1,11 @@ package rpc +import "fmt" + +// 'localhost' gets interpreted as ipv6 +// TODO: revisit this +const localhost = "127.0.0.1" + type RPCConfig struct { TM *ServerConfig `json:",omitempty" toml:",omitempty"` Profiler *ServerConfig `json:",omitempty" toml:",omitempty"` @@ -41,28 +47,28 @@ func DefaultRPCConfig() *RPCConfig { func DefaultTMConfig() *ServerConfig { return &ServerConfig{ Enabled: true, - ListenAddress: "tcp://localhost:26658", + ListenAddress: fmt.Sprintf("tcp://%s:26658", localhost), } } func DefaultGRPCConfig() *ServerConfig { return &ServerConfig{ Enabled: true, - ListenAddress: "localhost:10997", + ListenAddress: fmt.Sprintf("%s:10997", localhost), } } func DefaultProfilerConfig() *ServerConfig { return &ServerConfig{ Enabled: false, - ListenAddress: "tcp://localhost:6060", + ListenAddress: fmt.Sprintf("tcp://%s:6060", localhost), } } func DefaultMetricsConfig() *MetricsConfig { return &MetricsConfig{ Enabled: false, - ListenAddress: "tcp://localhost:9102", + ListenAddress: fmt.Sprintf("tcp://%s:9102", localhost), MetricsPath: "/metrics", BlockSampleSize: 100, }