Giter Site home page Giter Site logo

jtoomim / p2pool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from p2pool/p2pool

37.0 20.0 45.0 3.73 MB

Peer-to-peer Bitcoin mining pool

Home Page: https://github.com/jtoomim/p2pool/

License: GNU General Public License v3.0

Makefile 0.25% Python 94.77% Shell 0.07% C 1.41% HTML 3.40% Dockerfile 0.10%

p2pool's Introduction

P2pool installation with pypy -- Windows

On Windows, pypy is only supported via the Windows Subsystem for Linux (WSL). P2pool on pypy on WSL is much faster than P2pool on CPython on native Windows. To install WSL, first follow the steps outlined here:

https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

Once you've done that, run bash and follow the rest of the steps below.

P2pool installation with pypy -- Linux and Windows

Copy and paste the following commands into a bash shell in order to install p2pool on Windows or Linux.

sudo apt-get update

sudo apt-get -y install pypy pypy-dev pypy-setuptools gcc build-essential git

wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo pypy sudo rm setuptools-*.zip

wget https://pypi.python.org/packages/source/z/zope.interface/zope.interface-4.1.3.tar.gz#md5=9ae3d24c0c7415deb249dd1a132f0f79

tar zxf zope.interface-4.1.3.tar.gz

cd zope.interface-4.1.3/

sudo pypy setup.py install

cd ..

sudo rm -r zope.interface-4.1.3*

wget https://pypi.python.org/packages/source/T/Twisted/Twisted-15.4.0.tar.bz2

tar jxf Twisted-15.4.0.tar.bz2

cd Twisted-15.4.0

sudo pypy setup.py install

cd ..

sudo rm -r Twisted-15.4.0*

git clone https://github.com/jtoomim/p2pool.git

cd p2pool

You'll also need to install and run your bitcoind or altcoind of choice, and edit ~/.bitcoin/bitcoin.conf (or the corresponding file for litecoin or whatever other coin you intend to mine) with your bitcoind's RPC username and password. Launch your bitcoind or altcoind, and after it has finished downloading blocks and syncing, go to your p2pool directory and run

pypy run_p2pool.py

**P2pool Dockerfile

The Dockerfile uses the build instruction above to create a Docker image.

Build Docker image named p2pool

docker build -t p2pool ./

Run p2pool from Docker image

docker run -it --rm p2pool --version

jtoomimnet vs mainnet

If you wish to use the original forrestv btc mainnet instead of jtoomimnet, then replace

git clone https://github.com/jtoomim/p2pool.git

cd p2pool

above with

git clone https://github.com/p2pool/p2pool.git

cd p2pool

Note: The BTC p2pools currently have low hashrate, which means that payouts will be infrequent, large, and unpredictable. As of Feb 2018, blocks are found on jtoomimnet on average once every 25 days, and blocks are found on mainnet on average once every 108 days. Do not mine on BTC p2pool unless you are very patient and can tolerate receiving no revenue for several months.

Miner setup

P2pool communicates with miners via the stratum protocol. For BTC, configure your miners with the following information:

URL: stratum+tcp://(Your node's IP address or hostname):9332

Worker: (Your bitcoin address)

Password: x

Mining to Legacy (P2PKH), SegWit/MultiSig (P2SH) and Bech32 addresses are supported for the following coins with the specified address prefixes:

Coin P2PKH P2SH Bech32
Bitcoin 1... 3... bc1...
Bitcoin Cash* 1... (test) bitcoincash:q... or q...
Bitcoin SV* 1... (test) bitcoincash:q... or q...
Litecoin L... M... ltc1...
  • Bitcoin Cash and Bitcoin SV uses cashaddr instead of Bech32

Only Legacy addresses (P2PKH) are supported for coins not mentioned above. If you use an address that p2pool cannot understand, then p2pool will mine to that node's default address instead.

If you wish to modify the mining difficulty, you may add something like "address+4096" after your mining address to set the pseudoshare difficulty to 4096, or "address/65536" to set the actual share difficulty to 65536 or the p2pool minimum share difficulty, whichever is higher. Pseudoshares only affect hashrate statistics, whereas actual shares affect revenue variance and efficiency.

Firewall considerations

If your node is behind a firewall or behind NAT (i.e. on a private IP address), you may want to forward ports to your p2pool server. P2pool uses two ports: one for p2p communication with the p2pool network, and another for both the web UI and for stratum communication with workers. For Bitcoin, those ports are 9333 (p2p) and 9332 (stratum/web). For Litecoin, they are 9326 (p2p) and 9327 (stratum/web). For Bitcoin Cash, they are 9349 (p2p) and 9348 (stratum/web).

p2pool's People

Contributors

coblee avatar cohibaa avatar d0gzpaw avatar dcod3d avatar dmp1ce avatar drazisil avatar farsider350 avatar forrestv avatar gades avatar gmaxwell avatar goblin avatar grimd34th avatar harukama avatar imaginaryusername avatar iongchun avatar jtoomim avatar kevinxucs avatar kr1z1s avatar krellan avatar m0glie avatar maaku avatar midnightmagic avatar napieraj avatar nocarryr avatar northern-lites avatar rav3npl avatar roy7 avatar spencerr avatar thrasher- avatar veqtrus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

p2pool's Issues

Error when finding an AUX block

@jtoomim ,
Do you have any idea why I'm getting this error when finding an AUX block? I just updated my p2pool to latest and now it is giving me that error.

Thank you,

Error while processing merged mining POW:
Traceback (most recent call last):
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/d
efer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/root/p2pool/p2pool/util/jsonrpc.py", line 85, in _handle
    result = yield method_meth(*list(preargs) + list(params))
  File "/root/p2pool/p2pool/bitcoin/stratum.py", line 134, in rpc_submit
    result = got_response(header, worker_name, coinb_nonce, self.target)
  File "/root/p2pool/p2pool/bitcoin/worker_interface.py", line 139, in <lambda>
    lambda header, user, coinbase_nonce, pseudoshare_target: handler(header, user, pack.IntType(self._my_bits).pack(nonce) + coinbase_nonce, pseudoshare_target),
--- <exception caught here> ---
  File "/root/p2pool/p2pool/work.py", line 488, in got_response
    sub_meth = aux_work['merged_proxy'].rpc.getauxblock
  File "/root/p2pool/p2pool/util/jsonrpc.py", line 50, in __getattr__
    raise AttributeError('%r object has no attribute %r' % (self.__class__.__name__, attr))
exceptions.AttributeError: 'Proxy' object has no attribute 'rpc'

Nicehash invalid work response

Was trying to connect nicehash to p2pool

Selected mining algorithm: Scrypt... OK
Sending mining subscribe request... OK
Sending login information... OK
Mining subscribe request successfully completed... OK
Received mining set difficulty... OK
Pool difficulty is correct (provided=3847630.19764, minimum=500000)... OK
Received invalid work response... Error

What might be the problem?

exceptions.KeyError: 'ismine'

After run this command
pypy run_p2pool.py --net bitcoincash --bitcoind-config-path /opt/bch/bitcoin.conf --allow-obsolete-bitcoind
I got the error:
Fatal error: Traceback (most recent call last): File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 567, in _startRunCallbacks self._runCallbacks() File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 653, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1442, in gotResult _inlineCallbacks(r, g, deferred) File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1386, in _inlineCallbacks result = g.send(result) --- <exception caught here> --- File "/home/kamren/p2pool/p2pool/main.py", line 138, in main if not res['isvalid'] or not res['ismine']: exceptions.KeyError: 'ismine'

Merged urls fails

i was suppose to check merged urls feature but it always fail wen start calling a error on message.

P2Pool is not compatible with latest Bitcoin core version?

Getting error below, any plans to make this compatible?

2022-03-16 21:19:05.848096 P2Pool: 21248 shares in chain (13930 verified/21252 total) Peers: 7 (1 incoming)
2022-03-16 21:19:05.848204 Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2022-03-16 21:19:05.848236 Shares: 0 (0 orphan, 0 dead) Stale rate: ??? Efficiency: ??? Current payout: (0.0000)=0.0000 BTC
2022-03-16 21:19:05.848279 Pool: 408TH/s Stale rate: 1.6% Expected time to block: 9.2 years
2022-03-16 21:19:07.510267 Received good share: diff=2.79e+06 hash=000000000000025ec8711c5c89ba085accdd10e2ffd9eb3ff7cb45fd7eaa01ad miner=1HCfZtXnrds7drCe7PysTEHC67xtunfKjd
2022-03-16 21:19:10.393860 Unknown softforks found: set([u'taproot'])
2022-03-16 21:19:10.393983 Required softforks: [u'csv', u'!segwit', u'taproot'] Known: set(['bip65', 'csv', 'segwit'])
Unhandled Error
Traceback (most recent call last):
File "/home/rob/btcpool/p2pool/main.py", line 722, in run
reactor.run()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1243, in run
self.mainLoop()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1252, in mainLoop
self.runUntilCurrent()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 878, in runUntilCurrent
call.func(*call.args, **call.kw)
--- ---
File "/home/rob/btcpool/p2pool/bitcoin/stratum.py", line 75, in _send_work
x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
File "/home/rob/btcpool/p2pool/bitcoin/worker_interface.py", line 132, in get_work
desired_pseudoshare_target, worker_ip, *args)
File "/home/rob/btcpool/p2pool/work.py", line 278, in get_work
raise jsonrpc.Error_for_code(-12345)(u'unknown rule activated')
p2pool.util.jsonrpc.NarrowError: -12345 unknown rule activated

Latest version BTC and BCH.

Hi, version p2pool 34 (including the latest commits) does not work on BitcoinABC latest version (0.21.0) daemon, and BTC 0.19.0.1

Getting the share v34 warning on 1mb_segwit.

Hi,
I'm getting the following warning on 1mb_segwit:

Warning: A MAJORITY OF SHARES CONTAIN A VOTE FOR AN UNSUPPORTED SHARE IMPLEMENTATION! (v34 with 90% support)

Anything that should I do or just go with the flow?

litecoin 34.0 p2pool fork

A few days ago the node with the most hash switched to 34.0 and the network has switched.
Are you monitoring for bugs/issues? I have upgraded am seeing a lots of requests for parent shares and a lot of connects and attempts to share from older peers (because both are "protocol version is 3301" ?)

It's been a while since going through a p2pool version change for me, so I forget what the expected issues are such.

This came quick, I think it got pool owners off-guard.

Looks like right now the old chain has about 30GH/s but also seems to be the majority of nodes.
There is about 500GH/s on the new chain.

ravencoin

can you add ravencoin?
i search for an p2pool for ravencoin kawpow algo but i found nothing

Displaying low-power miners

Hello. How to implement the display of the work of low-power miners?
For example, if a miner has a capacity of only 100 megahashes, it connects and does the work, but the pool itself does not see it and does not display statistics on it.
How to make it display statistics?

Upgrade p2pool to support new wallets

Hello,

Im here testing this one and would like to know if still possible to mine something with this software if not updated yet to last wallet support ? Example; Btc 0.18 removed commands could be used to mine.

Error about IMMUTABLE_BLOCKS

Hi guys,
Getting this error while mining Litecoin/DOGE.
It shows up, screws the hashing for some time then it goes away.

Unhandled Error
Traceback (most recent call last):
  File "/p2pool/main.py", line 723, in run
    reactor.run()
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 1194, in run
    self.mainLoop()
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 1203, in mainLoop
    self.runUntilCurrent()
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 825, in runUntilCurrent
    call.func(*call.args, **call.kw)
--- <exception caught here> ---
  File "/p2pool/bitcoin/stratum.py", line 75, in _send_work
    x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
  File "/p2pool/bitcoin/worker_interface.py", line 132, in get_work
    desired_pseudoshare_target, worker_ip, *args)
  File "/p2pool/work.py", line 370, in get_work
    base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
  File "/p2pool/data.py", line 197, in generate_transaction
    if all_transaction_weight + this_weight + 4*80 + cls.gentx_weight + 2000 > net.BLOCK_MAX_WEIGHT and not net.IMMUTABLE_BLOCKS:
exceptions.AttributeError: 'module' object has no attribute 'IMMUTABLE_BLOCKS'

Thank you for supporting p2pool,
Igor Almeida

[Bounty; performance] Remove fast block propagation/transaction processing from p2pool

Introduction

P2pool has a bunch of unnecessary code in it for handling transactions. This code is the main source of performance issues in p2pool code, and causes shares to propagate and process slowly, thereby increasing p2pool's share orphan/DOA rates and reducing mining fairness. This transaction handling code also makes p2pool unable to scale to large block sizes.

The core of the problem is that p2pool encodes transactions using a special 2- or 3-byte encoding scheme for transactions that are included in multiple shares, and this encoded list gets included in the share's metadata OP_RETURN commitment. This encoded transaction list is redundant information, as the transactions are already committed via the merkle root hash.

The encoding scheme is to use a (share_height_delta, transaction_index) pair to tell p2pool where it can find the TXID for that transaction (by lookup in a previous share). Using this encoding scheme, p2pool was able to transmit shares (which can be decoded into full blocks) faster than pre-Xthin/Compact-Blocks bitcoind was able to transmit blocks. In the p2p layer, nodes will keep a dictionary of txid:transaction mappings, and will send all of the transactions it receives to each of its peers to ensure that the recipient can decode a share into a block as soon as the share is received, without needing to request any additional transactions over the network.

Now that we have schemes like Compact Blocks and Graphene (written in C++), p2pool's python-based fast-block propagation is entirely obsolete. Having p2pool do processing on a per-transaction basis means that the system's performance is limited by the speed at which python code can process transactions relative to p2pool's 30-60 sec share interval, and that performance constraint is far tighter than Bitcoin's limit of the speed at which C++ code can process transactions relative to Bitcoin's 600 sec bock interval.

Overview of changes

The changes to be made fall into four main categories: Changes to the share data structure, changes to block reconstruction, changes to the p2p protocol layer, and (optionally) adding a mechanism for block/share reconstruction and validation that is asynchronous and outside the latency-critical path.

Share structure changes

The core of the change is that two fields in the share_info data structure need to be removed: new_transaction_hashes and transaction_hash_refs. There's a lot of code in various places that touch these variables, like in Share.generate_transaction(...), all of which needs to be removed or replaced. Most of it is in p2pool/data.py.

This is a hard forking change. Because of the extent of the changes, and because so much of the change will be code deletion instead of addition, it may be better to roll out this change in a backward-incompatible fashion, and just start a new share chain instead of using the typical hard fork upgrade mechanism. But if you think you can do it as a more typical hard fork, that's cool too.

Block reconstruction

As the list of transactions in a share will not be stored in the same way, some changes might be necessary to the getblocktemplate, stratum, and block reconstruction code to make sure that all of the information needed to reassemble blocks is still retained.

P2P changes

After the share changes have been made, it will no longer be necessary for peers to send transactions to each other. This involves the update_remote_view_of_my_mining_txs(...) function; the update_remote_view_of_my_known_txs(...) function; the have_tx, losing_tx, forget_tx, and remember_tx messages, all in p2p.py; and some code in work.py for keeping track of transactions in getblocktemplate results.

Asynchronous validation

[Not yet written]

Bounty

This description is not yet complete. I'll add more information later.

I am offering a $5000 total bounty for this project. Milestone payments are an option.

BCH don't start

Hello! Can't run p2pool with Bitcoin Cash. Here is the log on startup:

# pypy run_p2pool.py --net bitcoincash --bitcoind-config-path /root/.bitcoin/bitcoin.conf
2022-06-13 23:16:10.734485 p2pool (version 16.0-200-g9eaae22)
2022-06-13 23:16:10.734740
2022-06-13 23:16:10.734939 Testing bitcoind RPC connection to 'http://127.0.0.1:8332/' with username 'bch'...
2022-06-13 23:16:10.946342     ...success!
2022-06-13 23:16:10.946568     Current block hash: 643c01c8ffe2d6d55667e3de5d059f4fa1b3e07e2b332cb
2022-06-13 23:16:10.946725     Current block height: 744356
2022-06-13 23:16:10.946864
2022-06-13 23:16:10.947050 Testing bitcoind P2P connection to '127.0.0.1:8333'...
2022-06-13 23:16:10.951640     ...success!
2022-06-13 23:16:10.951795
2022-06-13 23:16:10.951979 Determining payout address...
2022-06-13 23:16:10.952167     Getting payout address from bitcoind...
Error getting payout address from bitcoind:
Traceback (most recent call last):
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1184, in gotResult
    _inlineCallbacks(r, g, deferred)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
  File "/root/p2pool/p2pool/p2pool/util/deferral.py", line 41, in f
    result = yield func(*args, **kwargs)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/p2pool/p2pool/p2pool/util/jsonrpc.py", line 133, in _http_do
    raise Error_for_code(resp['error']['code'])(resp['error']['message'], resp['error'].get('data', None))
p2pool.util.jsonrpc.NarrowError: -32601 Method not found
# bitcoin-cli -version
Bitcoin Cash Node RPC client version v24.1.0-unk

Can you help me?

exceptions.KeyError: 'version-rolling.min-bit-count'

Some times I get this error on the debug log
2019-10-18 00:14:20.862869 >>>Authorize: 1CVaiBEx8t8Qiq5CK1Tu63BBuByU9qjFMf+119808 from 192.162.65.242 Squelched JSON error: Traceback (most recent call last): File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/protocols/basic.py", line 454, in dataReceived self.lineReceived(line) File "/home/kamren/p2pool/p2pool/util/jsonrpc.py", line 164, in lineReceived _handle(line, self, response_handler=self._matcher.got_response).addCallback(lambda line2: self.sendLine(line2) if line2 is not None else None) File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1532, in unwindGenerator return _inlineCallbacks(None, gen, Deferred()) File "/usr/local/lib/pypy2.7/dist-packages/Twisted-17.9.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1386, in _inlineCallbacks result = g.send(result) --- <exception caught here> --- File "/home/kamren/p2pool/p2pool/util/jsonrpc.py", line 85, in _handle result = yield method_meth(*list(preargs) + list(params)) File "/home/kamren/p2pool/p2pool/bitcoin/stratum.py", line 48, in rpc_configure minbitcount = extensionParameters['version-rolling.min-bit-count'] exceptions.KeyError: 'version-rolling.min-bit-count'

exceptions.ValueError: gentx doesn't match hash_link

I've created my own altcoin and setting up p2pool for scrypt mining. Everything works great until a block gets mined and I get this error. Also the miner only get's 0.1 coin and not 20. Been trying to get around this for days now. Appriciate if you guys could take the time to help me out :)

"
2022-07-12 20:39:44.211862 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:39:44.212049 Local: 12530H/s in last 15.5 seconds Local dead on arrival: ~0.0% (0-8%) Expected time to share: 1.4 minutes
2022-07-12 20:40:14.213224 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:40:14.213432 Local: 10116H/s in last 45.5 seconds Local dead on arrival: ~0.0% (0-6%) Expected time to share: 1.7 minutes
2022-07-12 20:40:44.214071 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:40:44.214278 Local: 13059H/s in last 1.3 minutes Local dead on arrival: ~0.0% (0-5%) Expected time to share: 1.3 minutes
2022-07-12 20:41:14.215882 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:41:14.216086 Local: 13328H/s in last 1.8 minutes Local dead on arrival: ~0.0% (0-5%) Expected time to share: 1.3 minutes
2022-07-12 20:41:23.496091
2022-07-12 20:41:23.496219 GOT BLOCK FROM MINER! Passing to bitcoind! ed0a3adec61d58ac430ea25040525aaf24445f308c7aadfc3774c5884bf88352
2022-07-12 20:41:23.496270
2022-07-12 20:41:23.500576 GOT SHARE! MThiBVZ1xAEYSvB6i1WXR5BbQYSsRY9pHV 4bf88352 prev xxxxxxxx age 115.82s
2022-07-12 20:41:23.501659 88754209086101587363432403941069444047867804914959720749306888963007345768855 42114609786524032990359427111505060556914516875841598301516162347366901126883
2022-07-12 20:41:23.501795 {'version': 1, 'tx_ins': [{'previous_output': None, 'sequence': None, 'script': '\x02\x84\x08'}], 'tx_outs': [{'value': 0, 'script': 'j$\xaa!\xa9\xed\x92\xac\x07\xc7\xb9\xe0\x08\xef\xfd\xe0\xe4u0d\xf22\x8b\x1c\x8c\xd3\xd0\xb4\x88\xf4\xbf\x1b\xba\x8c\xb93\x8c6'}, {'value': 10000000, 'script': 'v\xa9\x14\xd981\xb1\xa8\x0f\xc1\xaeM\x06M\x92\xfa\xe4\xeb\xd5\xa4\x15\x9c_\x88\xac'}, {'script': 'A\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', 'value': 1990000000}, {'value': 0, 'script': 'j(NFZZ4\xa5\x94Y\x01!\t\xbc\xa7%\xe29\xb2\x90x\xd8\xbd\xb1\x19[\x9bk6m\x94s8\xdf\x07\x00\x00\x00\x00\x00\x00\x00'}], 'lock_time': 0, 'marker': 0, 'flag': 1, 'witness': [['[P2Pool][P2Pool][P2Pool][P2Pool]']]}
Share check failed: ed0a3adec61d58ac430ea25040525aaf24445f308c7aadfc3774c5884bf88352 -> 0000000000000000000000000000000000000000000000000000000000000000
Traceback (most recent call last):
File "/home/ubuntu/p2pool/p2pool/bitcoin/worker_interface.py", line 139, in
lambda header, user, coinbase_nonce, pseudoshare_target: handler(header, user, pack.IntType(self._my_bits).pack(nonce) + coinbase_nonce, pseudoshare_target),
File "/home/ubuntu/p2pool/p2pool/work.py", line 530, in got_response
self.node.set_best_share()
File "/home/ubuntu/p2pool/p2pool/node.py", line 327, in set_best_share
best, desired, decorated_heads, bad_peer_addresses, self.punish= self.tracker.think(self.get_height_rel_highest, self.get_height, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value, self.feecache)
File "/home/ubuntu/p2pool/p2pool/data.py", line 745, in think
if self.attempt_verify(share, block_abs_height_func, known_txs, feecache):
--- ---
File "/home/ubuntu/p2pool/p2pool/data.py", line 723, in attempt_verify
share.gentx = share.check(self, known_txs, block_abs_height_func=block_abs_height_func, feecache=feecache)
File "/home/ubuntu/p2pool/p2pool/data.py", line 557, in check
raise ValueError('''gentx doesn't match hash_link''')
exceptions.ValueError: gentx doesn't match hash_link

2022-07-12 20:41:23.511306 > Block submittal result: False (u'duplicate') Expected: True
2022-07-12 20:41:23.512931 New work! Share diff: 0.00 Block value: 20.00 TWTC (0 tx, 0 kB)
2022-07-12 20:41:44.216756 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:41:44.216938 Local: 12131H/s in last 2.3 minutes Local dead on arrival: ~0.0% (0-5%) Expected time to share: 1.5 minutes
2022-07-12 20:42:14.217614 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2022-07-12 20:42:14.217767 Local: 9932H/s in last 2.8 minutes Local dead on arrival: ~0.0% (0-5%) Expected time to share: 1.9 minutes
"

34-memfree branch - username.worker syntax parses diff as worker

The recent username in this branch I dont think work as intended all the time. username+16.999 the 999 gets treated as the worker, and the pseudo share diff gets set to 16.

A second split of the username should maybe be done separately?

Can the regex here be pre-compiled, or is class/object created on each request?
This is not the most accurate test, but the difference seems pretty consistent.

>>> reg = re.compile('[/+]')
>>> now = time.time(); re.split("[/+]", "worker+16.000"); print("{:.8f}".format(time.time() - now))
['worker', '16.000']
0.00003386
>>> now = time.time(); reg.split("worker+16.000"); print("{:.8f}".format(time.time() - now))
['worker', '16.000']
0.00002599

Getting this error as of today

Error getting work from bitcoind:
Traceback (most recent call last):
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1184, in gotResult
    _inlineCallbacks(r, g, deferred)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
  File "/root/p2poolSoloNew/p2pool/util/deferral.py", line 41, in f
    result = yield func(*args, **kwargs)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/root/p2poolSoloNew/p2pool/bitcoin/helper.py", line 102, in getwork
    unpacked = bitcoin_data.tx_type.unpack(packed)
  File "/root/p2poolSoloNew/p2pool/util/pack.py", line 55, in unpack
    obj = self._unpack(data, ignore_trailing)
  File "/root/p2poolSoloNew/p2pool/util/pack.py", line 42, in _unpack
    obj = self.read(data)
  File "/root/p2poolSoloNew/p2pool/bitcoin/data.py", line 178, in read
    locktime = self._int_type.read(file)
  File "/root/p2poolSoloNew/p2pool/util/pack.py", line 175, in read
    return struct.unpack(self.desc, data)[0]
struct.error: unpack str size too short for format```
litecoin on latest version, p2pool as well.

Bitcoin Core testnet

I'm interested in generating some testnet coins on Bitcoin Core (tBTC). Is this possible with this project?

More generally, are there any testnet pools available for Bitcoin Core?

Error while starting p2pool

Following is the log of the error:
What might be the issue?

`root@nf:/home/p2pool# python run_p2pool.py --testnet
2019-07-13 10:05:52.332821 p2pool (version 16.0-160-g9b5938a)
2019-07-13 10:05:52.333124
2019-07-13 10:05:52.333432 Testing bitcoind P2P connection to '127.0.0.1:18333'...
2019-07-13 10:05:52.338334 ...success!
2019-07-13 10:05:52.338552
2019-07-13 10:05:52.338791 Testing bitcoind RPC connection to 'http://127.0.0.1:18332/' with username 'shiobi'...
Error while checking Bitcoin connection:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1442, in gotResult
_inlineCallbacks(r, g, deferred)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
--- ---
File "/home/p2pool/p2pool/util/deferral.py", line 41, in f
result = yield func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/p2pool/p2pool/bitcoin/helper.py", line 14, in check
if not (yield net.PARENT.RPC_CHECK(bitcoind)):
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/p2pool/p2pool/bitcoin/networks/bitcoin_testnet.py", line 18, in
(yield bitcoind.rpc_getinfo())['testnet']
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/p2pool/p2pool/util/jsonrpc.py", line 133, in _http_do
raise Error_for_code(resp['error']['code'])(resp['error']['message'], resp['error'].get('data', None))
p2pool.util.jsonrpc.NarrowError: -32601 Method not found

`

Add AsicBoost support for S9s

Bitmain recently released firmware which makes Overt AsicBoost available on S9s for compatible pools. Unfortunately, Bitmain has not specified the "multiversion" stratum extension that they're using, so this needs to be reverse engineered or determined based on the bmminer source code.

https://medium.com/@braiins_systems/bitmain-antminer-s9-asicboost-capability-verified-by-braiins-13-in-energy-savings-and-planned-da67c290152c

For Dragonmint machines, but not for S9s and for S9s with the newest firmware:

https://github.com/slushpool/stratumprotocol/blob/master/stratum-extensions.mediawiki#Extension_versionrolling

I am offering a 3 BCH bounty for the implementation of multiversion support for Antminer S9s for p2pool. Edit: I'm changing the bounty to $1500 worth of crypto, given the recent price drops.

Missing fork features: bip65, csv on Bitcoin ABC 0.20.4

I am running last release p2pool with Bitcoin ABC 0.20.4 full node. After start command pypy run_p2pool.py --net bitcoincash --bitcoind-config-path /opt/bch/bitcoin.conf I got the error: You are running a coin daemon that does not support all of the forking features that have been activated on this blockchain. Consequently, your node may mine invalid blocks or may mine blocks that are not part of the Nakamoto consensus blockchain. Missing fork features: bip65, csv
My bitcoin.conf
`datadir=/opt/bch/chainstate
pid=/opt/bch/bch.pid
daemon=1
server=1
txindex=1
#debug=bench
logips=1
deprecatedrpc=estimatefee

rpcuser=***
rpcpassword=***
rpcbind=127.0.0.1:10933
rpcallowip=0.0.0.0/0
rpcport=10933
bind=212.19.134.154:8333
`

P2pool does not validate that shares make valid blocks

Currently, p2pool does not perform any full validation of blocks or transactions. A peer can send a share that corresponds to a block that is invalid because it exceeds blocksize or sigop limits, because it includes a transaction with an invalid signature, because it contains a double-spend, because it builds upon an invalid block, because it builds on an extremely old block, or any other issue. This allows a malicious node to collect revenue from p2pool without performing any useful work for p2pool.

Note: In #19 I am advocating for removing fast share/block propagation code from p2pool, which would make it more difficult to add full validation.

URGENT: Litecoin P2Pool MWEB Update Required

Jtoomim, P2Pool does not support MimbleWimble extension blocks or signaling for MWEB.

Litecoin core version 0.21.2 RC6 with P2Pool version 16.0-192-g6dac42e (3501) results in the following P2Pool error:

2022-04-16 21:08:33.857138 > ########################################
2022-04-16 21:08:33.857332 > >>> Warning: LOST CONTACT WITH BITCOIND for 1.1 minutes! Check that it isn't frozen or dead!
2022-04-16 21:08:33.857406 > ########################################

Is there a plan to modify the current P2Pool codebase to support MW before activation in May 2022? Without modification, the Litecoin P2Pool network will stop mining valid blocks in approximately 30 days. Please advise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.