mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-19 01:51:19 +00:00
allow nil or dummy for in-proc
This commit is contained in:
parent
e2920d9702
commit
94a1978ce4
@ -77,7 +77,7 @@ func GetConfig(rootDir string) cfg.Config {
|
|||||||
}
|
}
|
||||||
mapConfig.SetDefault("chain_id", "tendermint_test")
|
mapConfig.SetDefault("chain_id", "tendermint_test")
|
||||||
mapConfig.SetDefault("genesis_file", rootDir+"/genesis.json")
|
mapConfig.SetDefault("genesis_file", rootDir+"/genesis.json")
|
||||||
mapConfig.SetDefault("proxy_app", "local")
|
mapConfig.SetDefault("proxy_app", "dummy")
|
||||||
mapConfig.SetDefault("moniker", "anonymous")
|
mapConfig.SetDefault("moniker", "anonymous")
|
||||||
mapConfig.SetDefault("node_laddr", "0.0.0.0:36656")
|
mapConfig.SetDefault("node_laddr", "0.0.0.0:36656")
|
||||||
mapConfig.SetDefault("fast_sync", false)
|
mapConfig.SetDefault("fast_sync", false)
|
||||||
@ -98,7 +98,7 @@ func GetConfig(rootDir string) cfg.Config {
|
|||||||
var defaultConfigTmpl = `# This is a TOML config file.
|
var defaultConfigTmpl = `# This is a TOML config file.
|
||||||
# For more information, see https://github.com/toml-lang/toml
|
# For more information, see https://github.com/toml-lang/toml
|
||||||
|
|
||||||
proxy_app = "local"
|
proxy_app = "dummy"
|
||||||
moniker = "__MONIKER__"
|
moniker = "__MONIKER__"
|
||||||
node_laddr = "0.0.0.0:36656"
|
node_laddr = "0.0.0.0:36656"
|
||||||
seeds = ""
|
seeds = ""
|
||||||
|
10
node/node.go
10
node/node.go
@ -25,6 +25,7 @@ import (
|
|||||||
sm "github.com/tendermint/tendermint/state"
|
sm "github.com/tendermint/tendermint/state"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
"github.com/tendermint/tendermint/version"
|
"github.com/tendermint/tendermint/version"
|
||||||
|
"github.com/tendermint/tmsp/example/dummy"
|
||||||
"github.com/tendermint/tmsp/example/nil"
|
"github.com/tendermint/tmsp/example/nil"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -238,11 +239,16 @@ func makeNodeInfo(sw *p2p.Switch, privKey crypto.PrivKeyEd25519) *p2p.NodeInfo {
|
|||||||
// Check the current hash, and panic if it doesn't match.
|
// Check the current hash, and panic if it doesn't match.
|
||||||
func getProxyApp(addr string, hash []byte) (proxyAppConn proxy.AppConn) {
|
func getProxyApp(addr string, hash []byte) (proxyAppConn proxy.AppConn) {
|
||||||
// use local app (for testing)
|
// use local app (for testing)
|
||||||
if addr == "local" {
|
switch addr {
|
||||||
|
case "nilapp":
|
||||||
app := nilapp.NewNilApplication()
|
app := nilapp.NewNilApplication()
|
||||||
mtx := new(sync.Mutex)
|
mtx := new(sync.Mutex)
|
||||||
proxyAppConn = proxy.NewLocalAppConn(mtx, app)
|
proxyAppConn = proxy.NewLocalAppConn(mtx, app)
|
||||||
} else {
|
case "dummy":
|
||||||
|
app := dummy.NewDummyApplication()
|
||||||
|
mtx := new(sync.Mutex)
|
||||||
|
proxyAppConn = proxy.NewLocalAppConn(mtx, app)
|
||||||
|
default:
|
||||||
remoteApp, err := proxy.NewRemoteAppConn(addr)
|
remoteApp, err := proxy.NewRemoteAppConn(addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Exit(Fmt("Failed to connect to proxy for mempool: %v", err))
|
Exit(Fmt("Failed to connect to proxy for mempool: %v", err))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user