Title: Need Help with P2Pool for HYC Hypercoin
Post by: zacho56 on June 01, 2013, 10:29:48 PM
Need the networks.py edited for hypercoin. I will offer 1k HYC for the person that does it. :)
Title: Re: Need Help with P2Pool for HYC Hypercoin
Post by: PSL on June 06, 2013, 05:02:32 PM
Need the networks.py edited for hypercoin. I will offer 1k HYC for the person that does it. :)
Is your bounty still valid? I think I can offer a small patch...
Title: Re: Need Help with P2Pool for HYC Hypercoin
Post by: baloo_kiev on June 06, 2013, 11:01:54 PM
Original source: https://github.com/hakabane/p2pool-altcoins, credit to akabane https://bitcointalk.org/index.php?action=profile;u=109664 Public node: http://78.27.191.182:8344/ (no fee except default 1% to original p2pool authors) Modifications for HYC: diff --git a/p2pool/bitcoin/helper.py b/p2pool/bitcoin/helper.py index adab25e..aa4899b 100644 --- a/p2pool/bitcoin/helper.py +++ b/p2pool/bitcoin/helper.py @@ -70,7 +70,7 @@ def submit_block_p2p(block, factory, net): @defer.inlineCallbacks def submit_block_rpc(block, ignore_failure, bitcoind, bitcoind_work, net): if bitcoind_work.value['use_getblocktemplate']: - if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'digital' in net.NAME: + if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'digital' in net.NAME or 'hyper' in net.NAME: result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex'))) success = result is None else: diff --git a/p2pool/bitcoin/networks.py b/p2pool/bitcoin/networks.py index 7dd26f4..682a920 100644 --- a/p2pool/bitcoin/networks.py +++ b/p2pool/bitcoin/networks.py @@ -104,6 +104,28 @@ nets = dict( SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), DUMB_SCRYPT_DIFF=2**16, ), + + hypercoin=math.Object( + P2P_PREFIX='fcd9b7dd'.decode('hex'), + P2P_PORT=17453, + ADDRESS_VERSION=40, + RPC_PORT=7452, + RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue( + 'hypercoin address' in (yield bitcoind.rpc_help()) and + not (yield bitcoind.rpc_getinfo())['testnet'] + )), + SUBSIDY_FUNC=lambda height: 25*100000000, + POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)), + BLOCK_PERIOD=40, + SYMBOL='HYC', + CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Hypercoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Hypercoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.hypercoin'), 'hypercoin.conf'), + BLOCK_EXPLORER_URL_PREFIX='http://example.com/', + ADDRESS_EXPLORER_URL_PREFIX='http://example.com/', + SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), + DUMB_SCRYPT_DIFF=2**16, + ), + + litecoin_testnet=math.Object( P2P_PREFIX='fcc1b7dc'.decode('hex'), P2P_PORT=19333, diff --git a/p2pool/networks.py b/p2pool/networks.py index 8f60436..f3f8f3f 100644 --- a/p2pool/networks.py +++ b/p2pool/networks.py @@ -63,6 +63,26 @@ nets = dict( ANNOUNCE_CHANNEL='#p2pool-alt', VERSION_CHECK=lambda v: True, ), + + hypercoin=math.Object( + PARENT=networks.nets['hypercoin'], + SHARE_PERIOD=10, # seconds + CHAIN_LENGTH=24*60*60//10, # shares + REAL_CHAIN_LENGTH=24*60*60//10, # shares + TARGET_LOOKBEHIND=200, # shares + SPREAD=45, # blocks + IDENTIFIER='9147c5bfc6923429'.decode('hex'), + PREFIX='9408c1a03cf629f9'.decode('hex'), + P2P_PORT=41731, + MIN_TARGET=0, + MAX_TARGET=2**256//2**20 - 1, + PERSIST=False, + WORKER_PORT=9327, + BOOTSTRAP_ADDRS='78.27.191.182'.split(' '), + ANNOUNCE_CHANNEL='#p2pool-alt', + VERSION_CHECK=lambda v: True, + ), + litecoin_testnet=math.Object( PARENT=networks.nets['litecoin_testnet'], SHARE_PERIOD=3, # seconds
|