<p>I wrote a solution to this problem two days ago:</p>

<h2>How to use p2pool with an accompanying standalone bitcoind</h2>

<p><em>(since the windows gui version of bitcoin 0.5.1 crashes frequently when used with p2pool)</em></p>

<h3>Assumptions:</h3>

<p><strong>OS</strong>: Windows 7</p>

<p><strong>Bitcoin</strong>: Latest stable release installed and working - <a href="http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.5.1/bitcoin-0.5.1-win32-setup.exe/download" rel="nofollow">http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.5.1/bitcoin-0.5.1-win32-setup.exe/download</a></p>

<p><strong>p2pool</strong>: you'll be slightly off the beaten path with this
   configuration as you're specifying the bitcoin address to send
   generated bitcoins and not using the second bitcoin processes wallet</p>

<ol>
<li><p>Download latest current p2pool code and extract to
"%programfiles%\p2pool" -
<a href="https://github.com/forrestv/p2pool/zipball/master" rel="nofollow">https://github.com/forrestv/p2pool/zipball/master</a></p></li>
<li><p>Download and install latest Python 2.7 (if you get 64bit, you'll need
64bit versions of the packages below) -
<a href="http://www.python.org/download/" rel="nofollow">http://www.python.org/download/</a></p></li>
<li><p>Download and install python extension package twisted -
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted</a></p></li>
<li><p>Download and install python extension package zope.interface -
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#zope.interface" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/#zope.interface</a></p></li>
<li><p>Download and install python extension package pil -
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil</a></p></li>
<li><p>Download and install python extension package pygame -
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil</a></p></li>
<li><p>Open your Bitcoin GUI client if it is not running and generate a new
address, take note of the generated address and close your Bitcoin
GUI client</p></li>
<li><p>Edit your existing "%appdata%\bitcoin\bitcoin.conf" and unless you
know what you're doing, change what ever is there to this and if the
file does not exist - create it:</p>

<pre><code>logtimestamps=1
</code></pre></li>
<li><p>Create the folder "%programfiles%\p2pool\bitcoind-data"</p></li>
<li><p>Create "%programfiles%\p2pool\bitcoind-data\bitcoin.conf" with your
 favorite text editor and populate it with this:</p>

<pre><code>server=1
logtimestamps=1
port=18333
rpcport=18332
rpcuser=bitcoinusername
rpcpassword=bitcoinpassword
rpcallowip=*
</code></pre></li>
<li><p>Take note of the folder name of the latest current p2pool code - it
 is in "%programfiles%\p2pool"</p></li>
<li><p>Create "%programfiles%\p2pool\p2pool.cmd" with your favorite text
 editor and populate it with this:</p>

<pre><code>@echo off
title p2pool
echo.
echo running p2pool ...
echo.
C:\Python27\python.exe "%programfiles%\p2pool\folder-name-of-the-latest-current-p2pool-code\run_p2pool.py" --net bitcoin --address yourbitcoinaddresshere --bitcoind-address 127.0.0.1 --bitcoind-rpc-port 18332 --bitcoind-p2p-port 18333 bitcoinusername bitcoinpassword
echo.
echo p2pool stopped.
echo.
pause
</code></pre></li>
<li><p>eg.</p>

<pre><code>@echo off
title p2pool
echo.
echo running p2pool ...
echo.
C:\Python27\python.exe "%programfiles%\p2pool\forrestv-p2pool-4f6c2e2\run_p2pool.py" --net bitcoin --address 12uN6G1uAtn7G29qfTdLD9des4y63Whr61 --bitcoind-address 127.0.0.1 --bitcoind-rpc-port 18332 --bitcoind-p2p-port 18333 bitcoinusername bitcoinpassword
echo.
echo p2pool stopped.
echo.
pause
</code></pre></li>
<li><p>Create "%programfiles%\p2pool\bitcoind.cmd" with your favorite text
editor and populate it with this:</p>

<pre><code>@echo off
title bitcoind
echo.
if exist "%programfiles%\bitcoin\daemon\bitcoind.exe" (set programfilesx86=0)
if exist "%programfiles(x86)%\bitcoin\daemon\bitcoind.exe" (set programfilesx86=1)
if %programfilesx86%==0 (goto :programfiles)
if %programfilesx86%==1 (goto :programfilesx86)
echo ERROR! bitcoind.exe not found in either "%programfiles%\bitcoin\daemon\" or "%programfiles(x86)%\bitcoin\daemon\" - giving up!
echo.
pause
goto:eof
:programfiles
echo running bitcoind.exe from "%programfiles%\Bitcoin\daemon\" ...
"%programfiles%\Bitcoin\daemon\bitcoind.exe" -datadir="%programfiles%\p2pool\bitcoind-data"
echo.
echo bitcoind stopped.
echo.
pause
goto:eof
:programfilesx86
echo running bitcoind.exe from "%programfiles(x86)%\Bitcoin\daemon\" ...
"%programfiles(x86)%\Bitcoin\daemon\bitcoind.exe" -datadir="%programfiles%\p2pool\bitcoind-data"
echo.
echo bitcoind stopped.
echo.
pause
</code></pre></li>
<li><p>List item</p></li>
<li><p>Copy blk*.dat from %appdata%\bitcoin to
 %programfiles%\p2pool\bitcoind-data</p>

<pre><code>Run "%programfiles%\p2pool\bitcoind.cmd"
Run "%programfiles%\p2pool\p2pool.cmd"
</code></pre></li>
</ol>

<p>You should now be able to mine on your machine to 127.0.0.1:9332 or to your machines IP on port 9332 on your LAN :)</p>

CC BY-SA 3.0
2012-01-19T09:43:57.247Z
2012-01-19T09:43:57.247Z
c_k
<p>I wanted to try out P2Pool mining, so I installed the newest Bitcoin (0.5.2, also tried it with 0.5.1).</p>

<p>Unfortunately when I start run_p2pool.exe it immediately crashes my Bitcoin!</p>

<p>My OS: Win7 x64</p>

<p>Any ideas?</p>

CC BY-SA 3.0
2012-01-19T06:57:59.090Z
Please drop by #p2pool channel on freenode IRC and the friendly folks there will try to help you out.
nanotube
CC BY-SA 3.0
2012-01-19T07:51:19.843Z
Could you post the specific error(s) you get? It's very difficult to troubleshoot via telepathy ;)
David Perry
CC BY-SA 3.0
2012-01-19T08:28:08.333Z
Before my edit, I read the title as "Something that P2Pool did made the Bitcoin market crash" :)
ripper234
CC BY-SA 3.0
2012-01-19T09:06:33.933Z
It seems I had to wait for my Bitcoin to fully synchronize with the network. After that it didn't crash any more.

IMHO bitcoin-qt.exe should not just crash in a case like this.
Frizz
CC BY-SA 3.0
2012-02-13T13:31:27.127Z
Did you report this as a bug in the Bitcoin bug tracker?  ( https://github.com/bitcoin/bitcoin/issues/new ).  p2pool shouldn't be able to make bitcoind crash, whatever it tries to do.  Rather than working around this by using a weird configuration we should attempt to fix the underlying problem.
Chris Moore
CC BY-SA 3.0
2012-02-13T13:40:12.980Z
If I try running p2pool while bitcoin-qt 0.5.2 is downloading blocks on linux, I see an exception in the p2pool output, ending with "p2pool.util.jsonrpc.Error: -10 Bitcoin is downloading blocks...".  If I run "bitcoind getwork" on the command line, I see: 'error: {"code":-10,"message":"Bitcoin is downloading blocks..."}'.  I guess the first thing I'd try if any of my computers had Windows on them would be to run "bitcoind.exe getwork" while bitcoin-qt.exe is downloading blocks and see if that causes it to crash too.
Chris Moore
<mining-pools><p2pool><mining-software>
P2Pool crashes the Bitcoin client
Frizz
# P2Pool crashes the Bitcoin client

(Asked by: username_0 on 2012-01-19)

I wanted to try out P2Pool mining, so I installed the newest Bitcoin (0.5.2, also tried it with 0.5.1).

Unfortunately when I start run\_p2pool.exe it immediately crashes my Bitcoin!

My OS: Win7 x64

Any ideas?

**Tags:** mining-pools, p2pool, mining-software

> **Comments:**
> **username_1**: Please drop by #p2pool channel on freenode IRC and the friendly folks there will try to help you out.  
> **username_2**: Could you post the specific error(s) you get? It's very difficult to troubleshoot via telepathy ;)  
> **username_3**: Before my edit, I read the title as "Something that P2Pool did made the Bitcoin market crash" :)  
> **username_0**: It seems I had to wait for my Bitcoin to fully synchronize with the network. After that it didn't crash any more.  IMHO bitcoin-qt.exe should not just crash in a case like this.  
> **username_4**: Did you report this as a bug in the Bitcoin bug tracker?  ( https://github.com/bitcoin/bitcoin/issues/new ).  p2pool shouldn't be able to make bitcoind crash, whatever it tries to do.  Rather than working around this by using a weird configuration we should attempt to fix the underlying problem.  
> **username_4**: If I try running p2pool while bitcoin-qt 0.5.2 is downloading blocks on linux, I see an exception in the p2pool output, ending with "p2pool.util.jsonrpc.Error: -10 Bitcoin is downloading blocks...".  If I run "bitcoind getwork" on the command line, I see: 'error: {"code":-10,"message":"Bitcoin is downloading blocks..."}'.  I guess the first thing I'd try if any of my computers had Windows on them would be to run "bitcoind.exe getwork" while bitcoin-qt.exe is downloading blocks and see if that causes it to crash too.  

---

## 1 answers

### Answer by username_5 on 2012-01-19. Score: 2

I wrote a solution to this problem two days ago:
How to use p2pool with an accompanying standalone bitcoind
(since the windows gui version of bitcoin 0.5.1 crashes frequently when used with p2pool)
Assumptions:
OS: Windows 7
Bitcoin: Latest stable release installed and working - http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.5.1/bitcoin-0.5.1-win32-setup.exe/download
p2pool: you'll be slightly off the beaten path with this
   configuration as you're specifying the bitcoin address to send
   generated bitcoins and not using the second bitcoin processes wallet

Download latest current p2pool code and extract to
"%programfiles%\p2pool" -
https://github.com/forrestv/p2pool/zipball/master
Download and install latest Python 2.7 (if you get 64bit, you'll need
64bit versions of the packages below) -
http://www.python.org/download/
Download and install python extension package twisted -
http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
Download and install python extension package zope.interface -
http://www.lfd.uci.edu/~gohlke/pythonlibs/#zope.interface
Download and install python extension package pil -
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
Download and install python extension package pygame -
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
Open your Bitcoin GUI client if it is not running and generate a new
address, take note of the generated address and close your Bitcoin
GUI client
Edit your existing "%appdata%\bitcoin\bitcoin.conf" and unless you
know what you're doing, change what ever is there to this and if the
file does not exist - create it:
logtimestamps=1

Create the folder "%programfiles%\p2pool\bitcoind-data"
Create "%programfiles%\p2pool\bitcoind-data\bitcoin.conf" with your
 favorite text editor and populate it with this:
server=1
logtimestamps=1
port=18333
rpcport=18332
rpcuser=bitcoinusername
rpcpassword=bitcoinpassword
rpcallowip=*

Take note of the folder name of the latest current p2pool code - it
 is in "%programfiles%\p2pool"
Create "%programfiles%\p2pool\p2pool.cmd" with your favorite text
 editor and populate it with this:
@echo off
title p2pool
echo.
echo running p2pool ...
echo.
C:\Python27\python.exe "%programfiles%\p2pool\folder-name-of-the-latest-current-p2pool-code\run_p2pool.py" --net bitcoin --address yourbitcoinaddresshere --bitcoind-address 127.0.0.1 --bitcoind-rpc-port 18332 --bitcoind-p2p-port 18333 bitcoinusername bitcoinpassword
echo.
echo p2pool stopped.
echo.
pause

eg.
@echo off
title p2pool
echo.
echo running p2pool ...
echo.
C:\Python27\python.exe "%programfiles%\p2pool\forrestv-p2pool-4f6c2e2\run_p2pool.py" --net bitcoin --address 12uN6G1uAtn7G29qfTdLD9des4y63Whr61 --bitcoind-address 127.0.0.1 --bitcoind-rpc-port 18332 --bitcoind-p2p-port 18333 bitcoinusername bitcoinpassword
echo.
echo p2pool stopped.
echo.
pause

Create "%programfiles%\p2pool\bitcoind.cmd" with your favorite text
editor and populate it with this:
@echo off
title bitcoind
echo.
if exist "%programfiles%\bitcoin\daemon\bitcoind.exe" (set programfilesx86=0)
if exist "%programfiles(x86)%\bitcoin\daemon\bitcoind.exe" (set programfilesx86=1)
if %programfilesx86%==0 (goto :programfiles)
if %programfilesx86%==1 (goto :programfilesx86)
echo ERROR! bitcoind.exe not found in either "%programfiles%\bitcoin\daemon\" or "%programfiles(x86)%\bitcoin\daemon\" - giving up!
echo.
pause
goto:eof
:programfiles
echo running bitcoind.exe from "%programfiles%\Bitcoin\daemon\" ...
"%programfiles%\Bitcoin\daemon\bitcoind.exe" -datadir="%programfiles%\p2pool\bitcoind-data"
echo.
echo bitcoind stopped.
echo.
pause
goto:eof
:programfilesx86
echo running bitcoind.exe from "%programfiles(x86)%\Bitcoin\daemon\" ...
"%programfiles(x86)%\Bitcoin\daemon\bitcoind.exe" -datadir="%programfiles%\p2pool\bitcoind-data"
echo.
echo bitcoind stopped.
echo.
pause

List item
Copy blk*.dat from %appdata%\bitcoin to
 %programfiles%\p2pool\bitcoind-data
Run "%programfiles%\p2pool\bitcoind.cmd"
Run "%programfiles%\p2pool\p2pool.cmd"


You should now be able to mine on your machine to 127.0.0.1:9332 or to your machines IP on port 9332 on your LAN :)


---

