This repository contains resources for creating a standalone instance of the stacks-blockchain with postgres and the stacks-blockchain-api
⚠️ PR's Welcome for other providers
Common files used by all providers are located at the base of this repo, like files and scripts.
Specific configurations for each provider are located under the packer directory, with providers each having their own folder, like ./packer/digitalocean
.
To start adapting these templates for your own image, you can customize some variables in ./packer/<provider>/debian.json
:
apt_packages
lists the APT packages to install on the build Droplet.application_version
defines the stacks-blockchain versionimage_name
defines the name of the resulting snapshot, which by default is stacks-blockchain-X.X.X.X
with a UNIX timestamp appended.You can also modify these variables at runtime by using the -var
flag.
Note that the paths in the templates are set so that you'll need to invoke the packer
command from the root of this repo.
The scripts folder contains the scripts packer
uses to setup the host.
In 03-bns.sh, comment the following lines:
echo "=== Enable stacks-blockchain-api BNS data ==="
sed -i -e 's|# BNS_IMPORT_DIR|BNS_IMPORT_DIR|' /opt/stacks-blockchain-docker/.env
echo "=== Downloading BNS Data ==="
BNS_IMPORT_DIR="/opt/stacks-blockchain-docker/persistent-data/bns-data" /opt/stacks-blockchain-docker/scripts/setup-bns.sh
In 02-stacks-blockchain.sh, comment the following lines:
echo "=== Enable stacks-blockchain-api fungible metadata ==="
sed -i -e 's|# STACKS_API_ENABLE_FT_METADATA|STACKS_API_ENABLE_FT_METADATA|' /opt/stacks-blockchain-docker/.env
echo "=== Enable stacks-blockchain-api non-fungible metadata ==="
sed -i -e 's|# STACKS_API_ENABLE_NFT_METADATA|STACKS_API_ENABLE_NFT_METADATA|' /opt/stacks-blockchain-docker/.env
$ packer build ./packer/digitalocean/debian.json
AWS template uses a slightly different cleanup script than DigitalOcean, specifically there is no dd
to zero the disk before the image is created. With this included, the process frequently timed out.
$ packer build ./packer/aws/debian.json