stacks-blockchain
by Hiro Systems
Stacks Blockchain Node
About this chart
Stacks Blockchain
The Stacks Blockchain 2.0 is a layer-1 blockchain that connects to Bitcoin for security and enables decentralized apps and predictable smart contracts. Stacks 2.0 implements Proof of Transfer (PoX) mining that anchors to Bitcoin security. Leader election happens at the Bitcoin blockchain and Stacks (STX) miners write new blocks on the separate Stacks blockchain. With PoX there is no need to modify Bitcoin to enable smart contracts and apps around it. See this page for more details and resources.
TL;DR
$ helm repo add hirosystems https://charts.hiro.so/hirosystems
$ helm install my-release hirosystems/stacks-blockchain
Introduction
This chart bootstraps a Stacks Blockchain node 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
The command deploys Stacks Blockchain 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/values.yaml
Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,
helm install my-release \
--set image.tag=2.05.0.2.2 \
--set image.debug=true \
--set replicaCount=2 \
hirosystems/stacks-blockchain
The above command sets the Stacks Blockchain image tag to 2.05.0.2.2, enables debug logging, and deploys two nodes.
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
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 image stores the Stacks Blockchain 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 (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 © 2022 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 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 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartstacks-blockchain is pinned at v2.2.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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