stacks-blockchain-api

by Hiro Systems

Helm chartv6.5.1App 8.13.2Verified publisher

API for the Stacks blockchain

About this chart

Stacks Blockchain API

An API for the Stacks 2.0 Blockchain.

TL;DR

$ helm repo add hirosystems https://charts.hiro.so/hirosystems
$ helm install my-release hirosystems/stacks-blockchain-api

Introduction

This chart bootstraps a Stacks Blockchain API deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

helm install my-release hirosystems/stacks-blockchain-api

The command deploys Stacks Blockchain API on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

See https://github.com/hirosystems/charts/blob/main/hirosystems/stacks-blockchain-api/values.yaml

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install my-release \
  --set apiWriter.enable=true \
  --set apiWriter.image.debug=true \
  --set apiWriter.image.tag=4.0.3 \
    hirosystems/stacks-blockchain-api

The above command enabled the Stacks Blockchain API Writer, sets the image tag to 4.0.3, and enables debug logging.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

helm install my-release -f values.yaml hirosystems/stacks-blockchain-api

Tip: You can use the default values.yaml

Configuration and installation details

Rolling VS Immutable tags

It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

Hiro Systems will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

Ingress

This chart provides support for Ingress resources. If you have an ingress controller installed on your cluster, you can utilize the ingress controller to serve your application.

To enable Ingress integration, set ingress.enabled to true. The ingress.hostname property can be used to set the host name. The ingress.tls parameter can be used to add the TLS configuration for this host. It is also possible to have more than one host, with a separate TLS configuration for each host.

TLS secrets

The chart also facilitates the creation of TLS secrets for use with the Ingress controller, with different options for certificate management.

Persistence

The Stacks Blockchain API image stores the Stacks Blockchain API data and configurations at the /hirosystems path of the container. Persistent Volume Claims are used to keep the data across deployments.

Additional environment variables

In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the extraEnvVars property.

extraEnvVars:
  - name: FOO
    value: bar

Alternatively, you can use a ConfigMap or a Secret with the environment variables. To do so, use the extraEnvVarsCM or the extraEnvVarsSecret values.

Sidecars

If additional containers are needed in the same pod as the Stacks Blockchain API (such as additional metrics or logging exporters), they can be defined using the sidecars parameter. If these sidecars export extra ports, extra port definitions can be added using the service.extraPorts parameter.

Pod affinity

This chart allows you to set your custom affinity using the affinity parameter. Find more information about Pod affinity in the kubernetes documentation.

As an alternative, use one of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the podAffinityPreset, podAntiAffinityPreset, or nodeAffinityPreset parameters.

License

Copyright © 2023 Hiro Systems

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Deploy stacks-blockchain-api with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has stacks-blockchain-api on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartstacks-blockchain-api is pinned at v6.5.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply