What should I do if I want to modify p2pool to suit for zcash?


#1

I know I should change bitcoin file to zcash .

I have highlight the attributes I consider to be modifid, Can anyone tell me how to do it?

Any suggestion will be ok

P2PPREFIX = 'f9beb4d9'.decode('hex')_
P2PPORT = 8333_
ADDRESS_VERSION = 0
RPCPORT = 8332_
**RPCCHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(**_
** (yield helper.checkgenesis_block(bitcoind, '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f')) and**_
** not (yield bitcoind.rpcgetinfo())['testnet']**_
** ))**
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POWFUNC = data.hash256_
BLOCK_PERIOD = 600 # s
SYMBOL = 'BTC'
**CONFFILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Bitcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Bitcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.bitcoin'), 'bitcoin.conf')**_
BLOCK_EXPLORER_URL_PREFIX = 'https://blockchain.info/block/'
ADDRESS_EXPLORER_URL_PREFIX = 'https://blockchain.info/address/'
TX_EXPLORER_URL_PREFIX = 'https://blockchain.info/tx/'
SANE_TARGET_RANGE = (2**256//2**32//1000000 - 1, 2**256//2**32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 0.001e8


#2

This is what I do p2pool/bitcoin/networks/zcash_testnet.py
the pow is zcash-pow...

It can't started like this

import os
import platform

from twisted.internet import defer

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

P2P_PREFIX = ''.decode('hex')
P2P_PORT = 18233
ADDRESS_VERSION = 111
RPC_PORT = 18232
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'zcashaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = pow.mine
BLOCK_PERIOD = 600 # s
SYMBOL = 'TAZ'
CONF_FILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Zcash') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Zcash/') if platform.system() == 'Darwin' else os.path.expanduser('~/.zcash'), 'zcash.conf')
BLOCK_EXPLORER_URL_PREFIX = 'http://blockexplorer.com/testnet/block/'
ADDRESS_EXPLORER_URL_PREFIX = 'http://blockexplorer.com/testnet/address/'
TX_EXPLORER_URL_PREFIX = 'http://blockexplorer.com/testnet/tx/'
SANE_TARGET_RANGE = (2**256//2**32//1000 - 1, 2**256//2**32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 1e8


#3

Check out this thread: https://forum.zcashcommunity.com/t/zcash-p2pool-mining-development/1051