Author

Topic: Need help editing the p2pool code to add support for mincoin and bbqcoin (Read 2324 times)

sr. member
Activity: 324
Merit: 250
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?
full member
Activity: 147
Merit: 101
Datum.network - register for Pre-ICO
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
hero member
Activity: 609
Merit: 500
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.
erk
hero member
Activity: 826
Merit: 500
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
legendary
Activity: 1792
Merit: 1008
/dev/null
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,
     ),
member
Activity: 71
Merit: 10
Thank you gritter, great work!
full member
Activity: 147
Merit: 101
Datum.network - register for Pre-ICO
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,
    ),
member
Activity: 71
Merit: 10
I'll give it a try, too when I get home...
sr. member
Activity: 324
Merit: 250
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,
sr. member
Activity: 324
Merit: 250
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'.
hero member
Activity: 602
Merit: 500
Just change a few of the letter or numbers, its not for connection to bbq but between p2pools Smiley
sr. member
Activity: 324
Merit: 250
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
erk
hero member
Activity: 826
Merit: 500
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/

hero member
Activity: 602
Merit: 500
Contact Narken on this forum, he got the most up 2 date code Smiley
sr. member
Activity: 324
Merit: 250
I'm gonna have a go at this now.
sr. member
Activity: 308
Merit: 250
Any success with this? Very intrigued about BQC on p2pool!
hero member
Activity: 756
Merit: 500
hero member
Activity: 602
Merit: 500
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
Jump to: