mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
dont lose keys (#3357)
This commit is contained in:
parent
f0332e1131
commit
538babb7e9
@ -7,7 +7,7 @@ client for fast development startup times instead of using the Prysm keystore.
|
||||
Usage:
|
||||
|
||||
```
|
||||
bazel run //tools/unencrypted-keys-gen -- --num-keys 64 --output-file /path/to/output.json
|
||||
bazel run //tools/unencrypted-keys-gen -- --num-keys 64 --output-json /path/to/output.json
|
||||
```
|
||||
|
||||
Which will create 64 BLS private keys each for validator signing and withdrawals.
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
var (
|
||||
numKeys = flag.Int("num-keys", 0, "Number of validator private/withdrawal keys to generate")
|
||||
outputJSON = flag.String("output-json", "", "JSON file to write output to")
|
||||
overwrite = flag.Bool("overwrite", false, "If the key file exists, it will be overwritten")
|
||||
)
|
||||
|
||||
type unencryptedKeysContainer struct {
|
||||
@ -35,6 +36,12 @@ func main() {
|
||||
log.Fatal("Please specify an --output-json file to write the unencrypted keys to")
|
||||
}
|
||||
|
||||
if !*overwrite {
|
||||
if _, err := os.Stat(*outputJSON); err == nil {
|
||||
log.Fatal("The file exists. Use a different file name or the --overwrite flag")
|
||||
}
|
||||
}
|
||||
|
||||
file, err := os.Create(*outputJSON)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
Loading…
Reference in New Issue
Block a user