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 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
20 POW_FUNC=data.hash256,
23 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'),
24 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/block/',
25 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/address/',
26 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
28 bitcoin_testnet=math.Object(
29 P2P_PREFIX='0b110907'.decode('hex'),
33 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
34 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
35 (yield bitcoind.rpc_getinfo())['testnet']
37 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
38 POW_FUNC=data.hash256,
41 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'),
42 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
43 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/address/',
44 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
48 P2P_PREFIX='f9beb4fe'.decode('hex'),
52 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
53 'namecoinaddress' in (yield bitcoind.rpc_help()) and
54 not (yield bitcoind.rpc_getinfo())['testnet']
56 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
57 POW_FUNC=data.hash256,
60 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'),
61 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
62 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/a/',
63 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
65 namecoin_testnet=math.Object(
66 P2P_PREFIX='fabfb5fe'.decode('hex'),
70 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
71 'namecoinaddress' in (yield bitcoind.rpc_help()) and
72 (yield bitcoind.rpc_getinfo())['testnet']
74 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
75 POW_FUNC=data.hash256,
78 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'),
79 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
80 ADDRESS_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/a/',
81 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
85 P2P_PREFIX='fbc0b6db'.decode('hex'),
89 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
90 'litecoinaddress' in (yield bitcoind.rpc_help()) and
91 not (yield bitcoind.rpc_getinfo())['testnet']
93 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
94 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
97 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'),
98 BLOCK_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/block/',
99 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
100 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
102 litecoin_testnet=math.Object(
103 P2P_PREFIX='fcc1b7dc'.decode('hex'),
107 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
108 'litecoinaddress' in (yield bitcoind.rpc_help()) and
109 (yield bitcoind.rpc_getinfo())['testnet']
111 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
112 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
113 BLOCK_PERIOD=150, # s
115 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'),
116 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
117 ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
118 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
121 for net_name, net in nets.iteritems():