Skip to content

Instantly share code, notes, and snippets.

View Daniel-VDM's full-sized avatar
🎯
Focusing

Daniel Van Der Maden Daniel-VDM

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
import time
import sys
import logging
import datetime
from multiprocessing.pool import ThreadPool
import harmony_transaction_generator as tx_gen
from harmony_transaction_generator import account_manager
#!/usr/bin/env python3
import time
import sys
import logging
import datetime
from multiprocessing.pool import ThreadPool
import harmony_transaction_generator as tx_gen
from harmony_transaction_generator import account_manager
#!/usr/bin/env python3
import time
import sys
import logging
import datetime
from multiprocessing.pool import ThreadPool
import harmony_transaction_generator as tx_gen
from harmony_transaction_generator import account_manager
#!/usr/bin/env python3
import time
import sys
import logging
import datetime
from multiprocessing.pool import ThreadPool
import harmony_transaction_generator as tx_gen
from harmony_transaction_generator import account_manager

Blacklist file used on testnet:

one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj # This is a comment
one1cwv3kk220ujzgvatz0h924t0hr8gkrmjc57jpm

Note that hmyTest is an alias for ./hmy --node=https://api.s0.b.hmny.io/

Testing 'from' account blacklist

Generating accounts...
[123145455685632] 2020-02-11 03:15:52.411336 : Created account: one1h7sv90gj43yceefe5rpzmehnkuva8hyy7qv43t (_tx_gen_NETWORK_TEST_151277617_8)
[123145429409792] 2020-02-11 03:15:52.587592 : Created account: one1ysc3kzfclpmzsms9lah76cz9fu07zge6ud2kpf (_tx_gen_NETWORK_TEST_151277617_0)
[123145445175296] 2020-02-11 03:15:52.638880 : Created account: one1sngxv32a6rnz72ss5s2yryrdm3eu0wql9u7sj7 (_tx_gen_NETWORK_TEST_151277617_14)
[123145460940800] 2020-02-11 03:15:52.719279 : Created account: one12unqc0njtv5yp53awudugng4sdjdcfsazugghp (_tx_gen_NETWORK_TEST_151277617_12)
[123145466195968] 2020-02-11 03:15:52.753046 : Created account: one14qtk3sgmtppk4ath7uv09hak6kfasax6yem922 (_tx_gen_NETWORK_TEST_151277617_10)
[123145434664960] 2020-02-11 03:15:52.760244 : Created account: one1ld2yxkap8akr5zpastx86y9w9xg2havlajm6cd (_tx_gen_NETWORK_TEST_151277617_2)
[123145439920128] 2020-02-11 03:15:52.823058 : Created account: one1allywptj7227wsz3p85cs8ked4vhwjg40258m9 (_tx_gen_NETWORK_TEST_151277617_4)
(base) Daniel-MBP:transaction-generator danielvdm$ python3 localnet_example.py
[123145630593024] 2020-02-12 20:25:13.092774 : Adding key file: (0) one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5.key
[123145641103360] 2020-02-12 20:25:13.095170 : Adding key file: (6) one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg.key
[123145635848192] 2020-02-12 20:25:13.101567 : Adding key file: (3) one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx.key
[123145646358528] 2020-02-12 20:25:13.101936 : Adding key file: (9) one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj.key
[123145656868864] 2020-02-12 20:25:13.102957 : Adding key file: (15) one1z05g55zamqzfw9qs432n33gycdmyvs38xjemyl.key
[123145662124032] 2020-02-12 20:25:13.109524 : Adding key file: (18) one1r4zyyjqrulf935a479sgqlpa78kz7zlcg2jfen.key
[123145651613696] 2020-02-12 20:25:13.111428 : Adding key file: (12) one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9.key
[123145630593024] 2020-02-12 20:25:13.381874 : Adding key file: (1) one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep.key
CLI Version: Harmony (C) 2020. hmy, version v268-f8dbabe-dirty (danielvdm@harmony.one 2020-02-12T15:16:08-0800)
Waiting for epoch 1 (or later)
Running: load_keys
[123145537851392] 2020-02-13 00:40:11.345161 : {"address": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", "balances": [{"shard": 0, "amount": 70.38091038095239}, {"shard": 1, "amount": 0.0}], "time-utc": "2020-02-13 00:40:11.345051"}
[123145516830720] 2020-02-13 00:40:11.358061 : {"address": "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", "balances": [{"shard": 0, "amount": 0.0}, {"shard": 1, "amount": 75.01409671428571}], "time-utc": "2020-02-13 00:40:11.357984"}
[123145543106560] 2020-02-13 00:40:11.360308 : {"address": "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", "balances": [{"shard": 0, "amount": 0.0}, {"shard": 1, "amount": 75.71424371428571}], "time-utc": "2020-02-13 00:40:11.360227"}
[123145501065216] 2020-02-13 00:40:11.360646 : {"address": "one1r4zyyjqrulf935a479sgqlpa78kz7zlcg2jfen", "balances": [{"shard": 0, "amount": 0.6}, {"shard"
package economics
import (
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/harmony-one/harmony/block"
"github.com/harmony-one/harmony/common/denominations"
"github.com/harmony-one/harmony/consensus/engine"

Running a node

To run a double-signing validator:

docker run --network host -it danielharmony/double-sign [ACCOUNT_PRIVATE_KEY] [BLS_PRIVATE_KEY] /ip4/52.40.84.2/tcp/9876/p2p/QmbPVwrqWsTYXq1RxGWcxx9SWaTUCfoo1wA6wmdbduWe29 ds.hmny.io http://52.54.240.140:9500

If you already have the docker image, use docker pull danielharmony/double-sign:latest to download the newest version.

Get funded private key from here