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//1000 - 1, 2**256//2**32 - 1),
29 bitcoin_testnet=math.Object(
30 P2P_PREFIX='0b110907'.decode('hex'),
34 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
35 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
36 (yield bitcoind.rpc_getinfo())['testnet']
38 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
39 POW_FUNC=data.hash256,
42 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'),
43 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
44 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/address/',
45 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
50 P2P_PREFIX='f9beb4fe'.decode('hex'),
54 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
55 'namecoinaddress' in (yield bitcoind.rpc_help()) and
56 not (yield bitcoind.rpc_getinfo())['testnet']
58 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
59 POW_FUNC=data.hash256,
62 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'),
63 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
64 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/a/',
65 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
68 namecoin_testnet=math.Object(
69 P2P_PREFIX='fabfb5fe'.decode('hex'),
73 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
74 'namecoinaddress' in (yield bitcoind.rpc_help()) and
75 (yield bitcoind.rpc_getinfo())['testnet']
77 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
78 POW_FUNC=data.hash256,
81 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'),
82 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
83 ADDRESS_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/a/',
84 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
89 P2P_PREFIX='fbc0b6db'.decode('hex'),
93 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
94 'litecoinaddress' in (yield bitcoind.rpc_help()) and
95 not (yield bitcoind.rpc_getinfo())['testnet']
97 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
98 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
101 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'),
102 BLOCK_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/block/',
103 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
104 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
105 DUMB_SCRYPT_DIFF=2**16,
107 litecoin_testnet=math.Object(
108 P2P_PREFIX='fcc1b7dc'.decode('hex'),
112 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
113 'litecoinaddress' in (yield bitcoind.rpc_help()) and
114 (yield bitcoind.rpc_getinfo())['testnet']
116 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
117 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
118 BLOCK_PERIOD=150, # s
120 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'),
121 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
122 ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
123 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
124 DUMB_SCRYPT_DIFF=2**16,
127 terracoin=math.Object(
128 P2P_PREFIX='42babe56'.decode('hex'),
132 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
133 'terracoinaddress' in (yield bitcoind.rpc_help()) and
134 not (yield bitcoind.rpc_getinfo())['testnet']
136 SUBSIDY_FUNC=lambda height: 20*100000000 >> (height + 1)//1050000,
137 POW_FUNC=data.hash256,
138 BLOCK_PERIOD=120, # s
140 CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Terracoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Terracoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.terracoin'), 'terracoin.conf'),
141 BLOCK_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/block/',
142 ADDRESS_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/address/',
143 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
146 terracoin_testnet=math.Object(
147 P2P_PREFIX='41babe56'.decode('hex'),
151 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
152 'terracoinaddress' in (yield bitcoind.rpc_help()) and
153 (yield bitcoind.rpc_getinfo())['testnet']
155 SUBSIDY_FUNC=lambda height: 20*100000000 >> (height + 1)//1050000,
156 POW_FUNC=data.hash256,
157 BLOCK_PERIOD=120, # s
159 CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Terracoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Terracoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.terracoin'), 'terracoin.conf'),
160 BLOCK_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/testnet/block/',
161 ADDRESS_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/testnet/address/',
162 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
167 for net_name, net in nets.iteritems():