aboutsummaryrefslogtreecommitdiffstats
path: root/test/keygen.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-16 12:17:29 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:23:39 +0800
commit44660543773109a68dc70e9efa25126dc9453e50 (patch)
tree15e31ffaf6291f6059bc926532a4355a1c6a680b /test/keygen.go
parent03fe9c0df6977974f22f5fe80f5db6e1afd49b54 (diff)
downloadgo-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar.gz
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar.bz2
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar.lz
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar.xz
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.tar.zst
go-tangerine-44660543773109a68dc70e9efa25126dc9453e50.zip
test: update genesis and keypairs
Diffstat (limited to 'test/keygen.go')
-rw-r--r--test/keygen.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/keygen.go b/test/keygen.go
new file mode 100644
index 000000000..b2c789723
--- /dev/null
+++ b/test/keygen.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+ "encoding/hex"
+ "fmt"
+
+ "github.com/dexon-foundation/dexon/crypto"
+)
+
+func main() {
+ for i := 0; i < 4; i++ {
+ privKey, err := crypto.GenerateKey()
+ if err != nil {
+ panic(err)
+ }
+ address := crypto.PubkeyToAddress(privKey.PublicKey).String()
+ pk := hex.EncodeToString(crypto.CompressPubkey(&privKey.PublicKey))
+
+ fmt.Printf(`
+ "%s": {
+ "balance": "1000000000000000000000",
+ "staked": "500000000000000000000",
+ "publicKey": "0x%s"
+ },`, address, pk)
+
+ crypto.SaveECDSA(fmt.Sprintf("test%d.nodekey", i), privKey)
+ }
+}