Bitcoin Forum
November 04, 2024, 07:55:18 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Problems with the linearize.py script  (Read 1183 times)
fturco (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 15, 2014, 10:30:22 AM
Last edit: April 15, 2014, 07:23:50 PM by fturco
 #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 <module>
    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
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1446



View Profile
April 15, 2014, 04: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)

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
fturco (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 15, 2014, 04: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...
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1446



View Profile
April 15, 2014, 04:57:24 PM
 #4

linearize.py gets blockchain data from bitcoin core using JSON-RPC calls. it does not read it from disk.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
fturco (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 16, 2014, 09: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.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1036



View Profile WWW
April 16, 2014, 10: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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!