aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-15 19:10:13 +0800
committerobscuren <geffobscura@gmail.com>2014-02-15 19:10:13 +0800
commit1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1 (patch)
treece7a45713a72dacc290c8e76113a0be03c70ef75 /ethereum.go
parent3fd5715872152fdd07c724dbbd8b1e06b062826b (diff)
downloadgo-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar.gz
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar.bz2
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar.lz
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar.xz
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.tar.zst
go-tangerine-1ba7ffe9f8eb468c11c20c933a85022a3b2dabe1.zip
Added text for keys
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go
index 9907de740..372d434af 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -32,12 +32,22 @@ func RegisterInterupts(s *eth.Ethereum) {
func CreateKeyPair(force bool) {
data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
if len(data) == 0 || force {
- log.Println("Generating new address and keypair")
-
pub, prv := secp256k1.GenerateKeyPair()
addr := ethutil.Sha3Bin(pub[1:])[12:]
- log.Printf("Your new address is %x\n", addr)
+ fmt.Printf(`
+Generating new address and keypair.
+Please keep your keys somewhere save.
+Currently Ethereum(G) does not support
+exporting keys.
+
+++++++++++++++++ KeyRing +++++++++++++++++++
+addr: %x
+prvk: %x
+pubk: %x
+++++++++++++++++++++++++++++++++++++++++++++
+
+`, addr, prv, pub)
keyRing := ethutil.NewValue([]interface{}{prv, addr, pub[1:]})
ethutil.Config.Db.Put([]byte("KeyRing"), keyRing.Encode())