mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
Integrate private validator socket client
Following ADDR 008 the node will connect to an external process to handle signing requests. Operation of the external process is left to the user. * introduce alias for PrivValidator interface on socket client * integrate socket client in node * structure tests * remove unnecessary flag
This commit is contained in:
12
node/node.go
12
node/node.go
@ -173,20 +173,22 @@ func NewNode(config *cfg.Config,
|
||||
// reload the state (it may have been updated by the handshake)
|
||||
state = sm.LoadState(stateDB)
|
||||
|
||||
// Connect to external signing process, if an address is provided.
|
||||
if config.PrivValidatorAddr != "" {
|
||||
var (
|
||||
privKey = crypto.GenPrivKeyEd25519()
|
||||
pvss = priv_val.NewPrivValidatorSocketServer(
|
||||
pvsc = priv_val.NewSocketClient(
|
||||
logger.With("module", "priv_val"),
|
||||
config.ChainID(),
|
||||
config.PrivValidatorAddr,
|
||||
config.PrivValidatorMaxConn,
|
||||
priv_val.LoadPrivValidatorJSON(config.PrivValidatorFile()),
|
||||
&privKey,
|
||||
)
|
||||
)
|
||||
|
||||
pvss.Start()
|
||||
if err := pvsc.Start(); err != nil {
|
||||
return nil, fmt.Errorf("Error starting private validator client: %v", err)
|
||||
}
|
||||
|
||||
privValidator = pvsc
|
||||
}
|
||||
|
||||
// Decide whether to fast-sync or not
|
||||
|
Reference in New Issue
Block a user