Author

Topic: Problems with the linearize.py script (Read 1164 times)

legendary
Activity: 1512
Merit: 1032
April 16, 2014, 06:19:59 AM
#6
If you want to download another copy of the blockchain through the Bitcoin network (which can be from another local bitcoin of yours), you can use https://github.com/jgarzik/pynode. It is a Python standalone Bitcoin node with limited functions. It has a script, mkbootstrap.py, which will also generate the torrent file.
newbie
Activity: 7
Merit: 0
April 16, 2014, 05:33:18 AM
#5
I finally managed to obtain the bootstrap.dat file. I had to:

  • create bitcoin.conf with server=1
  • set rpcuser/rpcpassword variables in both bitcoin.conf and linearize.cfg
  • set max_height=295000 in linearize.cfg
  • restart Bitcoin-Qt
  • run linearize.py

Thank you for the help.
legendary
Activity: 2058
Merit: 1431
April 15, 2014, 12:57:24 PM
#4
linearize.py gets blockchain data from bitcoin core using JSON-RPC calls. it does not read it from disk.
newbie
Activity: 7
Merit: 0
April 15, 2014, 12:40:10 PM
#3
I don't have a bitcoin.conf file in my home directory. I also don't understand what linearize.py is trying to connect to, as the blockchain data is on my hard disk. Should I run bitcoind instead of Bitcoin-Qt? Sorry but I'm quite confused...
legendary
Activity: 2058
Merit: 1431
April 15, 2014, 12:08:55 PM
#2
it should be pretty obvious
Quote
socket.error: [Errno 111] Connection refused

it probably means you don't have server=1 in bitcoin.conf (since you're running bitcoin-qt rather than bitcoind)
newbie
Activity: 7
Merit: 0
April 15, 2014, 06:30:22 AM
#1
Hello. I'm a new forum user, but have been using Bitcoin itself for a few months. I read here that I can obtain the bootstrap.dat file via Bittorrent, but since I already downloaded the blockchain data via Bitcoin-Qt I guess it's better to generate the file with the linearize.py script and then seed it. But I get the following error when running it:

Code:
Traceback (most recent call last):
  File "./linearize.py", line 130, in
    get_blocks(settings)
  File "./linearize.py", line 79, in get_blocks
    data = getblock(rpc, settings, height)
  File "./linearize.py", line 66, in getblock
    hash = rpc.getblockhash(n)
  File "./linearize.py", line 63, in getblockhash
    return self.rpc('getblockhash', [index])
  File "./linearize.py", line 41, in rpc
    'Content-type' : 'application/json' })
  File "/usr/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused

I don't know Python so I can't understand what's wrong. I just edited the max_height variable in example-linearize.cfg before running the script:

Code:
# bitcoind RPC settings
rpcuser=someuser
rpcpassword=somepassword
host=127.0.0.1
port=8332

# bootstrap.dat settings
netmagic=f9beb4d9
max_height=295000
output=bootstrap.dat
Jump to: