You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
583 B

10 years ago
10 years ago
  1. package main
  2. import (
  3. "encoding/base64"
  4. "fmt"
  5. . "github.com/tendermint/tendermint/account"
  6. . "github.com/tendermint/tendermint/binary"
  7. )
  8. func gen_account() {
  9. // TODO: uh, write better logic.
  10. // Generate private account
  11. privAccount := GenPrivAccount()
  12. fmt.Printf(`Generated account:
  13. Account Public Key: %X
  14. (base64) %v
  15. Account Private Key: %X
  16. (base64) %v
  17. `,
  18. privAccount.PubKey,
  19. base64.StdEncoding.EncodeToString(BinaryBytes(privAccount.PubKey)),
  20. privAccount.PrivKey,
  21. base64.StdEncoding.EncodeToString(BinaryBytes(privAccount.PrivKey)))
  22. }