mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 21:31:23 +00:00
config: all urls use tcp:// or unix:// prefix
This commit is contained in:
@ -55,7 +55,7 @@ func GetConfig(rootDir string) cfg.Config {
|
|||||||
mapConfig.SetDefault("proxy_app", "tcp://127.0.0.1:46658")
|
mapConfig.SetDefault("proxy_app", "tcp://127.0.0.1:46658")
|
||||||
mapConfig.SetDefault("tmsp", "socket")
|
mapConfig.SetDefault("tmsp", "socket")
|
||||||
mapConfig.SetDefault("moniker", "anonymous")
|
mapConfig.SetDefault("moniker", "anonymous")
|
||||||
mapConfig.SetDefault("node_laddr", "0.0.0.0:46656")
|
mapConfig.SetDefault("node_laddr", "tcp://0.0.0.0:46656")
|
||||||
mapConfig.SetDefault("seeds", "")
|
mapConfig.SetDefault("seeds", "")
|
||||||
// mapConfig.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
|
// mapConfig.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
|
||||||
mapConfig.SetDefault("fast_sync", true)
|
mapConfig.SetDefault("fast_sync", true)
|
||||||
@ -65,7 +65,7 @@ func GetConfig(rootDir string) cfg.Config {
|
|||||||
mapConfig.SetDefault("db_backend", "leveldb")
|
mapConfig.SetDefault("db_backend", "leveldb")
|
||||||
mapConfig.SetDefault("db_dir", rootDir+"/data")
|
mapConfig.SetDefault("db_dir", rootDir+"/data")
|
||||||
mapConfig.SetDefault("log_level", "info")
|
mapConfig.SetDefault("log_level", "info")
|
||||||
mapConfig.SetDefault("rpc_laddr", "0.0.0.0:46657")
|
mapConfig.SetDefault("rpc_laddr", "tcp://0.0.0.0:46657")
|
||||||
mapConfig.SetDefault("prof_laddr", "")
|
mapConfig.SetDefault("prof_laddr", "")
|
||||||
mapConfig.SetDefault("revision_file", rootDir+"/revision")
|
mapConfig.SetDefault("revision_file", rootDir+"/revision")
|
||||||
mapConfig.SetDefault("cswal", rootDir+"/data/cswal")
|
mapConfig.SetDefault("cswal", rootDir+"/data/cswal")
|
||||||
@ -92,12 +92,12 @@ var defaultConfigTmpl = `# This is a TOML config file.
|
|||||||
|
|
||||||
proxy_app = "tcp://127.0.0.1:46658"
|
proxy_app = "tcp://127.0.0.1:46658"
|
||||||
moniker = "__MONIKER__"
|
moniker = "__MONIKER__"
|
||||||
node_laddr = "0.0.0.0:46656"
|
node_laddr = "tcp://0.0.0.0:46656"
|
||||||
seeds = ""
|
seeds = ""
|
||||||
fast_sync = true
|
fast_sync = true
|
||||||
db_backend = "leveldb"
|
db_backend = "leveldb"
|
||||||
log_level = "notice"
|
log_level = "notice"
|
||||||
rpc_laddr = "0.0.0.0:46657"
|
rpc_laddr = "tcp://0.0.0.0:46657"
|
||||||
`
|
`
|
||||||
|
|
||||||
func defaultConfig(moniker string) (defaultConfig string) {
|
func defaultConfig(moniker string) (defaultConfig string) {
|
||||||
|
@ -70,7 +70,7 @@ func ResetConfig(localPath string) cfg.Config {
|
|||||||
mapConfig.SetDefault("proxy_app", "dummy")
|
mapConfig.SetDefault("proxy_app", "dummy")
|
||||||
mapConfig.SetDefault("tmsp", "socket")
|
mapConfig.SetDefault("tmsp", "socket")
|
||||||
mapConfig.SetDefault("moniker", "anonymous")
|
mapConfig.SetDefault("moniker", "anonymous")
|
||||||
mapConfig.SetDefault("node_laddr", "0.0.0.0:36656")
|
mapConfig.SetDefault("node_laddr", "tcp://0.0.0.0:36656")
|
||||||
mapConfig.SetDefault("fast_sync", false)
|
mapConfig.SetDefault("fast_sync", false)
|
||||||
mapConfig.SetDefault("skip_upnp", true)
|
mapConfig.SetDefault("skip_upnp", true)
|
||||||
mapConfig.SetDefault("addrbook_file", rootDir+"/addrbook.json")
|
mapConfig.SetDefault("addrbook_file", rootDir+"/addrbook.json")
|
||||||
@ -78,7 +78,7 @@ func ResetConfig(localPath string) cfg.Config {
|
|||||||
mapConfig.SetDefault("db_backend", "memdb")
|
mapConfig.SetDefault("db_backend", "memdb")
|
||||||
mapConfig.SetDefault("db_dir", rootDir+"/data")
|
mapConfig.SetDefault("db_dir", rootDir+"/data")
|
||||||
mapConfig.SetDefault("log_level", "debug")
|
mapConfig.SetDefault("log_level", "debug")
|
||||||
mapConfig.SetDefault("rpc_laddr", "0.0.0.0:36657")
|
mapConfig.SetDefault("rpc_laddr", "tcp://0.0.0.0:36657")
|
||||||
mapConfig.SetDefault("prof_laddr", "")
|
mapConfig.SetDefault("prof_laddr", "")
|
||||||
mapConfig.SetDefault("revision_file", rootDir+"/revision")
|
mapConfig.SetDefault("revision_file", rootDir+"/revision")
|
||||||
mapConfig.SetDefault("cswal", rootDir+"/data/cswal")
|
mapConfig.SetDefault("cswal", rootDir+"/data/cswal")
|
||||||
@ -105,12 +105,12 @@ var defaultConfigTmpl = `# This is a TOML config file.
|
|||||||
|
|
||||||
proxy_app = "dummy"
|
proxy_app = "dummy"
|
||||||
moniker = "__MONIKER__"
|
moniker = "__MONIKER__"
|
||||||
node_laddr = "0.0.0.0:36656"
|
node_laddr = "tcp://0.0.0.0:36656"
|
||||||
seeds = ""
|
seeds = ""
|
||||||
fast_sync = false
|
fast_sync = false
|
||||||
db_backend = "memdb"
|
db_backend = "memdb"
|
||||||
log_level = "debug"
|
log_level = "debug"
|
||||||
rpc_laddr = "0.0.0.0:36657"
|
rpc_laddr = "tcp://0.0.0.0:36657"
|
||||||
`
|
`
|
||||||
|
|
||||||
func defaultConfig(moniker string) (defaultConfig string) {
|
func defaultConfig(moniker string) (defaultConfig string) {
|
||||||
|
14
node/node.go
14
node/node.go
@ -348,7 +348,9 @@ func RunNode(config cfg.Config) {
|
|||||||
|
|
||||||
// Create & start node
|
// Create & start node
|
||||||
n := NewNode(config, privValidator, GetProxyApp)
|
n := NewNode(config, privValidator, GetProxyApp)
|
||||||
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp"))
|
|
||||||
|
protocol, address := ProtocolAndAddress(config.GetString("node_laddr"))
|
||||||
|
l := p2p.NewDefaultListener(protocol, address, config.GetBool("skip_upnp"))
|
||||||
n.AddListener(l)
|
n.AddListener(l)
|
||||||
err := n.Start()
|
err := n.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -448,3 +450,13 @@ func RunReplay(config cfg.Config) {
|
|||||||
}
|
}
|
||||||
log.Notice("Replay run successfully")
|
log.Notice("Replay run successfully")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Defaults to tcp
|
||||||
|
func ProtocolAndAddress(listenAddr string) (string, string) {
|
||||||
|
protocol, address := "tcp", listenAddr
|
||||||
|
parts := strings.SplitN(address, "://", 2)
|
||||||
|
if len(parts) == 2 {
|
||||||
|
protocol, address = parts[0], parts[1]
|
||||||
|
}
|
||||||
|
return protocol, address
|
||||||
|
}
|
||||||
|
@ -18,7 +18,8 @@ func TestNodeStartStop(t *testing.T) {
|
|||||||
|
|
||||||
// Create & start node
|
// Create & start node
|
||||||
n := NewNode(config, privValidator, GetProxyApp)
|
n := NewNode(config, privValidator, GetProxyApp)
|
||||||
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp"))
|
protocol, address := ProtocolAndAddress(config.GetString("node_laddr"))
|
||||||
|
l := p2p.NewDefaultListener(protocol, address, config.GetBool("skip_upnp"))
|
||||||
n.AddListener(l)
|
n.AddListener(l)
|
||||||
n.Start()
|
n.Start()
|
||||||
log.Notice("Started node", "nodeInfo", n.sw.NodeInfo())
|
log.Notice("Started node", "nodeInfo", n.sw.NodeInfo())
|
||||||
|
@ -55,7 +55,8 @@ func newNode(ready chan struct{}) {
|
|||||||
privValidatorFile := config.GetString("priv_validator_file")
|
privValidatorFile := config.GetString("priv_validator_file")
|
||||||
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
|
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
|
||||||
node = nm.NewNode(config, privValidator, nm.GetProxyApp)
|
node = nm.NewNode(config, privValidator, nm.GetProxyApp)
|
||||||
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), true)
|
protocol, address := nm.ProtocolAndAddress(config.GetString("node_laddr"))
|
||||||
|
l := p2p.NewDefaultListener(protocol, address, true)
|
||||||
node.AddListener(l)
|
node.AddListener(l)
|
||||||
node.Start()
|
node.Start()
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
# Top Level Testing Script
|
# Top Level Testing Script
|
||||||
# See the github.com/tendermint/tendermint/test/README.md
|
# See the github.com/tendermint/tendermint/test/README.md
|
||||||
|
Reference in New Issue
Block a user