4 from twisted.internet import defer
7 from p2pool.util import math, pack
9 BitcoinMainnet = math.Object(
10 P2P_PREFIX='f9beb4d9'.decode('hex'),
14 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
15 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
16 not (yield bitcoind.rpc_getinfo())['testnet']
18 POW_FUNC=data.hash256,
20 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'),
22 BitcoinTestnet = math.Object(
23 P2P_PREFIX='fabfb5da'.decode('hex'),
27 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
28 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
29 (yield bitcoind.rpc_getinfo())['testnet']
31 POW_FUNC=data.hash256,
33 CONF_FILE_FUNC=BitcoinMainnet.CONF_FILE_FUNC,
36 NamecoinMainnet = math.Object(
37 P2P_PREFIX='f9beb4fe'.decode('hex'),
41 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
42 'namecoinaddress' in (yield bitcoind.rpc_help()) and
43 not (yield bitcoind.rpc_getinfo())['testnet']
45 POW_FUNC=data.hash256,
47 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'),
49 NamecoinTestnet = math.Object(
50 P2P_PREFIX='fabfb5fe'.decode('hex'),
54 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
55 'namecoinaddress' in (yield bitcoind.rpc_help()) and
56 (yield bitcoind.rpc_getinfo())['testnet']
58 POW_FUNC=data.hash256,
60 CONF_FILE_FUNC=NamecoinMainnet.CONF_FILE_FUNC,
63 LitecoinMainnet = math.Object(
64 P2P_PREFIX='fbc0b6db'.decode('hex'),
68 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
69 'litecoinaddress' in (yield bitcoind.rpc_help()) and
70 not (yield bitcoind.rpc_getinfo())['testnet']
72 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
74 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'),
76 LitecoinTestnet = math.Object(
77 P2P_PREFIX='fcc1b7dc'.decode('hex'),
81 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
82 'litecoinaddress' in (yield bitcoind.rpc_help()) and
83 (yield bitcoind.rpc_getinfo())['testnet']
85 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
87 CONF_FILE_FUNC=LitecoinMainnet.CONF_FILE_FUNC,