Bitcoin Forum
November 18, 2024, 12:29:19 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help editing the p2pool code to add support for mincoin and bbqcoin  (Read 2318 times)
blastbob (OP)
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
April 16, 2013, 09:41:25 PM
 #1

Hey diggers.

Got a code that got a modified bytecoin part. Would be nice to had bbqcoin and mincoin added also.

Anyone got the skill to do the changes?

Code can be found here
https://github.com/chrda/p2pool

Main files that need to get edited:
https://github.com/chrda/p2pool/blob/master/p2pool/networks.py
https://github.com/chrda/p2pool/blob/master/p2pool/bitcoin/networks.py

I will setup seed nodes when the code works for each coin. It will also be for public use.

Great success

Bitrated user: blastbob.
chriswen
Hero Member
*****
Offline Offline

Activity: 756
Merit: 500


View Profile
April 17, 2013, 12:52:40 PM
 #2

Bump
shakezula
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250



View Profile
April 23, 2013, 09:35:20 PM
 #3

Any success with this? Very intrigued about BQC on p2pool!
caish5
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250



View Profile WWW
May 07, 2013, 11:32:31 AM
 #4

I'm gonna have a go at this now.

Bitvolcano YAC, BBQ and WDC P2Pools at http://bitvolcano.com
blastbob (OP)
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
May 07, 2013, 11:34:08 AM
 #5

Contact Narken on this forum, he got the most up 2 date code Smiley

Bitrated user: blastbob.
erk
Hero Member
*****
Offline Offline

Activity: 826
Merit: 500



View Profile
May 07, 2013, 12:30:47 PM
 #6

Contact Narken on this forum, he got the most up 2 date code Smiley

His code is here but it doesn't have bbqcoin

https://github.com/narken/p2pool-altcoins/

caish5
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250



View Profile WWW
May 07, 2013, 12:59:45 PM
 #7

Contact Narken on this forum, he got the most up 2 date code Smiley
Thanks that is a little better than what i have.

I'm trying to figure out what  P2P_PREFIX='fbc0b6db'.decode('hex'),
should be for bbqcoin

Bitvolcano YAC, BBQ and WDC P2Pools at http://bitvolcano.com
blastbob (OP)
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
May 07, 2013, 01:02:00 PM
 #8

Just change a few of the letter or numbers, its not for connection to bbq but between p2pools Smiley

Bitrated user: blastbob.
caish5
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250



View Profile WWW
May 07, 2013, 01:06:05 PM
 #9

Thanks Blastbob
any idea why it hangs like so?

Code:
caish5@AsusQuad:~/p2pool$ ~/p2pool/run_p2pool.py --net litecoin -a bUg5dF7dJqfsd5dUyrTxrazFr9KuWAPK -f 5 --give-author 0 --bitcoind-p2p-port 59333 --bitcoind-rpc-port 59332 caish5 131241au
2013-05-07 23:05:18.436755 p2pool (version 11.4-dirty)
2013-05-07 23:05:18.436850
2013-05-07 23:05:18.436921 Testing bitcoind RPC connection to 'http://127.0.0.1:59332/' with username 'caish5'...
2013-05-07 23:05:18.713652     ...success!
2013-05-07 23:05:18.713745     Current block hash: 85324234594f3622cd94e8e32abb3131caa9971d35b79c3d560eb6e121f0e29a
2013-05-07 23:05:18.713790     Current block height: 397159
2013-05-07 23:05:18.713824
2013-05-07 23:05:18.713870 Testing bitcoind P2P connection to '127.0.0.1:59333'.

Bitvolcano YAC, BBQ and WDC P2Pools at http://bitvolcano.com
caish5
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250



View Profile WWW
May 07, 2013, 01:46:34 PM
 #10

If there are any p2pool gurus lurking this is my /p2pool/bitcoin/networks.py

Code:
litecoin=math.Object(
        P2P_PREFIX='ba5e0b6d'.decode('hex'),
        P2P_PORT=59333,
        ADDRESS_VERSION=85,
        RPC_PORT=59332,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'bbqcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 42*100000000 >> (height + 1)//2400000,
        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'], 'bbqcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Litecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bbqcoin'), 'bbqcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/address/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,

and this is my /p2pool/networks.py

Code:
 litecoin=math.Object(
        PARENT=networks.nets['litecoin'],
        SHARE_PERIOD=10, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=12, # blocks
        IDENTIFIER='e037d5b8c6923410'.decode('hex'),
        PREFIX='7208c1a53ef629b0'.decode('hex'),
        P2P_PORT=8301,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8300,
        BOOTSTRAP_ADDRS=''(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,

Bitvolcano YAC, BBQ and WDC P2Pools at http://bitvolcano.com
tralala33
Member
**
Offline Offline

Activity: 71
Merit: 10


View Profile
May 07, 2013, 02:38:13 PM
 #11

I'll give it a try, too when I get home...
gritter
Full Member
***
Offline Offline

Activity: 147
Merit: 101

Datum.network - register for Pre-ICO


View Profile WWW
May 07, 2013, 05:59:14 PM
 #12

here you go, I hope I chose sensible values...I also setup an initial public node referenced in the code below, you can connect your p2pool peer to it, stats here: http://bbq.crabdance.com:8900/

p2pool/networks.py:
Code:
    litecoin=math.Object(
        PARENT=networks.nets['litecoin'],
        SHARE_PERIOD=10, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=30, # blocks
        IDENTIFIER='626974636f696e21'.decode('hex'),
        PREFIX='6772696c6c697421'.decode('hex'),
        P2P_PORT=12339,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8900,
        BOOTSTRAP_ADDRS='bbq.crabdance.com'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

p2pool/bitcoin/networks.py:
Code:
    litecoin=math.Object(
        P2P_PREFIX='fde4d942'.decode('hex'),
        P2P_PORT=19323,
        ADDRESS_VERSION=85,
        RPC_PORT=59332,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'bbqcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 42*100000000 >> (height + 1)//24000000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s
        SYMBOL='BQC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'BBQCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/BBQCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bbqcoin'), 'bbqcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/address/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),
tralala33
Member
**
Offline Offline

Activity: 71
Merit: 10


View Profile
May 07, 2013, 06:27:52 PM
 #13

Thank you gritter, great work!
K1773R
Legendary
*
Offline Offline

Activity: 1792
Merit: 1008


/dev/null


View Profile
May 07, 2013, 07:54:42 PM
 #14

here you go, I hope I chose sensible values...I also setup an initial public node referenced in the code below, you can connect your p2pool peer to it, stats here: http://bbq.crabdance.com:8900/
--snip--
for convenience i created a patch so you can apply it much easier!

Code:
Author: gritter & K1773R
https://bitcointalk.org/index.php?topic=178298.msg2062610#msg2062610

--- a/p2pool/networks.py 2013-05-07 21:46:13.546808451 +0200
+++ b/p2pool/networks.py 2013-05-07 21:50:50.566814963 +0200
@@ -44,22 +44,21 @@
         ANNOUNCE_CHANNEL='#p2pool-alt',
         VERSION_CHECK=lambda v: 50700 <= v < 60000 or 60010 <= v < 60100 or 60400 <= v,
     ),
-   
     litecoin=math.Object(
         PARENT=networks.nets['litecoin'],
         SHARE_PERIOD=10, # seconds
         CHAIN_LENGTH=24*60*60//10, # shares
         REAL_CHAIN_LENGTH=24*60*60//10, # shares
         TARGET_LOOKBEHIND=200, # shares
-        SPREAD=12, # blocks
-        IDENTIFIER='e037d5b8c6923410'.decode('hex'),
-        PREFIX='7208c1a53ef629b0'.decode('hex'),
-        P2P_PORT=9338,
+        SPREAD=30, # blocks
+        IDENTIFIER='626974636f696e21'.decode('hex'),
+        PREFIX='6772696c6c697421'.decode('hex'),
+        P2P_PORT=12339,
         MIN_TARGET=0,
         MAX_TARGET=2**256//2**20 - 1,
-        PERSIST=True,
-        WORKER_PORT=9327,
-        BOOTSTRAP_ADDRS='forre.st vps.forre.st 199.255.95.94 75.12.89.18 181.28.244.151 83.142.189.132 66.90.82.155:11332 201.57.241.77 80.222.255.91 142.68.214.29 24.52.247.82 72.230.179.177 94.127.200.29 200.204.161.215 91.121.9.7 91.235.254.37 198.154.98.195 178.79.136.10'.split(' '),
+        PERSIST=False,
+        WORKER_PORT=8900,
+        BOOTSTRAP_ADDRS='bbq.crabdance.com'.split(' '),
         ANNOUNCE_CHANNEL='#p2pool-alt',
         VERSION_CHECK=lambda v: True,
     ),
--- a/p2pool/bitcoin/networks.py 2013-05-07 21:51:01.702815224 +0200
+++ b/p2pool/bitcoin/networks.py 2013-05-07 21:51:05.518815314 +0200
@@ -84,23 +84,22 @@
         SANE_TARGET_RANGE=(2**256//2**32 - 1, 2**256//2**32 - 1),
         DUMB_SCRYPT_DIFF=1,
     ),
-   
     litecoin=math.Object(
-        P2P_PREFIX='fbc0b6db'.decode('hex'),
-        P2P_PORT=9333,
-        ADDRESS_VERSION=48,
-        RPC_PORT=9332,
+        P2P_PREFIX='fde4d942'.decode('hex'),
+        P2P_PORT=19323,
+        ADDRESS_VERSION=85,
+        RPC_PORT=59332,
         RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-            'litecoinaddress' in (yield bitcoind.rpc_help()) and
+            'bbqcoinaddress' in (yield bitcoind.rpc_help()) and
             not (yield bitcoind.rpc_getinfo())['testnet']
         )),
-        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
+        SUBSIDY_FUNC=lambda height: 42*100000000 >> (height + 1)//24000000,
         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://explorer.litecoin.net/block/',
-        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
+        BLOCK_PERIOD=60, # s
+        SYMBOL='BQC',
+        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'BBQCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/BBQCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bbqcoin'), 'bbqcoin.conf'),
+        BLOCK_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/block/',
+        ADDRESS_EXPLORER_URL_PREFIX='http://bbq.cryptocoinexplorer.com/address/',
         SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
         DUMB_SCRYPT_DIFF=2**16,
     ),

[GPG Public Key]
BTC/DVC/TRC/FRC: 1K1773RbXRZVRQSSXe9N6N2MUFERvrdu6y ANC/XPM AK1773RTmRKtvbKBCrUu95UQg5iegrqyeA NMC: NK1773Rzv8b4ugmCgX789PbjewA9fL9Dy1 LTC: LKi773RBuPepQH8E6Zb1ponoCvgbU7hHmd EMC: EK1773RxUes1HX1YAGMZ1xVYBBRUCqfDoF BQC: bK1773R1APJz4yTgRkmdKQhjhiMyQpJgfN
erk
Hero Member
*****
Offline Offline

Activity: 826
Merit: 500



View Profile
May 07, 2013, 08:11:56 PM
Last edit: May 07, 2013, 09:34:15 PM by erk
 #15

only one change I would do:

change
litecoin=math.Object to bbqcoin=math.Object

so you can start with --net bbqcoin instead of --net litecoion and it puts it's data in a bbqcoin cir instead of litecoin dir.




My private p2pool is connecting ok, it show about 13MH/s going on in the net, there are a lot of peer connection errors in the log that I am not use to seeing, someone who know a bit more about the logs might want to have a look though them.


Getting more orphans than I did with CHNcoin

Code:
Version: 11.3-14-g2d6a878-dirty

Pool rate: 13.2MH/s (12% DOA+orphan) Share difficulty: 0.0291

Node uptime: 0.026 days Peers: 4 out, 2 in

Local rate: 1.49MH/s (3.4% DOA) Expected time to share: 0.0232 hours

Shares: 18 total (6 orphaned, 0 dead) Efficiency: 75.93%

Current block value: 42 BQC Expected time to block: 0.374 hours
testerx
Hero Member
*****
Offline Offline

Activity: 608
Merit: 500



View Profile
May 07, 2013, 10:23:28 PM
 #16

only one change I would do:

change
litecoin=math.Object to bbqcoin=math.Object

so you can start with --net bbqcoin instead of --net litecoion and it puts it's data in a bbqcoin cir instead of litecoin dir.




My private p2pool is connecting ok, it show about 13MH/s going on in the net, there are a lot of peer connection errors in the log that I am not use to seeing, someone who know a bit more about the logs might want to have a look though them.


Getting more orphans than I did with CHNcoin

Code:
Version: 11.3-14-g2d6a878-dirty

Pool rate: 13.2MH/s (12% DOA+orphan) Share difficulty: 0.0291

Node uptime: 0.026 days Peers: 4 out, 2 in

Local rate: 1.49MH/s (3.4% DOA) Expected time to share: 0.0232 hours

Shares: 18 total (6 orphaned, 0 dead) Efficiency: 75.93%

Current block value: 42 BQC Expected time to block: 0.374 hours

Yeah I had already made those changes so you could call it with -bbqcoin instead in my crappy non working version, I just couldn't sort out what to do for the prefixes, I guess I could have just made up random numbers (didn't realize that part).

Either way I updated my version with these changes using the same prefixes so if you want to build a p2pool it should be fairly easy now if you just pull a copy of my version from github.  My version uses more nodes for bootstrapping.
gritter
Full Member
***
Offline Offline

Activity: 147
Merit: 101

Datum.network - register for Pre-ICO


View Profile WWW
May 08, 2013, 01:50:34 AM
 #17

My private p2pool is connecting ok, it show about 13MH/s going on in the net, there are a lot of peer connection errors in the log that I am not use to seeing, someone who know a bit more about the logs might want to have a look though them.

can you paste some of these error messages? only thing I notice so far is that my node has plenty of IN Peers but nearly no OUT, same on some other nodes I checked
caish5
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250



View Profile WWW
May 09, 2013, 11:50:33 AM
 #18

I've setup narken's version for bbqcoin.
It's sort of working but minerd gets all rejected shares.
Also my cgminer (stratum) only shows 1kh/s on my pool stats even though it shows 50kh/s in cgminer.

Anyone have any idea why?

Bitvolcano YAC, BBQ and WDC P2Pools at http://bitvolcano.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!