-
Notifications
You must be signed in to change notification settings - Fork 5
/
change_blockchain_params_stresstest_1.py
62 lines (57 loc) · 2.06 KB
/
change_blockchain_params_stresstest_1.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from grapheneapi.grapheneapi import GrapheneAPI
from graphenebase.transactions import formatTimeFromNow
from pprint import pprint
broadcast = True
proposer = "faucet"
client = GrapheneAPI("localhost", 8092, "", "")
obj = client.get_object("2.0.0")[0]
expiration = formatTimeFromNow(obj["parameters"]["committee_proposal_review_period"] + 30)
TX_HEADER = 14
TRANSFER_OP = 22
phases = [{
"maximum_transaction_size": 1 * 1024, # 1 kb
"maximum_block_size": 1 * 1024 * 1024, # 1 MB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 1 * 1024, # 1 kb
"maximum_block_size": 5 * 1024 * 1024, # 5 MB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 10 * 1024, # 10 kb
"maximum_block_size": 5 * 1024 * 1024, # 5 MB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 100 * 1024, # 100 kb
"maximum_block_size": 5 * 1024 * 1024, # 10 MB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 1 * 1024, # 1 kb
"maximum_block_size": 10 * 1024 * 1024, # 10 MB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 10 * 1024 * 1024, # 10 Mb
"maximum_block_size": 1024 * 1024 * 1024, # 1 GB
"block_interval": 3, # 3 secs
},{
"maximum_transaction_size": 100 * 1024, # 100 kB
"maximum_block_size": 1 * 1024 * 1024, # 1 MB
"block_interval": 2, # 2 secs
},{
"maximum_transaction_size": 10 * 1024 * 1024, # 10 Mb
"maximum_block_size": 1024 * 1024 * 1024, # 1 GB
"block_interval": 10, # 10 secs
},{
"maximum_transaction_size": 10 * 1024 * 1024, # 10 Mb
"maximum_block_size": 1024 * 1024 * 1024, # 1 GB
"block_interval": 1, # 1 secs
}]
tx = client.propose_parameter_change(
proposer,
expiration,
phases[0], # Pick Phase!
broadcast
)
pprint(tx)
if not broadcast:
print("=" * 80)
print("Set broadcast to 'True' if the transaction shall be broadcast!")