-
Notifications
You must be signed in to change notification settings - Fork 0
/
txGenerator.py
31 lines (21 loc) · 1017 Bytes
/
txGenerator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os, time
import numpy as np
UPDATE_PERIOD = 20
#Global parameters, replace with chain specific parameters
binaryLocation = 'binary location'
keyName = 'the name of your key'
amount = 'amount of coins to send'
denom = 'denomination of coinds to send'
chainID = 'chain-id'
#Comma delimited list of addresses to send to
addressList = ['addresses', 'of_target', 'wallets']
#Working loop
while True:
for address in addressList:
#Execute the Cosmos SDK bank send command to a subshell
bankSend = '%s tx bank send %s %s %s%s --chain-id=%s -y' % (binaryLocation, keyName, address, amount, denom, chainID)
os.system(bankSend)
##Generate random wait time in seconds using a Poisson distribution with lambda = 30.
##Lambda is the mean, which basically means this script will send a TX about every 30 seconds, give or take.
randomWait = np.random.poisson(30, 1)
time.sleep(randomWait.item(0))