Bitcoin Forum
December 14, 2019, 08:57:50 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need Help with P2Pool for HYC Hypercoin  (Read 746 times)
zacho56
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
June 01, 2013, 10:29:48 PM
 #1

Need the networks.py edited for hypercoin. I will offer 1k HYC for the person that does it. Smiley

"I have a dream" - Martin Luther King JR
There are several different types of Bitcoin clients. Server-assisted clients like blockchain.info rely on centralized servers to do their network verification for them. Although the server can't steal the client's bitcoins directly, it can easily execute double-spending-style attacks against the client.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1576357070
Hero Member
*
Offline Offline

Posts: 1576357070

View Profile Personal Message (Offline)

Ignore
1576357070
Reply with quote  #2

1576357070
Report to moderator
PSL
Member
**
Offline Offline

Activity: 166
Merit: 10


View Profile
June 06, 2013, 05:02:32 PM
Last edit: June 07, 2013, 12:03:03 AM by PSL
 #2

Need the networks.py edited for hypercoin. I will offer 1k HYC for the person that does it. Smiley

Is your bounty still valid? I think I can offer a small patch...
baloo_kiev
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
June 06, 2013, 11:01:54 PM
Last edit: June 06, 2013, 11:14:10 PM by baloo_kiev
 #3

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:

Code:
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


PGP: 6EC48BA7
Welcome to my p2pool: BTC
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!