-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflood2.py
More file actions
31 lines (26 loc) · 1 KB
/
flood2.py
File metadata and controls
31 lines (26 loc) · 1 KB
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
from pprint import pprint
import time
import json
import random
from grapheneapi.grapheneapi import GrapheneAPI
import threading
def run(n=0):
client = GrapheneAPI("localhost", 8092, "", "")
transfer = client.get_prototype_operation("transfer_operation")
from_account = client.get_account("faucet")
to_account = client.get_account("xeroc")
transfer[1]["to"] = to_account["id"]
transfer[1]["from"] = from_account["id"]
transfer[1]["amount"]["amount"] = 3
while True:
builder = client.begin_builder_transaction()
for i in range(0, random.randint(100, 500)):
print(n, end="", flush=True)
client.add_operation_to_builder_transaction(builder, transfer)
client.set_fees_on_builder_transaction(builder, "1.3.0")
print("\nTransfer!")
client.sign_builder_transaction(builder, True)
time.sleep(random.randint(0, 3))
for i in range(0, 10):
threading.Thread(target=run, args=(i,)).start()
time.sleep(random.randint(0, 10))