4358cc5856434cd934da9daad7f0bd2cfedebeff
[p2pool.git] / p2pool / networks.py
1 import os
2 import platform
3
4 from p2pool.bitcoin import networks
5 from p2pool.util import math
6
7 # CHAIN_LENGTH = number of shares back client keeps
8 # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout
9 # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH
10 # REAL_CHAIN_LENGTH must be changed in sync with all other clients
11 # changes can be done by changing one, then the other
12
13 BitcoinMainnet = math.Object(
14     PARENT=networks.BitcoinMainnet,
15     SHARE_PERIOD=10, # seconds
16     CHAIN_LENGTH=24*60*60//10, # shares
17     REAL_CHAIN_LENGTH=24*60*60//10, # shares
18     TARGET_LOOKBEHIND=200, # shares
19     SPREAD=3, # blocks
20     IDENTIFIER='fc70035c7a81bc6f'.decode('hex'),
21     PREFIX='2472ef181efcd37b'.decode('hex'),
22     NAME='bitcoin',
23     P2P_PORT=9333,
24     MAX_TARGET=2**256//2**32 - 1,
25     PERSIST=True,
26     WORKER_PORT=9332,
27     BOOTSTRAP_ADDRS='74.220.242.6:9334 93.97.192.93 66.90.73.83 67.83.108.0 219.84.64.174 24.167.17.248 109.74.195.142 83.211.86.49 89.78.212.44 94.23.34.145 168.7.116.243 72.14.191.28 94.174.40.189:9344'.split(' '),
28     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'),
29 )
30 BitcoinTestnet = math.Object(
31     PARENT=networks.BitcoinTestnet,
32     SHARE_PERIOD=10, # seconds
33     CHAIN_LENGTH=24*60*60//10, # shares
34     REAL_CHAIN_LENGTH=24*60*60//10, # shares
35     TARGET_LOOKBEHIND=200, # shares
36     SPREAD=3, # blocks
37     IDENTIFIER='5fc2be2d4f0d6bfb'.decode('hex'),
38     PREFIX='3f6057a15036f441'.decode('hex'),
39     NAME='bitcoin_testnet',
40     P2P_PORT=19333,
41     MAX_TARGET=2**256//2**32 - 1,
42     PERSIST=False,
43     WORKER_PORT=19332,
44     BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
45 )
46
47 LitecoinMainnet = math.Object(
48     PARENT=networks.LitecoinMainnet,
49     SHARE_PERIOD=10, # seconds
50     CHAIN_LENGTH=24*60*60//10, # shares
51     REAL_CHAIN_LENGTH=24*60*60//10, # shares
52     TARGET_LOOKBEHIND=200, # shares
53     SPREAD=12, # blocks
54     IDENTIFIER='e037d5b8c6923410'.decode('hex'),
55     PREFIX='7208c1a53ef629b0'.decode('hex'),
56     NAME='litecoin',
57     P2P_PORT=9338,
58     MAX_TARGET=2**256//2**20 - 1,
59     PERSIST=True,
60     WORKER_PORT=9327,
61     BOOTSTRAP_ADDRS='76.26.53.101 124.205.120.178 190.195.79.161 173.167.113.73 82.161.65.210 67.83.108.0 78.101.67.239 78.100.161.252 87.58.117.233 78.100.162.223 216.239.45.4 78.101.131.221 72.14.191.28 97.81.163.217 69.126.183.240 219.84.64.174 78.101.119.27 89.211.228.244 178.152.122.30 172.16.0.3 76.26.53.101:51319'.split(' '),
62 )
63 LitecoinTestnet = math.Object(
64     PARENT=networks.LitecoinTestnet,
65     SHARE_PERIOD=10, # seconds
66     CHAIN_LENGTH=24*60*60//10, # shares
67     REAL_CHAIN_LENGTH=24*60*60//10, # shares
68     TARGET_LOOKBEHIND=200, # shares
69     SPREAD=12, # blocks
70     IDENTIFIER='cca5e24ec6408b1e'.decode('hex'),
71     PREFIX='ad9614f6466a39cf'.decode('hex'),
72     NAME='litecoin_testnet',
73     P2P_PORT=19338,
74     MAX_TARGET=2**256//2**17 - 1,
75     PERSIST=False,
76     WORKER_PORT=19327,
77     BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
78 )
79
80 nets=dict((net.NAME, net) for net in set([BitcoinMainnet, BitcoinTestnet, LitecoinMainnet, LitecoinTestnet]))
81 realnets=dict((net.NAME, net) for net in nets.itervalues() if '_testnet' not in net.NAME)