bdead375539d83d5bb910283c17fc43a2c75dcd4
[p2pool.git] / p2pool / bitcoin / namecoin.py
1 from twisted.internet import defer
2
3 class Mainnet(object):
4     BITCOIN_P2P_PREFIX = 'f9beb4fe'.decode('hex')
5     BITCOIN_P2P_PORT = 8334
6     BITCOIN_ADDRESS_VERSION = 52
7     BITCOIN_RPC_PORT = 8332
8     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
9         'name_firstupdate' in (yield bitcoind.rpc_help()) and
10         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
11         not (yield bitcoind.rpc_getinfo())['testnet']
12     )))
13     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
14     BITCOIN_SYMBOL = 'NMC'
15
16 class Testnet(object):
17     BITCOIN_P2P_PREFIX = 'fabfb5fe'.decode('hex')
18     BITCOIN_P2P_PORT = 18334
19     BITCOIN_ADDRESS_VERSION = 111
20     BITCOIN_RPC_PORT = 8332
21     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
22         'name_firstupdate' in (yield bitcoind.rpc_help()) and
23         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
24         (yield bitcoind.rpc_getinfo())['testnet']
25     )))
26     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
27     BITCOIN_SYMBOL = 'tNMC'