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@dexon.org>2019-03-12 12:19:09 +0800
commit89d99563b957d0f88a5a2e8e8e13ada65cd1bbad (patch)
tree584c9291d09eecd67499f47c47c6c28fc53ca3c4 /test/keygen.go
parent563364279b4688a86867c31812dad6a14d044694 (diff)
downloaddexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar.gz
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar.bz2
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar.lz
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar.xz
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.tar.zst
dexon-89d99563b957d0f88a5a2e8e8e13ada65cd1bbad.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)
+ }
+}