Stacks Blockchain

Help strengthen the Stacks Blockchain while also making it easier/more efficient to access the data via API endpoints.

Software Included

Package Version License
stacks-blockchain GPLv3
stacks-blockchain-api 6.2.3 GPLv3

Creating an App using the Control Panel

Click the Deploy to DigitalOcean button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.

Deploy to DO

Creating an App using the API

In addition to creating a Droplet from the Stacks Blockchain 1-Click App using the control panel, you can also use the DigitalOcean API. As an example, to create a 4GB Stacks Blockchain Droplet in the SFO2 region, you can use the following curl command. You need to either save your API access token) to an environment variable or substitute it in the command below.

curl -X POST -H 'Content-Type: application/json' \
         -H 'Authorization: Bearer '$TOKEN'' -d \
        '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image": "stacksfoundation-stacksblockchain"}' \

Getting Started After Deploying Stacks Blockchain

Once droplet is launched, initial startup can take several minutes while BNS data is imported (this is a one time operation).

To keep track of the progress, you can ssh root@your_droplet_public_ipv4 to the host and run: /opt/stacks-blockchain-docker/ -n mainnet -a logs.

Once the stacks blockchain starts to sync with peers, application ports will open and nginx port 80 will now start proxying requests.

Use http://your_droplet_public_ipv4 to access the data directly, with output being similar to:

    "server_version": "stacks-blockchain-api v6.2.3 (master:77ab3ae2)",
    "status": "ready",
    "chain_tip": {
    "block_height": 16220,
        "block_hash": "0x3123fba9c0de6b569573494cf83c1d5d198a66bfd5f48ef97949b6bf11ba13be",
        "index_block_hash": "0xeec960fbbd6186b4ccac85ce12adba72be497d881f81e077305c90955b51a6ae"

All services are managed by a systemd unit file that is set to start on boot.

Manual control is also possible via the script at /opt/stacks-blockchain-docker/ on the host.

Full details on how to use the script is available here.