Merge pull request #5118 from filcloud/keygen-outfile
add keygen outfile
This commit is contained in:
commit
5c37c9d8e9
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@
|
||||
/lotus-gateway
|
||||
/lotus-pcr
|
||||
/lotus-wallet
|
||||
/lotus-keygen
|
||||
/bench.json
|
||||
/lotuspond/front/node_modules
|
||||
/lotuspond/front/build
|
||||
|
6
Makefile
6
Makefile
@ -204,6 +204,12 @@ lotus-wallet:
|
||||
.PHONY: lotus-wallet
|
||||
BINS+=lotus-wallet
|
||||
|
||||
lotus-keygen:
|
||||
rm -f lotus-keygen
|
||||
go build -o lotus-keygen ./cmd/lotus-keygen
|
||||
.PHONY: lotus-keygen
|
||||
BINS+=lotus-keygen
|
||||
|
||||
testground:
|
||||
go build -tags testground -o /dev/null ./cmd/lotus
|
||||
.PHONY: testground
|
||||
|
@ -22,6 +22,11 @@ func main() {
|
||||
Value: "bls",
|
||||
Usage: "specify key type to generate (bls or secp256k1)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "out",
|
||||
Aliases: []string{"o"},
|
||||
Usage: "specify key file name to generate",
|
||||
},
|
||||
}
|
||||
app.Action = func(cctx *cli.Context) error {
|
||||
memks := wallet.NewMemKeyStore()
|
||||
@ -50,7 +55,11 @@ func main() {
|
||||
return err
|
||||
}
|
||||
|
||||
fi, err := os.Create(fmt.Sprintf("%s.key", kaddr))
|
||||
outFile := fmt.Sprintf("%s.key", kaddr)
|
||||
if cctx.IsSet("out") {
|
||||
outFile = fmt.Sprintf("%s.key", cctx.String("out"))
|
||||
}
|
||||
fi, err := os.Create(outFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user