mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-20 08:26:31 +00:00
Integrate privVal client with node secret
This commit is contained in:
committed by
Ethan Buchman
parent
38d18ca11a
commit
7d71e702d8
@ -13,6 +13,7 @@ import (
|
||||
func main() {
|
||||
var (
|
||||
chainID = flag.String("chain-id", "mychain", "chain id")
|
||||
numClients = flag.Int("clients", 1, "number of concurrently connected clients")
|
||||
privValPath = flag.String("priv", "", "priv val file path")
|
||||
socketAddr = flag.String("socket.addr", ":46659", "socket bind addr")
|
||||
|
||||
@ -20,17 +21,19 @@ func main() {
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
logger.Info("args", "chainID", *chainID, "privPath", *privValPath)
|
||||
logger.Info("Reading args privValidatorSocketServer", "chainID", *chainID, "privPath", *privValPath)
|
||||
|
||||
privVal := priv_val.LoadPrivValidatorJSON(*privValPath)
|
||||
|
||||
pvss := priv_val.NewPrivValidatorSocketServer(
|
||||
logger,
|
||||
*socketAddr,
|
||||
*chainID,
|
||||
*socketAddr,
|
||||
*numClients,
|
||||
privVal,
|
||||
nil,
|
||||
)
|
||||
// pvss.Start()
|
||||
pvss.Start()
|
||||
|
||||
cmn.TrapSignal(func() {
|
||||
pvss.Stop()
|
||||
|
20
node/node.go
20
node/node.go
@ -79,7 +79,7 @@ type NodeProvider func(*cfg.Config, log.Logger) (*Node, error)
|
||||
func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) {
|
||||
var privVal types.PrivValidator
|
||||
privVal = types.LoadOrGenPrivValidatorFS(config.PrivValidatorFile())
|
||||
/*
|
||||
/* TODO
|
||||
if config.PrivValidatorAddr != "" {
|
||||
pvsc := priv_val.NewPrivValidatorSocketClient(logger.With("module", "priv_val"),
|
||||
config.PrivValidatorAddr)
|
||||
@ -94,7 +94,8 @@ func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) {
|
||||
proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()),
|
||||
DefaultGenesisDocProviderFunc(config),
|
||||
DefaultDBProvider,
|
||||
logger)
|
||||
logger,
|
||||
)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -183,6 +184,21 @@ func NewNode(config *cfg.Config,
|
||||
// reload the state (it may have been updated by the handshake)
|
||||
state = sm.LoadState(stateDB)
|
||||
|
||||
/* TODO
|
||||
// Generate node PrivKey
|
||||
privKey := crypto.GenPrivKeyEd25519()
|
||||
|
||||
if config.PrivValidatorAddr != "" {
|
||||
pvsc := priv_val.NewPrivValidatorSocketClient(
|
||||
logger.With("module", "priv_val"),
|
||||
config.PrivValidatorAddr,
|
||||
&privKey,
|
||||
)
|
||||
pvsc.Start()
|
||||
privValidator = pvsc
|
||||
}
|
||||
*/
|
||||
|
||||
// Decide whether to fast-sync or not
|
||||
// We don't fast-sync when the only validator is us.
|
||||
fastSync := config.FastSync
|
||||
|
Reference in New Issue
Block a user