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 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/address/',
25 SANE_MAX_TARGET=2**256//2**32 - 1,
27 bitcoin_testnet=math.Object(
28 P2P_PREFIX='fabfb5da'.decode('hex'),
32 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
33 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
34 (yield bitcoind.rpc_getinfo())['testnet']
36 POW_FUNC=data.hash256,
39 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'),
40 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
41 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/address/',
42 SANE_MAX_TARGET=2**256//2**32 - 1,
46 P2P_PREFIX='f9beb4fe'.decode('hex'),
50 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
51 'namecoinaddress' in (yield bitcoind.rpc_help()) and
52 not (yield bitcoind.rpc_getinfo())['testnet']
54 POW_FUNC=data.hash256,
57 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'),
58 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
59 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/a/',
60 SANE_MAX_TARGET=2**256//2**32 - 1,
62 namecoin_testnet=math.Object(
63 P2P_PREFIX='fabfb5fe'.decode('hex'),
67 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
68 'namecoinaddress' in (yield bitcoind.rpc_help()) and
69 (yield bitcoind.rpc_getinfo())['testnet']
71 POW_FUNC=data.hash256,
74 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'),
75 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
76 ADDRESS_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/a/',
77 SANE_MAX_TARGET=2**256//2**32 - 1,
81 P2P_PREFIX='fbc0b6db'.decode('hex'),
85 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
86 'litecoinaddress' in (yield bitcoind.rpc_help()) and
87 not (yield bitcoind.rpc_getinfo())['testnet']
89 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
92 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'),
93 BLOCK_EXPLORER_URL_PREFIX='http://abe.liteco.in/block/',
94 ADDRESS_EXPLORER_URL_PREFIX='http://abe.liteco.in/address/',
95 SANE_MAX_TARGET=2**256//1000 - 1,
97 litecoin_testnet=math.Object(
98 P2P_PREFIX='fcc1b7dc'.decode('hex'),
102 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
103 'litecoinaddress' in (yield bitcoind.rpc_help()) and
104 (yield bitcoind.rpc_getinfo())['testnet']
106 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
107 BLOCK_PERIOD=150, # s
109 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'),
110 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
111 ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
112 SANE_MAX_TARGET=2**256//1000 - 1,
115 for net_name, net in nets.iteritems():