P2Pool is a decentralized Bitcoin mining pool that works by creating a peer-to-peer network of miner nodes.
P2Pool 分布式的矿池,其原理是创建P2P的矿机节点网络。
P2Pool creates a new block chain in which the difficulty is adjusted so a new block is found every 30 seconds. The blocks that get into the P2Pool block chain (called the "share chain") are the same blocks that would get into the Bitcoin block chain, only they have a lower difficulty target. Whenever a peer announces a new share found (new block in the P2Pool block chain), it is received by the other peers, and the other peers verify that this block contains payouts for all the previous miners who found a share (and announced it) that made it into the P2Pool share chain. This continues until some peer finds a block that has a difficulty that meets the Bitcoin network's difficulty target. This peer announces this block to the Bitcoin network and miners who have submitted shares for this block are paid in the generation transaction, proportionally to how many shares they have found in the last while. - Unknown author
P2Pool 会创建一个新的block chain(称为share chain),然后动态调整难度系数以保证1 block/30s的速度.share chain中的block和提交到bitcoin block chain中的block是一样的,区别只是share chain中的block难度系数低些。一旦有节点声称发现新的share,其他节点也会收到广播,然后其他节点会核查该block中的payout收款人是否包含上次发现share并提交到share chain的miners.如此循环往复,直到发现的share的难度系数符合BTC网络的难度系数。然后发现该share的节点将发现的share提交到btc网络,然后所有为找到该block而提交过share的所有miner都会在下笔交易按上一轮提交的share比例获得分成。
Decentralized payout pooling solves the problem of centralized mining pools degrading the decentralization of Bitcoin and avoids the risk of hard to detect theft by pool operators.
Miners are configured to connect to a P2Pool node that can be run locally, alongside the miner. P2Pool users must run a full Bitcoin node which serves the purpose of independently validating transactions and the Bitcoin blockchain. P2Pool also supports merged mining and several alternative blockchains.
分布式的payout pooling解决了集中池会降低BTC网络分散化程度的问题,并且规避了pool管理员盗币的风险。
矿机可以被配置为连接到本地运行的P2Pool节点上.P2Pool用户必须要运行完整的Bitcoin node,因为bitcoin node要用来独立验证tx和blockchain.P2Pool也支持merged mining和其他类型的blockchain.
P2Pool nodes work on a chain of shares similar to Bitcoin's blockchain. Each node works on a block that includes payouts to the previous shares' owners and the node itself, which can also result in a share if it meets P2Pool's difficulty.
Because of the importance of strengthening Bitcoin's decentralization, some Bitcoin supporters donate to P2Pool miners, resulting in average returns above 100% of the expected reward. However, it should be noted that there are other pools (such as BitPenny and Eligius) which can provide this same level of decentralization.
P2Pool节点的share chain 与block chain类似.每个节点正操作的block信息都包含了对上轮share提交者的payout和node本身,并且产生的share也符合p2pool的难度系数。
正因为提高BTC网络分散化水平的重要性,某些BTC支持者向P2Pool的miner提供捐赠,这就导致平均回报率高于期望回报率。需要注意的是其他矿池例如 BitPenny and Eligius也提供了相当的分散化水平。
Contents [hide]
1 Overview
1.1 Payout logic
1.2 Stales
2 Joining the pool
2.1 Frequently Asked Questions
2.2 Miners
2.2.1 Tips to configure bfgminer to reduce stale/doa:
2.3 Useful features
2.4 Web interface
2.5 Included README
2.6 Option Reference
3 Interoperability table
4 Protocol description
5 History
6 Donating to P2Pool miners
7 Sponsors
8 See Also
9 External Links
10 References
Overview
P2Pool shares form a "sharechain" with each share referencing the previous share's hash. Each share contains a standard Bitcoin block header, some P2Pool-specific data that is used to compute the generation transaction (total subsidy, payout script of this share, a nonce, the previous share's hash, and the current target for shares), and a Merkle branch linking that generation transaction to the block header's Merkle hash.
P2Pool的share chain上的每个share指向前一share的hash.每个share都包含了标准BTC block的头信息,还有些P2Pool定义的用于计算下个tx数据(total subsidy,payout script,nonce,上个share的hash,当前难度系数),还有个merkle branch用于连接下个tx到block header的merkle hash.
The chain continuously regulates its target to keep generation around one share every thirty seconds, just as Bitcoin regulates it to generate one block every ten minutes. This means that finding shares becomes more difficult (resulting in higher variance) the more people mine on P2Pool, though large miners have the option to raise their difficulty, and so reduce the impact of their mining on P2Pool's minimum difficulty.
share chain不断调整难度系数值来维持每30s一个share的频率,就像BTC调整难度系数来维持每10min一个block的频率。这也意味着找到share的难度随着P2Pool上miner的增加而增加(导致更高的不确定性),然而大多数miner都可以调高他们的难度系数来降低P2pool最低难度系数对他们的影响。
Unlike Bitcoin, nodes do not know the entire chain - instead they only hold the last 8640 shares (the last day's worth). In order to prevent an attacker from working on a chain in secret and then releasing it, overriding the existing chain, chains are judged by how much work they have since a point in the past. To ascertain that the work has been done since that point, nodes look at the Bitcoin blocks that the shares reference, establishing a provable timestamp. (If a share points to a block, it was definitely made after that block was made.)
和BTC不一样的是,P2Pool节点并完全不知道整个chain-相反他们只知道最近的8640个share(前一天的share总量)。为了防止在share chain上的攻击者释放share chain覆盖当前的chain,通过自过去某个时间点开始chain保有的work来校验chain。为了确定从那个时间点的work已经完成,node查看share指向的BTC block,建立一个可证实的时间戳。(如果某个share指向一个block,那他肯定实在该block生成之后才生成的。)
Payout logic
Each share contains a generation transaction that pays to the previous n shares, where n is the number of shares whose total work is equal to 3 times the average work required to solve a block, or 8640 (= 24 hours of shares), whichever is smaller. Payouts are weighted based on the amount of work each share took to solve, which is proportional to the p2pool difficulty at that time.
每个share都包含了一个generation transaction向之前的n个share payout,n指的是share的个数,share需要的work大约是算出一个block所需平均work的3倍,8640(24小时能算出的share数)。payout根据算出每个share所需的work总量计算,大致是那个时间点P2Pool的难度的某个比例.
The block reward (currently 25BTC) and the transaction fees are combined and apportioned according to these rules:
block奖励(目前25BTC)和交易费合并后根据以下原则分摊出去:
A subsidy of 0.5% is sent to the node that solved the block in order to discourage not sharing solutions that qualify as a block. (A miner with the aim to harm others could withhold the block, thereby preventing anybody from getting paid. He can NOT redirect the payout to himself.) The remaining 99.5% is distributed evenly to miners based on work done recently.
0.5%的subsidy打给算出block的node用于抑制不共享解决方案的爆块行为。(某些损害他人miner据有block并拒绝其他人分成,他决不能把payout都转给自己)剩余的99.5%根据work量最终分给miners.
In the event that a share qualifies as a block, this generation transaction is exposed to the Bitcoin network and takes effect, transferring each node its payout.
当有share符合btc的难度,会产生generation transaction并传播到btc网络,生效后转给每个node相应的payout.
Stales
On P2Pool stales refer to shares which can't make it into the sharechain. Because the sharechain is 60 times faster than the Bitcoin chain many stales are common and expected. However, because the payout is PPLNS only your stale rate relative to other nodes is relevant; the absolute rate is not.
Stales指的是不能被加入到share chain的share。因为sharechain比block chain快60倍,所以stales会很常见。但是,因为payout分利模式是PPLNS的,你的stale率应该和其他节点相当的,绝对的stale率不是。
There are two reported kinds of stales in P2Pool: "DEAD ON ARRIVAL" shares and orphan shares. Dead shares were too old by the time they arrived at your local P2Pool. Very high dead rates can indicate miner misconfiguration. Orphan shares are shares which were not extended by the rest of the P2Pool network, because some other miner's share was accepted first. Very high orphan rates may indicate network connectivity problems.
The P2Pool console output shows your relative stale rate compared to other P2Pool miners in the 'Own efficiency' column:
P2Pool有两种类型的stale:DOA share和orphan share。DOA指的是到达P2Pool的时间太靠后的share。过高的DOA比率意味着miner配置有问题.orphan指的是没有被P2pool网络续接引用的share,主要是由于某些其他miner的share先被承认。过高的orphan比率意味着网络连接有问题:网络延迟过高
2012-01-07 20:57:51.797420 Pool stales: 13% Own: 13±2% Own efficiency: 100±2%
When you first start P2Pool claimed efficiency will be low and the error bounds on this estimate will be large, but as it runs the numbers will converge to their correct values.
If your efficiency is unusually low, make sure your network connection isn't overloaded, that your miners support long polling and are not set to work for excessive amounts of time, and that your bitcoind has multiple connections.
刚启动p2pool的时候显示的efficiency会比较低,error bounds比较大,但随着p2pool运行时间增长,这个数字会逐渐接近比较准确的值。
如果你的efficiency一直很低,请确认你的网络是否过载,查查你的miner是否支持long poll,miner是否工作过量,还有检查下你的bitcoind是否连接过多。
Joining the pool
Follow these steps to join the pool:
按照如下步骤加入p2pool.
Run Bitcoin with the RPC interface enabled: edit bitcoin.conf to include:
打开RPC接口,运行bitcoin:编辑bitcoin.conf,引入如下内容
rpcuser=USER
rpcpassword=LONG_RANDOM_SECRET_VALUE
server=1
Replace LONG_RANDOM_SECRET_VALUE with something long and random like the output of smashing your keyboard for a bit like fju4M78yAj3ds39pak92raK. You don't need to be able to remember it. If your RPC port becomes exposed to the internet a thief could steal your bitcoin if they could guess it, or use a brute force attack in order to find it.
Bitcoin 0.8.5 or later is required
It's important that your Bitcoin client be fully synchronized before starting. It's also better if you have the Bitcoin port forwarded
替换LONG_RANDOM_SECRET_VALUE为某些随机的长字符串,例如随机敲击键盘产生的字符串。你不需要记住这个字符串。如果你的RPC端口对internet公开,那窃贼很容易能猜到你的rpcpasword或者暴力破解方法而盗走你的BTC。
Bitcoin 0.8.5或者更新版
确保你的bitcoin客户端已经同步完成,通过bitcoin forwar到其他可用的bitcoin上也行。
Download p2pool:
Windows binary: See http://forum.bitcoin.org/index.php?topic=18313.0
Source download: https://github.com/forrestv/p2pool/tags
git: git clone git://github.com/forrestv/p2pool.git
下载p2pool,windows版:http://forum.bitcoin.org/index.php?topic=18313.0
源码下载:https://github.com/forrestv/p2pool/tags
git下载:git://github.com/forrestv/p2pool.git
Run p2pool: (See below for additional options.)
Windows py2exe: run_p2pool.exe
Source: python run_p2pool.py
运行p2pool
windows,执行run_p2pool.exe
源码:python run_p2pool.py
Run a miner daemon with long polling connecting to 127.0.0.1 (or the IP of the host running p2pool if it isn't on the same computer as the miner) on port 9332 with any username and password
bfgminer -O u:p -o http://127.0.0.1:9332/ --submit-stales
运行miner守护线程,long poll连接127.0.0.1(如果miner和p2pool不在同一电脑运行,IP指的是运行p2pool的电脑的IP)端口9332,任意username和password均可。
Dependencies if running from source:
Q: "Why does my miner report so many longpoll events when mining on p2pool? - P4Man"
A: "Once every ~10 seconds is normal. That is how often p2pool shares are generated (as opposed to ~10 min for bitcoin blocks) - cabin"
Q:为什么我的miner连接p2pool的时候报告那么多longpoll事件?
A:每10s一次longpoll是正常的。
Q: "Do the 'orphan' and 'dead' shares in P2Pool's status display hurt me?"
A: They shouldn't - It's normal for some fraction of everyone's shares to end up orphaned or dead. Because payouts are calculated by counting how many shares you have relative to others, everyone with normal configurations is equally "hurt" by this. However, if you have a large proportion of stales, your payout will be hurt. You can see how well you're doing by looking at P2Pool's "Efficiency" (ex: Efficiency: ~110.6% (40-111%)). If 100% doesn't lie within the confidence interval at the end, something is probably wrong (with 95% confidence).
Q:'orphan' and 'dead' shares 对我有什么影响?
A:没影响-每个人的share都有可能会是orphaned或dead。因为payout是根据你相比他人提交的share数计算的,所有配置正确的miner的"hurt"是同等的。但是如果你的stale比例很高,你的payout会受影响。你可以通过P2Pool's "Efficiency"看出来.如果不在可靠区间,肯定是哪里出问题了。
Q: "What do I do if my efficiency is low?"
A: Make sure the computers you're running P2Pool and the miner on have enough memory and CPU time. If you have a lot of dead shares or the "Local dead on arrival" number is higher than a few percent, that means that something is wrong with your miner. Check to make sure that it is one of the working versions in the Miners section on this page. Lower the intensity or raise the FPS of your miner. If you have a lot of orphan shares, something is wrong with P2Pool's P2P connection. Decrease the load on your internet connection or enable QoS (Quality of Service) on your router.
Q:如果我的efficiency 很低我该怎么做?
A:首先请确保运行p2pool和miner的电脑内存充裕,CPU够用。如果你的矿池出现很多dead share,或者 "Local dead on arrival"数值较高,那就意味着你的miner哪里出问题了。检查下你的miner是页面中提到的miner。调低intensity 或调高FPS 试试。如果你的miner的orphan share太多,P2pool的连接可能有问题。调低网络负载或者开启路由的QoS.
Q: What is PPLNS?
A: Pay-Per-Last-N-Shares is a payout method that is completely resistant to pool hoppers.
Q:PPLNS是什么意思?
A:Pay-Per-Last-N-Shares是一种分成模式,
Q: Why am I not getting very many shares?!
A: The P2Pool difficulty is hundreds of times higher than on other pools. It can take time to get a share. P2Pool displays an estimate of how long you have to wait in the console output.
Q:为什么我的shares没那么多?
A:P2Pool的难度比其他pool高数百倍。算出share需要花费点时间。P2Pool的控制台显示的有算出block你大概需要等多长时间。
Q: Why does my miner say it has found a lot of shares but p2pool say I have only found a few?!
A: The real P2Pool difficulty is hundreds of times higher than on normal pools, but p2pool essentially lies to your miner and tells it to work on relatively easy shares so that it submits shares every few seconds instead of every few hours. P2Pool then ignores any submitted shares that don't match the real share difficulty. By doing this, P2Pool can more accurately report your local hash rate and you can see if you are having problems with too many stale shares quickly
Q:为什么我的miner显示有很多shares而p2pool显示的只有几个?
A:P2pool的实际难度是常规pool的数百倍,但是p2pool本质上还是依靠miner,它让miner在一些相对容易的share上计算,所以miner每隔几秒提交一次share而不是几个小时。如果提交的share难度不符合p2pool的实际难度,shares会被忽略掉。通过这种方法,p2pool可以比较精确的算出你的local hash rate,你也可以从此看出你的miner是否算出stale shares太频繁。
Q: Why am I getting so many rejects?
A: You're using an incompatible miner. See the miners section here, increase your FPS on the miner, decrease the intensity, upgrade your miner, or try a different miner.
Q:为什么我有这么多rejects?
A:你的miner可能不兼容p2pool.查阅页面miners section,调高miner的FPS或者调低intensity,升级miner,或者换个miner.
Q: What stops the pool operator or the block finder from stealing a block?
A: A block solution is only worth anything because its hash matches Bitcoin's target. Altering anything within the block will change its hash and make it worthless. If you are concerned about the pool operator stealing a block, you should try to inspect the source code of each new version.
Q:通过什么措施防止operator或block finder盗取block?
A:block solution有价值是因为它符合btc网络的难度。修改block内的任何内容都会改变block的hash从而导致block无用。如果你担心operator盗取block,你可以查看下各个版本的源码。
Q: Why does it say "Generated?" I want to spend my coins now!
A: P2Pool includes payouts in generation transactions, which must mature (taking 120 blocks or 20 hours) before they can be spent. The reason for this is that a block could be orphaned, which would make its payout invalid and could reverse transactions.
Q:为什么显示的是"Generated?我想现在就消费我的coin!
A:p2pool的payout在generation transaction才pay,所以必须等到mature(大约120个blocks也就是20小时)才能消费。原因是block 可能会是orphaned,如果那样,payouts就是无效的,那就相当于reverse tx了。
Q: Do I get paid transaction fees?
A: Yes. They are split among P2Pool miners.
Q:我能拿到交易费么?
A:是的,tx fee会分摊给p2pool的miners
Q: What are these payments I'm getting that aren't generated?
A: These are subsidies that people who support the idea of P2Pool send to miners.
Q:为什么我会有非计算share收益的不明收入?
A:这些是津贴(p2pool支持者发给p2pool miner的)
Q: Cool Subsidies sound like an awesome idea! How do I send some BTC to these awesome miners?
A: See end of this page.
Q:subsidy听起来很棒啊,我怎么给这些出色的miners发放BTC?
A:请看页面最下方。
Q: Do I really need the WHOLE blockchain?
A: Yes. Your node needs to be able to independently make decisions about what transactions to mine.
Q:我是否必需整个blockchain?
A:是的。你的node需要对挖什么样的tx有独立的决策能力
Q: How do merged mining payments work?
A: Merged mining is handled entirely by namecoind, so you're solo mining and payouts will Go into namecoind's wallet.
This is all for the latest p2pool version, as it includes several new workarounds.
如下是最新的p2pool支持的miners
With all miners, using a HIGH FPS target (100?) or a LOW intensity (8 for bfgminer?) helps a lot with reducing stales.
对所有的miners而言,使用高的FPS或低的intensity都有助于减少stales.
bfgminer, cgminer, and ufasoft work perfectly without any extra options.
DiabloMiner works fine after commit 3b731b9.
Phoenix works fine after commit a658ef2.
Poclbm works fine after commit 5e994e7.
P2Pool uses higher difficulty shares than most centralized pools, so you'll see fewer shares reported. This is normal and doesn't reduce your payments. It's also normal to see longpoll messages once per every ten seconds on average.
p2pool的难度远高于传统集中式的pool,
Tips to configure bfgminer to reduce stale/doa:
"gpu-threads" : "1", (2 by default)
"queue" : "0", (1 by default)
Because of fast longpooling in p2pool it is better not NOT fetch work ahead.
因为p2pool是long poll,所以最好别超前get work。
On non-dedicated machines intensity=3 allows normal usage of PC, set it to 7 or more to get full hashrate.
On most cards best is diablo and phatk kernel, looks like poclbm kernel have unstable rate.
Useful features
If upgrading P2Pool or changing its configuration, you can start another instance of P2Pool in parallel with the first. It will start normally, but realize that the worker and P2P listening ports are busy and keep trying to bind to them in the background. Thus, you can do almost-completely-seamless upgrades of P2Pool.
如果要升级p2pool或修改它的配置,你可以先启用另一个p2pool的实例,保持并行。新p2pool实例启动正常,但是当发现worker和p2p监听端口处于busy状态,它会在后头不断尝试绑定到这个端口上。因此你可以保持pool无间断工作的同时升级p2pool.
If you run multiple P2Pool nodes or have trusted friends that run P2Pool, you can use -n to establish a constant extra P2P connection to them.
如果你运行多个P2Pool节点后者有可信的朋友在运行p2pool,你可以使用-n 建立连接到额外的节点
You can make P2Pool use a configuration file by running run_p2pool.py @FILENAME, with FILENAME being the path to a file containing the command-line arguments (newlines are ignored) Example:
你可以让p2pool从配置文件运行,方法是run_p2pool.py @FILENAME FILENAME 是包含运行p2pool命令行的文件路径。(忽略换行符)
--net bitcoin
-n 1.2.3.4
Setting the username of your miner connecting to P2Pool to a Bitcoin address will make it mine to that address instead of the one requested from bitcoind or set by -a
设置miner的username为BTC收款地址可以让挖矿收益打到这个地址而不是从bitcoind查找打款地址,也可以-a参数指定收款地址
Appending "/1000" to a miner's username will increase the difficulty of producing a P2Pool share to at most 1000. This is useful to large miners because doing this can make it easier for small miners while minimally impacting the large miners themselves. See recommended values.
追加"/1000"到miner的username后可以调高p2pool的难度到1000(最高值)。这对大型矿机很有利,因为这样做降低了p2pool最低难度值对大型矿机的影响。
Appending "+1" (for example) after that will make P2Pool always give your miners work with a difficulty of 1
追加"+1"将会让p2pool总是给你的矿机分得的工作难度为1。
Web interface
Lots of data and useful tools are available at http://127.0.0.1:9332/something:
很多数据分析工具可以通过此地址查看 http://127.0.0.1:9332/something ,something代表如下参数(/static/ , /rate ...)
/static/ - Lots of information from shares to graphs to payouts.
shares的payouts图表信息
/rate
/users
/fee
/current_payouts
/patron_sendmany - Gives sendmany outputs for fair donations to P2Pool 给p2pool捐赠
/global_stats
/local_stats
/peer_addresses
/payout_addr
/recent_blocks
/uptime
/web/log - Some different stats collected over the last day 从昨天开始的各种统计信息
Included README
Requirements:安装p2pool依赖的包和安装方法
Generic:
Bitcoin >=0.6.0rc4 or Bitcoin >=0.5.4 (for BIP16 support) or Litecoin
Python
Twisted
python-argparse (for Python <=2.6)
Linux:
sudo apt-get install python-zope.interface python-twisted python-twisted-web
sudo apt-get install python-argparse # if on Python 2.6 or older
Windows:
Install Python 2.7: http://www.python.org/getit/
Install Twisted: http://twistedmatrix.com/trac/wiki/Downloads
Install Zope.Interface: http://pypi.python.org/pypi/zope.interface/3.8.0
Unzip the files into C:\Python27\Lib\site-packages
Running P2Pool:
To use P2Pool, you must be running your own local bitcoind. For standard
configurations, using P2Pool should be as simple as:要使用p2pool,你必须先运行你本地的bitcoind。使用标准配置,使用p2pool命令很简单,如下:
python run_p2pool.py
Then run your miner program, connecting to 127.0.0.1 on port 9332 with any
username and password.然后运行你的miner,连接到127.0.0.1:9332,填上username和password
If you are behind a NAT, you should enable TCP port forwarding on your
router. Forward port 9333 to the host running P2Pool.如果你用的NAT,你需要开启路由的TCP端口转发功能。将端口9333转发到运行p2pool的主机
Run "python run_p2pool.py --help" for additional options.python run_p2pool.py --help查看帮助和更多其他选项
Notes for Litecoin:
Requirements:
In order to run P2Pool with the Litecoin network, you would need to build and install the
ltc_scrypt module that includes the scrypt proof of work code that Litecoin uses for hashes.要让p2pool运行在litecoin网络,你需要build和运行ltc_scrypt module用于引入基于scrypt 的POW。
Linux:
cd litecoin_scrypt
sudo python setup.py install
cd litecoin_scrypt
C:\Python27\python.exe setup.py build --compile=mingw32 install
If you run into an error with unrecognized command line option '-mno-cygwin', see this:
http://stackoverflow.com/questions/6034390/compiling-with-cython-and-mingw-produces-gcc-error-unrecognized-command-line-o
如果执行过程中遇到error:unrecognized command line option '-mno-cygwin',请参考如下地址:
Running P2Pool:
Run P2Pool with the "--net litecoin" option.
Run your miner program, connecting to 127.0.0.1 on port 9327.
Forward port 9338 to the host running P2Pool.转发9338端口到p2pool的主机
Litecoin's use of ports 9332 and 9332 conflicts with P2Pool running on
the Bitcoin network. To avoid problems, add these lines to litecoin.conf Litecoin使用9332会和运行在btc网络的p2pool端口冲突。为避免此问题,添加如下命令行到litecoin.conf
and restart litecoind:
rpcport=10332
port=10333
Option Reference
usage: run_p2pool.py [-h] [--version] [--net {bitcoin,litecoin}] [--testnet]
[--debug] [-a ADDRESS] [--datadir DATADIR]
[--logfile LOGFILE] [--merged MERGED_URLS]
[--give-author DONATION_PERCENTAGE] [--iocp]
[--irc-announce] [--no-bugreport] [--p2pool-port PORT]
[-n ADDR[:PORT]] [--disable-upnp] [--max-conns CONNS]
[-w PORT or ADDR:PORT] [-f FEE_PERCENTAGE]
[--bitcoind-address BITCOIND_ADDRESS]
[--bitcoind-rpc-port BITCOIND_RPC_PORT]
[--bitcoind-p2p-port BITCOIND_P2P_PORT]
[BITCOIND_RPCUSERPASS [BITCOIND_RPCUSERPASS ...]]
p2pool (version 0.11.1-8-ged9359d)
optional arguments:
-h, --help show this help message and exit显示帮助信息并退出
--version show program's version number and exit
--net {bitcoin,litecoin}连接的哪种网络(bitcoin,litecoin..),缺省是bitcoin
use specified network (default: bitcoin)
--testnet use the network's testnet是否连接到testnet
--debug enable debugging mode是否开启debug模式
-a ADDRESS, --address ADDRESS payouts到此地址,缺省从bitcoind获得
generate payouts to this address (default: <address
requested from bitcoind>)
--datadir DATADIR store data in this directory (default: <directory
run_p2pool.py is in>/data)存储数据到此目录(缺省为run_p2pool.py所在目录/data)
--logfile LOGFILE log to this file (default: data/<NET>/log)日志文件路径(缺省 data/<NET>/log)
--merged MERGED_URLS call getauxblock on this url to get work for merged
mining (example:
http://ncuser:ncpass@127.0.0.1:10332/)merged mining的getauxblock地址
--give-author DONATION_PERCENTAGE
donate this percentage of work towards the development
of p2pool (default: 0.5)捐赠比例(缺省0.5)
--iocp use Windows IOCP API in order to avoid errors due to
large number of sockets being open使用windows的IOCP API避免因为过多端口打开造成的错误
--irc-announce announce any blocks found on
irc://irc.freenode.net/#p2pool
--no-bugreport disable submitting caught exceptions to the author禁用提交异常信息给author
--disable-upnp don't attempt to use UPnP to forward p2pool's P2P port
from the Internet to this computer禁止通过UPnP转发从internet过来的p2p端口到此电脑
p2pool interface:
--p2pool-port PORT use port PORT to listen for connections (forward this
port from your router!) (default: bitcoin:9333,
litecoin:9338)通过此端口监听连接(路由要转发此端口)(缺省:bitcoin:9333,litecoin:9338)
-n ADDR[:PORT], --p2pool-node ADDR[:PORT]
connect to existing p2pool node at ADDR listening on
port PORT (defaults to default p2pool P2P port) in
addition to builtin addresses连接到已存在的p2pool节点(缺省为p2pool-port)
--max-conns CONNS maximum incoming connections (default: 40)最大连接数(缺省40)
worker interface:
-w PORT or ADDR:PORT, --worker-port PORT or ADDR:PORT
listen on PORT on interface with ADDR for RPC
connections from miners (default: all interfaces,
bitcoin:9332, litecoin:9327)miner连接端口(缺省:所有接口,bitcoin:9332,litecoin:9327)
-f FEE_PERCENTAGE, --fee FEE_PERCENTAGE
charge workers mining to their own bitcoin address (by
setting their miner's username to a bitcoin address)
this percentage fee to mine on your p2pool instance.
Amount displayed at http://127.0.0.1:WORKER_PORT/fee
(default: 0)对worker收费的费率,具体情况通过http://127.0.0.1:WORKER_PORT/fee查看
bitcoind interface:bitcoind接口参数:
--bitcoind-address BITCOIND_ADDRESS
connect to this address (default: 127.0.0.1)连接到此地址bitcoind,缺省127.0.0.1
--bitcoind-rpc-port BITCOIND_RPC_PORT
connect to JSON-RPC interface at this port (default:
bitcoin:8332, litecoin:9332 <read from bitcoin.conf if
password not provided>) JSON-RPC接口的访问端口(缺省bitcoin:8332,litecoin:9332,如果没有提供password从bitcoin.conf读取)
--bitcoind-p2p-port BITCOIND_P2P_PORT
connect to P2P interface at this port (default:
bitcoin:8333, litecoin:9333 <read from bitcoin.conf if
password not provided>)连接p2p端口(缺省:bitcoin:8333,litecoin:9333,没有提供password从bitcoin.conf读取)
BITCOIND_RPCUSERPASS bitcoind RPC interface username, then password, space-
separated (only one being provided will cause the
username to default to being empty, and none will
cause P2Pool to read them from bitcoin.conf)bitcoind RPC接口username和password,空格分隔。(只提供一个会导致username默认为空,不填会导致p2pool从bitcoin.conf读取)
Interoperability table 兼容性
P2pool works fine with most hardware. This lists some of the hardware confirmed to work and any special configuration required.
ASICminer blade 10GH/s (Requires adding +1 to username or proxy)
Avalon 110nm 60-110 GH/s (All batches)
Avalon based 55nm 200 GH/s (specific makers?)
Avalon prototype 55nm 120GH/s (~ 20 exist)
Cointerra Terraminer IV (very low stale rate, maybe the lowest of any mining asic)
Icarus FPGA
Bitfury strikes back H-card and M-card (instructions)
Bitmain Antminer S1 180GH/s (Requires 20131226 firmware.)
BFL SC Jalapeno, SC Single 30, 50, & 60 GH/s
(Various GPU and most FPGAs other than BFL single FPGAs work fine too)
Protocol description
P2Pool's protocol mirrors Bitcoin's P2P protocol in many ways. It uses the same framing (prefix, command, length, checksum, payload) and similar commands:
version - sent to establish a connection - contains (version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash)
setmode - sent to update the mode sent in the version message - contains (mode)
ping - sent to keep connection alive - contains ()
addrme - request that the receiving node send out an addr for the sending node - contains (port)
addrs - broadcast list of nodes' addresses - contains (addrs)
getaddrs - request that the receiving node send count addrs - contains (count)
getshares - request that the receiving node send the shares referenced by hashes and parents of their parents, stopping at any share referenced by stops - contains (hashes, parents, stops)
shares - broadcast message of the contents of shares - contains (shares)
History
This project was announced on June 17, 2011 by Forrest Voight[1].
The pool began testing against mainnet in mid-July, 2011. The pool was reviewed on a Bitcoin Miner post on July 26, 2011[2].
The software author's address for donations can be found in the signature section of his forum profile.
Donating to P2Pool miners
In order to encourage people to mine to P2Pool you can donate to the recent miners in proportion using a sendmany:
For example, a bash script to donate 10 btc is:
为了激励更多人在P2Pool挖矿,你可以捐赠些BTC给最近使用p2pool的miners,如下示例捐赠10个BTC
~/src/bitcoin/src/bitcoind sendmany "" "$(GET http://127.0.0.1:9332/patron_sendmany/10)"
You can replace "" with "accountname" if you want to pay from some specific bitcoind account, and you need to replace 127.0.0.1 with the address of your P2Pool node if you're not running one locally.
Note that the amount you donate will be allocated to recent miners in proportion to the amount of work they've done in the last 24 hours or so, but all the miner whose shares of the donated amount are less than 0.01 BTC will have their shares combined into a single amount which is awarded to one of them at random, with the chance of winning this 'lottery' weighted by the miner's recent amount of work done. You can change this 0.01 BTC threshold like this, for example, which says to pay 10 BTC, but to share it amongst more miners that the default, cutting off at 0.001 BTC instead of at 0.01 BTC.
~/src/bitcoin/src/bitcoind sendmany "" "$(GET http://127.0.0.1:9332/patron_sendmany/10/0.001)"
If you decide to donate you should announce it on the forums so that your donations provide the most incentive possible.
Sponsors
Thanks to:
The Bitcoin Foundation for its generous support of P2Pool
The Litecoin Project for its generous donations to P2Pool
See Also
Comparison of mining pools
Pooled Mining
P2Pool code documentation
External Links
P2Pool forum
p2pool project on GitHub
IRC Web #p2pool discussion and support
p2pool.info stats page (appears broken since May 2014 and as of June 2014 - you can use http://ANY.NODE:9332/static/graphs.html )
p2pool.hostv.pl Public list of P2Pool BTC/LTC nodes.
p2pool-nodes.info Another public list of P2Pool (BTC) nodes.
whatisp2pool.com An easy introduction to mining and P2Pool.
References
↑ p2pool: Decentralized, DoS-resistant, Hop-Proof - Now active on mainnet!
↑ P2Pool Decentralized Pool Nearly Ready For Prime-Time
Category: