Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Jul 20, 2018
1 parent c3b72c5 commit fe1f2a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ run/example/1:
.PHONY: run/example/2
run/example/2:
@go run example/sign.go

.PHONY: run/example/3
run/example/3:
@go run example/seed.go

.PHONY: run/example/4
run/example/4:
@go run example/keys.go
21 changes: 14 additions & 7 deletions example/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (

func main() {
mnemonic := "tag volcano eight thank tide danger coast health above argue embrace heavy"
fmt.Println("deriving from mnenonic")
fmt.Println(mnemonic)

wallet, err := hdwallet.NewFromMnemonic(mnemonic)
if err != nil {
log.Fatal(err)
Expand All @@ -22,12 +21,20 @@ func main() {
log.Fatal(err)
}

fmt.Println("account address", account.Address.Hex())
fmt.Printf("Account address: %s\n", account.Address.Hex())

privateKey, err := wallet.PrivateKeyHex(account)
if err != nil {
log.Fatal(err)
}

pk, _ := wallet.PrivateKeyHex(account)
fmt.Println("private key hex: ", pk)
fmt.Printf("Private key in hex: %s\n", privateKey)

publicKey, _ := wallet.PublicKeyHex(account)
if err != nil {
log.Fatal(err)
}

pub, _ := wallet.PublicKeyHex(account)
fmt.Println("public key hex: ", pub)
fmt.Printf("Public key in hex: %s\n", publicKey)

}

0 comments on commit fe1f2a4

Please sign in to comment.