diff --git a/README.md b/README.md index 5f4b7cab..dcd07852 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,8 @@ http://stackoverflow.com/q/6034390/1260906 Running P2Pool: ------------------------- Vertcoin: -* Run P2Pool with the "--net vertcoin" or "--net vertcoin2" (if you want to connect to 2nd network; use --worker-port 9171 if you want default port for 2nd network workers) option. -* Run your miner program, connecting to 127.0.0.1 on port 9171 or 9172 (for 2nd network). +* Run P2Pool with the "--net vertcoin", "--net vertcoin2" (if you want to connect to 2nd network) or "--net vertcoin3" (for 3rd network) option. +* Run your miner program, connecting to 127.0.0.1 on port 9171, 9172 (for 2nd network) or 9174 (for 3rd network). GPUCcoin: * Run P2Pool with the "--net gpucoin" option. diff --git a/p2pool/bitcoin/networks.py b/p2pool/bitcoin/networks.py index 92417350..eaf20c1c 100644 --- a/p2pool/bitcoin/networks.py +++ b/p2pool/bitcoin/networks.py @@ -38,6 +38,24 @@ def spa_sub(n): return 101-i +def get_caishensubsidy(bnHeight): + nSubsidy = 28 + + if bnHeight == 0: + nSubsidy = 1 + elif bnHeight < 2: + nSubsidy = 560000 + elif bnHeight > 3583630: + nSubsidy = 1 + elif bnHeight > 2150178: + nSubsidy = 3 + elif bnHeight > 1075089: + nSubsidy = 5 + elif bnHeight > 358363: + nSubsidy = 10 + + return int(nSubsidy * 100000000) + def get_subsidy(nCap, nMaxSubsidy, bnTarget): bnLowerBound = 0.01 bnUpperBound = bnSubsidyLimit = nMaxSubsidy @@ -245,7 +263,7 @@ def check_genesis_block(bitcoind, genesis_block_hash): DUMB_SCRYPT_DIFF=2**16, DUST_THRESHOLD=0.03e8, ), - + kimocoin=math.Object( P2P_PREFIX='6b696d6f'.decode('hex'), P2P_PORT=1889, @@ -267,6 +285,28 @@ def check_genesis_block(bitcoind, genesis_block_hash): DUMB_SCRYPT_DIFF=2**16, DUST_THRESHOLD=0.03e8, ), + + caishen=math.Object( + P2P_PREFIX='fabfb5da'.decode('hex'), + P2P_PORT=14260, + ADDRESS_VERSION=28, + RPC_PORT=14261, + RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue( + 'caishenaddress' in (yield bitcoind.rpc_help()) and + not (yield bitcoind.rpc_getinfo())['testnet'] + )), + SUBSIDY_FUNC=lambda height: get_caishensubsidy(height), + POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('vtc_scrypt').getPoWHash(data)), + BLOCK_PERIOD=88, # s + SYMBOL='CAI', + CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Caishen') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Caishen/') if platform.system() == 'Darwin' else os.path.expanduser('~/.caishen'), 'caishen.conf'), + BLOCK_EXPLORER_URL_PREFIX='http://greekpool.eu:29000/block/', + ADDRESS_EXPLORER_URL_PREFIX='http://greekpool.eu:29000/address/', + TX_EXPLORER_URL_PREFIX='http://greekpool.eu:29000/tx/', + SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), + DUMB_SCRYPT_DIFF=2**16, + DUST_THRESHOLD=0.03e8, + ), ) for net_name, net in nets.iteritems(): diff --git a/p2pool/networks.py b/p2pool/networks.py index 0d86607d..65d183e2 100644 --- a/p2pool/networks.py +++ b/p2pool/networks.py @@ -81,12 +81,12 @@ MAX_TARGET=2**256//2**20 - 1, PERSIST=False, WORKER_PORT=9171, - BOOTSTRAP_ADDRS='q30.qhor.net seed.p2pool.etyd.org vtc.royalminingco.com p2pool.letsmine.it'.split(' '), + BOOTSTRAP_ADDRS='q30.qhor.net seed.p2pool.etyd.org vtc.royalminingco.com p2pool.letsmine.it lovok.no-ip.com'.split(' '), ANNOUNCE_CHANNEL='#p2pool-vtc', VERSION_CHECK=lambda v: True, ), - vertcoin2=math.Object( # --> low hashrate net + vertcoin2=math.Object( # --> middle hashrate net PARENT=networks.nets['vertcoin'], SHARE_PERIOD=15, # seconds CHAIN_LENGTH=24*60*60//10, # shares @@ -100,7 +100,26 @@ MAX_TARGET=2**256//2**20 - 1, PERSIST=False, WORKER_PORT=9172, - BOOTSTRAP_ADDRS='lovok.no-ip.com:9346 lovok.no-ip.com:9347 us-east.p2pools.net:9346 us-east.p2pools.net:9347 vert.marcsi.ch:9346 vert.marcsi.ch:9347'.split(' '), + BOOTSTRAP_ADDRS='lovok.no-ip.com us-east.p2pools.net us-central.p2pools.net us-west.p2pools.net vert.marcsi.ch'.split(' '), + ANNOUNCE_CHANNEL='#p2pool-vtc', + VERSION_CHECK=lambda v: True, + ), + + vertcoin3=math.Object( # --> low hashrate net + PARENT=networks.nets['vertcoin'], + SHARE_PERIOD=15, # seconds + CHAIN_LENGTH=24*60*60//10, # shares + REAL_CHAIN_LENGTH=24*60*60//10, # shares + TARGET_LOOKBEHIND=200, # shares + SPREAD=12, # blocks + IDENTIFIER='a06a81c827cab975'.decode('hex'), + PREFIX='7c3614a6bcdcf796'.decode('hex'), + P2P_PORT=9348, + MIN_TARGET=4, + MAX_TARGET=2**256//2**20 - 1, + PERSIST=False, + WORKER_PORT=9174, + BOOTSTRAP_ADDRS='lovok.no-ip.com vtc.cubeconnex.com'.split(' '), ANNOUNCE_CHANNEL='#p2pool-vtc', VERSION_CHECK=lambda v: True, ), @@ -201,6 +220,25 @@ VERSION_CHECK=lambda v: True, ), + caishen=math.Object( + PARENT=networks.nets['caishen'], + SHARE_PERIOD=15, # seconds + CHAIN_LENGTH=24*60*60//10, # shares + REAL_CHAIN_LENGTH=24*60*60//10, # shares + TARGET_LOOKBEHIND=200, # shares + SPREAD=12, # blocks + IDENTIFIER='a06a81c827cab9e3'.decode('hex'), + PREFIX='7c3614a6bcdcf7e4'.decode('hex'), + P2P_PORT=2828, + MIN_TARGET=4, + MAX_TARGET=2**256//2**20 - 1, + PERSIST=False, + WORKER_PORT=2888, + BOOTSTRAP_ADDRS='thepool.pw lovok.no-ip.com'.split(' '), + ANNOUNCE_CHANNEL='#p2pool-cai', + VERSION_CHECK=lambda v: True, + ), + ) for net_name, net in nets.iteritems(): net.NAME = net_name diff --git a/web-static.modern/index.html b/web-static.modern/index.html index f784bb0a..8c766668 100644 --- a/web-static.modern/index.html +++ b/web-static.modern/index.html @@ -128,8 +128,8 @@