Post
Topic
Board Announcements (Altcoins)
Re: [ANN][SHA-256][21coin] ULTRA RARE 21 COIN - NOW IN CRYPTORUSH.IN - 3 EXCHANGES!
by
ruggero
on 27/02/2014, 12:14:21 UTC
Hi all!
I wanted to give the community the settings to add P2Pool nodes for 21coin.
You can download and install Rav3nPL's p2pool-rav from GitHub: https://github.com/Rav3nPL/p2pool-rav
Just add the following code sections at the end of each networks.py file.

In p2pool-rav/p2pool/bitcoin/networks.py add:

Code:
   twentyone=math.Object(
        P2P_PREFIX='21212121'.decode('hex'),
        P2P_PORT=21213,
        ADDRESS_VERSION=3,
        RPC_PORT=21212,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            '21coinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 0.00000001*100000000 if height < 1500 else 0.0021*100000000 if height == 212 else 0.0021*100000000 if height == 2122 else 0.0021*100000000 if height == 21212 else 0.0021*100000000 if height == 212121 else 0.0021*100000000 if height == 2121212 else 0.000021*100000000,
        POW_FUNC=data.hash256,
        BLOCK_PERIOD=126, # s
        SYMBOL='21',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], '21coin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/21coin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.21coin'), '21coin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://bitalchemy.net/21coin/',
        ADDRESS_EXPLORER_URL_PREFIX='http://bitalchemy.net/21coin/',
        TX_EXPLORER_URL_PREFIX='http://bitalchemy.net/21coin/',
        SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
        DUMB_SCRYPT_DIFF=1,
        DUST_THRESHOLD=0.001e8,
    ),

And in p2pool-rav/p2pool/networks.py add:

Code:
   twentyone=math.Object(
        PARENT=networks.nets['twentyone'],
        SHARE_PERIOD=25, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=10, # blocks
        IDENTIFIER='1212121212121212'.decode('hex'), ## If this value is changed the P2Pool won't sync with other nodes
        PREFIX='2121212121212121'.decode('hex'), ## If this value is changed the P2Pool won't sync with other nodes
        P2P_PORT=21022, ## If this value is changed the P2Pool won't sync with other nodes
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**32 - 1,
        PERSIST=False,
        WORKER_PORT=21021, ## IMPORTANT: Don't forget to open this port on your Firewall!
        ## Add your pool in the line below, e.g.:
        ## BOOTSTRAP_ADDRS='nr1.co.in yourpool.com '.split(' '),
        ## or should you not have a domain name use your IP address, e.g.:
        ## BOOTSTRAP_ADDRS='nr1.co.in 123.156.123.232 '.split(' '),
        BOOTSTRAP_ADDRS='nr1.co.in'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool',
        VERSION_CHECK=lambda v: True,
    ),

Please don't hesitate to ask if you need some support.