pass in NodeKey to NewNode (#2212)

Fixes #1544
This commit is contained in:
bradyjoestar
2018-08-15 16:29:45 +08:00
committed by Anton Kaliaev
parent ad24d66750
commit 5446452b01
2 changed files with 18 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ import (
cfg "github.com/tendermint/tendermint/config"
nm "github.com/tendermint/tendermint/node"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/proxy"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
@@ -120,7 +121,11 @@ func NewTendermint(app abci.Application) *nm.Node {
pvFile := config.PrivValidatorFile()
pv := privval.LoadOrGenFilePV(pvFile)
papp := proxy.NewLocalClientCreator(app)
node, err := nm.NewNode(config, pv, papp,
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
if err != nil {
panic(err)
}
node, err := nm.NewNode(config, pv, nodeKey, papp,
nm.DefaultGenesisDocProviderFunc(config),
nm.DefaultDBProvider,
nm.DefaultMetricsProvider(config.Instrumentation),