-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (41 loc) · 1.34 KB
/
main.py
File metadata and controls
49 lines (41 loc) · 1.34 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from .blockchain_metrics import calculate_metrics
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
'-f', '--filename',
dest='filename',
action='store',
required=False,
default='addresses.yaml',
help='specifies the name of the file containing the addresses',
)
parser.add_argument(
'-n', '--network',
dest='network',
action='store',
required=True,
default='all',
help='specifies the name of the network to use (all/polygon/sepolia)',
)
parser.add_argument(
'-c', '--contracts',
dest='doContracts',
action='store_true',
required=False,
default=False,
help='specifies whether to start from contracts (or from wallet addresses)',
)
args, unknown = parser.parse_known_args()
if len(unknown) > 0:
print(f'Unknown options {unknown}')
parser.print_help()
exit(-1)
if args.network not in ['polygon', 'sepolia', 'all']:
print(f'Network not supported: {args.network}')
parser.print_help()
exit(-1)
calculate_metrics(filename=args.filename, doContracts=args.doContracts, network=args.network)