Pricing error connecting to bitcoin regtest

hello, i am attempting to connect the blockstack-core node to a regtest bitcoind instance. Bitcoin is started in the regtest & server mode and blockstack-core is able index transactions. When i run blockstack pricing there is an error - unable to get fee estimate. The debug statements are posted below. Am i missing any other configuration here?

[2018-03-19 07:04:47,935] [ERROR] [fees:109] (3337.140593917351680)
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/fees.py”, line 87, in get_tx_fee_per_byte
fee = bitcoind_client.estimatefee(2)
File “/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py”, line 143, in call
response = self._get_response()
File “/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py”, line 185, in _get_response
http_response = self.__conn.getresponse()
File “/usr/local/lib/python2.7/httplib.py”, line 1108, in getresponse
raise ResponseNotReady()
ResponseNotReady
[2018-03-19 07:04:47,936] [ERROR] [fees:111] (3337.140593917351680) Failed to estimate tx fee per byte
[2018-03-19 07:04:47,936] [ERROR] [actions:627] (3337.140593917351680) Unable to calculate fee per byte
{
“error”: “Unable to get fee estimate”
}

Looks like one of two things:

  • the Blockstack CLI tool couldn’t connect to your permissioned Bitcoin node’s JSON-RPC port
  • you need a newer version of the requests package
1 Like

Hi @jude

We are able to use curl and fire getbalance and other methods using the same configuration we have in the blockstack-server and blockstack client.

Connect to bitcoind at http://“blockstack”@localhost:18443, timeout=300000.0
ubuntu@ip-20-1-1-171:~$ curl --data-binary ‘{“jsonrpc”:“1.0”,“id”:“curltext”,“method”:“getbalance”,“params”:[]}’ -H ‘content-type:text/plain;’ http://blockstack:blockstacksystem@localhost:18443
{“result”:5500.00000000,“error”:null,“id”:“curltext”}

However, domain pricing information does not yet appear. I think we are running Python 2.7.

@luckshas fyi

Thanks for posting more details!

Your bitcoind node is clearly up and taking requests. The ResponseNotReady() exception you’re seeing appears to be outside of Blockstack. But, it can be triggered by certain versions of the requests package, which Blockstack uses to talk to bitcoind. Can you tell me which version of requests you’re using?

@jude
it is 2.18.4
$ pip freeze|grep requests
requests==2.18.4

1 Like

Thanks for confirming!

I’m having a hard time duplicating the problem on my machine. Can you show me the output of running blockstack price with BLOCKSTACK_DEBUG=1 set in the environment?

Alternatively, does this work?

$ blockstack api start
$ curl http://localhost:6270/v1/prices/names/YOUR_NAME.id
$ curl http://localhost:6270/v1/prices/names/luxman.id
{"error": "Unable to get fee estimate"}

[2018-03-21 05:54:18,602] [DEBUG] [rpc:4130] (2311.139624152299264)
full path: /v1/prices/names/luxman.id
method: GET
path: /v1/prices/names/luxman.id
qs: {}
headers:
host: localhost:6270
accept: */*
user-agent: curl/7.47.0

[2018-03-21 05:54:18,603] [WARNING] [rpc:4141] (2311.139624152299264) Origin is absent or not local
[2018-03-21 05:54:18,604] [DEBUG] [rpc:4172] (2311.139624152299264) No authentication needed
[2018-03-21 05:54:18,608] [DEBUG] [proxy:95] (2311.139624152299264) Default proxy to http://localhost:16264
[2018-03-21 05:54:18,609] [DEBUG] [client:98] (2311.139624152299264) Connect to http://localhost:16264
[2018-03-21 05:54:18,611] [WARNING] [dropbox:188] (2311) Config file '/home/ubuntu/.blockstack/client.ini': section 'dropbox' is missing 'token'.  Write access will be disabled
[2018-03-21 05:54:18,612] [DEBUG] [client:116] (2311.139624152299264) Loaded storage drivers ['disk', 'gaia_hub', 'dropbox', 's3', 'blockstack_resolver', 'http', 'dht']
[2018-03-21 05:54:18,614] [DEBUG] [rpc:5779] (2311.139624152299264) RPC running (/home/ubuntu/.blockstack/api_endpoint.pid)
[2018-03-21 05:54:18,615] [DEBUG] [actions:730] (2311.139624152299264) Try to get wallet keys from API server
[2018-03-21 05:54:18,619] [DEBUG] [proxy:95] (2311.139624152299264) Default proxy to http://localhost:16264
[2018-03-21 05:54:18,620] [DEBUG] [client:98] (2311.139624152299264) Connect to http://localhost:16264
[2018-03-21 05:54:18,622] [WARNING] [dropbox:188] (2311) Config file '/home/ubuntu/.blockstack/client.ini': section 'dropbox' is missing 'token'.  Write access will be disabled
[2018-03-21 05:54:18,623] [DEBUG] [client:116] (2311.139624152299264) Loaded storage drivers ['disk', 'gaia_hub', 'dropbox', 's3', 'blockstack_resolver', 'http', 'dht']
[2018-03-21 05:54:18,624] [DEBUG] [session:189] (2297.139624152299264) Connect to bitcoind at localhost:18443 (/home/ubuntu/.blockstack/client.ini)
[2018-03-21 05:54:18,624] [DEBUG] [session:104] (2297.139624152299264) [2311] Connect to bitcoind at http://"blockstack"@localhost:18443, timeout=300000.0
[2018-03-21 05:54:18,876] [ERROR] [fees:109] (2297.139624152299264)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/fees.py", line 87, in get_tx_fee_per_byte
    fee = bitcoind_client.estimatefee(2)
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 143, in __call__
    response = self._get_response()
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 185, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/local/lib/python2.7/httplib.py", line 1108, in getresponse
    raise ResponseNotReady()
ResponseNotReady
[2018-03-21 05:54:18,876] [ERROR] [fees:111] (2297.139624152299264) Failed to estimate tx fee per byte
[2018-03-21 05:54:18,877] [ERROR] [actions:627] (2311.139624152299264) Unable to calculate fee per byte
127.0.0.1 - - [21/Mar/2018 05:54:18] "GET /v1/prices/names/luxman.id HTTP/1.1" 404 -
$ blockstack price luxman.id
[2018-03-21 06:08:21,611] [DEBUG] [spv:103] (7450.140127712511744) Using mainnet
[2018-03-21 06:08:21,748] [DEBUG] [client:98] (7450.140127712511744) Connect to http://localhost:16264
[2018-03-21 06:08:21,749] [WARNING] [storage:633] (7450.140127712511744) Storage implementation is missing a "get_immutable_handler" method
[2018-03-21 06:08:21,749] [WARNING] [storage:633] (7450.140127712511744) Storage implementation is missing a "put_immutable_handler" method
[2018-03-21 06:08:21,749] [WARNING] [storage:633] (7450.140127712511744) Storage implementation is missing a "delete_immutable_handler" method
[2018-03-21 06:08:21,749] [WARNING] [storage:633] (7450.140127712511744) Storage implementation is missing a "delete_mutable_handler" method
[2018-03-21 06:08:21,928] [WARNING] [dropbox:188] (7450) Config file '/home/ubuntu/.blockstack/client.ini': section 'dropbox' is missing 'token'.  Write access will be disabled
[2018-03-21 06:08:21,928] [DEBUG] [client:116] (7450.140127712511744) Loaded storage drivers ['disk', 'gaia_hub', 'dropbox', 's3', 'blockstack_resolver', 'http', 'dht']
[2018-03-21 06:08:21,929] [DEBUG] [rpc:5779] (7450.140127712511744) RPC running (/home/ubuntu/.blockstack/api_endpoint.pid)
[2018-03-21 06:08:21,929] [DEBUG] [actions:730] (7450.140127712511744) Try to get wallet keys from API server
[2018-03-21 06:08:21,929] [DEBUG] [rpc:5779] (7450.140127712511744) RPC running (/home/ubuntu/.blockstack/api_endpoint.pid)
[2018-03-21 06:08:21,932] [DEBUG] [rpc:5285] (7450.140127712511744) Connect to API at localhost:6270
[2018-03-21 06:08:21,943] [DEBUG] [rpc:4554] (7450.140127712511744) Remote API endpoint is running version 0.18.0
[2018-03-21 06:08:21,960] [DEBUG] [rpc:5285] (7450.140127712511744) Connect to API at localhost:6270
[2018-03-21 06:08:21,970] [DEBUG] [rpc:4554] (7450.140127712511744) Remote API endpoint is running version 0.18.0
[2018-03-21 06:08:21,985] [DEBUG] [session:189] (7450.140127712511744) Connect to bitcoind at localhost:18443 (/home/ubuntu/.blockstack/client.ini)
[2018-03-21 06:08:21,985] [DEBUG] [session:104] (7450.140127712511744) [7450] Connect to bitcoind at http://"blockstack"@localhost:18443, timeout=300000.0
[2018-03-21 06:08:22,236] [ERROR] [fees:109] (7450.140127712511744)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/fees.py", line 87, in get_tx_fee_per_byte
    fee = bitcoind_client.estimatefee(2)
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 143, in __call__
    response = self._get_response()
  File "/usr/local/lib/python2.7/site-packages/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 185, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/local/lib/python2.7/httplib.py", line 1108, in getresponse
    raise ResponseNotReady()
ResponseNotReady
[2018-03-21 06:08:22,237] [ERROR] [fees:111] (7450.140127712511744) Failed to estimate tx fee per byte
[2018-03-21 06:08:22,237] [ERROR] [actions:627] (7450.140127712511744) Unable to calculate fee per byte
{
    "error": "Unable to get fee estimate"
}

Interesting—you see how it’s trying to connect to http://"blockstack"@localhost:1443? If you look in your ~/.blockstack/client.ini file under the [bitcoind] section, do you have user = "blockstack" or user = blockstack (no quotes)? If you have quotes, can you try removing them? The value for user = is passed as the authentication username as a literal.

2 Likes

yeah i have corrected and that error is not coming up but again I am still unable to get the fee estimate . Could it be because of not enough transactions and blocks on regtest node for estimatefee to generate a fee?

1 Like