Post
Topic
Board Mining (Altcoins)
Re: Finding p2pool networks.py values for new altcoins
by
tvb
on 07/02/2014, 15:01:56 UTC
So, I had a little chat with forrestv! Here is some information on how to find the correct settings for the /bitcoin/networks.py file.

Attention: the /bitcoin/networks.py is COIN SPECIFIC

Sample /bitcoin/networks.py:

Code:

=math.Object(
        P2P_PREFIX=''.decode('hex'),
        P2P_PORT=,
        ADDRESS_VERSION=,
        RPC_PORT=,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'address' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: * >> (height + 1)//840000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=, # s
        SYMBOL='',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], '') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support//') if platform.system() == 'Darwin' else os.path.expanduser('~/.'), '.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        TX_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,
    ),

Detailed explanation

P2P_PREFIX =
pulled from ./src/main.ccp (search for "unsigned char pchMessageStart" and use the value between { } (remove all 0x))

P2P_PORT =
pulled from ./src/protocol.h (search for "GetDefaultPort", 2nd value will be the port value.)

ADDRESS_VERSION =
pulled from ./src/base58.h (search for "PUBKEY_ADDRESS")

RPC_PORT =
pulled from ./src/bitcoinrpc.cpp (search for 'GetArg("-rpcport", xxxx)' where xxxx is the value of the port.

RPC_CHECK change e.g. 'litecoinaddress' to 'address'

SUBSIDY_FUNC = * >> (height + 1)//
pulled from ./src/main.cpp (search for "nSubsidy")
pulled from ./src/main.cpp (search for "nSubsidy >>= (nHeight")

note: If there is no "halfing" you should take out the ">> (height + 1)//"

BLOCK_PERIOD =
pulled from ./src/main.cpp (search for "static const int64 nTargetSpacing")

SYMBOL =
Like BTC, LTC, DOGE

CONF_FILE_FUNC = change , , and

BLOCK_EXPLORER_URL_PREFIX =

ADDRESS_EXPLORER_URL_PREFIX =

TX_EXPLORER_URL_PREFIX =

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 = 0.03e8
No changes for scrypt.

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 (current 0.1000).

Transaction fees in Litecoin have been designed to protect the network from a problem known as transaction spam (dust transactions). If someone was to setup a loop between two wallets, sending back and forth small amounts, they would grow the block chain. Fees prevent this as it becomes too expensive to do this.[/size]