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