added testcase for node+work that simulates mining 100 shares
[p2pool.git] / p2pool / bitcoin / networks.py
index a0f9b53..30666cd 100644 (file)
@@ -16,6 +16,7 @@ nets = dict(
             'bitcoinaddress' in (yield bitcoind.rpc_help()) and
             not (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
         POW_FUNC=data.hash256,
         BLOCK_PERIOD=600, # s
         SYMBOL='BTC',
@@ -25,14 +26,15 @@ nets = dict(
         SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
     ),
     bitcoin_testnet=math.Object(
-        P2P_PREFIX='fabfb5da'.decode('hex'),
+        P2P_PREFIX='0b110907'.decode('hex'),
         P2P_PORT=18333,
         ADDRESS_VERSION=111,
-        RPC_PORT=8332,
+        RPC_PORT=18332,
         RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
             'bitcoinaddress' in (yield bitcoind.rpc_help()) and
             (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
         POW_FUNC=data.hash256,
         BLOCK_PERIOD=600, # s
         SYMBOL='tBTC',
@@ -51,6 +53,7 @@ nets = dict(
             'namecoinaddress' in (yield bitcoind.rpc_help()) and
             not (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
         POW_FUNC=data.hash256,
         BLOCK_PERIOD=600, # s
         SYMBOL='NMC',
@@ -68,6 +71,7 @@ nets = dict(
             'namecoinaddress' in (yield bitcoind.rpc_help()) and
             (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//210000,
         POW_FUNC=data.hash256,
         BLOCK_PERIOD=600, # s
         SYMBOL='tNMC',
@@ -86,12 +90,13 @@ nets = dict(
             'litecoinaddress' in (yield bitcoind.rpc_help()) and
             not (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
         POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
         BLOCK_PERIOD=150, # s
         SYMBOL='LTC',
         CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Litecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litecoin'), 'litecoin.conf'),
-        BLOCK_EXPLORER_URL_PREFIX='http://abe.liteco.in/block/',
-        ADDRESS_EXPLORER_URL_PREFIX='http://abe.liteco.in/address/',
+        BLOCK_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/block/',
+        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
         SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
     ),
     litecoin_testnet=math.Object(
@@ -103,13 +108,14 @@ nets = dict(
             'litecoinaddress' in (yield bitcoind.rpc_help()) and
             (yield bitcoind.rpc_getinfo())['testnet']
         )),
+        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
         POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
         BLOCK_PERIOD=150, # s
         SYMBOL='tLTC',
         CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Litecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litecoin'), 'litecoin.conf'),
         BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
         ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
-        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
+        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
     ),
 )
 for net_name, net in nets.iteritems():