03441d8923bd94a738b767e766eaf0d1fd3aa9a4
[p2pool.git] / p2pool / bitcoin / i0coin.py
1 from twisted.internet import defer
2
3 class Mainnet(object):
4     BITCOIN_P2P_PREFIX = 'f1b2b3d4'.decode('hex')
5     BITCOIN_P2P_PORT = 7333
6     BITCOIN_ADDRESS_VERSION = 105
7     BITCOIN_RPC_PORT = 7332
8     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
9         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
10         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
11         'i0coinaddress' in (yield bitcoind.rpc_help()) and
12         not (yield bitcoind.rpc_getinfo())['testnet']
13     )))
14     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
15     BITCOIN_SYMBOL = 'I0C'
16
17 class Testnet(object):
18     BITCOIN_P2P_PREFIX = 'f5b6b7d8'.decode('hex')
19     BITCOIN_P2P_PORT = 17333
20     BITCOIN_ADDRESS_VERSION = 112
21     BITCOIN_RPC_PORT = 7332
22     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
23         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
24         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
25         'i0coinaddress' in (yield bitcoind.rpc_help()) and
26         (yield bitcoind.rpc_getinfo())['testnet']
27     )))
28     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
29     BITCOIN_SYMBOL = 'tI0C'