Bitcoin Forum
July 10, 2024, 08:02:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Local / 中文 (Chinese) / p2pool终极宝典 —胡乱优化篇 on: February 27, 2014, 10:55:00 AM
p2pool终极宝典
—胡乱优化篇

p2pool—最好的矿池(没有之一)

彪悍的帖子 不需要回复可见

苦逼的矿工 不要求大家贡献

注 大家最好自己架设矿池!如果手边没有闲置电脑,或懒得维护,可以到我的矿池挖矿!

我的矿池

      BTC(比特币矿池)

              地址         www.openmine.linkpc.net:9332

              用户名     你的钱包地址

              密码         自己写

      LITECOIN(莱特币矿池)

               地址         www.openmine.linkpc.net:9327

               用户名     你的钱包地址

               密码         自己写

qq交流群258910734

此文原则

1不仅讲然,而且讲所以然,以求触类旁通。

2尽量不用专业术语,以通俗易懂为原则。

此文权限

1此文挂到GPL下 (GPL第几版,随便),受益于Linux多年,也算为开源做点贡献。

2 随便转载,球才要版权。

此文是疯狂架设篇的续篇,先看疯狂架设篇!

优化主要分三块

Linux系统的优化

bitcoin网络的优化

p2pool网络的优化

Linux系统的优化(主要是安全方面)

1不要开放不必要的端口

2不要提供不必要的服务

3不要启动不必要的软件

4软件不要用源码编译安装

5专机专用

参考

http://www.debian.org/doc/manuals/securing-debian-howto/index.en.html

bitcoin的优化(主要是指命令行参数)

有两个方法设置命令行参数

1 命令行使用,参数之间用空格分开!

2 $HOME/.bitcoin/bitcoin.conf(除了-datadir和-conf)。一个参数一行!

如果同时在命令行和配置文件指定了同样的选项,则优先使用命令行的。

Options:

 -?                     This help message
 -conf=<file>           Specify configuration file (default: bitcoin.conf)
 -pid=<file>            Specify pid file (default: bitcoind.pid)
 -gen                   Generate coins (default: 0)
 -datadir=<dir>         Specify data directory
 -dbcache=<n>           Set database cache size in megabytes (default: 25)
 -timeout=<n>           Specify connection timeout in milliseconds (default: 5000)
 -proxy=<ip:port>       Connect through socks proxy
 -socks=<n>             Select the version of socks proxy to use (4-5, default: 5)
 -tor=<ip:port>         Use proxy to reach tor hidden services (default: same as -proxy)
 -dns                   Allow DNS lookups for -addnode, -seednode and -connect
 -port=<port>           Listen for connections on <port> (default: 8333 or testnet: 18333)
 -maxconnections=<n>    Maintain at most <n> connections to peers (default: 125)
 -addnode=<ip>          Add a node to connect to and attempt to keep the connection open
 -connect=<ip>          Connect only to the specified node(s)
 -seednode=<ip>         Connect to a node to retrieve peer addresses, and disconnect
 -externalip=<ip>       Specify your own public address
 -onlynet=<net>         Only connect to nodes in network <net> (IPv4, IPv6 or Tor)
 -discover              Discover own IP address (default: 1 when listening and no -externalip)
 -checkpoints           Only accept block chain matching built-in checkpoints (default: 1)
 -listen                Accept connections from outside (default: 1 if no -proxy or -connect)
 -bind=<addr>           Bind to given address and always listen on it. Use [host]:port notation for IPv6
 -dnsseed               Find peers using DNS lookup (default: 1 unless -connect)
 -banscore=<n>          Threshold for disconnecting misbehaving peers (default: 100)
 -bantime=<n>           Number of seconds to keep misbehaving peers from reconnecting (default: 86400)
 -maxreceivebuffer=<n>  Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)
 -maxsendbuffer=<n>     Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)
 -upnp                  Use UPnP to map the listening port (default: 1 when listening)
 -paytxfee=<amt>        Fee per KB to add to transactions you send
 -server                Accept command line and JSON-RPC commands
 -testnet               Use the test network
 -debug                 Output extra debugging information. Implies all other -debug* options
 -debugnet              Output extra network debugging information
 -logtimestamps         Prepend debug output with timestamp
 -shrinkdebugfile       Shrink debug.log file on client startup (default: 1 when no -debug)
 -printtoconsole        Send trace/debug info to console instead of debug.log file
 -printtodebugger       Send trace/debug info to debugger
 -rpcuser=<user>        Username for JSON-RPC connections
 -rpcpassword=<pw>      Password for JSON-RPC connections
 -rpcport=<port>        Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)
 -rpcallowip=<ip>       Allow JSON-RPC connections from specified IP address
 -rpcthreads=<n>        Set the number of threads to service RPC calls (default: 4)
 -blocknotify=<cmd>     Execute command when the best block changes (%s in cmd is replaced by block hash)
 -walletnotify=<cmd>    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
 -alertnotify=<cmd>     Execute command when a relevant alert is received (%s in cmd is replaced by message)
 -upgradewallet         Upgrade wallet to latest format
 -keypool=<n>           Set key pool size to <n> (default: 100)
 -rescan                Rescan the block chain for missing wallet transactions
 -salvagewallet         Attempt to recover private keys from a corrupt wallet.dat
 -checkblocks=<n>       How many blocks to check at startup (default: 288, 0 = all)
 -checklevel=<n>        How thorough the block verification is (0-4, default: 3)
 -txindex               Maintain a full transaction index (default: 0)
 -loadblock=<file>      Imports blocks from external blk000??.dat file
 -reindex               Rebuild block chain index from current blk000??.dat files
 -par=<n>               Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)

Block creation options:

 -blockminsize=<n>      Set minimum block size in bytes (default: 0)
 -blockmaxsize=<n>      Set maximum block size in bytes (default: 250000)
 -blockprioritysize=<n> Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)
 -mintxfee=<m.n>        Minimum  fee-per-kilobyte to qualify as fee-paying (default: 0.0001)

SSL options: (see the Bitcoin Wiki for SSL setup instructions)

 -rpcssl                                  Use OpenSSL (https) for JSON-RPC connections
 -rpcsslcertificatechainfile=<file.cert>  Server certificate file (default: server.cert)
 -rpcsslprivatekeyfile=<file.pem>         Server private key (default: server.pem)
 -rpcsslciphers=<ciphers>                 Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)

UI options:

 -lang=<lang>           Set language, for example "de_DE" (default: system locale)
 -min                   Start minimized
 -splash                Show splash screen on startup (default: 1)

Many of the boolean options can also be set to off by specifying them with a "no" prefix: e.g. -nodnseed.

p2pool的优化(主要指命令行参数)

只可以在命令行使用,参数之间用空格分开!

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --net {bitcoin,litecoin}
                        use specified network (default: bitcoin)
  --testnet             use the network's testnet
  --debug               enable debugging mode
  -a ADDRESS, --address ADDRESS
                        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)
  --logfile LOGFILE     log to this file (default: 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/)
  --give-author DONATION_PERCENTAGE
                        donate this percentage of work towards the development
                        of p2pool (default: 0.5)
  --iocp                use Windows IOCP API in order to avoid errors due to
                        large number of sockets being open
  --irc-announce        announce any blocks found on
                        irc://irc.freenode.net/#p2pool
  --no-bugreport        disable submitting caught exceptions to the author
  --disable-upnp        don't attempt to use UPnP to forward p2pool's P2P port
                        from the Internet to this computer

p2pool interface:
  --p2pool-port PORT    use port PORT to listen for connections (forward this
                        port from your router!) (default: 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
  --max-conns CONNS     maximum incoming connections (default: 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)
  -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)

bitcoind interface:
  --bitcoind-address BITCOIND_ADDRESS
                        connect to this address (default: 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>)
  --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>)
  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)

2  Local / 中文 (Chinese) / p2pool终极宝典 —疯狂架设篇 on: February 21, 2014, 10:19:19 AM
p2pool终极宝典

—疯狂架设篇

p2pool—最好的矿池(没有之一)

彪悍的帖子 不需要回复可见

苦逼的矿工 不要求大家贡献

注 大家最好自己架设矿池!如果手边没有闲置电脑,或懒得维护,可以到我的矿池挖矿!

我的矿池

   BTC(比特币矿池)

      地址  www.openmine.linkpc.net:9332
      用户名  你的钱包地址
      密码  自己写

   LITECOIN(莱特币矿池)

      地址  www.openmine.linkpc.net:9327
      用户名  你的钱包地址
      密码  自己写

qq交流群   258910734

此文原则

1不仅讲然,而且讲所以然,以求触类旁通。

2尽量不用专业术语,以通俗易懂为原则。

3考虑到有很多人不熟悉linux,加入大量插图。

此文权限

1此文挂到GPL下 (GPL第几版,随便),受益于Linux多年,也算为开源做点贡献。

2 随便转载,球才要版权。

起因

最近搞了台蚂蚁180g加入了苦逼矿工的行列!

看过网上很多架设p2pool矿池的教程,获益良多,但总觉得抓不到精髓!要知道设定的好坏对挖矿效率有很大的影响,所以把p2pool官方的教程翻译了一遍,

后自己总结了下。不敢独享,奉献给大家!此文不仅适用用比特币,莱特币等其他币种也适用!

为什么选p2pool矿池

   优点

      去中心化

           p2pool矿池由分布在全球的各个节点组成,没有中心矿池。

           所以不用担心黑客,因为除非黑客把全球的各个节点都黑了,否则他弄不到钱!

           不用担心矿主黑钱!中心化矿池挖矿所得都是先打入矿主账户,再由矿主分给大家,所以......。不用担心矿主卷钱跑路,因为收益的分发由全球分布的节点计算生成,与矿主无关。

           不用担心51%攻击。天然免疫51%。

      低延迟

           服务器就在自己家,延迟有多低就不用说了吧!一般1ms左右!在国外的服务器挖矿,延迟至少是200ms,拒绝率,丢包率高的惊人!

           低延迟的直接效果就是doa低(dead on arrived收到的就是死块),orphan低(孤立块,收到的块已经被别人声明),挖矿效率极高。

     高收益

           平均收益比其他矿池高。最好以两个星期为周期,用这个矿池挖矿所得收益,和其他矿池对比下。

     不会发生矿难

           服务器就在自己家还矿难个毛啊!

  缺点

     矿池节点架设维护比较难

     收益不稳定,忽高忽低,也有可能一天颗粒无收,也可能一天发4次工资!所以更适合24小时不间断挖矿的专业矿工。

     目前中国p2pool节点池子比较少,大部分是欧美用户!中国也有几个,队伍急需扩大!(但只要是在这挖的基本都是专业矿工,24小时不间断的!矿工和他们的收益可以在线查看http://p2pool.info/#users

准备工作

1 linux系统一套

   推荐debian(google、美国童子军数据库用的都是它,集稳定、快速、安全于一身,电脑极客的最爱!)。

   下载地址

    http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-CD-1.iso

        有人说 哥们怎么不用windows!

       linux三大优点—稳定、高效、安全!稳定和高效并不是我们选择linux的决定性因素!现在的win7、8也很稳定,就是效率差点。但中等电脑的效率可以很轻松搞定矿池!最主要的是安全,现在windows的病毒木马,满大街!你用windows架设矿池,一个bitcoin就5000啊!看过更牛逼的矿主用windows架设,到处招人到他的矿池挖矿,我就无语了,哥们坑自己就好了,别坑别人!

       有人说,哥们我看见linux就蛋疼,全是命令行怎么搞啊!

       我只想说,有我在怕个球啊!

2 比特币钱包

       一定要用官方的钱包(也就是中本聪钱包),同步完16g,慢慢等吧!不可用别的钱包替代!必须同步完!p2pool需要钱包里面的块连数据!

       下载地址

       https://bitcoin.org/bin/0.8.6/bitcoin-0.8.6-linux.tar.gz

3 p2pool程序

          下载地址

          https://codeload.github.com/forrestv/p2pool/tar.gz/13.4

开始安装

1安装linux(要启用图形界面,后面会用到)
          http://www.debian.org/releases/stable/amd64/index.html.zh-cn
2安装装比特币钱包
      2.1解压钱包到/home目录
       2.2切换到钱包目录
       2.3创建软连接(快捷方式)
       2.4运行钱包

       2.5退出钱包(不需要等同步)
       2.6创建钱包配置文件
            在/home目录的.bitcoin目录下创建配置文件bitcoin.conf
            在配置文件中写入
            server=1
            rpcuser=用户名(这是rpc协议的用户名和矿机无关,主要是用来识别rpc连接)
            rpcpassword=密码(这是rpc协议的密码和矿机无关,主要是用来加密rpc连接),这一步很重要,密码一定要很牛逼,如果黑客攻破这个密码,你的币就全完了,哥教你一招!现在最牛逼的加密方式是sha512,你随便找一个文件越小越好,越随便越好,然后计算他的sha512值,把这个值作为密码!放心强度绝对牛逼,就算天河2号想暴力破解也得几百年!


      2.7运行钱包,等待钱包同步完成,得12小时左右(20m光纤),很痛苦!


3 安装p2pool
      3.1安装依赖包

      3.2解压矿池软件到/home目录
        3.3创建shell脚本,加入运行时参数
      3.3运行p2pool,等待同步(这是bitcoin钱包程序必须是打开的,切忌切忌)


      3.4当出现矿池总速度的时候表示矿池架设成功!

      3.5 检测是否架设成功!打开浏览器输入127.0.0.1:9332,如果出现下图则表示架设成功!

4为矿机填写矿池信息
      矿池地址 127.0.0.1:9332
      用户名 钱包的收款地址
      密码 随便写


附录

p2pool官网 http://p2pool.in/
p2poolwiki https://en.bitcoin.it/wiki/P2Pool
p2pool信息网 http://p2pool.info/

debian分三个版本
      稳定版 不推荐 速度太慢
            极其稳定,牺牲了效率,里面的软件基本都是10年前的软件,兼容性极好,老掉牙的软件兼容性能不好吗?
      sid版 不推荐 服务器还是稳定点吧!
            不稳定,效率较高,都是最新的软件,软件基本是1天前发布的最新版本,很多都是上午发布,下午就放进了操作系统,没有经过兼容性测试,系统跑到崩溃是家常便饭!
      测试版 推荐
            相当稳定,效率与稳定取得了完美的平衡,软件也基本比较新,兼容性良好
      下载地址
            http://cdimage.debian.org/cdimage/weekly-builds/
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!