Add ability to construct new instance of Tendermint core from scratch

This commit is contained in:
Adrian Brink
2017-09-13 08:32:53 +02:00
committed by Ethan Buchman
parent 7dd3c007c7
commit 4e13a19339
3 changed files with 19 additions and 45 deletions

View File

@@ -128,12 +128,16 @@ func GenPrivValidator() *PrivValidator {
}
}
func LoadPrivValidatorWithSigner(signer Signer) *PrivValidator {
// LoadPrivValidatorWithSigner instantiates a private validator with a custom
// signer object. Tendermint tracks state in the PrivValidator that might be
// saved to disk. Please supply a filepath where Tendermint can save the
// private validator.
func LoadPrivValidatorWithSigner(signer Signer, filePath string) *PrivValidator {
return &PrivValidator{
Address: signer.PubKey().Address(),
PubKey: signer.PubKey(),
LastStep: stepNone,
filePath: "",
filePath: filePath,
Signer: signer,
}
}