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/',
24 SANE_MAX_TARGET=2**256//2**32 - 1,
26 bitcoin_testnet=math.Object(
27 P2P_PREFIX='fabfb5da'.decode('hex'),
31 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
32 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
33 (yield bitcoind.rpc_getinfo())['testnet']
35 POW_FUNC=data.hash256,
38 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'),
39 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
40 SANE_MAX_TARGET=2**256//2**32 - 1,
43 nameecoin=math.Object(
44 P2P_PREFIX='f9beb4fe'.decode('hex'),
48 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
49 'namecoinaddress' in (yield bitcoind.rpc_help()) and
50 not (yield bitcoind.rpc_getinfo())['testnet']
52 POW_FUNC=data.hash256,
55 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'),
56 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
57 SANE_MAX_TARGET=2**256//2**32 - 1,
59 namecoin_testnet=math.Object(
60 P2P_PREFIX='fabfb5fe'.decode('hex'),
64 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
65 'namecoinaddress' in (yield bitcoind.rpc_help()) and
66 (yield bitcoind.rpc_getinfo())['testnet']
68 POW_FUNC=data.hash256,
71 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'),
72 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
73 SANE_MAX_TARGET=2**256//2**32 - 1,
77 P2P_PREFIX='fbc0b6db'.decode('hex'),
81 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
82 'litecoinaddress' in (yield bitcoind.rpc_help()) and
83 not (yield bitcoind.rpc_getinfo())['testnet']
85 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
88 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'),
89 BLOCK_EXPLORER_URL_PREFIX='http://abe.liteco.in/block/',
90 SANE_MAX_TARGET=2**256//1000 - 1,
92 litecoin_testnet=math.Object(
93 P2P_PREFIX='fcc1b7dc'.decode('hex'),
97 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
98 'litecoinaddress' in (yield bitcoind.rpc_help()) and
99 (yield bitcoind.rpc_getinfo())['testnet']
101 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
102 BLOCK_PERIOD=150, # s
104 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'),
105 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
106 SANE_MAX_TARGET=2**256//1000 - 1,
109 for net_name, net in nets.iteritems():