moved version check into network definitions so it doesn't apply to litecoin
[p2pool.git] / p2pool / networks.py
1 from p2pool.bitcoin import networks
2 from p2pool.util import math
3
4 # CHAIN_LENGTH = number of shares back client keeps
5 # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout
6 # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH
7 # REAL_CHAIN_LENGTH must be changed in sync with all other clients
8 # changes can be done by changing one, then the other
9
10 nets = dict(
11     bitcoin=math.Object(
12         PARENT=networks.nets['bitcoin'],
13         SHARE_PERIOD=10, # seconds
14         CHAIN_LENGTH=24*60*60//10, # shares
15         REAL_CHAIN_LENGTH=24*60*60//10, # shares
16         TARGET_LOOKBEHIND=200, # shares
17         SPREAD=3, # blocks
18         IDENTIFIER='fc70035c7a81bc6f'.decode('hex'),
19         PREFIX='2472ef181efcd37b'.decode('hex'),
20         P2P_PORT=9333,
21         MAX_TARGET=2**256//2**32 - 1,
22         PERSIST=True,
23         WORKER_PORT=9332,
24         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(' '),
25         ANNOUNCE_CHANNEL='#p2pool',
26         VERSION_CHECK=lambda (major, minor, patch), temp_work: major >= 7 or (major == 6 and patch >= 3) or (major == 5 and minor >= 4) or '/P2SH/' in temp_work['coinbaseflags'],
27     ),
28     bitcoin_testnet=math.Object(
29         PARENT=networks.nets['bitcoin_testnet'],
30         SHARE_PERIOD=10, # seconds
31         CHAIN_LENGTH=24*60*60//10, # shares
32         REAL_CHAIN_LENGTH=24*60*60//10, # shares
33         TARGET_LOOKBEHIND=200, # shares
34         SPREAD=3, # blocks
35         IDENTIFIER='5fc2be2d4f0d6bfb'.decode('hex'),
36         PREFIX='3f6057a15036f441'.decode('hex'),
37         P2P_PORT=19333,
38         MAX_TARGET=2**256//2**32 - 1,
39         PERSIST=False,
40         WORKER_PORT=19332,
41         BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
42         ANNOUNCE_CHANNEL='#p2pool-alt',
43         VERSION_CHECK=lambda (major, minor, patch), temp_work: major >= 7 or (major == 6 and patch >= 3) or (major == 5 and minor >= 4) or '/P2SH/' in temp_work['coinbaseflags'],
44     ),
45     
46     litecoin=math.Object(
47         PARENT=networks.nets['litecoin'],
48         SHARE_PERIOD=10, # seconds
49         CHAIN_LENGTH=24*60*60//10, # shares
50         REAL_CHAIN_LENGTH=24*60*60//10, # shares
51         TARGET_LOOKBEHIND=200, # shares
52         SPREAD=12, # blocks
53         IDENTIFIER='e037d5b8c6923410'.decode('hex'),
54         PREFIX='7208c1a53ef629b0'.decode('hex'),
55         P2P_PORT=9338,
56         MAX_TARGET=2**256//2**20 - 1,
57         PERSIST=True,
58         WORKER_PORT=9327,
59         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(' '),
60         ANNOUNCE_CHANNEL='#p2pool-alt',
61         VERSION_CHECK=lambda (major, minor, patch), temp_work: True,
62     ),
63     litecoin_testnet=math.Object(
64         PARENT=networks.nets['litecoin_testnet'],
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         P2P_PORT=19338,
73         MAX_TARGET=2**256//2000 - 1,
74         PERSIST=False,
75         WORKER_PORT=19327,
76         BOOTSTRAP_ADDRS='72.14.191.28'.split(' '),
77         ANNOUNCE_CHANNEL='#p2pool-alt',
78         VERSION_CHECK=lambda (major, minor, patch), temp_work: True,
79     ),
80 )
81 for net_name, net in nets.iteritems():
82     net.NAME = net_name