52b1a87aed648f5422d18fee4ccfc252f6519aec
[p2pool.git] / p2pool / bitcoin / networks.py
1 from twisted.internet import defer
2
3 from . import data
4 from p2pool.util import math
5
6 BitcoinMainnet = math.Object(
7     P2P_PREFIX='f9beb4d9'.decode('hex'),
8     P2P_PORT=8333,
9     ADDRESS_VERSION=0,
10     RPC_PORT=8332,
11     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
12         'bitcoinaddress' in (yield bitcoind.rpc_help()) and
13         not (yield bitcoind.rpc_getinfo())['testnet']
14     )),
15     POW_FUNC=data.block_header_type.hash256,
16     SYMBOL='BTC',
17 )
18 BitcoinTestnet = math.Object(
19     P2P_PREFIX='fabfb5da'.decode('hex'),
20     P2P_PORT=18333,
21     ADDRESS_VERSION=111,
22     RPC_PORT=8332,
23     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
24         'bitcoinaddress' in (yield bitcoind.rpc_help()) and
25         (yield bitcoind.rpc_getinfo())['testnet']
26     )),
27     POW_FUNC=data.block_header_type.hash256,
28     SYMBOL='tBTC',
29 )
30
31 NamecoinMainnet = math.Object(
32     P2P_PREFIX='f9beb4fe'.decode('hex'),
33     P2P_PORT=8334,
34     ADDRESS_VERSION=52,
35     RPC_PORT=8332,
36     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
37         'namecoinaddress' in (yield bitcoind.rpc_help()) and
38         not (yield bitcoind.rpc_getinfo())['testnet']
39     )),
40     POW_FUNC=data.block_header_type.hash256,
41     SYMBOL='NMC',
42 )
43 NamecoinTestnet = math.Object(
44     P2P_PREFIX='fabfb5fe'.decode('hex'),
45     P2P_PORT=18334,
46     ADDRESS_VERSION=111,
47     RPC_PORT=8332,
48     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
49         'namecoinaddress' in (yield bitcoind.rpc_help()) and
50         (yield bitcoind.rpc_getinfo())['testnet']
51     )),
52     POW_FUNC=data.block_header_type.hash256,
53     SYMBOL='tNMC',
54 )
55
56 LitecoinMainnet = math.Object(
57     P2P_PREFIX='fbc0b6db'.decode('hex'),
58     P2P_PORT=9333,
59     ADDRESS_VERSION=48,
60     RPC_PORT=9332,
61     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
62         'litecoinaddress' in (yield bitcoind.rpc_help()) and
63         not (yield bitcoind.rpc_getinfo())['testnet']
64     )),
65     POW_FUNC=data.block_header_type.scrypt,
66     SYMBOL='LTC',
67 )
68 LitecoinTestnet = math.Object(
69     P2P_PREFIX='fcc1b7dc'.decode('hex'),
70     P2P_PORT=19333,
71     ADDRESS_VERSION=111,
72     RPC_PORT=19332,
73     RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
74         'litecoinaddress' in (yield bitcoind.rpc_help()) and
75         (yield bitcoind.rpc_getinfo())['testnet']
76     )),
77     POW_FUNC=data.block_header_type.scrypt,
78     SYMBOL='tLTC',
79 )