Skip to content
161 changes: 130 additions & 31 deletions charts/block-node-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,84 @@

## Prerequisites

- Helm 3+
- Kubernetes 1.29+
* [Helm 3+](https://helm.sh/docs/intro/install/)
* [Kubernetes 1.29+](https://kubernetes.io/releases/)

For Development and Test environment is recommended to use minikube with the following command (if want to deploy the kube-prometheus-stack for metrics visualization):
## Development and Test Environment Setup

For development and test environments, it is recommended to use [minikube](https://minikube.sigs.k8s.io/docs/start/).

### Basic minikube setup
```bash
minikube delete && minikube start --kubernetes-version=v1.23.0 --memory=8g --bootstrapper=kubeadm --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.bind-address=0.0.0.0 --extra-config=controller-manager.bind-address=0.0.0.0
minikube delete && minikube start --kubernetes-version=v1.29.0
```

Set environment variables that will be used for the remainder of the document:
Replacing the values with the appropriate values for your environment: bn-release is short for block-node-release, but you can name you release as you wish. And use the version that you want to install.
### minikube setup with monitoring support

If you want to deploy the `kube-prometheus-stack` for metrics visualization:
```bash
export RELEASE="bn-release"
export VERSION="0.23.0-SNAPSHOT"
minikube delete && minikube start \
--kubernetes-version=v1.29.0 \
--memory=8g \
--bootstrapper=kubeadm \
--extra-config=kubelet.authentication-token-webhook=true \
--extra-config=kubelet.authorization-mode=Webhook \
--extra-config=scheduler.bind-address=0.0.0.0 \
--extra-config=controller-manager.bind-address=0.0.0.0
```

## Template

To generate the K8 manifest files without installing the chart, you need to clone this repo and navigate to `/charts` folder.
## Configuration

Set environment variables that will be used throughout this guide. Replace the values with appropriate values for your environment:
```bash
helm template --name-template bn-release block-node-server/ --dry-run --output-dir out
export RELEASE="bn-release" # bn-release is short for block-node-release
export VERSION="0.23.0-SNAPSHOT"
```
## Installation Options

Check notice on line 40 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L40

Expected: 1; Actual: 0; Above

## Install using a published chart
### Option 1: Template (without installing)

To pull the packaged chart from the public repo:
To generate Kubernetes manifest files without installing the chart:

1. Clone this repository
2. Navigate to the `/charts` folder
3. Run the following command:
```bash
helm pull oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-helm-chart --version "${VERSION}"
helm template --name-template bn-release block-node-server/ --dry-run --output-dir out
```

To install the chart with default values:
### Option 2: Install using a published chart

#### Pull the packaged chart
```bash
helm install "${RELEASE}" block-node-server/charts/block-node-server-$VERSION.tgz
helm pull oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version "${VERSION}"
```

To install the chart with custom values:
#### Install with default values
```bash
helm install "${RELEASE}" block-node-server-$VERSION.tgz
```

#### Install with custom values
```bash
helm install "${RELEASE}" block-node-server/charts/block-node-server-$VERSION.tgz -f <path-to-custom-values-file>
helm install "${RELEASE}" block-node-server-$VERSION.tgz -f <path-to-custom-values-file>
```

*Note:* If using the chart directly after cloning the github repo, there is no need to add the repo. and install can be directly.
Assuming you are at the root folder of the repo.
### Option 3: Install directly from cloned repository

*Note:* There is no need to add the repo, If using the chart directly after cloning the GitHub repository. Assuming you are at the root folder of the repository:

1. Build dependencies:
```bash
helm dependency build charts/block-node-server
```

2. Install the chart:

Check notice on line 79 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L79

Expected: 1; Actual: 2; Style: 1/1/1
```bash
helm install "${RELEASE}" charts/block-node-server -f <path-to-custom-values-file>
```

## Configure
## Custom Configuration

There are several ways to configure the Hiero Block Node. The following is the most common and recommended way to configure the Hiero Block Node.

Expand Down Expand Up @@ -115,27 +138,103 @@
enabled: false
```
## Using
## Post-Installation
Follow the `NOTES` instructions after installing the chart to perform `port-forward` to the Hiero Block Node and be able to use it.

## Upgrade

To upgrade the chart to a new version:

1. Set the new version:
```bash
export VERSION="<new-version>"
```

2. Pull the new chart version:

Check notice on line 154 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L154

Expected: 1; Actual: 2; Style: 1/1/1
```bash
helm pull oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version "${VERSION}"
```

3. Save your current configuration:

Check notice on line 159 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L159

Expected: 1; Actual: 3; Style: 1/1/1
```bash
helm get values "${RELEASE}" > user-values.yaml
```

4. Upgrade the release:

Check notice on line 164 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L164

Expected: 1; Actual: 4; Style: 1/1/1
```bash
helm upgrade "${RELEASE}" block-node-server-$VERSION.tgz -f user-values.yaml
```

## Uninstall

To uninstall the chart:

```bash
helm uninstall "${RELEASE}"
```
This will remove all Kubernetes resources associated with the release.

## Upgrade

To upgrade the chart:
## Troubleshooting

This section covers common issues you may encounter when working with the Hiero Block Node Helm chart.

### Chart Dependencies Missing

**When running:**
```bash
helm template --name-template bn-release block-node-server/ --dry-run --output-dir out
```

**Error:**
```

Check notice on line 191 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L191

Fenced code blocks should have a language specified
Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: kube-prometheus-stack, loki, promtail
Error: Chart.yaml file is missing
```
**Solution:**
Before running the template command, build the chart dependencies:
```bash
helm dependency build charts/block-node-server
```

This will download all required chart dependencies to the `charts/` directory.

---

### Chart Version Not Found in Registry

**When running:**
```bash
helm pull oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-helm-chart --version "${VERSION}"
```

**Error:**
```
Error: failed to perform "fetchReference" on source: ghcr.io/hiero-ledger/hiero-block-node/block-node-helm-chart:0.22.8-SNAPSHOT: not found
```

or
```
Error: failed to perform "fetchReference" on source: ghcr.io/hiero-ledger/hiero-block-node/block-node-helm-chart:0.21.2: not found
```

**Cause:**

The specified chart version does not exist in the registry, or the OCI registry path has changed.

**Solution:**

1. Use the correct OCI registry path:
```bash
helm pull oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version "${VERSION}"
```

2. Verify the chart version exists by checking the [releases page](https://github.com/hiero-ledger/hiero-block-node/releases)

Check notice on line 235 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L235

Expected: 1; Actual: 2; Style: 1/2/3

3. Confirm your `VERSION` environment variable is set to a valid release:

Check notice on line 237 in charts/block-node-server/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

charts/block-node-server/README.md#L237

Expected: 2; Actual: 3; Style: 1/2/3
```bash
# update the helm repo
helm repo update
# save current user supplied values
helm get values "${RELEASE}" > user-values.yaml
# upgrade the chart
helm upgrade "${RELEASE}" hiero-block-node/block-node-server -f user-values.yaml
echo $VERSION
```
Loading