first, get the image ready:
git clone https://github.com/caisirius/p2pool
cd p2pool
docker build -t freecash/p2pool:0.1.snapshot .
cp fc.conf.sample fc.conf
then modify 'fc.conf': type the correct rpcuser and rpcpassword=xxx
modify 'run_docker.sh': modify the payout_address and fc_node_ip
note: fc_node_ip can not be 127.0.0.1 or localhost
start p2pool for mainnet:
./run_docker.sh mainnet
start p2pool for testnet:
./run_docker.sh testnet
if you want to stop p2pool:
./stop_docker.sh
view the log:
docker logs -n 50 -f freecash_p2pool
export log to a local file:
docker logs freecash_p2pool > fc_p2pool.log
To set the mining difficulty, you can modify the 'SANE_TARGET_RANGE' parameter in the 'p2pool/bitcoin/networks/freecash.py' file. The default value is 505000, you could change the last number '505000' of SANE_TARGET_RANGE to change the difficulty of miner shares.
Generic:
- Bitcoin >=0.11.1
- Python >=2.6
- Twisted >=10.0.0
- 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
Windows:
- Install Python 2.7
- Install Twisted
- Install Zope.Interface
- Install python win32 api
- Install python win32 api wmi wrapper
- Unzip the files into C:\Python27\Lib\site-packages
To use P2Pool, you must be running your own local bitcoind. For standard configurations, using P2Pool should be as simple as:
python run_p2pool.py
Then run your miner program, connecting to 127.0.0.1 on port 9332 with any username and password.
If you are behind a NAT, you should enable TCP port forwarding on your router. Forward port 9333 to the host running P2Pool.
Run for additional options.
python run_p2pool.py --help
1HNeqi3pJRNvXybNX4FKzZgYJsdTSqJTbk
https://en.bitcoin.it/wiki/P2Pool
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.
Linux:
cd litecoin_scrypt
sudo python setup.py install
Windows (mingw):
- Install MinGW: http://www.mingw.org/wiki/Getting_Started
- Install Python 2.7: http://www.python.org/getit/
In bash type this:
cd litecoin_scrypt
C:\Python27\python.exe setup.py build --compile=mingw32 install
Windows (Microsoft Visual C++)
- Open visual studio console
In bash type this:
SET VS90COMNTOOLS=%VS110COMNTOOLS% # For visual c++ 2012
SET VS90COMNTOOLS=%VS100COMNTOOLS% # For visual c++ 2010
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
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.
Litecoin's use of ports 9333 and 9332 conflicts with P2Pool running on the Bitcoin network. To avoid problems, add these lines to litecoin.conf and restart litecoind:
rpcport=10332
port=10333
Thanks to:
- The Bitcoin Foundation for its generous support of P2Pool
- The Litecoin Project for its generous donations to P2Pool