-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconstants.py
More file actions
30 lines (26 loc) · 804 Bytes
/
constants.py
File metadata and controls
30 lines (26 loc) · 804 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
import os
import json
default_config_path = os.environ['HOME'] + '/.ethct.json'
try:
config = json.load(open(default_config_path))
except:
config = {
'accounts':[],
'defaultAccount': 0,
'network': 'ropsten',
'infurakey': '',
}
URL = {
'mainnet': "https://mainnet.infura.io/v3/" + config['infurakey'],
'ropsten': "https://ropsten.infura.io/v3/" + config['infurakey'],
'rinkeby': "https://rinkeby.infura.io/v3/" + config['infurakey'],
'kovan': "https://kovan.infura.io/v3/" + config['infurakey'],
'local': "http://localhost:8545",
}
NETWORK = config['network']
try:
defaultAccount = config['defaultAccount']
PRIVATE_KEY = config['accounts'][defaultAccount]
except:
defaultAccount = None
PRIVATE_KEY = None