Pages:
Author

Topic: Finding p2pool networks.py values for new altcoins - page 2. (Read 38084 times)

full member
Activity: 147
Merit: 100
You need to get the vertcoin p2pool code. Sorry I'm on mobile or I would post a link. Google will get you to the proper github fork for scrypt-n p2pool. Also, I'm pretty sure that fork already has settings for gpucoin. Good luck.
sr. member
Activity: 406
Merit: 251
Hi all!  I am trying to start a p2pool for GPUCoin, got a lot father that i thought i might on the first night!  self teaching and doing this on a linux vps.

I am getting this error when launching the run_p2pool.py:

Code:
2014-03-18 20:46:28.221623 > ---  ---
2014-03-18 20:46:28.221653 >   File "/root/p2pool-gpuc/p2pool/util/deferral.py", line 41, in f
2014-03-18 20:46:28.221682 >     result = yield func(*args, **kwargs)
2014-03-18 20:46:28.221710 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2014-03-18 20:46:28.221740 >     result = g.send(result)
2014-03-18 20:46:28.221768 >   File "/root/p2pool-gpuc/p2pool/node.py", line 218, in poll_header
2014-03-18 20:46:28.221797 >     handle_header((yield self.factory.conn.value.get_block_header(self.bitcoind_work.value['previous_block'])))
2014-03-18 20:46:28.221833 >   File "/root/p2pool-gpuc/p2pool/node.py", line 200, in handle_header
2014-03-18 20:46:28.221870 >     if not (self.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(new_header)) <= self.bitcoind_work.value['bits'].target):
2014-03-18 20:46:28.221895 >   File "/root/p2pool-gpuc/p2pool/bitcoin/networks.py", line 243, in
2014-03-18 20:46:28.221914 >     POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('vtc_scrypt').getPoWHash(data)),
2014-03-18 20:46:28.221947 > exceptions.ImportError: No module named vtc_scrypt
2014-03-18 20:46:28.321285 > Unhandled error in Deferred:
2014-03-18 20:46:28.321478 > Unhandled Error
2014-03-18 20:46:28.321517 > Traceback (most recent call last):
2014-03-18 20:46:28.321539 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 362, in callback
2014-03-18 20:46:28.321561 >     self._startRunCallbacks(result)
2014-03-18 20:46:28.321581 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
2014-03-18 20:46:28.321601 >     self._runCallbacks()
2014-03-18 20:46:28.321621 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
2014-03-18 20:46:28.321641 >     current.result = callback(current.result, *args, **kw)
2014-03-18 20:46:28.321660 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
2014-03-18 20:46:28.321680 >     _inlineCallbacks(r, g, deferred)
2014-03-18 20:46:28.321698 > --- ---

Would love to figure out what i am doing wrong. Thanks for the help!
newbie
Activity: 22
Merit: 0
Hi,

I am trying to set up p2pool mining for the new crypto money called CrimeaCoin.
I tried connecting miners (CGMiner and SGminer) from my local computer and I am getting these error messages:
1. Locally:
Code:
C:\Program Files\sgminer-4.1.0-windows>sgminer -o http://54.84.97.75:29399 -u CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9 -p 34523523324tertewgdsgsdfgsd -T
[22:31:41] Started sgminer 4.1.0
[22:31:41] Loaded configuration file sgminer.conf
[22:31:42] Probing for an alive pool
[22:31:52] Waiting for work to be available from pools.
[22:32:12] Pool 1 slow/down or URL or credentials invalid
[22:32:12] Pool 0 slow/down or URL or credentials invalid
[22:32:42] No servers were found that could be used to get work from.

[22:32:42] Please check the details from the list below of the servers you have input
[22:32:42] Most likely you have input the wrong URL, forgotten to add a port, or have not set up workers
[22:32:42] Pool: 0  URL: http://54.84.97.75:29399  User: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9  Password: 34523523324tertewgdsgsdfgsd
[22:32:42] Pool: 1  URL: http://54.84.97.75:29399  User: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9  Password: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9
[22:32:42] No servers could be used! Exiting.
C:\Program Files\sgminer-4.1.0-windows>
2. On the server I am getting the following:
Code:
2014-03-18 02:57:20.294056 Determining payout address...
2014-03-18 02:57:20.294181     Getting payout address from bitcoind...
2014-03-18 02:57:20.297373     ...success! Payout address: CKAfhTtX6CudCANCKVSa8nuVxnhNowAu2d
2014-03-18 02:57:20.322358
2014-03-18 02:57:20.322559 Loading shares...
2014-03-18 02:57:20.322967     ...done loading 0 shares (0 verified)!
2014-03-18 02:57:20.323142
2014-03-18 02:57:20.323331 Initializing work...
2014-03-18 02:57:20.480716     ...success!
2014-03-18 02:57:20.480976
2014-03-18 02:57:20.481190 Joining p2pool network using port 29399...
2014-03-18 02:57:20.483070     ...success!
2014-03-18 02:57:20.486045
2014-03-18 02:57:20.488709 Listening for workers on '' port 29499...
2014-03-18 02:57:20.613184     ...success!
2014-03-18 02:57:20.613422
2014-03-18 02:57:20.613631 Started successfully!
2014-03-18 02:57:20.613830 Go to http://127.0.0.1:29499/ to view graphs and statistics!
2014-03-18 02:57:20.614045 Donating 0.0% of work towards P2Pool's development. Please donate to encourage further development of P2Pool!
2014-03-18 02:57:20.614227
2014-03-18 02:57:21.157642 Peer 0.0.0.0:29399 misbehaving, will drop and ban. Reason: was connected to self
2014-03-18 02:57:21.157994 Bad peer banned: ('0.0.0.0', 29399)
2014-03-18 02:57:21.158759 Peer 127.0.0.1:50571 misbehaving, will drop and ban. Reason: was connected to self
2014-03-18 02:57:21.158971 Bad peer banned: ('127.0.0.1', 50571)
2014-03-18 02:57:23.636639 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:23.636797  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:38.647482 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:38.647646  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:53.656534 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:53.656703  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:54.953175 Handshake timed out, disconnecting from 108.50.228.148:12901
2014-03-18 02:57:54.953522 Handshake timed out, disconnecting from 108.50.228.148:12900
2014-03-18 02:58:05.056238 Handshake timed out, disconnecting from 108.50.228.148:12902
2014-03-18 02:58:05.056584 Handshake timed out, disconnecting from 108.50.228.148:12903
2014-03-18 02:58:08.680911 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:58:08.681080  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???

I am stuck with this error message "Handshake timed out, disconnecting from". Tried searching on Internet but nothing helpful.
My code is
p2pool/p2pool/networks.py
Code:
    
    crimeacoin=math.Object(
        PARENT=networks.nets['crimeacoin'],
        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='7c45630909c3eb49'.decode('hex'),
        PREFIX='3f6a2b46c49d15ef'.decode('hex'),
        P2P_PORT=29399,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=29499,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#cma',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.9.0.0!' if v < 80501 else None,
    ),
    crimeacoin_testnet=math.Object(
        PARENT=networks.nets['crimeacoin_testnet'],
        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=29699,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=29799,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#cma',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.9.0.0!' if v < 80501 else None,
    ),
p2pool/p2pool/bitcoin/networks.py
Code:
    crimeacoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=29342,
        ADDRESS_VERSION=28,
        RPC_PORT=29332,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'crimeacoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 125*100000000 >> (height + 1)//5100000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150, # s
        SYMBOL='CMA',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Crimeacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Crimeacoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.crimeacoin'), 'crimeacoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/address/',
        TX_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,
    ),
    crimeacoin_testnet=math.Object(
        P2P_PREFIX='fcc1b7dc'.decode('hex'),
        P2P_PORT=29343,
        ADDRESS_VERSION=28,
        RPC_PORT=29333,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'crimeacoinaddress' in (yield bitcoind.rpc_help()) and
            (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 125*100000000 >> (height + 1)//5100000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150, # s
        SYMBOL='tCMA',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Crimeacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Crimeacoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.crimeacoin'), 'crimeacoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
        TX_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=1e8,
    ),

Does anybody know what is wrong? I will appreciate any help. Thanks!
newbie
Activity: 29
Merit: 0
I won't be around much for the weekend so a summary of my efforts so far in case anyone stumbles upon this and wants to have a crack at it or is already working on it -

p2pool/networks.py -

Code:
    grandcoin=math.Object(
        PARENT=networks.nets['grandcoin'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=50, # shares
        SPREAD=40, # blocks
        IDENTIFIER='4665617468657212'.decode('hex'),
        PREFIX='b131010ba6d472a9'.decode('hex'),
        P2P_PORT=12377,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19327,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

p2pool/bitcoin/networks.py -

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

This alone of course yields LateEnd errors anytime work comes in with transactions due to the extra field (tx comment).


That error points to the unpack function in p2pool/util/pack.py where as already discussed in this thread, we can set ignore_trailing to True.  If we do that in both places it is set to False, p2pool will accept and work on blocks with transactions, but fails when trying to submit the solved block with -

Code:
2014-03-07 02:46:05.893463 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 76, in submit_block_rpc
2014-03-07 02:46:05.893494 >     result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex')))
2014-03-07 02:46:05.893526 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks

2014-03-07 02:46:05.893771 > p2pool.util.jsonrpc.NarrowError: -1 CDataStream::read() : end of data

I played around in helper.py with the submit function to no avail, so instead I went after the transaction format (realizing full well that this might break coins that do not have a transaction comment, including possibly the merged coins I am working on, but if I can get it working *with* comments, I can then figure out how to make it deal with stuff without comments) -

p2pool/data.py (search for lock_time) -

Code:
        gentx = dict(
            version=1,
            tx_ins=[dict(
                previous_output=None,
                sequence=None,
                script=share_data['coinbase'],
            )],
            tx_outs=[dict(value=amounts[script], script=script) for script in dests if amounts[script] or script == DONATION_SCRIPT] + [dict(
                value=0,
                script='\x6a\x28' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(64).pack(last_txout_nonce),
            )],
            lock_time=0,
            txcomment=0,
        )

p2pool/bitcoin/data.py (search again for lock_time) -

Code:
tx_type = pack.ComposedType([
    ('version', pack.IntType(32)),
    ('tx_ins', pack.ListType(pack.ComposedType([
        ('previous_output', pack.PossiblyNoneType(dict(hash=0, index=2**32 - 1), pack.ComposedType([
            ('hash', pack.IntType(256)),
            ('index', pack.IntType(32)),
        ]))),
        ('script', pack.VarStrType()),
        ('sequence', pack.PossiblyNoneType(2**32 - 1, pack.IntType(32))),
    ]))),
    ('tx_outs', pack.ListType(pack.ComposedType([
        ('value', pack.IntType(64)),
        ('script', pack.VarStrType()),
    ]))),
    ('lock_time', pack.IntType(32)),
    ('txcomment', pack.IntType(256),
])

and this of lead me to the EarlyEnd in my previous post.  I also tried ('txcomment', pack.PossiblyNoneType(2**32 - 1, pack.IntType(256))), which lead to the same.

I did try a varstrtype for txcomment but that lead to some strange errors -

Code:
2014-03-07 04:29:06.554275 > Squelched JSON error:
2014-03-07 04:29:06.554367 > Traceback (most recent call last):
2014-03-07 04:29:06.554453 >   File "/usr/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 464, in dataReceived
2014-03-07 04:29:06.554525 >     self.lineReceived(line)
2014-03-07 04:29:06.554593 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 164, in lineReceived
2014-03-07 04:29:06.554666 >     _handle(line, self, response_handler=self._matcher.got_response).addCallback(lambda line2: self.sendLine(line2) if line2 is not None else None)
2014-03-07 04:29:06.554737 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1213, in unwindGenerator
2014-03-07 04:29:06.554807 >     return _inlineCallbacks(None, gen, Deferred())
2014-03-07 04:29:06.554869 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
2014-03-07 04:29:06.554931 >     result = g.send(result)
2014-03-07 04:29:06.554990 > --- ---
2014-03-07 04:29:06.555051 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 85, in _handle
2014-03-07 04:29:06.555112 >     result = yield method_meth(*list(preargs) + list(params))
2014-03-07 04:29:06.555173 >   File "/home/rob/p2pool/p2pool/bitcoin/stratum.py", line 74, in rpc_submit
2014-03-07 04:29:06.555235 >     return got_response(header, worker_name, coinb_nonce)
2014-03-07 04:29:06.555295 >   File "/home/rob/p2pool/p2pool/bitcoin/worker_interface.py", line 136, in
2014-03-07 04:29:06.555357 >     lambda header, user, coinbase_nonce: handler(header, user, pack.IntType(self._my_bits).pack(nonce) + coinbase_nonce),
2014-03-07 04:29:06.555420 >   File "/home/rob/p2pool/p2pool/work.py", line 389, in got_response
2014-03-07 04:29:06.555481 >     share = get_share(header, last_txout_nonce)
2014-03-07 04:29:06.555542 >   File "/home/rob/p2pool/p2pool/data.py", line 213, in get_share
2014-03-07 04:29:06.555604 >     hash_link=prefix_to_hash_link(bitcoin_data.tx_type.pack(gentx)[:-32-8-4], cls.gentx_before_refhash),
2014-03-07 04:29:06.555667 >   File "/home/rob/p2pool/p2pool/data.py", line 24, in prefix_to_hash_link
2014-03-07 04:29:06.555726 >     assert prefix.endswith(const_ending), (prefix, const_ending)
2014-03-07 04:29:06.555799 > exceptions.AssertionError: ('\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff8\x03\xec~\x05,\xfa\xbemm\x97y\x13T\xf7\x80\'\xefW\x13^\x1cO[}in"\x13\x0bO(D\xe8\xfd\xdb(\x15R\x1cK|\x04\x00\x00\x00\x00\x00\x00\x00\x06/P2SH/\xff\xff\xff\xff\x03\x00\xe8vH\x17\x00\x00\x00\x19v\xa9\x14\xe5\xbd\xd9\xb6\x7f\n\x80\xdcHD\xb4U\x15Mc\xce.\x8d\xbc\x86\x88\xac\x00\x00\x00\x00\x00\x00\x00\x00CA\x04\xff\xd0=\xe4Jn\x11\xb9\x91\x7f:)\xf9D2\x83\xd9\x87\x1c\x9dt>\xf3\r^\xdd\xcd7\tKd\xd1\xb3\xd8\t\x04\x96\xb52Vxk\xf5\xc8)2\xec#\xc3\xb7M\x9f\x05\xa6\xf9Z\x8bU)5&VfK\xac\x00\x00\x00\x00\x00\x00\x00\x00*j(\xa8', 'CA\x04\xff\xd0=\xe4Jn\x11\xb9\x91\x7f:)\xf9D2\x83\xd9\x87\x1c\x9dt>\xf3\r^\xdd\xcd7\tKd\xd1\xb3\xd8\t\x04\x96\xb52Vxk\xf5\xc8)2\xec#\xc3\xb7M\x9f\x05\xa6\xf9Z\x8bU)5&VfK\xac\x00\x00\x00\x00\x00\x00\x00\x00*j(')

I realize it's a string in the grandcoin code, but I'm guessing and hoping it's converted to something else before it's sent over, if it's not I may be barking up the wrong tree though.  I also tried PossiblyNoneType/VarStrType and got the same AssertionError.

Any help, tips, pointers, code, genie wishes used towards this, online python tutorials, or anything else that could be of use would be GREATLY appreciated!
newbie
Activity: 29
Merit: 0
ok, I think I've got it looking for a comment now by modifying the transaction stuff in p2pool/data.py and p2pool/bitcoin/data.py, but now I'm getting EarlyEnd, I'm guessing when there isn't a comment present -

Code:
2014-03-07 04:55:02.756009 > Error getting work from bitcoind:
2014-03-07 04:55:02.756092 > Traceback (most recent call last):
2014-03-07 04:55:02.756140 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks
2014-03-07 04:55:02.756183 >     current.result = callback(current.result, *args, **kw)
2014-03-07 04:55:02.756223 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in gotResult
2014-03-07 04:55:02.756263 >     _inlineCallbacks(r, g, deferred)
2014-03-07 04:55:02.756301 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 04:55:02.756341 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 04:55:02.756432 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 04:55:02.756478 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 04:55:02.756517 > --- ---
2014-03-07 04:55:02.756554 >   File "/home/rob/p2pool/p2pool/util/deferral.py", line 41, in f
2014-03-07 04:55:02.756591 >     result = yield func(*args, **kwargs)
2014-03-07 04:55:02.756648 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
2014-03-07 04:55:02.756721 >     result = g.send(result)
2014-03-07 04:55:02.756791 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 49, in getwork
2014-03-07 04:55:02.756861 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2014-03-07 04:55:02.756932 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 63, in unpack
2014-03-07 04:55:02.757004 >     obj = self._unpack(data, ignore_trailing)
2014-03-07 04:55:02.757077 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 42, in _unpack
2014-03-07 04:55:02.757135 >     obj, (data2, pos) = self.read((data, 0))
2014-03-07 04:55:02.757175 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 295, in read
2014-03-07 04:55:02.757212 >     item[key], file = type_.read(file)
2014-03-07 04:55:02.757249 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 310, in read
2014-03-07 04:55:02.757286 >     value, file = self.inner.read(file)
2014-03-07 04:55:02.757323 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 218, in read
2014-03-07 04:55:02.757360 >     data, file = read(file, self.bytes)
2014-03-07 04:55:02.757396 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 16, in read
2014-03-07 04:55:02.757433 >     raise EarlyEnd()
2014-03-07 04:55:02.757468 > p2pool.util.pack.EarlyEnd:

This I am not sure how to deal with.  If there are any python ninjas out there that could point me in the right direction that would be great.
newbie
Activity: 29
Merit: 0
I've recently tried to port p2pool to some newer alt coins and have been hitting a brick wall. I'm pretty sure this going beyond basic network.py values but I wanted to get some opinions.

I've tried setting this up for grandcoin, lottocoin, luckycoin and earthcoin. The one I'm most interested in getting to work is earthcoin, so let's take that one for example. This is the error I receive when running it.



Now, what I noticed is in the pack.py file, the functions

is where the error is being thrown. The pos is always 1 character bigger then len(data) when the error is thrown. So setting the ignore_trailing=True eliminates the error, but when testing it against earthcoin, we hashed overnight and found a few blocks. However, none of them were actually committed to the blockchain and nothing was paid out. So I assume that is messing with the blocks submitted and they're not valid.

If you don't change that variable, the error that was mentioned is thrown for a while. Eventually it will connect to the wallet daemon, and you can actually hash in the pool, however the connection to the wallet will go unstable and the errors will start again. The connection to the wallet never really stabilizes.

Just for reference  here are my earthcoin network.py values.


If anyone that has better python skills than me, and a better knowledge of how p2pool works cares to help, I'd greatly appreciate it. Like I said, I don't think this is isolated to earthcoin as I've seen this behavior with several new alt coins. Also, I've posted a bug report on the official p2pool github in case anyone wants to contribute.


Anyone have any updates/more information on this?  The bug report hasn't been updated in quite a while it appears.  I recall reading somewhere (probably this thread) that it has something to do with transaction comments in some coins.  I tried setting ignore_trailing to True as mentioned above, and that resolves my "Error getting work from bitcoind" errors, and p2pool will accept and work on block with transactions, but when they're solved it is unable to submit them ...

Successful block since making the change (which showed up in my wallet moments later) -

Code:
2014-03-07 02:39:16.574778 New work for worker! Difficulty: 0.001344 Share difficulty: 0.013897 Total block value: 1000.000000 GDC including 0 transactions
2014-03-07 02:39:16.577876 New work for worker! Difficulty: 0.000750 Share difficulty: 0.013897 Total block value: 1000.000000 GDC including 0 transactions

2014-03-07 02:39:32.021422 GOT BLOCK FROM MINER! Passing to bitcoind! http://grandcoin.org/blocks/63e787bf697863ca4657ce95fac4f7c72ac37963b6969343c00b9ecbfbc5d44b
2014-03-07 02:39:32.021524
2014-03-07 02:39:32.029135 GOT BLOCK FROM PEER! Passing to bitcoind! fbc5d44b bitcoin: http://grandcoin.org/blocks/63e787bf697863ca4657ce95fac4f7c72ac37963b6969343c00b9ecbfbc5d44b

Unsuccessful block since making the change -

Code:
2014-03-07 02:46:05.004488 New work for worker! Difficulty: 0.001263 Share difficulty: 0.015175 Total block value: 1000.000000 GDC including 1 transactions
2014-03-07 02:46:05.007726 New work for worker! Difficulty: 0.000750 Share difficulty: 0.015175 Total block value: 1000.000000 GDC including 1 transactions

2014-03-07 02:46:05.869605 GOT BLOCK FROM MINER! Passing to bitcoind! http://grandcoin.org/blocks/a0cf1b50837d2c59dab244ad472879ef1de9e93ff961f05a530d09abb32c0fef
2014-03-07 02:46:05.875186 > GOT INCOMPLETE BLOCK FROM PEER! b32c0fef bitcoin: http://grandcoin.org/blocks/a0cf1b50837d2c59dab244ad472879ef1de9e93ff961f05a530d09abb32c0fef

2014-03-07 02:46:05.892902 > Error submitting block: (will retry)
2014-03-07 02:46:05.892947 > Traceback (most recent call last):
2014-03-07 02:46:05.892983 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks
2014-03-07 02:46:05.893016 >     current.result = callback(current.result, *args, **kw)
2014-03-07 02:46:05.893051 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in gotResult
2014-03-07 02:46:05.893083 >     _inlineCallbacks(r, g, deferred)
2014-03-07 02:46:05.893118 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893149 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893182 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893213 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893246 > --- ---
2014-03-07 02:46:05.893277 >   File "/home/rob/p2pool/p2pool/util/deferral.py", line 41, in f
2014-03-07 02:46:05.893307 >     result = yield func(*args, **kwargs)
2014-03-07 02:46:05.893338 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893368 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893400 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893431 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893463 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 76, in submit_block_rpc
2014-03-07 02:46:05.893494 >     result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex')))
2014-03-07 02:46:05.893526 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893558 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893635 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893665 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893699 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 133, in _http_do
2014-03-07 02:46:05.893729 >     raise Error_for_code(resp['error']['code'])(resp['error']['message'], resp['error'].get('data', None))
2014-03-07 02:46:05.893771 > p2pool.util.jsonrpc.NarrowError: -1 CDataStream::read() : end of data

It retries a few times and then gives up.  I've switched back to solo mining right off the wallet (so, no merged  Sad) until I can figure this out, but I don't know where to begin, and half a day of reading everything I could find online hasn't yielded a solution  Sad
legendary
Activity: 1270
Merit: 1000
I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.

The danger is like the guy who replied here

https://github.com/forrestv/p2pool/issues/183

You probably recognize him from irc. Smiley If he falls over to a backup pool then much later back to his own node, it might do nothing but HWs all day until he can manually fix it because of the 0 diff issue.
Yes, that is a problem  Undecided
Perhaps using cgwatcher can help. Not sure (haven't looked) but it may have a setting to watch for # of HW errors and restart the miner. If not then maybe we can make a feature suggestion.
sr. member
Activity: 434
Merit: 250
I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.

The danger is like the guy who replied here

https://github.com/forrestv/p2pool/issues/183

You probably recognize him from irc. Smiley If he falls over to a backup pool then much later back to his own node, it might do nothing but HWs all day until he can manually fix it because of the 0 diff issue.
legendary
Activity: 1270
Merit: 1000
When you first connect to a new node and there are no stats at all you will get served DIFF 0 work which will cause HWs in some types of miners. If you mine for a while with any + it will get some stats stored, then you can disconnect and reconnect without the + and you should be fine, with vardiff giving you pseudoshare targets above 0. I just put in a suggestion to the p2pool repo that the minimum work ever served should be 1 (for sha256) or 1/X where X is the scrypt adjustment to the difficulty figure for that coin (it's in bitcoin/networks.py).

I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.
sr. member
Activity: 434
Merit: 250
When you first connect to a new node and there are no stats at all you will get served DIFF 0 work which will cause HWs in some types of miners. If you mine for a while with any + it will get some stats stored, then you can disconnect and reconnect without the + and you should be fine, with vardiff giving you pseudoshare targets above 0. I just put in a suggestion to the p2pool repo that the minimum work ever served should be 1 (for sha256) or 1/X where X is the scrypt adjustment to the difficulty figure for that coin (it's in bitcoin/networks.py).
full member
Activity: 154
Merit: 100
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.

Thank you for that!

This is what happens when I run it - I get all Succcesses at the top but then I get this repeatedly:

2014-02-25 19:31:06.817362 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-02-25 19:31:06.817451  Local: 0H/s in last 0.0 seconds Local dead on arrival: Huh Expected time to share: Huh


Any ideas?

EDIT: Its works I think, I just pointed my miner at it. I'm getting a bunch of HW issues but I'll sort that out.

When I tried starting a Litecoin p2pool earlier I wasnt getting the above messages that I am getting with Litebar. Not sure why.

Right I have this kinda working, finally.

I was getting a bunch of hardware issues until I put +16 after my username in my cgminer conf file. However I dont think this is the permanent solution. I think its a setting on the server that needs to be corrected to may be allocate the difficulty better. I think its one (or more) of the settings to do with ~/P2Pool/P2Pool/Network.py

I will tweak them, however if anyone has any ideas on which ones I should be fiddling around with, please let me know.

Muchos gracias amigos.

UPDATE: This is it: New Litebar P2Pool: http://lifeforce.info:24323 - To add to your collection! Use as your main or as a back up - VPS Hosted - London Based - Fee: 0.5% Going to do some more tweaking first.
full member
Activity: 154
Merit: 100
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.

Thank you for that!

This is what happens when I run it - I get all Succcesses at the top but then I get this repeatedly:

2014-02-25 19:31:06.817362 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-02-25 19:31:06.817451  Local: 0H/s in last 0.0 seconds Local dead on arrival: Huh Expected time to share: Huh


Any ideas?

EDIT: Its works I think, I just pointed my miner at it. I'm getting a bunch of HW issues but I'll sort that out.

When I tried starting a Litecoin p2pool earlier I wasnt getting the above messages that I am getting with Litebar. Not sure why.
legendary
Activity: 1270
Merit: 1000
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.
full member
Activity: 154
Merit: 100
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Q2) I have done the settings (except for prefix and identifier) to the best of my ability with the aid of this thread for Litebar network.py in both P2Pool locations. Can some bright spark actually post the correct settings for Litebar please. I have spent 12 hours trying figuring it out and could use any help.

Code:
   litebar=math.Object(
        PARENT=networks.nets['litebar'],
        SHARE_PERIOD=15,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=10,
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=19065,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=true,
        WORKER_PORT=19055,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='',
        VERSION_CHECK=lambda v: True,

    ),

 


    litebar=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9065,
        ADDRESS_VERSION=48,
        RPC_PORT=9055,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'litebaraddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 2*100000000 >> (height + 1)//438000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=180,
        SYMBOL='LTB',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'litebar') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/litebar/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litebar'), 'litebar.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,
DUMB_SCRYPT_DIFF=0.03e8,
    ),

I know some of these settings are ball park figures, and some of these setting might be completely wrong. Any help would be appreciated. Thanks
legendary
Activity: 1270
Merit: 1000
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.

Have seen this happen on the first miner to join a node. I forget the exact message but also notice something like "unidentified stratum" in the console when this happens.

Simple quick fix (for me) is to restart the miner.
sr. member
Activity: 434
Merit: 250
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.

Someone say getting work with 0 diff causes errors but I have no idea if it is HW errors or something else. Try connecting to your node with /.00001+.00001 if you use a scrypt based coin. (/1+1 if a SHA based coin). That will make sure you never get anything below 1 diff.
newbie
Activity: 29
Merit: 0
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.
legendary
Activity: 1270
Merit: 1000
Started a new thread detailing the values. Work in progress. Will update as time allows:

https://bitcointalksearch.org/topic/p2pool-detailed-settings-for-altcoins-457574
tvb
newbie
Activity: 38
Merit: 0
SUBSIDY_FUNC = *
pulled from ./src/main.cpp (search for "nSubsidy")
total number of minable coins.

I believe this is incorrect. I think the correct way is:

for litecoin:
SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
SUBSIDY_FUNC=lambda height: 'block reward' * 'satoshies' >> (height + 1)//'height where block halves'.

If there is no "halfing" you take out the >> (height + 1)//'height where block halves'

//840000 is the number from main.cpp in nSubsidy -> nSubsidy >>= (nHeight /

Thank you! I have updated my post to reflect your corrections.
sr. member
Activity: 434
Merit: 250
IMHO the main problem with this is, that p2pool tries to dish out share difficulties so that it expects no more than one solved share per minute from all connected clients. So as my VTC node has about 6 MH/s local rate at the moment, the log shows a standard share difficulty of 1.39 given to clients. Minimum share difficulty for the pool is 0.063 on the other hand. So it seems perfectly legit to specify a custom share difficulty of 0.55 for my miner. (If you specify it too low, p2pool seems to use the minimum pool difficulty anyway).

Interesting. I kept assuming small miner variance was due to large share difficulty but that's not the case at all for VTC right now, if you are a small miner using a big public node.

2014-02-08 18:41:03.086159 New work for worker! Difficulty: 0.001676 Share difficulty: 1.505790
2014-02-08 18:41:03.287006 New work for worker! Difficulty: 0.001676 Share difficulty: 0.058060

I have a couple dozen lines similar to the first. The 2nd is my testing with difficultly forced as low as it can go. Being a single GPU miner, 1.5 (98683) will take me far far longer to get 1 share than .058 (3805) would.

Edit: Apologies for the thread hijack. mmouse we should move this to the P2Pool main thread or to the VTC thread.
Pages:
Jump to: