+import os
+import platform
+
from twisted.internet import defer
from . import data
)),
POW_FUNC=data.hash256,
SYMBOL='BTC',
+ CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Bitcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Bitcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bitcoin'), 'bitcoin.conf'),
)
BitcoinTestnet = math.Object(
P2P_PREFIX='fabfb5da'.decode('hex'),
)),
POW_FUNC=data.hash256,
SYMBOL='tBTC',
+ CONF_FILE_FUNC=BitcoinMainnet.CONF_FILE_FUNC,
)
NamecoinMainnet = math.Object(
)),
POW_FUNC=data.hash256,
SYMBOL='NMC',
+ CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Namecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Namecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.namecoin'), 'bitcoin.conf'),
)
NamecoinTestnet = math.Object(
P2P_PREFIX='fabfb5fe'.decode('hex'),
)),
POW_FUNC=data.hash256,
SYMBOL='tNMC',
+ CONF_FILE_FUNC=NamecoinMainnet.CONF_FILE_FUNC,
)
LitecoinMainnet = math.Object(
)),
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
SYMBOL='LTC',
+ CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Litecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litecoin'), 'litecoin.conf'),
)
LitecoinTestnet = math.Object(
P2P_PREFIX='fcc1b7dc'.decode('hex'),
)),
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
SYMBOL='tLTC',
+ CONF_FILE_FUNC=LitecoinMainnet.CONF_FILE_FUNC,
)
args.bitcoind_rpc_username, args.bitcoind_rpc_password = ([None, None] + args.bitcoind_rpc_userpass)[-2:]
if args.bitcoind_rpc_password is None:
- if not hasattr(net, 'CONF_FILE_FUNC'):
+ if not hasattr(net.PARENT, 'CONF_FILE_FUNC'):
parser.error('This network has no configuration file function. Manually enter your RPC password.')
- conf_path = net.CONF_FILE_FUNC()
+ conf_path = net.PARENT.CONF_FILE_FUNC()
if not os.path.exists(conf_path):
parser.error('''Bitcoin configuration file not found. Manually enter your RPC password.\r\n'''
'''If you actually haven't created a configuration file, you should create one at %s with the text:\r\n'''
-import os
-import platform
-
from p2pool.bitcoin import networks
from p2pool.util import math
PERSIST=True,
WORKER_PORT=9332,
BOOTSTRAP_ADDRS='74.220.242.6:9334 93.97.192.93 66.90.73.83 67.83.108.0 219.84.64.174 24.167.17.248 109.74.195.142 83.211.86.49 89.78.212.44 94.23.34.145 168.7.116.243 72.14.191.28 94.174.40.189:9344'.split(' '),
- CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Bitcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Bitcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bitcoin'), 'bitcoin.conf'),
)
BitcoinTestnet = math.Object(
PARENT=networks.BitcoinTestnet,
PERSIST=False,
WORKER_PORT=19332,
BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
- CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Bitcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Bitcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bitcoin'), 'testnet', 'bitcoin.conf'),
)
LitecoinMainnet = math.Object(
PERSIST=True,
WORKER_PORT=9327,
BOOTSTRAP_ADDRS='76.26.53.101 124.205.120.178 190.195.79.161 173.167.113.73 82.161.65.210 67.83.108.0 78.101.67.239 78.100.161.252 87.58.117.233 78.100.162.223 216.239.45.4 78.101.131.221 72.14.191.28 97.81.163.217 69.126.183.240 219.84.64.174 78.101.119.27 89.211.228.244 178.152.122.30 172.16.0.3 76.26.53.101:51319'.split(' '),
- CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Litecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litecoin'), 'litecoin.conf'),
)
LitecoinTestnet = math.Object(
PARENT=networks.LitecoinTestnet,
PERSIST=False,
WORKER_PORT=19327,
BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
- CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Litecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litecoin'), 'testnet', 'litecoin.conf'),
)
nets=dict((net.NAME, net) for net in set([BitcoinMainnet, BitcoinTestnet, LitecoinMainnet, LitecoinTestnet]))