tendermint/cmd/gen_account.go

29 lines
583 B
Go
Raw Normal View History

package main
import (
"encoding/base64"
"fmt"
2014-12-17 01:37:13 -08:00
. "github.com/tendermint/tendermint/account"
. "github.com/tendermint/tendermint/binary"
)
2014-11-07 23:27:03 -08:00
func gen_account() {
// TODO: uh, write better logic.
// Generate private account
2014-12-17 01:37:13 -08:00
privAccount := GenPrivAccount()
fmt.Printf(`Generated account:
Account Public Key: %X
(base64) %v
Account Private Key: %X
(base64) %v
`,
privAccount.PubKey,
base64.StdEncoding.EncodeToString(BinaryBytes(privAccount.PubKey)),
privAccount.PrivKey,
base64.StdEncoding.EncodeToString(BinaryBytes(privAccount.PrivKey)))
2014-12-23 17:20:52 -08:00
}