consolidated network definitions
[p2pool.git] / p2pool / bitcoin / networks.py
1 from twisted.internet import defer
2
3
4 class BitcoinMainnet(object):
5     BITCOIN_P2P_PREFIX = 'f9beb4d9'.decode('hex')
6     BITCOIN_P2P_PORT = 8333
7     BITCOIN_ADDRESS_VERSION = 0
8     BITCOIN_RPC_PORT = 8332
9     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
10         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
11         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
12         not (yield bitcoind.rpc_getinfo())['testnet']
13     )))
14     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
15     BITCOIN_SYMBOL = 'BTC'
16
17 class BitcoinTestnet(object):
18     BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
19     BITCOIN_P2P_PORT = 18333
20     BITCOIN_ADDRESS_VERSION = 111
21     BITCOIN_RPC_PORT = 8332
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         (yield bitcoind.rpc_getinfo())['testnet']
26     )))
27     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
28     BITCOIN_SYMBOL = 'tBTC'
29
30
31 class NamecoinMainnet(object):
32     BITCOIN_P2P_PREFIX = 'f9beb4fe'.decode('hex')
33     BITCOIN_P2P_PORT = 8334
34     BITCOIN_ADDRESS_VERSION = 52
35     BITCOIN_RPC_PORT = 8332
36     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
37         'name_firstupdate' in (yield bitcoind.rpc_help()) and
38         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
39         not (yield bitcoind.rpc_getinfo())['testnet']
40     )))
41     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
42     BITCOIN_SYMBOL = 'NMC'
43
44 class NamecoinTestnet(object):
45     BITCOIN_P2P_PREFIX = 'fabfb5fe'.decode('hex')
46     BITCOIN_P2P_PORT = 18334
47     BITCOIN_ADDRESS_VERSION = 111
48     BITCOIN_RPC_PORT = 8332
49     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
50         'name_firstupdate' in (yield bitcoind.rpc_help()) and
51         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
52         (yield bitcoind.rpc_getinfo())['testnet']
53     )))
54     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
55     BITCOIN_SYMBOL = 'tNMC'
56
57
58 class IxcoinMainnet(object):
59     BITCOIN_P2P_PREFIX = 'f9beb4d9'.decode('hex')
60     BITCOIN_P2P_PORT = 8337
61     BITCOIN_ADDRESS_VERSION = 138
62     BITCOIN_RPC_PORT = 8338
63     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
64         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
65         'ixcoinaddress' in (yield bitcoind.rpc_help()) and
66         not (yield bitcoind.rpc_getinfo())['testnet']
67     )))
68     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
69     BITCOIN_SYMBOL = 'IXC'
70
71 class IxcoinTestnet(object):
72     BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
73     BITCOIN_P2P_PORT = 18337
74     BITCOIN_ADDRESS_VERSION = 111
75     BITCOIN_RPC_PORT = 8338
76     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
77         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
78         'ixcoinaddress' in (yield bitcoind.rpc_help()) and
79         (yield bitcoind.rpc_getinfo())['testnet']
80     )))
81     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
82     BITCOIN_SYMBOL = 'tIXC'
83
84
85 class I0coinMainnet(object):
86     BITCOIN_P2P_PREFIX = 'f1b2b3d4'.decode('hex')
87     BITCOIN_P2P_PORT = 7333
88     BITCOIN_ADDRESS_VERSION = 105
89     BITCOIN_RPC_PORT = 7332
90     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
91         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
92         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
93         'i0coinaddress' in (yield bitcoind.rpc_help()) and
94         not (yield bitcoind.rpc_getinfo())['testnet']
95     )))
96     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
97     BITCOIN_SYMBOL = 'I0C'
98
99 class I0coinTestnet(object):
100     BITCOIN_P2P_PREFIX = 'f5b6b7d8'.decode('hex')
101     BITCOIN_P2P_PORT = 17333
102     BITCOIN_ADDRESS_VERSION = 112
103     BITCOIN_RPC_PORT = 7332
104     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
105         'name_firstupdate' not in (yield bitcoind.rpc_help()) and
106         'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
107         'i0coinaddress' in (yield bitcoind.rpc_help()) and
108         (yield bitcoind.rpc_getinfo())['testnet']
109     )))
110     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
111     BITCOIN_SYMBOL = 'tI0C'
112
113
114 class SolidcoinMainnet(object):
115     BITCOIN_P2P_PREFIX = 'deadbabe'.decode('hex')
116     BITCOIN_P2P_PORT = 7555
117     BITCOIN_ADDRESS_VERSION = 125
118     BITCOIN_RPC_PORT = 8332
119     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
120         'solidcoinaddress' in (yield bitcoind.rpc_help()) and
121         not (yield bitcoind.rpc_getinfo())['testnet']
122     )))
123     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 32*100000000 >> (height + 1)//300000)
124     BITCOIN_SYMBOL = 'SC'
125
126
127 class LitecoinMainnet(object):
128     BITCOIN_P2P_PREFIX = 'fbc0b6db'.decode('hex')
129     BITCOIN_P2P_PORT = 9333
130     BITCOIN_ADDRESS_VERSION = 48
131     BITCOIN_RPC_PORT = 9332
132     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
133         'litecoinaddress' in (yield bitcoind.rpc_help()) and
134         not (yield bitcoind.rpc_getinfo())['testnet']
135     )))
136     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//840000)
137     BITCOIN_POW_SCRYPT = True;
138     BITCOIN_SYMBOL = 'LTC'
139
140 class LitecoinTestnet(object):
141     BITCOIN_P2P_PREFIX = 'fcc1b7dc'.decode('hex')
142     BITCOIN_P2P_PORT = 19333
143     BITCOIN_ADDRESS_VERSION = 111
144     BITCOIN_RPC_PORT = 19332
145     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
146         'litecoinaddress' in (yield bitcoind.rpc_help()) and
147         (yield bitcoind.rpc_getinfo())['testnet']
148     )))
149     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//840000)
150     BITCOIN_POW_SCRYPT = True;
151     BITCOIN_SYMBOL = 'tLTC'