forked from KMDLabs/LabsNotary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listassetchainparams.py
executable file
·40 lines (35 loc) · 1.09 KB
/
listassetchainparams.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
#!/usr/bin/env python2
import os
import json
import sys
if len(sys.argv) > 1:
specific_chain = sys.argv[1]
else:
specific_chain = False
def format_param(param, value):
return '-' + str(param) + '=' + str(value)
def format_bool(param):
return '-' + str(param)
script_dir = os.getcwd()
with open(script_dir + '/assetchains.json') as file:
assetchains = json.load(file)
for chain in assetchains:
if specific_chain and chain['ac_name'] != specific_chain:
continue
params = []
for param, value in chain.items():
if param == 'freq':
continue
if param == 'branch':
continue
if param == 'burntxid':
continue
if type(value) is bool:
params.append(format_bool(param))
continue
if isinstance(value, list):
for dupe_value in value:
params.append(format_param(param, dupe_value))
else:
params.append(format_param(param, value))
print(' '.join(params))