mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-25 17:34:36 +00:00
PrivKey is just []byte
This commit is contained in:
+6
-10
@@ -1,24 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
. "github.com/tendermint/tendermint/account"
|
||||
"github.com/tendermint/tendermint/account"
|
||||
. "github.com/tendermint/tendermint/binary"
|
||||
)
|
||||
|
||||
func gen_account() {
|
||||
privAccount := account.GenPrivAccount()
|
||||
privAccountJSONBytes := JSONBytes(privAccount)
|
||||
fmt.Printf(`Generated a new account!
|
||||
|
||||
// TODO: uh, write better logic.
|
||||
// Generate private account
|
||||
privAccount := GenPrivAccount()
|
||||
%v
|
||||
|
||||
fmt.Printf(`Generated account:
|
||||
Account Public Key: %v
|
||||
Account Private Key: %v
|
||||
`,
|
||||
hex.EncodeToString(BinaryBytes(privAccount.PubKey)),
|
||||
hex.EncodeToString(BinaryBytes(privAccount.PrivKey)),
|
||||
string(privAccountJSONBytes),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,12 +5,14 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/state"
|
||||
|
||||
. "github.com/tendermint/tendermint/binary"
|
||||
)
|
||||
|
||||
func gen_validator() {
|
||||
|
||||
privValidator := state.GenPrivValidator()
|
||||
privValidatorJSONBytes := privValidator.JSONBytes()
|
||||
privValidatorJSONBytes := JSONBytes(privValidator)
|
||||
fmt.Printf(`Generated a new validator!
|
||||
Paste the following JSON into your %v file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user