BlockStack : How can i setup a blockstack full node (not testnet)

BlockStack : How can i setup a blockstack full node (not testnet)?

@jwiley could you give @vishalgupta96 some pointers?

Sure!
The easiest way is to follow the instructions here: https://github.com/blockstack/stacks-blockchain/tree/stacks-1.0#Installing-Blockstack-Core

If you have more specific questions or you want to run this in a particular way, please let me know and i’ll follow up with some more details.

Hi @jwiley… Thanks… i am already following the same link and setting up blockstack core using docker. I have taken docker image from docker hub and followed the below steps to set it up:

$ git clone [email protected]:blockstack/blockstack-core.git
$ cd blockstack-core
$ docker build -t blockstack-core:master .

# create directory to store Blockstack Core state
$ export BLOCKSTACK_DIR="/var/blockstack-core-data"
$ mkdir -p "$BLOCKSTACK_DIR"
$ docker run \
   -v $BLOCKSTACK_DIR:/root/.blockstack-server \
   -p 6264:6264 \
   -p 6270:6270 \
   blockstack-core:master

But i am unable to follow the further steps as mentioned below:

Before doing anything, you should configure your Blockstack Core node.
$ blockstack-core configure

When i am running this from inside the blockstack docker container which i have made up using above docker run command... it is unable to recognize "blockstack".
blockstack-core configure
    blockstack-core: not found

Below are the docker container logs -- 
INFO [1603111607.223] [testnet/stacks-node/src/run_loop/neon.rs:120] [ThreadId(1)] Follower node: starting up
ERROR [1603111607.244] [src/chainstate/stacks/index/storage.rs:1550] [ThreadId(1)] Not found (no file is open)
INFO [1603111607.244] [src/chainstate/stacks/index/marf.rs:216] [ThreadId(1)] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
ERROR [1603111737.918] [src/burnchains/bitcoin/network.rs:208] [ThreadId(1)] Failed to connect to peer 35.236.218.197:18444: connection to peer could not be (re-)established

Could you help what should I do further to have it working? Also I assume that this would be connecting to mainnet (not testnet).. is this understanding correct?

Thanks!
I’ll have to look over what’s going on here and get back to you with some specific instructions

Essentially what is going on here is that the readme you were looking at is outdated as work continues on v2 of the stacks blockchain.

I’ll give you 2 options for running the current (v1) mainnet (not the v2 testnet, as your logs above are showing).

  1. basically, the commands are nearly identical, but we’re using a specific branch stacks-1.0
git clone https://github.com/blockstack/stacks-blockchain --branch stacks-1.0 --single-branch
cd stacks-blockchain
docker build -t blockstack-core:master .

# create directory to store Blockstack Core state
export BLOCKSTACK_DIR="/tmp/blockstack-core-data"
mkdir -p "$BLOCKSTACK_DIR"
docker run \
  -e BLOCKSTACK_ATLAS_SEEDS="seed.blockstack.xyz:6264"
  -v $BLOCKSTACK_DIR:/root/.blockstack-server \
  -p 6264:6264 \
  -p 6270:6270 \
blockstack-core:master
  1. running a public container - this option will be a bit faster, and is the current version that we run for the PBC today.
docker run -d \
  -e BLOCKSTACK_ATLAS_SEEDS="seed.blockstack.xyz:6264"
  -v $BLOCKSTACK_DIR:/root/.blockstack-server \
  -p 6264:6264 \
  -p 6270:6270 \
quay.io/blockstack/blockstack-core:v22.0.0.0

In both cases, I recommend using the env var BLOCKSTACK_ATLAS_SEEDS="seed.blockstack.xyz:6264", since this will talk initially to a cluster of nodes that we’re running (you don’t have to use this at all - but it might make initial syncs a little faster).

Either option I’ve outlined should work for you, and if you want to run the api etc, please let me know and I can help you with that if you’re so inclined.

@jwiley … Thanks a lot for the help. I have used option 2 and converted docker run command into a compose file and started the node. It seems that it is able to connect to mainnet:1.0.
Do I still need to perform below actions after starting the node as mentioned on the URL:

$ blockstack-core configure
$ blockstack-core --debug fast_sync
$ blockstack-core --debug start

When i am trying some of the below APIs to see if it is syncing or not then i am unable to getting “(56) Recv failure: Connection reset by peer”.

I am using below APIs:

curl http://localhost:6270/v1/ping
curl http://localhost:6270/v1/names/muneeb.id
curl http://localhost:6270/extended/v1/block/{block_hash}
curl http://localhost:6270/extended/v1/block

I am actually confused which APIs should i use for mainnet:1.0. There are different set of APIs available on different links. Could you clarify for below URLs , which one i should use for which version:

https://blockstack.github.io/stacks-blockchain-api/#operation
https://core.blockstack.org/#account-operations
https://blockstack.github.io/stacks-blockchain-api/

Thanks again in advance!

It would be super helpful if you could share your compose file here (minus anything sensitive etc-just be sure to note what the data should be so i can replicate it).

I can confirm though that if the sync is not done, the port will not be open.
I can’t say the timing of how long a sync takes but if you give it a lot of resources it can take 20-30 minutes when using fast-sync.

Sure @jwiley. Below is the compose file:

version: '2'
services:
    node:
        image: quay.io/blockstack/blockstack-core:v22.0.0.0
        ports:
            - "6264:6264"
            - "6270:6270"
        environment:
            - BLOCKSTACK_ATLAS_SEEDS=seed.blockstack.xyz:6264
        volumes:
            - /{system path}/data:/root/.blockstack-server

Could you tell me which RPC i can use for checking the latest sync block of the node and also which set of RPCs (out of above 3 links)… i should use to query from this node.

Hi @jwiley… I just checked the node logs and it seems that it is stopping after a point of time. Below are the logs, can we find what’s wrong here?

[2020-10-22 04:37:30,522] [DEBUG] [indexer:722] (11.139652107142976) Restoring '/root/.blockstack-server/backups/subdomains.db.bak.653615' to '/root/.blockstack-server/subdomains.db'
[2020-10-22 04:37:31,689] [DEBUG] [indexer:722] (11.139652107142976) Restoring '/root/.blockstack-server/backups/subdomains.db.queue.bak.653615' to '/root/.blockstack-server/subdomains.db.queue'
[2020-10-22 04:37:31,690] [DEBUG] [indexer:278] (11.139652107142976) Restored state from 653615
[2020-10-22 04:37:31,756] [DEBUG] [namedb:91] (11.139652107142976) Connect to database '/root/.blockstack-server/blockstack-server.db'
[2020-10-22 04:37:31,758] [DEBUG] [session:104] (11.139652107142976) [11] Connect to bitcoind at http://[email protected]:8332, timeout=300.0
Synchronizing from snapshot from http://fast-sync-20.blockstack.org/snapshot.bsk.  This may take up to 15 minutes.
Verify 920790928 bytes
Restored to /root/.blockstack-server
[2020-10-22 04:38:01,856] [ERROR] [indexer:1629] (11.139652107142976) timed out
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/indexer.py", line 1627, in get_index_range
    current_block = get_blockchain_height(blockchain_name, blockchain_client)
  File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/indexer.py", line 1612, in get_blockchain_height
    return get_bitcoin_blockchain_height(blockchain_client)
  File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/blockchain/bitcoin_blockchain/blocks.py", line 889, in get_bitcoin_blockchain_height
    current_block = int(bitcoind.getblockcount())
  File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 139, in __call__
    'Content-type': 'application/json'})
  File "/usr/lib/python2.7/httplib.py", line 1082, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1122, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1078, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 894, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 856, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 833, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
timeout: timed out
Traceback (most recent call last):
  File "/usr/local/bin/blockstack-core", line 4, in <module>
    __import__('pkg_resources').run_script('blockstack==22.0.0.0', 'blockstack-core')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 658, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1438, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/EGG-INFO/scripts/blockstack-core", line 42, in <module>
    run_blockstackd()
  File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/blockstack/blockstackd.py", line 3515, in run_blockstackd
    setup_recovery(working_dir)
  File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/blockstack/blockstackd.py", line 3012, in setup_recovery
    assert current_block, 'Failed to connect to bitcoind'
AssertionError: Failed to connect to bitcoind
/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
[2020-10-22 04:38:06,569] [DEBUG] [spv:104] (11.139979652884288) Using mainnet
[2020-10-22 04:38:06,693] [DEBUG] [blockstackd:2921] (11.139979652884288) Stripped argv: /usr/local/bin/blockstack-core fast_sync
[2020-10-22 04:38:06,693] [DEBUG] [blockstackd:2772] (11.139979652884288) Working dir: /root/.blockstack-server
[2020-10-22 04:38:06,694] [DEBUG] [config:2232] (11.139979652884288) Load config from '/root/.blockstack-server/blockstack-server.ini'
[2020-10-22 04:38:06,694] [DEBUG] [config:1981] (11.139979652884288) Using configuration-given Atlas hostname
[2020-10-22 04:38:06,694] [INFO] [config:1990] (11.139979652884288) Atlas IP address is (127.0.0.1, 6264)
[2020-10-22 04:38:06,696] [DEBUG] [blockstackd:2780] (11.139979652884288) config
{
    "bitcoind": {
        "bitcoind_p2p_port": 8333,
        "bitcoind_passwd": "blockstacksystem",
        "bitcoind_port": 8332,
        "bitcoind_regtest": false,
        "bitcoind_server": "bitcoin.blockstack.com",
        "bitcoind_spv_path": "/root/.virtualchain-spv-headers.dat",
        "bitcoind_timeout": 300.0,
        "bitcoind_user": "blockstack"
    },
    "blockstack": {
        "announcers": "judecn.id,muneeb.id,shea256.id",
        "atlas": true,
        "atlas_blacklist": "",
        "atlas_hostname": "127.0.0.1",
        "atlas_port": 6264,
        "atlas_seeds": "seed.blockstack.xyz:6264",
        "atlasdb_path": "/root/.blockstack-server/atlas.db",
        "backup_frequency": 144,
        "backup_max_age": 10008,
        "enabled": true,
        "rpc_port": 6264,
        "save_rejected": false,
        "server_version": "22.0.0.0",
        "subdomaindb_path": "/root/.blockstack-server/subdomains.db",
        "zonefiles": "/root/.blockstack-server/zonefiles"
    },
    "blockstack-api": {
        "api_host": "localhost",
        "api_port": 6270,
        "enabled": true,
        "indexer_url": "http://localhost:6264"
    }
}
[2020-10-22 04:38:06,700] [DEBUG] [fast_sync:471] (11.139979652884288) Fetch http://fast-sync-20.blockstack.org/snapshot.bsk to /root/.blockstack-server/.blockstack-fast-sync-cuw9Pp...
/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:446: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
  pubk = ec.EllipticCurvePublicNumbers.from_encoded_point(ec.SECP256K1(), pubk_uncompressed_hex.decode('hex')).public_key(default_backend())
[2020-10-22 04:38:31,312] [DEBUG] [fast_sync:259] (11.139979652884288) Try decompressing with native tools
[2020-10-22 04:38:31,323] [DEBUG] [fast_sync:265] (11.139979652884288) tar xf '/root/.blockstack-server/.blockstack-fast-sync-cuw9Pp' -C '/root/.blockstack-server'

Thanks for the update, i’ll look into your compose file.

As for the error, it’s pretty simple really - AssertionError: Failed to connect to bitcoind
The bitcoind host here is one that we run, and I suspect that you may just be timing out - I’ll look into that service on my end, but if you have a local btc host you’re welcome to update the config to use that.

Try running something like this to see how long it takes (or if it times out):

bitcoin-cli -rpcconnect=bitcoin.blockstack.com -rpcport=8332 -rpcuser=blockstack -rpcpassword=blockstacksystem getblockchaininfo | jq '.blocks'

ex:

$ bitcoin-cli \
>   -rpcconnect=bitcoin.blockstack.com \
>   -rpcport=8332 \
>   -rpcuser=blockstack \
>   -rpcpassword=blockstacksystem \
> getblockchaininfo | jq '.blocks'
653884

your compose file seems fine, but i’ve added a little to it:

version: '2'
services:
  node:
    image: quay.io/blockstack/blockstack-core:v22.0.0.0
    container_name: blockstack_core
    ports:
      - "6264:6264"
      - "6270:6270"
    environment:
      - BLOCKSTACK_ATLAS_SEEDS=seed.blockstack.xyz:6264
    volumes:
      - ./data:/root/.blockstack-server
      - ./blockstack-server.ini:/root/.blockstack-server/blockstack-server.ini
    networks:
      - blockstack
networks:
  blockstack:
    driver: bridge
    name: blockstack

you’ll notice the addition of a second volume - this is a custom config we can use (particularly if you need to change the bitcoin section).
the config i’m using is as follows:

[bitcoind]
passwd = blockstacksystem
regtest = False
spv_path = /root/.virtualchain-spv-headers.dat
server = bitcoin.blockstack.com
p2p_port = 8333
user = blockstack
timeout = 300
port = 8332

[blockstack]
subdomaindb_path = /root/.blockstack-server/subdomains.db
rpc_port = 6264
backup_max_age = 1
enabled = True
atlasdb_path = /root/.blockstack-server/atlas.db
atlas_blacklist =
atlas = True
backup_frequency = 144
zonefiles = /root/.blockstack-server/zonefiles
atlas_port = 6264
announcers = judecn.id,muneeb.id,shea256.id
server_version = 22.0.0.0

[blockstack-api]
indexer_url = http://localhost:6264
api_port = 6270
enabled = True
api_host = 0.0.0.0

I’m also using a dir local to the compose file, data. you could simply place the config file inside of that directory if you prefer as well.

If you still have the issues connecting to bitcoin.blockstack.com, you can try 2 things:

  1. change timeout = 300 to something like timeout = 600
  2. change the server to something closer to your geographic location, or on your own network if you have a node.

@vishalgupta96 did this changes I’ve suggested help you get this running?

Hi @jwiley … I am trying this now and will let you know if it works. Due to some time off, i could not try this. Thanks for the follow-up, i will let you know asap.

By that time, it would be really helpful if you can provide some help regarding the APIs question that i had mentioned above. I can see there are different set of APIs available but could not figure out, which one i should be able to use on this node (blockstack-core) and also would i be able to continue using these when Stacks:2.0 is released or what changes i am expected to do.
https://blockstack.github.io/stacks-blockchain-api/#operation https://core.blockstack.org/#account-operations https://blockstack.github.io/stacks-blockchain-api/

@jwiley … Hi , I have tried the above steps - I am able to start the docker container and it seems to be working fine. Below are the docker logs but still when I am using RPC for checking the node
(curl http://localhost:6270/v1/ping) but it says… “curl: (56) Recv failure: Connection reset by peer” :

docker logs -->
/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release. from cryptography.hazmat.backends import default_backend /usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release. from cryptography.hazmat.backends import default_backend /usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release. from cryptography.hazmat.backends import default_backend [2020-10-27 13:01:48,496] [DEBUG] [spv:104] (10.140463714588480) Using mainnet [2020-10-27 13:01:48,608] [DEBUG] [blockstackd:2921] (10.140463714588480) Stripped argv: /usr/local/bin/blockstack-core fast_sync [2020-10-27 13:01:48,608] [DEBUG] [blockstackd:2772] (10.140463714588480) Working dir: /root/.blockstack-server [2020-10-27 13:01:48,608] [DEBUG] [config:2232] (10.140463714588480) Load config from '/root/.blockstack-server/blockstack-server.ini' [2020-10-27 13:01:48,608] [DEBUG] [config:1774] (10.140463714588480) Using STUN servers to discover my public IP (set 'atlas_hostname' to a valid DNS name or IP address in the config file to override) [2020-10-27 13:02:39,555] [DEBUG] [config:1776] (10.140463714588480) Atlas host IP is None [2020-10-27 13:02:39,555] [WARNING] [config:1986] (10.140463714588480) No Atlas hostname could be determined, assuming 127.0.0.1 [2020-10-27 13:02:39,555] [INFO] [config:1990] (10.140463714588480) Atlas IP address is (127.0.0.1, 6264) [2020-10-27 13:02:39,556] [DEBUG] [blockstackd:2780] (10.140463714588480) config { "bitcoind": { "bitcoind_p2p_port": 8333, "bitcoind_passwd": "blockstacksystem", "bitcoind_port": 8332, "bitcoind_regtest": false, "bitcoind_server": "bitcoin.blockstack.com", "bitcoind_spv_path": "/root/.virtualchain-spv-headers.dat", "bitcoind_timeout": 300, "bitcoind_user": "blockstack" }, "blockstack": { "announcers": "judecn.id,muneeb.id,shea256.id", "atlas": true, "atlas_blacklist": "", "atlas_hostname": "127.0.0.1", "atlas_port": 6264, "atlas_seeds": "seed.blockstack.xyz:6264", "atlasdb_path": "/root/.blockstack-server/atlas.db", "backup_frequency": 144, "backup_max_age": 10008, "enabled": true, "rpc_port": 6264, "save_rejected": false, "server_version": "22.0.0.0", "subdomaindb_path": "/root/.blockstack-server/subdomains.db", "zonefiles": "/root/.blockstack-server/zonefiles" }, "blockstack-api": { "api_host": "localhost", "api_port": 6270, "enabled": true, "indexer_url": "http://localhost:6264" } } [2020-10-27 13:02:39,560] [DEBUG] [fast_sync:471] (10.140463714588480) Fetch http://fast-sync-20.blockstack.org/snapshot.bsk to /root/.blockstack-server/.blockstack-fast-sync-hBbIsq... /usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/ecdsalib.py:446: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point pubk = ec.EllipticCurvePublicNumbers.from_encoded_point(ec.SECP256K1(), pubk_uncompressed_hex.decode('hex')).public_key(default_backend()) [2020-10-27 13:03:05,841] [DEBUG] [fast_sync:259] (10.140463714588480) Try decompressing with native tools [2020-10-27 13:03:05,855] [DEBUG] [fast_sync:265] (10.140463714588480) tar xf '/root/.blockstack-server/.blockstack-fast-sync-hBbIsq' -C '/root/.blockstack-server'

Could you tell us if it seems to be working fine and how can i check if this node is working or not and latest block?

[2020-10-27 13:03:05,855] [DEBUG] [fast_sync:265] (10.140463714588480) tar xf '/root/.blockstack-server/.blockstack-fast-sync-hBbIsq' -C '/root/.blockstack-server'

It is indeed working as expected - this is the fast-sync process where your node is now decompressing a roughly 1GB tar file /root/.blockstack-server/.blockstack-fast-sync-hBbIsq

Because of the nature of the files in this archive, it can take a while to fully decompress (entirely dependent on how much system resources you’ve allocated to docker). The main issue with this decompression is the presence of many small files which are created.

Now, to sidestep this process…you’re more than welcome to use OS native tools to decompress the above archive (it may be faster if it has access to more resources).

When i tested this myself, it took several hours with 1 CPU and access to 4GB of RAM in docker.
But again, it’s entirely resource dependent - the more CPU you give it, the faster it will decompress.

Only after this decompression is complete will the ports become open (you’ll see this in the logs, once it progresses past that last log entry).

For most of these queries, you’ll simply translate them to your local instance.
One thing to note - the links you’ve shared are old. the newer page is at https://core.blockstack.org/

now, for specific operations we’ll use a simple example:
https://core.blockstack.org/#name-querying-get-name-info

To retrieve the name info from the above:
https://core.blockstack.org/v1/names/muneeb.id

Locally, this would translate to a query like this (assuming you’ve exposed 6270 to localhost):
http://localhost:6270/v1/names/muneeb.id

The majority of queries will work using the above format. And you’re also welcome to run queries against core.blockstack.org

Thanks @jwiley for API help.

Although, it is still not able to connect to bitcoind… pls see the logs below. I’hv tried both the options you provided, changing the timeout to 600 and changing the server also my local server which is running a bitcoin node. But it does not seem to work. Could you suggest, if i should increase to timeout even more in order to connect to bitcoin.blockstack.com:

[2020-10-27 14:53:28,887] [DEBUG] [db:365] (8.139795012372288) Grant 0 to 3BLsggc5i5GbsqwwgvjR2VnZanYydExwWP (originally: SM1MY43X1H2P1EH45E25B60RT52ARCVDHB0FZFCVB, metadata: c14f3bd4c3dfc85f8d7a8208ae76f01c97c4038159590cd3c78448d733a226b2) [2020-10-27 14:53:28,888] [DEBUG] [db:365] (8.139795012372288) Grant 0 to 3FUDUhmFZKgTnKiiQg5JkyrJaWCXCG9FPU (originally: SM2BJBZX8EREHZRET5AY512MS42W7WSFA8YC1MY9N, metadata: c14f3bd4c3dfc85f8d7a8208ae76f01c97c4038159590cd3c78448d733a226b2) [2020-10-27 14:53:28,888] [WARNING] [db:360] (8.139795012372288) Using unspendable address "unallocated" [2020-10-27 14:53:28,888] [DEBUG] [db:365] (8.139795012372288) Grant 453172121000000 to unallocated (originally: unallocated, metadata: 8f2a9f0b6cf0d91b2cbfa4f1a981cdbb777a47d0fc62bc1f15f8294952cc8bbb) [2020-10-27 14:53:28,983] [DEBUG] [indexer:314] (8.139795012372288) Setup chain state in /root/.blockstack-server [2020-10-27 14:53:29,045] [DEBUG] [indexer:370] (8.139795012372288) CHAINSTATE: INSERT INTO snapshots (block_id,consensus_hash,ops_hash,timestamp) VALUES ( 373597, '17ac43c1d8549c3181b200f1bf97eb7d', None, 1603810409); '' [2020-10-27 14:53:29,068] [DEBUG] [indexer:370] (8.139795012372288) CHAINSTATE: INSERT INTO snapshots (block_id,consensus_hash,ops_hash,timestamp) VALUES ( 373598, '17ac43c1d8549c3181b200f1bf97eb7d', None, 1603810409); '' [2020-10-27 14:53:29,090] [DEBUG] [indexer:370] (8.139795012372288) CHAINSTATE: INSERT INTO snapshots (block_id,consensus_hash,ops_hash,timestamp) VALUES ( 373599, '17ac43c1d8549c3181b200f1bf97eb7d', None, 1603810409); '' [2020-10-27 14:53:29,109] [DEBUG] [indexer:370] (8.139795012372288) CHAINSTATE: INSERT INTO snapshots (block_id,consensus_hash,ops_hash,timestamp) VALUES ( 373600, '17ac43c1d8549c3181b200f1bf97eb7d', None, 1603810409); '' [2020-10-27 14:53:29,132] [DEBUG] [indexer:722] (8.139795012372288) Restoring '/root/.blockstack-server/backups/blockstack-server.db.bak.654335' to '/root/.blockstack-server/blockstack-server.db' [2020-10-27 14:53:35,529] [DEBUG] [indexer:722] (8.139795012372288) Restoring '/root/.blockstack-server/backups/blockstack-server.snapshots.bak.654335' to '/root/.blockstack-server/blockstack-server.snapshots' [2020-10-27 14:53:44,695] [DEBUG] [indexer:722] (8.139795012372288) Restoring '/root/.blockstack-server/backups/atlas.db.bak.654335' to '/root/.blockstack-server/atlas.db' [2020-10-27 14:53:44,728] [DEBUG] [indexer:722] (8.139795012372288) Restoring '/root/.blockstack-server/backups/subdomains.db.bak.654335' to '/root/.blockstack-server/subdomains.db' [2020-10-27 14:53:45,941] [DEBUG] [indexer:722] (8.139795012372288) Restoring '/root/.blockstack-server/backups/subdomains.db.queue.bak.654335' to '/root/.blockstack-server/subdomains.db.queue' [2020-10-27 14:53:46,796] [DEBUG] [indexer:278] (8.139795012372288) Restored state from 654335 [2020-10-27 14:53:47,002] [DEBUG] [namedb:91] (8.139795012372288) Connect to database '/root/.blockstack-server/blockstack-server.db' [2020-10-27 14:53:47,004] [DEBUG] [session:104] (8.139795012372288) [8] Connect to bitcoind at http://[email protected]:8332, timeout=600.0 [2020-10-27 14:54:17,125] [ERROR] [indexer:1629] (8.139795012372288) timed out Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/indexer.py", line 1627, in get_index_range current_block = get_blockchain_height(blockchain_name, blockchain_client) File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/indexer.py", line 1612, in get_blockchain_height return get_bitcoin_blockchain_height(blockchain_client) File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/blockchain/bitcoin_blockchain/blocks.py", line 889, in get_bitcoin_blockchain_height current_block = int(bitcoind.getblockcount()) File "/usr/local/lib/python2.7/dist-packages/virtualchain-20.0.1.0-py2.7.egg/virtualchain/lib/blockchain/bitcoin_blockchain/authproxy.py", line 139, in __call__ 'Content-type': 'application/json'}) File "/usr/lib/python2.7/httplib.py", line 1082, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1122, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 1078, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 894, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 856, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 833, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err timeout: timed out Traceback (most recent call last): File "/usr/local/bin/blockstack-core", line 4, in <module> Synchronizing from snapshot from http://fast-sync-20.blockstack.org/snapshot.bsk. This may take up to 15 minutes. Verify 921688191 bytes Restored to /root/.blockstack-server __import__('pkg_resources').run_script('blockstack==22.0.0.0', 'blockstack-core') File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 658, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1438, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/EGG-INFO/scripts/blockstack-core", line 42, in <module> run_blockstackd() File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/blockstack/blockstackd.py", line 3515, in run_blockstackd setup_recovery(working_dir) File "/usr/local/lib/python2.7/dist-packages/blockstack-22.0.0.0-py2.7.egg/blockstack/blockstackd.py", line 3012, in setup_recovery assert current_block, '**Failed to connect to bitcoind'** **AssertionError: Failed to connect to bitcoind**

try running this:

$ bitcoin-cli \
  -rpcconnect=bitcoin.blockstack.com \
  -rpcport=8332 \
  -rpcuser=blockstack \
  -rpcpassword=blockstacksystem \
getblockchaininfo | jq '.blocks'

which should output an int like: 654457

also try to netcat the host:
nc -vz bitcoin.blockstack.com 8332

The strange part here is that you’re able to download the 1GB tar archive without any issue, but when it comes to bitcoin you’re timing out.

I also see this as your config from previous log:

config { "bitcoind": { "bitcoind_p2p_port": 8333, "bitcoind_passwd": "blockstacksystem", "bitcoind_port": 8332, "bitcoind_regtest": false, "bitcoind_server": "bitcoin.blockstack.com", "bitcoind_spv_path": "/root/.virtualchain-spv-headers.dat", "bitcoind_timeout": 300, "bitcoind_user": "blockstack" },

Are you certain docker is using an updated config?
I don’t think increasing the timeout will help here - 600 is already 10 minutes for a timeout.

There is another scenario that could be possible here, but for that i’ll need to know your public ip via direct message.

Hi @jwiley … I am able to connect to my local bitcoin node and it seems that it has synced. But my node is getting stopped because of below error now. Any idea for this?

[2020-10-27 16:15:59,522] [DEBUG] [indexer:278] (10.140516374021952) Restored state from 654335
[2020-10-27 16:15:59,615] [DEBUG] [namedb:91] (10.140516374021952) Connect to database ‘/root/.blockstack-server/blockstack-server.db’
[2020-10-27 16:15:59,617] [DEBUG] [session:104] (10.140516374021952) [10] Connect to bitcoind at http://@:8332, timeout=600.0
Synchronizing from snapshot from http://fast-sync-20.blockstack.org/snapshot.bsk. This may take up to 15 minutes.
Verify 921688191 bytes
Restored to /root/.blockstack-server
Node synchronized! Node state written to /root/.blockstack-server
Start your node with blockstack-core start
Pass --debug for extra output.
sed: cannot rename /root/.blockstack-server/sedzpJR1W: Device or resource busy