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.

31 lines
583 B

  1. // +build gen_account
  2. package main
  3. import (
  4. "encoding/base64"
  5. "fmt"
  6. "github.com/tendermint/tendermint/config"
  7. "github.com/tendermint/tendermint/state"
  8. )
  9. func main() {
  10. // Parse config flags
  11. config.ParseFlags()
  12. // Generate private account
  13. privAccount := state.GenPrivAccount()
  14. fmt.Printf(`Generated account:
  15. Account Public Key: %X
  16. (base64) %v
  17. Account Private Key: %X
  18. (base64) %v
  19. `,
  20. privAccount.PubKey,
  21. base64.StdEncoding.EncodeToString(privAccount.PubKey),
  22. privAccount.PrivKey,
  23. base64.StdEncoding.EncodeToString(privAccount.PrivKey))
  24. }