-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkichain_ibc.py
More file actions
28 lines (24 loc) · 1001 Bytes
/
kichain_ibc.py
File metadata and controls
28 lines (24 loc) · 1001 Bytes
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
from subprocess import Popen, PIPE
from random import choice, randint
from time import sleep
PATH = 'transfer' # replace with your path
IBC0 = 'kichain-t-4' # source chain
IBC1 = 'testnet-croeseid-4' # destination chain
COMMAND = (f"rly tx transfer {IBC0} {IBC1} amountutki "
f"$(rly chains address {IBC1}) --path {PATH}",
f"rly tx transfer {IBC1} {IBC0} amountbasetcro "
f"$(rly chains address {IBC0}) --path {PATH}")
def main():
"""Randomly generate transctions and send them through ibc
using Popen module"""
while True:
try:
AMOUNT = randint(1000, 9999) # randomly generates amount to send
path = choice(COMMAND).replace('amount', f"{AMOUNT}") # randm path
result = Popen(path, stdout=PIPE, shell=True).communicate()[0]
print(f"{result}")
sleep(60)
except Exception as err:
print(err.message)
if __name__ == '__main__':
main()