-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (31 loc) · 985 Bytes
/
main.py
File metadata and controls
40 lines (31 loc) · 985 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
29
30
31
32
33
34
35
36
37
38
39
40
import sys
import argparse
import logging
from algorithm import is_valid_algorithm
from pool import Pool
log_level = logging.DEBUG
logging.basicConfig(
format='[%(levelname)s][%(asctime)s]: %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p',
encoding='utf-8',
level=log_level)
parser = argparse.ArgumentParser(description='')
parser.add_argument('--host',
type=str,
default='127.0.0.1',
help="")
parser.add_argument('--port',
type=str,
default='7878',
help="")
parser.add_argument('--algo',
default='ethash',
type=str,
help="[smart_mining, ethash, kawpow, meowpow]")
args = parser.parse_args()
if is_valid_algorithm(args.algo) is False:
logging.error(f'Algorithm unsupported {args.algo}')
sys.exit(1)
pool = Pool(args.algo, args.host, int(args.port))
pool.bind()
pool.process()