4 from twisted.internet import defer
7 from p2pool.util import math, pack
11 P2P_PREFIX='f9beb4d9'.decode('hex'),
15 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
16 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
17 not (yield bitcoind.rpc_getinfo())['testnet']
19 POW_FUNC=data.hash256,
22 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'),
23 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/block/',
25 bitcoin_testnet=math.Object(
26 P2P_PREFIX='fabfb5da'.decode('hex'),
30 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
31 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
32 (yield bitcoind.rpc_getinfo())['testnet']
34 POW_FUNC=data.hash256,
37 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'),
38 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
41 nameecoin=math.Object(
42 P2P_PREFIX='f9beb4fe'.decode('hex'),
46 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
47 'namecoinaddress' in (yield bitcoind.rpc_help()) and
48 not (yield bitcoind.rpc_getinfo())['testnet']
50 POW_FUNC=data.hash256,
53 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'),
54 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
56 namecoin_testnet=math.Object(
57 P2P_PREFIX='fabfb5fe'.decode('hex'),
61 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
62 'namecoinaddress' in (yield bitcoind.rpc_help()) and
63 (yield bitcoind.rpc_getinfo())['testnet']
65 POW_FUNC=data.hash256,
68 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'),
69 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
73 P2P_PREFIX='fbc0b6db'.decode('hex'),
77 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
78 'litecoinaddress' in (yield bitcoind.rpc_help()) and
79 not (yield bitcoind.rpc_getinfo())['testnet']
81 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
84 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'),
85 BLOCK_EXPLORER_URL_PREFIX='http://abe.liteco.in/block/',
87 litecoin_testnet=math.Object(
88 P2P_PREFIX='fcc1b7dc'.decode('hex'),
92 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
93 'litecoinaddress' in (yield bitcoind.rpc_help()) and
94 (yield bitcoind.rpc_getinfo())['testnet']
96 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
99 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'),
100 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
103 for net_name, net in nets.iteritems():