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),
28 DUST_THRESHOLD=0.001e8,
30 bitcoin_testnet=math.Object(
31 P2P_PREFIX='0b110907'.decode('hex'),
35 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
36 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
37 (yield bitcoind.rpc_getinfo())['testnet']
39 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
40 POW_FUNC=data.hash256,
43 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'),
44 BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/block/',
45 ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/testnet/address/',
46 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
52 P2P_PREFIX='f9beb4fe'.decode('hex'),
56 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
57 'namecoinaddress' in (yield bitcoind.rpc_help()) and
58 not (yield bitcoind.rpc_getinfo())['testnet']
60 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
61 POW_FUNC=data.hash256,
64 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'),
65 BLOCK_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/b/',
66 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.dot-bit.org/a/',
67 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
71 namecoin_testnet=math.Object(
72 P2P_PREFIX='fabfb5fe'.decode('hex'),
76 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
77 'namecoinaddress' in (yield bitcoind.rpc_help()) and
78 (yield bitcoind.rpc_getinfo())['testnet']
80 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
81 POW_FUNC=data.hash256,
84 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'),
85 BLOCK_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/b/',
86 ADDRESS_EXPLORER_URL_PREFIX='http://testnet.explorer.dot-bit.org/a/',
87 SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
93 P2P_PREFIX='fbc0b6db'.decode('hex'),
97 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
98 'litecoinaddress' in (yield bitcoind.rpc_help()) and
99 not (yield bitcoind.rpc_getinfo())['testnet']
101 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
102 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
103 BLOCK_PERIOD=150, # s
105 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'),
106 BLOCK_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/block/',
107 ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
108 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
109 DUMB_SCRYPT_DIFF=2**16,
110 DUST_THRESHOLD=0.03e8,
112 litecoin_testnet=math.Object(
113 P2P_PREFIX='fcc1b7dc'.decode('hex'),
117 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
118 'litecoinaddress' in (yield bitcoind.rpc_help()) and
119 (yield bitcoind.rpc_getinfo())['testnet']
121 SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
122 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
123 BLOCK_PERIOD=150, # s
125 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'),
126 BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
127 ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
128 SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
129 DUMB_SCRYPT_DIFF=2**16,
133 terracoin=math.Object(
134 P2P_PREFIX='42babe56'.decode('hex'),
138 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
139 'terracoinaddress' in (yield bitcoind.rpc_help()) and
140 not (yield bitcoind.rpc_getinfo())['testnet']
142 SUBSIDY_FUNC=lambda height: 20*100000000 >> (height + 1)//1050000,
143 POW_FUNC=data.hash256,
144 BLOCK_PERIOD=120, # s
146 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'),
147 BLOCK_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/block/',
148 ADDRESS_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/address/',
149 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
153 terracoin_testnet=math.Object(
154 P2P_PREFIX='41babe56'.decode('hex'),
158 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
159 'terracoinaddress' in (yield bitcoind.rpc_help()) and
160 (yield bitcoind.rpc_getinfo())['testnet']
162 SUBSIDY_FUNC=lambda height: 20*100000000 >> (height + 1)//1050000,
163 POW_FUNC=data.hash256,
164 BLOCK_PERIOD=120, # s
166 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'),
167 BLOCK_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/testnet/block/',
168 ADDRESS_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:3750/testnet/address/',
169 SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
175 for net_name, net in nets.iteritems():