mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-22 03:08:30 +00:00
handle missing validators dir during key import
This commit is contained in:
parent
23b7cbfc9c
commit
b454501595
@ -72,8 +72,9 @@ proc obtainTestnetKey(conf: BeaconNodeConf): Future[ValidatorPrivKey] {.async.}
|
||||
return ValidatorPrivKey.init(privKeyContent)
|
||||
|
||||
proc saveValidatorKey(key: ValidatorPrivKey, conf: BeaconNodeConf) =
|
||||
let filename = conf.dataDir / dataDirValidators / $key.pubKey
|
||||
writeFile(filename, $key)
|
||||
let validatorsDir = conf.dataDir / dataDirValidators
|
||||
createDir validatorsDir
|
||||
writeFile(validatorsDir / $key.pubKey, $key)
|
||||
|
||||
proc init*(T: type BeaconNode, conf: BeaconNodeConf): Future[BeaconNode] {.async.} =
|
||||
new result
|
||||
|
Loading…
x
Reference in New Issue
Block a user