Author

Topic: P2Pool Detailed Settings for Altcoins (Read 12988 times)

full member
Activity: 1275
Merit: 141
September 22, 2021, 03:34:51 PM
#50
can anyone help me to create p2pool for Ravencoin?

Did you bother to look at the last year this thread was posted too.... February 2015.

It is dead. 

newbie
Activity: 56
Merit: 0
September 22, 2021, 02:58:02 PM
#49
can anyone help me to create p2pool for Ravencoin?
full member
Activity: 196
Merit: 100
February 02, 2015, 03:10:12 PM
#48
Little question: I'd like to host a p2pool node for XMG. XMG uses the M7M algo, so I guess there are some other modifications necessary, not just the values in the networks.py?

You are correct. You would have to compile in support for that algo. Can't help much more as I have personally not tried compiling in anything other than SHA and Scrypt. I know there is support for x11 and possibly others but have never looked into any of them.

Would you be interested in checking it out? The Magi (XMG) developer is interested in P2Pool but we need someone who has experience with. If you are interested (I guess bounty would be available), please contact Joe Lao https://bitcointalksearch.org/user/joelao95-182342
legendary
Activity: 1270
Merit: 1000
February 02, 2015, 02:52:05 PM
#47
Little question: I'd like to host a p2pool node for XMG. XMG uses the M7M algo, so I guess there are some other modifications necessary, not just the values in the networks.py?

You are correct. You would have to compile in support for that algo. Can't help much more as I have personally not tried compiling in anything other than SHA and Scrypt. I know there is support for x11 and possibly others but have never looked into any of them.
hero member
Activity: 756
Merit: 501
February 02, 2015, 05:30:04 AM
#46
Little question: I'd like to host a p2pool node for XMG. XMG uses the M7M algo, so I guess there are some other modifications necessary, not just the values in the networks.py?
full member
Activity: 142
Merit: 101
October 25, 2014, 10:02:52 AM
#45
Great info found here, it has helped me get rolling on creating the new files for OSC - OpenSourceCoin. (ocoin) https://github.com/bryceweiner/OSC/tree/master/src

I'd like to run a "solo" P2Pool with my AntMiner S1's mining OSC, but I have not been able to find a fork that had anything for ocoin.

Here is what I have so far:
p2pool\networks\ocoin.py :
Code:
from p2pool.bitcoin import networks

PARENT = networks.nets['ocoin']
SHARE_PERIOD = 20 # seconds
CHAIN_LENGTH = 24*60*60//10 # shares
REAL_CHAIN_LENGTH = 24*60*60//10 # shares
TARGET_LOOKBEHIND = 60 # shares
SPREAD = 30 # blocks
IDENTIFIER = ''.decode('hex')
PREFIX = ''.decode('hex')
P2P_PORT = 9512
MIN_TARGET = 0
MAX_TARGET = 2**256//2**32 - 1
PERSIST = False
WORKER_PORT = 19512
BOOTSTRAP_ADDRS = ''.split(' ')
ANNOUNCE_CHANNEL = '#p2pool-alt'
VERSION_CHECK = lambda v: True

p2pool\bitcoin\networks\ocoin.py :
Code:
import os
import platform

from twisted.internet import defer

from .. import data, helper
from p2pool.util import pack


P2P_PREFIX = 'e4e8e9e5'.decode('hex')
P2P_PORT = 28532
ADDRESS_VERSION = 2
RPC_PORT = 38532
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'Ocoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        ))
SUBSIDY_FUNC = lambda height: 25*100000000 >> (height * 1)//400000
POW_FUNC = data.hash256
BLOCK_PERIOD = 12 # s
SYMBOL = 'OSC'
CONF_FILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Ocoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/ocoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.ocoin'), 'ocoin.conf')
BLOCK_EXPLORER_URL_PREFIX = ''
ADDRESS_EXPLORER_URL_PREFIX = ''
TX_EXPLORER_URL_PREFIX = ''
SANE_TARGET_RANGE = (2**256//2**32//1000 - 1, 2**256//2**32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 0.001e8

\AppData\Roaming\Ocoin\ocoin.conf :
Code:
server=1
listen=1
daemon=1
rpcuser=user
rpcpassword=x
rpcallowip=*
rpcport=38532
port=28532
gen=0

The P2Pool starts and connects, but scrolls a few error messages highlighted in bold below:  (I've gone ahead and removed a lot of the repetitive errors)
Code:
C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master>run_p2pool.py --net ocoin --give-author 0.0 --no-bugreport --disable-upnp --address thWXobKDyMGVmK4UHwDdhgJSo1qX93ZTT
2014-10-25 10:51:28.412000 p2pool (version unknown 7032706f6f6c2d7261762d6d6173746572)
2014-10-25 10:51:28.415000
2014-10-25 10:51:28.416000 Testing bitcoind RPC connection to 'http://127.0.0.1:38532/' with username 'user'...
2014-10-25 10:51:28.550000     ...success!
2014-10-25 10:51:28.551000     Current block hash: 8db7f2d43d630b2e3fd334ce306457ca45329a5aec1066e3e490
2014-10-25 10:51:28.551000     Current block height: 578450
2014-10-25 10:51:28.552000
2014-10-25 10:51:28.553000 Testing bitcoind P2P connection to '127.0.0.1:28532'...
2014-10-25 10:51:28.659000     ...success!
2014-10-25 10:51:28.660000
2014-10-25 10:51:28.661000 Determining payout address...
2014-10-25 10:51:28.662000     ...success! Payout address: thWXobKDyMGVmK4UHwDdhgJSo1qX93ZTT
2014-10-25 10:51:28.663000
2014-10-25 10:51:28.663000 Loading shares...
2014-10-25 10:51:28.664000     ...done loading 0 shares (0 verified)!
2014-10-25 10:51:28.665000
2014-10-25 10:51:28.666000 Initializing work...
2014-10-25 10:51:28.803000     ...success!
2014-10-25 10:51:28.805000
2014-10-25 10:51:28.806000 Joining p2pool network using port 9512...
2014-10-25 10:51:28.813000     ...success!
2014-10-25 10:51:28.814000
2014-10-25 10:51:28.815000 Listening for workers on '' port 19512...
2014-10-25 10:51:29     ...success!
2014-10-25 10:51:29.001000
2014-10-25 10:51:29.002000 Started successfully!
2014-10-25 10:51:29.002000 Go to http://127.0.0.1:19512/ to view graphs and statistics!
2014-10-25 10:51:29.004000 Donating 0.0% of work towards P2Pool's development. Please donate to encourage further development of P2Pool!
2014-10-25 10:51:29.004000
2014-10-25 10:51:29.050000 > Unhandled Error
2014-10-25 10:51:29.051000 > Traceback (most recent call last):
2014-10-25 10:51:29.052000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\run_p2pool.py", line 5, in
2014-10-25 10:51:29.052000 >     main.run()
2014-10-25 10:51:29.053000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:51:29.053000 >     reactor.run()
2014-10-25 10:51:29.056000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:51:29.056000 >     self.mainLoop()
2014-10-25 10:51:29.057000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:51:29.059000 >     self.runUntilCurrent()
2014-10-25 10:51:29.061000 > --- ---
2014-10-25 10:51:29.065000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:51:29.070000 >     call.func(*call.args, **call.kw)
2014-10-25 10:51:29.078000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 425, in resolveAddress
2014-10-25 10:51:29.081000 >     self._setRealAddress(self.addr)
2014-10-25 10:51:29.083000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 440, in _setRealAddress
2014-10-25 10:51:29.086000 >     self.doConnect()
2014-10-25 10:51:29.094000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 569, in doConnect
2014-10-25 10:51:29.255000 >     connectResult = self.socket.connect_ex(self.realAddress)
2014-10-25 10:51:29.258000 >   File "C:\Python27\lib\socket.py", line 224, in meth
2014-10-25 10:51:29.260000 >     return getattr(self._sock,name)(*args)
2014-10-25 10:51:29.262000 > [b]exceptions.OverflowError: getsockaddrarg: port must be 0-65535.[/b]
2014-10-25 10:51:32.005000 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-10-25 10:51:40.144000 > Unhandled Error
2014-10-25 10:51:40.147000 > Traceback (most recent call last):
2014-10-25 10:51:40.149000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\run_p2pool.py", line 5, in
2014-10-25 10:51:40.152000 >     main.run()
2014-10-25 10:51:40.156000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:51:40.162000 >     reactor.run()
2014-10-25 10:51:40.168000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:51:40.170000 >     self.mainLoop()
2014-10-25 10:51:40.173000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:51:40.177000 >     self.runUntilCurrent()
2014-10-25 10:51:40.184000 > --- ---
2014-10-25 10:51:40.189000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:51:40.194000 >     call.func(*call.args, **call.kw)
2014-10-25 10:51:40.196000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 425, in resolveAddress
2014-10-25 10:51:40.199000 >     self._setRealAddress(self.addr)
2014-10-25 10:51:40.205000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 440, in _setRealAddress
2014-10-25 10:51:40.207000 >     self.doConnect()
2014-10-25 10:51:40.209000 >   File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 569, in doConnect
2014-10-25 10:51:40.213000 >     connectResult = self.socket.connect_ex(self.realAddress)
2014-10-25 10:51:40.217000 >   File "C:\Python27\lib\socket.py", line 224, in meth
2014-10-25 10:51:40.222000 >     return getattr(self._sock,name)(*args)
2014-10-25 10:51:40.239000 > [b]exceptions.OverflowError: getsockaddrarg: port must be 0-65535.[/b]
2014-10-25 10:51:46.750000 > Unhandled Error
2014-10-25 10:52:20.558000 > Traceback (most recent call last):
2014-10-25 10:52:20.561000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:52:20.571000 >     reactor.run()
2014-10-25 10:52:20.575000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:52:20.578000 >     self.mainLoop()
2014-10-25 10:52:20.580000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:52:20.583000 >     self.runUntilCurrent()
2014-10-25 10:52:20.587000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:52:20.592000 >     call.func(*call.args, **call.kw)
2014-10-25 10:52:20.596000 > --- ---
2014-10-25 10:52:20.600000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\bitcoin\stratum.py", line 38, in _send_work
2014-10-25 10:52:20.604000 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2014-10-25 10:52:20.609000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\bitcoin\worker_interface.py", line 129, in get_work
2014-10-25 10:52:20.612000 >     x, handler = self._inner.get_work(*args)
2014-10-25 10:52:20.616000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\work.py", line 310, in get_work
2014-10-25 10:52:20.620000 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2014-10-25 10:52:20.655000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\data.py", line 222, in generate_transaction
2014-10-25 10:52:20.656000 >     script='\x6a\x28' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(64).pack(last_txout_nonce),
2014-10-25 10:52:20.659000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\data.py", line 246, in get_ref_hash
2014-10-25 10:52:20.664000 >     share_info=share_info,
2014-10-25 10:52:20.667000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 74, in pack
2014-10-25 10:52:20.676000 >     data = self._pack(obj)
2014-10-25 10:52:20.678000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 52, in _pack
2014-10-25 10:52:20.680000 >     f = self.write(None, obj)
2014-10-25 10:52:20.683000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 301, in write
2014-10-25 10:52:20.688000 >     file = type_.write(file, item[key])
2014-10-25 10:52:20.692000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 327, in write
2014-10-25 10:52:20.697000 >     raise ValueError('incorrect length item!')
2014-10-25 10:52:20.700000 > [b]exceptions.ValueError: incorrect length item![/b]
2014-10-25 10:52:24.033000 > Unhandled Error
2014-10-25 10:52:38.053000 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-10-25 10:52:38.054000  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???

The block reward structure is as follows (It is now currently paying 12.50 OSC per block):
Code:
// miner's coin base reward based on nBits
int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
{
static const int64 nMinimumCoin = 0.0777 * COIN;
int64 nSubsidy = 0.0777 * COIN; //genesis
if (nHeight > 0 && nHeight < 7) {nSubsidy = 0 * COIN;} // zero
else if (nHeight == 7) {nSubsidy = 177777 * COIN;} // Premine
else if (nHeight > 7 && nHeight < 1000) {nSubsidy = 2.5 * COIN;} // IRC Launch
else if (nHeight > 1000 && nHeight < 1337) {nSubsidy = 0.0777 * COIN;} // low instamine official launch
else if (nHeight == 1337) {nSubsidy = 1337 * COIN;} //L33T
else if (nHeight > 1337 && nHeight < 4000) {nSubsidy = 1 * COIN;} //final launch period
else if (nHeight > 4000 && nHeight < 8000) {nSubsidy = 22.5 * COIN;} // 22.5 coin
else if (nHeight > 8000 && nHeight < 16000) {nSubsidy = 15 * COIN;} // 15 coins per block
else if (nHeight > 16000 && nHeight < 32000) {nSubsidy = 7.5 * COIN;} // 7.5 coins per block
else if (nHeight > 32000 && nHeight < 64000) {nSubsidy = 6 * COIN;} // 6 coins per block
else if (nHeight > 64000 && nHeight < 77777) {nSubsidy = 4 * COIN;} // 4 coins
else if (nHeight == 77777) {nSubsidy = 10000 * COIN;} // bonus reward
else if (nHeight > 77777 && nHeight < 128000) {nSubsidy = 4 * COIN;} // 4 coins
else if (nHeight > 128000 && nHeight < 256000) {nSubsidy = 20 * COIN;} // 20 coins
else if (nHeight > 256000) {nSubsidy = 25 * COIN;} // 25 coins
else if (nHeight > 2400000) {nSubsidy = 5 * COIN;}
else {nSubsidy = 1 * COIN;}
// Subsidy is cut in half every 400 thousand blocks
nSubsidy >>= (nHeight / 400000);

Any help would be greatly appreciated.  FYI, I used the files from another coin which works fine (XJO - Joulecoin) as a template to make the files for OSC.

Thanks!
member
Activity: 84
Merit: 10
October 21, 2014, 03:46:12 AM
#44
Tried also your fork:

https://github.com/CartmanSPC/p2pool

its not possible to deploy it on Bitcoin Testnet network =(.
Share chain stays empty ..
member
Activity: 84
Merit: 10
October 20, 2014, 04:22:11 PM
#43
i tried different ones.
for example this one:
https://github.com/forrestv/p2pool

I also tried to "bootstrap" on bitcoin testnetwork. (deleted all bootstrap addresses), launched with persist=false and changed identifiers but the sharechain just stays empty.

i used p2pool_run.py --testnet

Everything went fine, even with connected nodes, but i the share chain is still empty ..

So overall: im unable to start the initial chain
legendary
Activity: 1270
Merit: 1000
October 20, 2014, 01:02:50 PM
#42
A block should not need to be found. Which p2pool is this for? Link?
member
Activity: 84
Merit: 10
October 18, 2014, 01:42:49 PM
#41
Hey,

i got trouble running a new fresh p2pool node.

Got everything up and running and it seems its working...

P2Pool nodes connect to each other.. stratum works everything seems fine..

Exept there p2pool nodes doesnt generate any shares..

I tried to bootstrap the shares with persist = False but it doesnt work.


Also i got a lot of spam of:

Code:
Worker asdgasd submitted share with hash > target:
Hash:   ba14c750915d8d67b76e6dce4874360d7fbf7d2a7feeb925743cb47b03597d1f
Target: ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Any idears how to properly bootstrap? Does the bootstrapping node may have to find a Block first?

Any suggestions would be nice Smiley
legendary
Activity: 1270
Merit: 1000
September 19, 2014, 01:46:59 PM
#40
Great explanation on P2Pools Pay Per Last N Shares (PPLNS) payout system from windpath:

https://bitcointalksearch.org/topic/1500-th-p2pool-decentralized-dos-resistant-hop-proof-pool-18313

sr. member
Activity: 280
Merit: 250
August 18, 2014, 05:35:47 PM
#39
Thanks Lucky Cris. Would you or anyone else happen to know what the other file is?

A couple of coins had it listed in the protocol.cpp file. But I was told they can technically be in any... I guess it depends on which coin is cloned? But it seems the Darkcoin clones uses prototocol.cpp.
newbie
Activity: 5
Merit: 0
August 18, 2014, 05:12:44 PM
#38
It shure would be nice to know where to look for them , i cant find them
legendary
Activity: 1270
Merit: 1000
August 18, 2014, 04:14:05 PM
#37
Thanks Lucky Cris. Would you or anyone else happen to know what the other file is?
sr. member
Activity: 280
Merit: 250
August 18, 2014, 12:41:11 PM
#36
OP, just wanted to point out that some of these coins put the pchmeassagestart hex value in another file; so if it's not in the main.cpp it could be in another. I don't know if it has any significance, but figure I'd at least advise so you can update the OP
newbie
Activity: 5
Merit: 0
August 18, 2014, 12:27:12 PM
#35
Great work .

I was wondering is there anybody who can help out with karmacoin settings ?

Chears
full member
Activity: 129
Merit: 102
June 20, 2014, 06:01:06 PM
#34
hey i was looking for a bit of help with my fuelcoin p2pool just wanted to make sure i had everything setup correctly. i am connected and have everything going Smiley so that is no longer an issue. i just want to make sure my values are correct.

Hey, I went ahead and edited the config files to suit FuelCoin, there were a few changes that needed to be made.

I've posted the code up on pastebin if you'd like to have a look.

FuelCoin recommended settings for P2Pool nodes;

http://pastebin.com/PQTWdjcP
legendary
Activity: 964
Merit: 1000
June 20, 2014, 12:08:28 AM
#33
hey i was looking for a bit of help with my fuelcoin p2pool just wanted to make sure i had everything setup correctly. i am connected and have everything going Smiley so that is no longer an issue. i just want to make sure my values are correct.

p2pool file

fuelcoin=math.Object(
        PARENT=networks.nets['fuelcoin'],
        SHARE_PERIOD=6, # seconds
        CHAIN_LENGTH=6*60*60//10, # shares
        REAL_CHAIN_LENGTH=7*24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=60, # blocks
        IDENTIFIER='fc70035c7a81bc6f'.decode('hex'),
        PREFIX='2472ef181efcd37b'.decode('hex'),
        P2P_PORT=9111,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**32 - 1,
        PERSIST=False,
        WORKER_PORT=9222,
        BOOTSTRAP_ADDRS='98.174.25.28 173.230.51.38 173.230.49.15 173.79.134.197'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Fuelcoin to >=0.8.5!' if v < 80500 else None,


bitcoin file

    fuelcoin=math.Object(
        P2P_PREFIX='f5d3a3d0'.decode('hex'),
        P2P_PORT=9111,
        ADDRESS_VERSION=36,
        RPC_PORT=9222,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'FuelCoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
        POW_FUNC=data.hash256,
        BLOCK_PERIOD=30, # s
        SYMBOL='FUEL',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Fuelcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Fuelcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.fuelcoin'), 'fuelcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/address/',
        TX_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=1,
        DUST_THRESHOLD=0.03e8,
    ),


I am also having problems with the pool showing blocks that were not mined by any of the miners on the pool.
and the pool hashrate has continued to rise past 3th/s when i only have 1th/s on it.
the address is http://99.236.215.227:9222/static/ it seems to be a bit more accurate now. but still not great ive changed the settings around a bit. for the share per second trying to play with it.
legendary
Activity: 1120
Merit: 1000
Sorry for the bump, just didnt see it neccessary to make a new thread;

Did anyone find a solution for getting stuck on
Code:
2014-05-13 05:42:20.871001 Testing bitcoind P2P connection to '127.0.0.1:1217'...
2014-05-13 05:42:25.871320     ...taking a while. Common reasons for this include all of bitcoind's connection slots being used...
2014-05-13 05:43:21.048088 > Bitcoin connection lost. Reason: Connection was closed cleanly.
full member
Activity: 190
Merit: 100
April 18, 2014, 05:32:23 AM
#31
nice work here  Wink
legendary
Activity: 1270
Merit: 1000
April 17, 2014, 06:28:14 PM
#30
What's the purpose/advantage of removing the block punishing code? That's an area I've never looked at and am clueless about.

I think that it hurts the nodes that don't have it vs the ones that do?
sr. member
Activity: 434
Merit: 250
April 07, 2014, 09:31:56 PM
#29
What's the purpose/advantage of removing the block punishing code? That's an area I've never looked at and am clueless about.
legendary
Activity: 1270
Merit: 1000
April 07, 2014, 07:43:32 PM
#28
What is MAX_TARGET?  I've noticed it's different for various coins but not sure how it's computed.

the maximum custom difficulty you can set

hmm, nm, i'm not 100% sure about that actually, would have to look at the source again.   i think that's what it is, though.

btw, for any coin with, say, block times of 2 or 3 minutes or less, you should remove the following in data.py:

if best is not None:
            best_share = self.items[best]
            punish, punish_reason = best_share.should_punish_reason(previous_block, bits, self, known_txs)
            if punish > 0:
                print 'Punishing share for %r! Jumping from %s to %s!' % (punish_reason, format_hash(best), format_hash(best_share.previous_hash))
                best = best_share.previous_hash

...  first off, these blocks are too fast to have that anyway.  not to mention that the vast majority of the time this will be beneficial to your node.  if you build off of that old valid *share that's just getting punished because of a new block, all the other clients will follow your chain (as it'll be the longest).  this way you don't end up making a share some 3 seconds later and have some slow (or modified, heh heh) node build off the original share

In ravs repo it does this with the following:

Code:
    def should_punish_reason(self, previous_block, bits, tracker, known_txs):
#       if (self.header['previous_block'], self.header['bits']) != (previous_block, bits) and self.header_hash != previous_block and self.peer_addr is not None:
#           return True, 'Block-stale detected! height(%x) < height(%x) or %08x != %08x' % (self.header['previous_block'], previous_block, self.header['bits'].bits, bits.bits)

Same result?
legendary
Activity: 1270
Merit: 1000
March 28, 2014, 04:58:53 PM
#27
Separated CHAIN_LENGTH and REAL_CHAIN_LENGTH into two different sections and expanded on the explanation.
newbie
Activity: 4
Merit: 0
March 15, 2014, 05:56:30 PM
#26
Hey i made new altcoin and i want to run a p2pool with it.

Source for coin : http://github.com/skatecoin/skatecoin

i set in coin P2Port to: 21607
               RPCport to : 21606
Now i download p2pool-rav and edit p2pool/networks.py and p2pool/bitcoin/networks.py

.skatecoin/src/skatecoin.conf

rpcuser=skatecoinrpc
rpcpassword=my password
listen=1
addnode=91.230.204.187
server=1
daemon=1
rpcallowip=77.45.47.126
rpcallowip=91.230.205.78
rpcport=21606
port=21607
rpcallowip=127.0.0.1
rpcallowip=*.*.*.*



Here is: skatecoin=math.Object(
        PARENT=networks.nets['skatecoin'],
        SHARE_PERIOD=25, # seconds target spacing
        CHAIN_LENGTH=24*60*60//25, # shares
        REAL_CHAIN_LENGTH=24*60*60//25, # shares
        TARGET_LOOKBEHIND=25, # shares coinbase maturity
        SPREAD=20, # blocks
        IDENTIFIER='cacacacae0e0e0ee'.decode('hex'),
        PREFIX='fefeefcf0e0f3434'.decode('hex'),
        P2P_PORT=31606,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=31707,
   BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

AND..


skatecoin=math.Object(
        P2P_PREFIX='fcd9b7dd'.decode('hex'),
        P2P_PORT=21607,
        ADDRESS_VERSION=25,
        RPC_PORT=21606,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'skatecoinaddress' 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=90, # s
        SYMBOL='SK8',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'SkateCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/SkateCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.skatecoin'), 'skatecoin.conf'),

        BLOCK_EXPLORER_URL_PREFIX='http://skatechain.info/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://skatechain.info/address/',
        TX_EXPLORER_URL_PREFIX='http://skatechain.info/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,


Now i run p2pool

python ./p2pool-rav/run_p2pool.py --net skatecoin -a BGysxf56z6cX1e68EoRv8fzwa8J6V1HLoQ -f 1 -w 31707 --give-author 0 --bitcoind-p2p-port 21607 --bitcoind-rpc-port 2106 skatecoinrpc my rpc pass from skatecoin.conf


Output:


2014-03-15 18:55:21.413497 p2pool (version 13.3-247-g2ffa4af-dirty)
2014-03-15 18:55:21.413580
2014-03-15 18:55:21.413636 Testing bitcoind RPC connection to 'http://127.0.0.1:21606/' with username 'skatecoinrpc'...
2014-03-15 18:55:21.416764 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
2014-03-15 18:55:22.419917 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
2014-03-15 18:55:23.422838 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!


Tell me please what i'm doing wrong?
full member
Activity: 140
Merit: 100
March 13, 2014, 11:45:42 PM
#25
Oh ok I see, thanks for the explanaion Smiley

Are the 2 networks.py files the only to modify to get an alt-coin based on scrypt working on p2pool?
legendary
Activity: 1270
Merit: 1000
March 08, 2014, 11:16:39 PM
#24
Thanks for this thread! Very helpful but how can you configure a coin with random block reward? I saw on Rav3nPL github settings for dogecoin for example but there's nothing particular, I wonder how it works.

There is a promising new pull request that takes the subsidy function out into a 'module' to return a value. Have been meaning to dig into it as a solution not only for DOGE, etc. but also for WDC and it's decreasing reward.

Yeah I saw that for dgb, I've set up a pool with the subsidy function from the py_module made by chaeplin. Sounds promising for other alts Tongue

But if you look at dogecoin in networks.py from Rav3nPL github the subsidy function is: SUBSIDY_FUNC=lambda height: 10000*100000000. How can it works?

I doesn't really...it produces blocks of only 10,000 DOGE when the SUBSIDY_FUNC is actually used. The blockchain has many examples of this happening. Funny thing is others have used that same value for other coins that have random block rewards. I was staging a protest by not running a DOGE node for a while but finally gave in  Roll Eyes

Fortunately changing SUBIDY_FUNC is not a value that requires a new fork of the coins p2pool sharechain so it can be done node by node whenever they like. I think the DGB p2pool started a new fork (changing ident/prefix) not knowing this  Tongue
full member
Activity: 140
Merit: 100
March 07, 2014, 05:14:44 AM
#23
Thanks for this thread! Very helpful but how can you configure a coin with random block reward? I saw on Rav3nPL github settings for dogecoin for example but there's nothing particular, I wonder how it works.

There is a promising new pull request that takes the subsidy function out into a 'module' to return a value. Have been meaning to dig into it as a solution not only for DOGE, etc. but also for WDC and it's decreasing reward.

Yeah I saw that for dgb, I've set up a pool with the subsidy function from the py_module made by chaeplin. Sounds promising for other alts Tongue

But if you look at dogecoin in networks.py from Rav3nPL github the subsidy function is: SUBSIDY_FUNC=lambda height: 10000*100000000. How can it works?
member
Activity: 81
Merit: 10
March 07, 2014, 02:13:37 AM
#22
Quote
I have not tried this myself but someone said (although I have my doubts) that changing p2pool/networks.py PREFIX= to the same value as p2pool/bitcoin/networks.com P2P_PREFIX= works for some coins that get stuck on 'Testing bitcoind P2P connection'. Again, I seriously doubt it but give it a shot and report back.

In your coin example you would change p2pool/networks.py from:
PREFIX='adcc0aecfe4c04c9'.decode('hex'),
to:
PREFIX='ddb9b7ef'.decode('hex'),

Heh, if that works I would be shocked  Grin

I've try but it dont work...
But there must be a chance to make it there are many p2pools for so much coins.  Huh Undecided

Its not the PREFIX i've test it on an other coin, i search the point...
legendary
Activity: 1270
Merit: 1000
March 07, 2014, 01:48:40 AM
#21
Thanks for this thread! Very helpful but how can you configure a coin with random block reward? I saw on Rav3nPL github settings for dogecoin for example but there's nothing particular, I wonder how it works.

There is a promising new pull request that takes the subsidy function out into a 'module' to return a value. Have been meaning to dig into it as a solution not only for DOGE, etc. but also for WDC and it's decreasing reward.
legendary
Activity: 1270
Merit: 1000
March 07, 2014, 01:44:29 AM
#20
full member
Activity: 140
Merit: 100
March 06, 2014, 04:58:35 PM
#19
Thanks for this thread! Very helpful but how can you configure a coin with random block reward? I saw on Rav3nPL github settings for dogecoin for example but there's nothing particular, I wonder how it works.
member
Activity: 81
Merit: 10
March 06, 2014, 03:17:31 PM
#18
Hi, i try and try but it don't work.

I do all like in the "tutorial" but i think the identifier and prefix is more...
If i change the identifier of an existing coin twisted fall in a loop.
And i try to add a simple coin 4 test =>

2014-03-06 21:06:47.817990     Current block hash: 1f08c0cb6ff064bf911b3e73756bc553cacb166dbd4552d399ed6c2cf4dd30c8
2014-03-06 21:06:47.818232     Current block height: 74250
2014-03-06 21:06:47.818441
2014-03-06 21:06:47.818728 Testing bitcoind P2P connection to '127.0.0.1:11656'...
2014-03-06 21:06:52.819332     ...taking a while. Common reasons for this include all of bitcoind's connection slots being used...

and this is on every coins i try

Code:
piratecoin=math.Object(
        P2P_PREFIX='ddb9b7ef'.decode('hex'), #pchmessagestart
        P2P_PORT=11656,
        ADDRESS_VERSION=23, #pubkey_address
        RPC_PORT=11655,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'piratecoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 0*1200000000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # seconds
        SYMBOL='PIR',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'piratecoin')
                if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/piratecoin$
                if platform.system() == 'Darwin' else os.path.expanduser('~/.piratecoin'), 'piratecoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://explorer.coin-project.org/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.coin-project.org/address/',
        TX_EXPLORER_URL_PREFIX='http://explorer.coin-project.org/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,
    ),
in /bitcoin
and:
Code:
piratecoin=math.Object(
        PARENT=networks.nets['piratecoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=8*60*60//10, # shares
        REAL_CHAIN_LENGTH=8*60*60//10, # shares
        TARGET_LOOKBEHIND=60, # shares
        SPREAD=30, # blocks
        IDENTIFIER='4d2307e841c11fdd'.decode('hex'),
        PREFIX='adcc0aecfe4c04c9'.decode('hex'),
        P2P_PORT=25005,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=25006,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),
in the /p2pool folder
any idea???
chain length and so not editet because try for run only Smiley

thanks 4 help
zvs
legendary
Activity: 1680
Merit: 1000
https://web.archive.org/web/*/nogleg.com
March 06, 2014, 04:25:41 AM
#17
What is MAX_TARGET?  I've noticed it's different for various coins but not sure how it's computed.

the maximum custom difficulty you can set

hmm, nm, i'm not 100% sure about that actually, would have to look at the source again.   i think that's what it is, though.

btw, for any coin with, say, block times of 2 or 3 minutes or less, you should remove the following in data.py:

if best is not None:
            best_share = self.items[best]
            punish, punish_reason = best_share.should_punish_reason(previous_block, bits, self, known_txs)
            if punish > 0:
                print 'Punishing share for %r! Jumping from %s to %s!' % (punish_reason, format_hash(best), format_hash(best_share.previous_hash))
                best = best_share.previous_hash

...  first off, these blocks are too fast to have that anyway.  not to mention that the vast majority of the time this will be beneficial to your node.  if you build off of that old valid *share that's just getting punished because of a new block, all the other clients will follow your chain (as it'll be the longest).  this way you don't end up making a share some 3 seconds later and have some slow (or modified, heh heh) node build off the original share
full member
Activity: 210
Merit: 100
March 06, 2014, 12:56:09 AM
#16
Great resource, will be using this to get P2Pools running for some of the newer coins
full member
Activity: 122
Merit: 100
March 05, 2014, 06:32:28 PM
#15
What is MAX_TARGET?  I've noticed it's different for various coins but not sure how it's computed.
legendary
Activity: 1270
Merit: 1000
February 28, 2014, 02:45:34 PM
#14
I want to work on some coins with POW/POS - is it best to use your repo - or use the one developed for NVC?

Assuming Novacoin is POW/POS then yes...work off of that one. I have no experience with POW/POS coins and P2Pool.
full member
Activity: 155
Merit: 100
February 28, 2014, 11:02:28 AM
#13
I want to work on some coins with POW/POS - is it best to use your repo - or use the one developed for NVC?
legendary
Activity: 1270
Merit: 1000
February 23, 2014, 03:34:51 PM
#12
Added comments to p2pool/bitcoin/networks.py in SUBSIDY_FUNC and DUST_THRESHOLD sections.

Added coin examples to p2pool/networks.py in the SPREAD section.

Added how to generate unique values for IDENTIFIER and PREFIX in p2pool/networks.py.
legendary
Activity: 1270
Merit: 1000
February 21, 2014, 01:59:32 PM
#11
Updated RPC_CHECK= ... 'litecoinaddress' to also include:
You can also find this in rpcdump.cpp after "dumpprivkey <"

Thanks deeppurple72
newbie
Activity: 44
Merit: 0
February 20, 2014, 09:37:45 PM
#10
Please deeppurple72, let's keep this conversation on github. You made your point and I understand it and I accept it.
Of course you are welcome any time to join and contribute in documenting more in detail the internals of the P2Pool configuration.
If not now in several months, or whenever it will not be an obstacle to your goals/plans.

full member
Activity: 140
Merit: 100
February 20, 2014, 09:27:29 PM
#9
Hi CartmanSPC,

first of all thanks for all the work you put in organizing this information about P2Pool. Reading it put me up with most of the knowledge I have of configuring new P2Pools for altcoins.
I guess you read the disappointing answer of deeppurple72 on Github (if not go and check it https://github.com/forrestv/p2pool/issues/157#issuecomment-35691652).

If you don't mind I'd like to help/contribute to the work you have started, and join forces to figure out how to make as many interesting cryptos as possible with p2pool.
And then redistribute the code + the documentation for the good of the community as a whole.

If you think it's too much work or you are not interested I will understand. But then I'll try to carry on on my own and of course give you all the credit you deserve!
Ciao!



Like I said, I will share with the community soon.
2nd of all, your code was not rewritten, and not being "sold"
3rd because the new coins have low diff, 0 nodes/ 0 peers is actually an advantage
4th I would like to run the new pools for several months and then share with the
community the knowledge.... I am not attempting to "sell" some custom
modification of p2pool software, so let me make that perfectly clear!

There is a forum on bitcointalk.org about "HOW TO MAKE ALT-COINS WORK WITH P2POOL"
that has alot of good information. I just happened to discover on my own lots of additional information. When I said "bounty", it referred to information, and NOT p2pool software.

Also, you will notice that I did NOT post any wallet addresses, as I did not seriously
expect anyone to actually do that.

Let me run some pools for a few months so I can make a little something first,
then I will glady clue you people in....

Also, you guys were very hard on me when I requested some kind of way to penalize
those cloud-miners, pools running into pools, "excessive hashrates"
calling my request "ludicrous" and such....

and then you wonder why I suddenly don't feel so friendly?

Hmmmm........
newbie
Activity: 44
Merit: 0
February 20, 2014, 09:16:39 PM
#8
Hi CartmanSPC,

first of all thanks for all the work you put in organizing this information about P2Pool. Reading it put me up with most of the knowledge I have of configuring new P2Pools for altcoins.
I guess you read the disappointing answer of deeppurple72 on Github (if not go and check it https://github.com/forrestv/p2pool/issues/157#issuecomment-35691652).

If you don't mind I'd like to help/contribute to the work you have started, and join forces to figure out how to make as many interesting cryptos as possible with p2pool.
And then redistribute the code + the documentation for the good of the community as a whole.

If you think it's too much work or you are not interested I will understand. But then I'll try to carry on on my own and of course give you all the credit you deserve!
Ciao!
sr. member
Activity: 434
Merit: 250
February 16, 2014, 08:56:42 PM
#7
How can I contol what diff p2pool will send to miner?

To your own miner? /DIFF will control your share target to gets shares on the chain, +DIFF will control your pseudo share target to report work back even if it's lower than share target.
newbie
Activity: 26
Merit: 0
February 12, 2014, 07:52:09 AM
#6
How can I contol what diff p2pool will send to miner?
newbie
Activity: 6
Merit: 0
February 10, 2014, 04:12:32 PM
#5
Thanks for posting this ,I started working on adding our stuff and quickly realised there was more
to it than I thought there would be .. 
tvb
newbie
Activity: 38
Merit: 0
February 10, 2014, 03:05:20 AM
#4
PERSIST=True
You need to set it to False to bootstrap the sharechain, but once you've done that and have a bootstrap node up, set it to True
It prevents anyone else from bootstrapping a sharechain
legendary
Activity: 1270
Merit: 1000
February 09, 2014, 09:26:44 PM
#3
p2pool/networks.py

Unlike p2pool/bitcoin/networks.py some of the values here may be subjective and not clearly defined.
I will add my own personal comments to each setting. Please feel free to add your own or discuss opposing viewpoints.


For reference here is the section of the code for litecoin:
Code:
   litecoin=math.Object(
        PARENT=networks.nets['litecoin'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='e037d5b8c6923410'.decode('hex'),
        PREFIX='7208c1a53ef629b0'.decode('hex'),
        P2P_PORT=9338,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=9327,
        BOOTSTRAP_ADDRS='forre.st vps.forre.st liteco.in 95.211.21.103 37.229.117.57 66.228.48.21 180.169.60.179 112.84.181.102 74.214.62.115 209.141.46.154 78.27.191.182 66.187.70.88 88.190.223.96 78.47.242.59 158.182.39.43 180.177.114.80 216.230.232.35 94.231.56.87 62.38.194.17 82.67.167.12 183.129.157.220 71.19.240.182 216.177.81.88 109.106.0.130 113.10.168.210 218.22.102.12 85.69.35.7:54396 201.52.162.167 95.66.173.110:8331 109.65.171.93 95.243.237.90 208.68.17.67 87.103.197.163 101.1.25.211 144.76.17.34 209.99.52.72 198.23.245.250 46.151.21.226 66.43.209.193 59.127.188.231 178.194.42.169 85.10.35.90 110.175.53.212 98.232.129.196 116.228.192.46 94.251.42.75 195.216.115.94 24.49.138.81 61.158.7.36 213.168.187.27 37.59.10.166 72.44.88.49 98.221.44.200 178.19.104.251 87.198.219.221 85.237.59.130:9310 218.16.251.86 151.236.11.119 94.23.215.27 60.190.203.228 176.31.208.222 46.163.105.201 198.84.186.74 199.175.50.102 188.142.102.15 202.191.108.46 125.65.108.19 15.185.107.232 108.161.131.248 188.116.33.39 78.142.148.62 69.42.217.130 213.110.14.23 185.10.51.18 74.71.113.207 77.89.41.253 69.171.153.219 58.210.42.10 174.107.165.198 50.53.105.6 116.213.73.50 83.150.90.211 210.28.136.11 86.58.41.122 70.63.34.88 78.155.217.76 68.193.128.182 198.199.73.40 193.6.148.18 188.177.188.189 83.109.6.82 204.10.105.113 64.91.214.180 46.4.74.44 98.234.11.149 71.189.207.226'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-ltc',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.8.5.1!' if v < 80501 else None,
    ),


For now here are some of my notes (work in progress):

SHARE_PERIOD
SHARE_PERIOD sets a target time for how often to provide a share. It will regulating the difficulty to try to hit that target time taking into account the setting in TARGET_LOOKBEHIND.
A lower number will have the effect of a lower share difficulty but also result in a larger share chain depending on the value in CHAIN_LENGTH. It may also cause additional orphans in the p2pool share chain as too low a difficulty will mean multiple miners will find shares at the same time. Not necessarily a bad thing as your all working on finding the same block but the winning finder will get the credit for the share.

Comment
I have seen people say a good rule of thumb is setting this to 1/5 of the altcoin block period. Too high a number will provide a higher diff share favoring higher hash rate miners. Too low a number increases resources (traffic, memory, storage) and orphans from competing miners finding the same shares. I believe setting this to 10 for most altcoins with block times of between 0.5 - 2 minutes is a good compromise.


CHAIN_LENGTH
CHAIN_LENGTH is the number of shares p2pool keeps before discarding them. It needs to be larger than or equal to REAL_CHAIN_LENGTH (it is normally equal to). One reason it increase this would be to show more data in the recent blocks found list.

Example: 24*60*60//10 = 1 day of shares. 7*24*60*60//10 = 7 days of shares. [verification needed]

REAL_CHAIN_LENGTH

REAL_CHAIN_LENGTH sets the total number of previously found shares to include in the payout when a block is found. A longer chain provides a larger amount of time to find a share (get paid for work).
It also contributes to how long you need mine to reach your "full" payout amount.

Comment
24*60*60//10 is calculated as follows:
(24*60*60)/10 = 8,640 shares are paid when a block is found.

Take the value in SHARE_PERIOD and multiply by the number of shares to find how many seconds a share is valid for.
For example:

8,640 shares will be paid with a share expected to be found every 10 seconds
8,640 * 10 = 86,400 seconds
86,400 / 60 = 1,440 minutes
1,440 / 60 = 24 hours
24 / 24 = 1 days

I have tried various REAL_CHAIN_LENGTH settings but have settled on 24*60*60//10 for the following reasons:
Allows a 24 hours period of time for finding of a share and for those shares to be valid based on having a share period of 10 seconds.
  • Allows smaller miners time to find a share within 24 hours
  • Amount of time to full payout increased but so does the time you continue to receive payment after you stop mining
  • Takes longer to ramp up to your full payout amount but you continue to get paid for about the same amount of time after you stop mining. With a  CHAIN_LENGTH setting of 24*60*60//10 I would say most miners reach their full payout between 6-8 hours and continue to receive a payout for about the same amount of time after they stop mining (depending on their hashrate and the setting in spread).



TARGET_LOOKBEHIND
Determines the number of shares counted for difficulty regulation.
Used to determine share difficulty based on the hash rate of p2pool (not individual nodes).

Comment
Some people set this really low but I recommend it be kept at 200 as it will modify the share diff based on the previous 200 shares rather quickly. I think they believe it will take TARGET_LOOKBEHIND*SHARE_PERIOD='time it takes to adjust' but I feel it actually uses the last 200 shares and adjust based on the average. Setting too low a number does not give it a large enough number of shares to determine the proper value and adjust smoothly.
With large miners coming and going the difficulty adjustment takes too long with 200 shares on smaller p2pool networks. On larger p2pool networks this is not noticeable but I have resulted to setting this to 20 to accommodate large miners coming and going.

SPREAD
SPREAD determines how many blocks (max) to pay if a miner finds at lease one share.
Does not go beyond the CHAIN_LENGTH/REAL_CHAIN_LENGTH setting.

Comment
600/[block time]=x
x*3=spread

Quote
bitcoin      SPREAD=3      block every 600 seconds         Baseline
litecoin     SPREAD=12     block every 150 seconds        600/150=4       4x3=12
bbqcoin      SPREAD=30     block every 60 seconds         600/60=10       10x3=30
casinocoin   SPREAD=60     block every 30 seconds         600/30=20       20x3=60
digitalcoin  SPREAD=90     block every 20 seconds         600/20=30       30x3=90  (old spec)
digitalcoin  SPREAD=45     block every 40 seconds         600/40=15       15x3=45  (new spec)
worldcoin    SPREAD=120    block every 15 seconds         600/15=40       40x3=120 (old spec)
worldcoin    SPREAD=60     block every 30 seconds         600/30=20       20x3=60  (new spec)
anoncoin     SPREAD=10     block every 205 seconds        600/205=2.926829268292683   2.926829268292683x3=8.780487804878049
globalcoin   SPREAD=45     block every 40 seconds         600/40=15       15x3=45
dogecoin     SPREAD=30     block every 60 seconds         600/60=10       10x3=30
potcoin      SPREAD=45     block every 40 seconds         600/40=15       15x3=45
craftcoin    SPREAD=6      block every 300 seconds        600/300=2        2x3=6  (old spec)
craftcoin    SPREAD=30     block every 60 seconds         600/60=10       10x3=30 (new spec)
nyancoin     SPREAD=30     block every 60 seconds         600/60=10       10x3=30

It is not a hard limit # of blocks, it is the # times the average work required to solve a block.  In other words, for a SPREAD=3 if the average time to block is 8 hours, then your shares will fall off the payout after 24 hours.  So, if p2pool happens to get lucky and solve 10 blocks in that 24 hour period, your share will be paid for all 10 blocks.



--------------------
To generate unique values for IDENTIFIER and PREFIX create a random string of 19 numbers and convert to Hex.

I use the windows Programmer Calculator to do the conversion (View menu).

Example:
5486237465184378845 = 4C2307E841C11FDD

....more to come!
legendary
Activity: 1270
Merit: 1000
February 09, 2014, 09:26:33 PM
#2
p2pool/bitcoin/networks.py

This is where the coin specific settings are stored. All the information in this file needs to come from the source code of each coin and be updated if any of that information is changed.

For reference here is the section of the code for litecoin:
Code:
   litecoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9333,
        ADDRESS_VERSION=48,
        RPC_PORT=9332,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'litecoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
        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/',
        TX_EXPLORER_URL_PREFIX='http://explorer.litecoin.net/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,
    ),

litecoin=math.Object(
Change litecoin to match the name of the altcoin.

P2P_PREFIX='fbc0b6db'.decode('hex'),
Replace 'fbc0b6db' with the values from main.cpp at pchMessageStart[4] =
Remove all '0x' and combine the rest.

P2P_PORT=9333,
Replace 9333 by looking in protocol.h and finding the 2nd value after GetDefaultPort
Some coins may have this in chainparams.cpp at nDefaultPort =

ADDRESS_VERSION=48,
Look in base58.h and find the value of PUBKEY_ADDRESS

RPC_PORT=9332,
Look in bitcoinrpc.cpp for GetArg("-rpcport", xxxx), xxxx is the RPC_PORT.
Some coins may have this in chainparams.cpp at  nRPCPort =

RPC_CHECK= ... 'litecoinaddress'
Look in bitcoinrpc.cpp after setaccount <
If the altcoin has a 'space' between altcoin and address make sure you include the 'space'.
You can also find this in rpcdump.cpp after dumpprivkey <

SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
SUBSIDY_FUNC=lambda height: 'block reward' * 'satoshies' >> (height + 1)//'height where block halves'.
For 'block reward' look in main.cpp for nSubsidy
For 'height where block halves' look in main.cpp for nSubsidy -> nSubsidy >>= (nHeight /
If a coin does not have a height where the block halves take out >> (height + 1)//'height where block halves'

Comment
Pay particular attention to verifying that you have this correct. Not doing so will result in some blocks being rewarded less than their full value.

SUBSIDY_FUNC is only used in some instances.
Quote
Sometimes  removed_fees  contains  None  when P2Pool doesn't know the fee associated with a transaction, such as with old versions of *coind as a result of this old bug. Then, P2Pool has to make a conservative estimate of the subsidy using its computed base subsidy and the sum of the fees it does know.

I have not seen a solution for coins with a random block reward. For random block reward coins some have suggested that the 'block reward' should be set to a low number as a high number would cause the block to be rejected [try to verify].

To do
Determine the correct SUBSIDY_FUNC for coins that decrease by a percentage (WDC, Digibyte).
Determine the correct SUBSIDY_FUNC for coins that have a random block reward (DOGE, LEAF, FLAP PENG, MEOW, etc).



....more to come. For now here are my dirty notes:

BLOCK_PERIOD=
------------------------------------------
target time between blocks
pulled from src/main.cpp (search for "static const int64 nTargetSpacing")
------------------------------------------

SANE_TARGET_RANGE = (2**256//1000000000 - 1, 2**256//1000 - 1)
No changes for scrypt.
DUMB_SCRYPT_DIFF = 2**16
No changes for scrypt.

DUST_THRESHOLD =
Note about DUST_TRESHOLD: In an effort to reduce the number of very small dust payments hanging around in peoples wallets, it does this by looking at your expected block payment and adjusted the required share difficulty until this is above its DUST_THRESHOLD value.
0.03e8    = 3000000   = 0.03       in satoshis [someone please verify]
1e8       = 100000000 = 0.00000001 in satoshis [someone please verify]
0.001e8   = 100000    = 0.001      in satoshis [someone please verify]
legendary
Activity: 1270
Merit: 1000
February 09, 2014, 09:26:20 PM
#1
Since it is so hard to find all the information in one location I thought I would start a thread detailing the changes necessary to make most POW altcoins work with p2pool. Thanks go out to all those who have posted this information elsewhere on the forum.

There are two files that will need to be changed:

p2pool/bitcoin/networks.py
p2pool/networks.py


Will break these down in the next two posts. Over time I will update to reflect new information.

Note: When a coin changes it's spec p2pool needs to be changed to match.
Note: All nodes must run the same code. If there are any changes [some exceptions] it is recommended to start a new p2pool share chain by changing IDENTIFIER and PREFIX and deleting the p2pool/data folder.

I maintain a GitHub that I keep updated of the coins I run on xpool.net here:
https://github.com/CartmanSPC/p2pool

Here are some other popular repositories:
https://github.com/narken/p2pool-altcoins
https://github.com/Rav3nPL/p2pool-rav

Please use caution when using some of these repositories as they may not have been updated to reflect changed coin specs.

Link to the original source by forrestv (BTC, LTC, TRC):
https://github.com/forrestv/p2pool
Jump to: