Post
Topic
Board Mining (Altcoins)
Re: Finding p2pool networks.py values for new altcoins
by
yahma
on 24/12/2013, 06:18:25 UTC
There seems to be some confusion about the values for networks.py, so lets see if we can sort things out and provide a bit of clarification:

SHARE_PERIOD: How often should P2Pool generate a new share (rule of thumb: 1/5 - 1/10 of the block period)
CHAIN_LENGTH: How many shares P2Pool client keeps
REAL_CHAIN_LENGTH: The {N} value in PPLNS
Note:  REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH

SPREAD:  How long a 'share' is valid (ie. for how many block can be paid for this share)
TARGET_LOOKBEHIND: Is used for diff calculations.  (ie. how many previous shares to use in calculating difficulty) - lower values can be used to prevent a big miner from getting too many shares before diff rises
PERSIST: False (if you want to allow your server to run independently of any bootstrap nodes... but still allow syncing if they exist).  True will require other nodes on the network to run.
IDENTIFIER & PREFIX: P2Pool will only sync with other nodes who have Identifier and Prefix matching yours (and using same p2p port).. if any of the above values change, a new identifier & prefix need to be created in order to prevent problems.

Example:

Code:
     casinocoin=math.Object(
        PARENT=networks.nets['casinocoin'],
        SHARE_PERIOD=5, # seconds target spacing
        CHAIN_LENGTH=3*60*60//5, # shares
        REAL_CHAIN_LENGTH=3*60*60//5, # shares
        TARGET_LOOKBEHIND=60,
        SPREAD=60, # blocks
        IDENTIFIER='7696C5EF0B281C2F'.decode('hex'),
        PREFIX='4C2E2CD651764B9F'.decode('hex'),
        P2P_PORT=23640,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8840,
        BOOTSTRAP_ADDRS='csc.xpool.net bigiron.homelinux.com'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

CasinoCoin generates a new block every 30 seconds.  SHARE_PERIOD should be 1/5 to 1/10th of that.  In this case 5s is (1/6) share period.  Having a value above 1/5 risks more stale shares & larger inefficiency.
CHAIN_LENGTH & REAL_CHAIN_LENGTH are set up to allow for 3 Hour PPLNS.
TARGET_LOOKBEHIND is set to 60 (shares) giving a 300 second (5min) difficulty adjustment.
SPREAD is set to 60 blocks, so a share will be valid up to 60 blocks or REAL_CHAIN_LENGTH (3 hours), whichever is shorter.
P2P_PORT, IDENTIFIER & PREFIX must match the other nodes you wish to sync with... (all the above values must also match)

Hope this clears a few things up!!