Stacks.js: Updated CLI getting python exception.

Created on 20 Aug 2016  路  13Comments  路  Source: blockstack/stacks.js

Hi guys, not sure if I'm missing a setting here. Just updated the CLI (OSX) and I'm getting this exception:

Traceback (most recent call last):
  File "/usr/local/bin/blockstack", line 57, in <module>
    res = configure(interactive=False, force=False)
  File "/usr/local/lib/python2.7/site-packages/blockstack_client/config.py", line 593, in configure
    raise Exception("No blockchain reader given")
Exception: No blockchain reader given

Any ideas how to fix this?

All 13 comments

It seems you have a broken config file(~/.blockstack/client.ini).

You need to specify blockchain_reader there in client section and add blockchain_reader section

It would be really helpful to drop here your current config (dont forget to remove passwords from there before posting)

These are my current settings on ~/.blockstack/client.ini

I haven't modified this at all.

[blockstack-client]
server = server.blockstack.org
port = 6264
metadata = /Users/santisiri/.blockstack/metadata
storage_drivers = dht
blockchain_headers = /Users/santisiri/.blockstack/blockchain-headers.dat
advanced_mode = false
dht_mirror = mirror.blockstack.org
dht_mirror_port = 6266
rpc_token = [a long hash displayed here]

Hi, I got same error on Ubuntu 16.04.1 LTS. My client.ini is untouched.

[blockstack-client]
server = server.blockstack.org
port = 6264
metadata = /home/syck/.blockstack/metadata
storage_drivers = disk,dht
blockchain_headers = /home/syck/.blockstack/blockchain-headers.dat
advanced_mode = false
dht_mirror = mirror.blockstack.org
dht_mirror_port = 6266
rpc_token = -removed- 

This error is triggered any command like this:

****@****:~$ blockstack balance
Traceback (most recent call last):
  File "/usr/local/bin/blockstack", line 57, in <module>
    res = configure(interactive=False, force=False)
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/config.py", line 588, in configure
    raise Exception("No blockchain reader given")
Exception: No blockchain reader given

I'll reply within 2 hours with right client.ini for you both.
And will try to give explanations

@santisiri

First, make a registration in Blockcypher (https://www.blockcypher.com) and receive api token from them. They provide a SaaS API for Bitcoin's Blockchain.
It's not necessity, other options are:

  • use your own bitcoin full node (with txIndex=1 enabled);
  • use Blockstack's bitcoin full node;
  • use other full bitcoin node trusted by you;
    (if you want one of these options, reply, will help with config).
[blockstack-client]
server = node.blockstack.org
port = 6264
queue_path = /Users/santisiri/.blockstack/queues.db
metadata = /Users/santisiri/.blockstack/metadata
storage_drivers = disk,blockstack_resolver,blockstack_server,http,dht
storage_drivers_required_write = disk,blockstack_server
blockchain_headers = /Users/santisiri/.blockstack/blockchain-headers.dat
advanced_mode = false
dht_mirror = mirror.blockstack.org
dht_mirror_port = 6266
rpc_token = <your_rpc_token>
blockchain_reader = blockcypher
blockchain_writer = blockcypher
rpc_detach = True
api_endpoint_port = 6270
poll_interval = 300
path = /Users/santisiri/.blockstack/client.ini
dir = /Users/santisiri/.blockstack

[blockchain-reader]
utxo_provider = blockcypher
api_token = <your_blockcypher_api_token>

[blockchain-writer]
utxo_provider = blockcypher
api_token = <your_blockcypher_api_token>

Another way is to run
blockstack configure and put config params interactively

@syck

You also need to get blockcypher registration in order to gain api token. It's free unless 200 requests/hour.

[blockstack-client]
rpc_token = <your_rpc_token>
queue_path = /home/syck/.blockstack/queues.db
blockchain_reader = blockcypher
rpc_detach = True
advanced_mode = False
blockchain_writer = blockcypher
poll_interval = 300
server = node.blockstack.org
port = 6264
path = /home/syck/.blockstack/client.ini
storage_drivers_required_write = disk,blockstack_server
api_endpoint_port = 6270
storage_drivers = disk,blockstack_resolver,blockstack_server,http,dht
client_version = 0.0.13.14
metadata = /home/syck/.blockstack/metadata
email = 
dir = /home/syck/.blockstack
blockchain_headers = /home/syck/.blockstack/blockchain-headers.dat

[blockchain-reader]
utxo_provider = blockcypher
api_token = <your_blockcypher_api_token>

[blockchain-writer]
utxo_provider = blockcypher
api_token = <your_blockcypher_api_token>

@santisiri @syck
if you don't want to use 3rd party api for blockchain, you can use your own full bitcoin node (but you need to import there keys from blockstack's cli), or Blockstack's bitcoin full node:

[blockstack-client]
....
blockchain_reader = bitcoind_utxo
blockchain_writer = bitcoind_utxo
....

[blockchain-reader]
utxo_provider = bitcoind_utxo
rpc_username = <bitcoin_server_rpc_username>
timeout = 300.0
mock = False
rpc_password = <bitcoin_server_rpc_password>
port = <bitcoin_server_port>
use_https = False
server = <bitcoin_server_ip>

[blockchain-writer]
utxo_provider = bitcoind_utxo
rpc_username = <bitcoin_server_rpc_username>
timeout = 300.0
mock = False
rpc_password = <bitcoin_server_rpc_password>
port = <bitcoin_server_port>
use_https = False
server = <bitcoin_server_ip>

Also I need to point out that I'm not a part of Blockstack's dev team - just trying to help :)

@aagorelik Thank you! The blockcypher token based config worked for me.

Thx and regards,
s

Hi @aagorelik, thanks for the great help!

I created the blockcypher account and got my token and modified client.ini according to your suggestion, but after saving the file and running blockstack again got the following message

{
    "error": "Invalid configuration file:  != 0.0.13.21",
    "help": "Your configuration file (/Users/santisiri/.blockstack/client.ini) is out of date.  Please move it and try again in order to automatically generate a new config file."
}

upon further inspection, looks like blockstack adds specific settings on client.ini that weren't part of my edit:

[bitcoind]
mock = False
passwd = blockstacksystem
server = bitcoin.blockstack.com
user = blockstack
timeout = 300
port = 8332
use_https = False

I'm running bitcoind as we speak, not sure if this outcome has something to do with that. currently downloading the blockchain still at block height ~392K. will try again with your suggestion to connect directly to my bitcoin node (both are running on same server).

update:

Removed ~/.blockstack/client.ini and ran blockstack again, now it's working fine.

@santisiri don't forget to have

txindex=1

in your bitcoin.conf or it won't work that way.
If you don't have this flag right now, it will take another one full indexation for bitcoind.

@aagorelik duly noted, tnx for the help!

This issue looks like it has been resolved, thanks to @aagorelik :) I'm going to go ahead and close it. Please re-open if the problem persists.

Was this page helpful?
0 / 5 - 0 ratings