Skip to content

Commit cfb0261

Browse files
committed
Tweaked and formatted
Signed-off-by: Nana Essilfie-Conduah <[email protected]>
1 parent 53601bf commit cfb0261

File tree

4 files changed

+122
-87
lines changed

4 files changed

+122
-87
lines changed

charts/block-node-server/scripts/Taskfile.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ version: '3'
33
dotenv: ['.env']
44

55
tasks:
6+
clear-release:
7+
cmds:
8+
- helm uninstall $RELEASE -n $NAMESPACE
9+
- kubectl delete pvc -n $NAMESPACE live-storage-pvc logging-storage-pvc archive-storage-pvc
10+
- kubectl delete pv -n $NAMESPACE archive-storage-pv live-storage-pv logging-storage-pv
11+
- kubectl delete namespace $NAMESPACE
12+
613
load-kubectl-helm:
714
cmds:
815
- mkdir -p ${HOME}/.kube
@@ -32,29 +39,30 @@ tasks:
3239
- kubectl -n ${NAMESPACE} exec ${POD} -- sh -c 'rm -rf /opt/hiero/block-node/data/live/* /opt/hiero/block-node/data/historic/*'
3340
- kubectl -n ${NAMESPACE} delete pod $POD
3441

35-
setup-grpcurl:
42+
reset-upgrade:
3643
cmds:
37-
- curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
38-
- sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
39-
- rm grpcurl.tar.gz
44+
- kubectl -n ${NAMESPACE} exec ${POD} -- sh -c 'rm -rf /opt/hiero/block-node/data/live/* /opt/hiero/block-node/data/historic/*'
45+
- kubectl -n ${NAMESPACE} delete pod $POD
46+
- helm upgrade $RELEASE oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version $VERSION -n $NAMESPACE --install --values values-override/bare-metal-values.yaml
47+
- sleep 90
48+
- kubectl get all -n $NAMESPACE
4049

4150
setup-bn-proto:
4251
cmds:
4352
- curl -L https://github.com/hiero-ledger/hiero-block-node/releases/download/v$VERSION/block-node-protobuf-$VERSION.tgz -o block-node-protobuf-$VERSION.tgz
4453
- tar -xzf block-node-protobuf-$VERSION.tgz -C ~/block-node-protobuf-$VERSION
4554
- rm block-node-protobuf-$VERSION.tgz
4655

47-
reset-upgrade:
56+
setup-grpcurl:
4857
cmds:
49-
- kubectl -n ${NAMESPACE} exec ${POD} -- sh -c 'rm -rf /opt/hiero/block-node/data/live/* /opt/hiero/block-node/data/historic/*'
50-
- kubectl -n ${NAMESPACE} delete pod $POD
51-
- helm upgrade $RELEASE oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version $VERSION -n $NAMESPACE --install --values values-override/bare-metal-values.yaml
52-
- sleep 90
53-
- kubectl get all -n $NAMESPACE
58+
- curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
59+
- sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
60+
- rm grpcurl.tar.gz
5461

55-
clear-release:
62+
scale-bn:
5663
cmds:
57-
- helm uninstall $RELEASE -n $NAMESPACE
58-
- kubectl delete pvc -n $NAMESPACE live-storage-pvc logging-storage-pvc archive-storage-pvc
59-
- kubectl delete pv -n $NAMESPACE archive-storage-pv live-storage-pv logging-storage-pv
60-
- kubectl delete namespace $NAMESPACE
64+
- kubectl scale deployment $RELEASE-block-node-server -n $NAMESPACE --replicas=0
65+
- sleep 10
66+
- kubectl scale deployment $RELEASE-block-node-server -n $NAMESPACE --replicas=1
67+
- sleep 90
68+
- kubectl get all -n $NAMESPACE
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NAMESPACE=<bn-k8s-namespace>
2+
RELEASE=<bn-k8s-release>
3+
VERSION=<bn-version>
4+
POD=<bn-k8s-namespace>-block-node-server-0
Lines changed: 95 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,159 @@
11
# Single Node Kubernetes Deployment
22

3-
This document provides instructions for deploying a single-node Kubernetes cluster using the Block Node Server Helm chart.
4-
This setup is ideal for production environments on bare m=metal or cloud VMs.
3+
This document provides instructions for deploying the Block Node Server Helm chart in a Single-Node Kubernetes environment.
4+
This setup is ideal for production environments on bare metal or cloud VMs.
55

66
## Prerequisites
7-
The single requirement is a server with a supported operating system and sufficient resources to run Kubernetes and the Block Node Server.
7+
8+
The single requirement is a server with a supported operating system and sufficient resources to run Kubernetes and the
9+
Block Node Server.
810

911
Suggested minimum specifications:
1012

11-
1. Local Full History (LFH)
12-
- CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+)
13-
- RAM: 256 GB
14-
- Disk:
15-
- 8 TB NVMe SSD
16-
- 500 TB
17-
- 2 x 10 Gbps Network Interface Cards (NICs)
18-
2. Remote Full History (RFH)
19-
- CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+)
20-
- RAM: 256 GB
21-
- Disk: 8 TB NVMe SSD
22-
- 2 x 10 Gbps Network Interface Cards (NICs)
23-
24-
In both configurations a Linux-based operating system is recommended, such as Ubuntu 22.04 LTS.
13+
1. **Local Full History (LFH)**: All block history is stored locally on the server.
14+
- CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+)
15+
- RAM: 256 GB
16+
- Disk:
17+
- 8 TB NVMe SSD
18+
- 500 TB
19+
- 2 x 10 Gbps Network Interface Cards (NICs)
20+
2. **Remote Full History (RFH)**: Block history is stored remotely.
21+
- CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+)
22+
- RAM: 256 GB
23+
- Disk: 8 TB NVMe SSD
24+
- 2 x 10 Gbps Network Interface Cards (NICs)
25+
26+
Recommendations:
27+
- In both configurations a Linux-based operating system is recommended, such as Ubuntu 22.04 LTS or Debian 11 LTS.
28+
- Whiles 10 Gbps NICs are suggested, we recommend higher bandwidth NICs (20 Gbps or more) for better performance and future-proofing.
2529

2630
Note: Servers may be acquired by bare metal providers or cloud service providers that offer dedicated instances.
2731
LFH servers require significant storage capacity, as such these are expected to be sourced from bare metal providers.
2832

2933
## Server Provisioning
3034

31-
Once a server has been acquired, it needs to be provisioned with the necessary software components to run Kubernetes and the Block Node Server.
32-
33-
Assuming an ubuntu environment, [./scripts/ubuntu-production.sh](./scripts/ubuntu-production.sh) serves as a provisioner script to automate the installation of required dependencies.:
35+
Once a server has been acquired, it needs to be provisioned with the necessary software components to run Kubernetes
36+
and the Block Node Server.
3437

38+
Assuming a Linux based environment, [./scripts/linux-bare-metal-provisioner.sh](scripts/linux-bare-metal-provisioner.sh) serves as a provisioner script to automate the
39+
installation of required dependencies.:
3540

3641
## Installation Steps
3742

3843
With the server provisioned, follow these steps to deploy the Block Node Server on a single-node Kubernetes cluster:
3944

4045
Note: Some steps are marked as intermediate, indicating they will change due to improvements
4146

42-
1. **ENV variables**: Set some helpful environment variables for your deployment in a `.env file:
47+
1. **ENV variables setup**: Set some helpful environment variables for your deployment in a `.env file:
4348

4449
```bash
45-
NAMESPACE=<insert namepace>
46-
RELEASE=<insert release name>
47-
VERSION=<insert latest stable block node GA version>
48-
POD=${RELEASE}-block-node-server-0
50+
NAMESPACE=<insert namepace>
51+
RELEASE=<insert release name>
52+
VERSION=<insert latest stable block node GA version>
53+
POD=${RELEASE}-block-node-server-0
4954
```
5055

51-
2. (Intermediate) **Automate with Task**: Use the provided [./scripts/Taskfile.yml](./scripts/Taskfile.yml) to streamline the deployment process.
52-
The Taskfile includes tasks for installing Helm charts, configuring the Block Node Server, and managing the Kubernetes cluster.
56+
A sample `.env` file is provided at [./scripts/.env.sample](./scripts/.env.sample).
5357

58+
2. (Intermediate) **Automate with Task**: Use the provided [./scripts/Taskfile.yml](./scripts/Taskfile.yml) to
59+
streamline the deployment process. The Taskfile includes tasks for installing Helm charts, configuring the Block Node
60+
Server, and managing the Kubernetes cluster.
5461

5562
3. (Intermediate) **Setup `kubectl` and `helm` environments**:
5663

57-
```bash
58-
task load-kubectl-helm
59-
```
64+
```bash
65+
task load-kubectl-helm
66+
```
67+
4. **Configure Persistent Volume Creation Script**: Create Persistent Volume (PV)s and Persistent Volume Claim (PVC)s
68+
for Block Node Server data storage.
6069

61-
4. **Configure Persistent Volume Creation Script**: Create Persistent Volume (PV)s and Persistent Volume Claim (PVC)s for Block Node Server data storage.
70+
Update [./values-overrides/host-paths.yaml](./values-overrides/host-paths.yaml) with the appropriate namespace.
6271

63-
Update [./values-overrides/host-paths.yaml](./values-overrides/host-paths.yaml) with the appropriate namespace.
6472
```bash
6573
kubectl apply -f ./k8s/single-node/pv-pvc.yaml -n ${NAMESPACE}
6674
```
67-
6875
5. **Configure Helm Chart Values**: Customize the Helm chart values for your deployment.
6976

7077
Update [./values-overrides/lfh-values.yaml](./values-overrides/lfh.yaml) or [./values-overrides/rfh-values.yaml](./values-overrides/rfh.yaml) with your specific configuration settings.
7178

7279
6. **Install Block Node Server Helm Chart**: Deploy the Block Node Server using Helm.
80+
7381
```bash
7482
task helm-release
75-
```
76-
83+
```
7784
7. **Verify Deployment**: Check the status of the Block Node Server deployment to ensure it is running correctly.
85+
7886
```bash
7987
kubectl get pods -n ${NAMESPACE}
8088
kubectl logs ${POD} -n ${NAMESPACE}
8189
```
8290

83-
Expected output should indicate that the Block Node Server is operational.
91+
Expected output should indicate that the Block Node Server is operational.
92+
8493
```bash
8594
# [org.hiero.block.node.app.BlockNodeApp start] Started BlockNode Server : State = RUNNING, Historic blocks =
8695
```
87-
8896
8. **Access Block Node Server**: Connect to the Block Node Server using the configured service endpoint.
8997

90-
Install `grpcurl` if not already installed:
98+
Install `grpcurl` if not already installed:
99+
91100
```bash
92101
curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
93102
sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
94103
rm grpcurl.tar.gz
95104
```
96105

97-
Install protobuf compiler if not already installed:
98-
```bash
99-
VERSION="latest stable version here"
100-
BASE_URL="https://github.com/hiero-ledger/hiero-block-node/releases/download/v${VERSION}"
101-
ARCHIVE="block-node-protobuf-${VERSION}.tgz"
102-
TGZ="block-node-protobuf-${VERSION}.tgz"
103-
DEST_DIR="${HOME}/block-node-protobuf-${VERSION}"
104-
105-
curl -L "${BASE_URL}/${ARCHIVE}" -o "${ARCHIVE}"
106-
107-
# Ensure unzip is available
108-
command -v unzip >/dev/null 2>&1 || sudo apt-get install -y unzip
109-
110-
mkdir -p "${DEST_DIR}"
111-
tar -xzf "${ARCHIVE}" -C "${DEST_DIR}"
112-
# This is needed as tar doesnt support to overwrite the existing tar
113-
tar -xzf "${DEST_DIR}"/block-node-protobuf-${VERSION}.tgz -C "${DEST_DIR}"
114-
rm "${ARCHIVE}" "${DEST_DIR}/${TGZ}"
115-
```
106+
Install protobuf compiler if not already installed:
116107

117-
Use `grpcurl` to interact with the Block Node Server:
118-
```bash
119-
grpcurl -plaintext -emit-defaults -import-path block-node-protobuf-<VERSION> -proto block-node/api/node_service.proto -d '{}' <host>:40840 org.hiero.block.api.BlockNodeService/serverStatus
120-
```
108+
```bash
109+
VERSION="latest stable version here"
110+
BASE_URL="https://github.com/hiero-ledger/hiero-block-node/releases/download/v${VERSION}"
111+
ARCHIVE="block-node-protobuf-${VERSION}.tgz"
112+
TGZ="block-node-protobuf-${VERSION}.tgz"
113+
DEST_DIR="${HOME}/block-node-protobuf-${VERSION}"
114+
115+
curl -L "${BASE_URL}/${ARCHIVE}" -o "${ARCHIVE}"
116+
117+
# Ensure unzip is available
118+
command -v unzip >/dev/null 2>&1 || sudo apt-get install -y unzip
119+
120+
mkdir -p "${DEST_DIR}"
121+
tar -xzf "${ARCHIVE}" -C "${DEST_DIR}"
122+
# This is needed as tar doesnt support to overwrite the existing tar
123+
tar -xzf "${DEST_DIR}"/block-node-protobuf-${VERSION}.tgz -C "${DEST_DIR}"
124+
rm "${ARCHIVE}" "${DEST_DIR}/${TGZ}"
125+
```
121126

122-
Expected output should show the server status:
123-
```bash
124-
# expected response will be, 18446744073709551615 implies -1 which is expected on a new BN
125-
{
126-
"firstAvailableBlock": "18446744073709551615",
127-
"lastAvailableBlock": "18446744073709551615",
128-
"onlyLatestState": false,
129-
"versionInformation": null
130-
}
131-
```
127+
Use `grpcurl` to interact with the Block Node Server:
128+
129+
```bash
130+
grpcurl -plaintext -emit-defaults -import-path block-node-protobuf-<VERSION> -proto block-node/api/node_service.proto -d '{}' <host>:40840 org.hiero.block.api.BlockNodeService/serverStatus
131+
```
132+
133+
Expected output should show the server status:
134+
135+
```bash
136+
# expected response will be, 18446744073709551615 implies -1 which is expected on a new BN
137+
{
138+
"firstAvailableBlock": "18446744073709551615",
139+
"lastAvailableBlock": "18446744073709551615",
140+
"onlyLatestState": false,
141+
"versionInformation": null
142+
}
143+
```
144+
9. **Helm Chart Upgrades**: To upgrade the Block Node Server Helm chart to a newer version, update the `VERSION`
145+
variable in your `.env` file and run:
132146

133-
9. **Helm Chart Upgrades**: To upgrade the Block Node Server Helm chart to a newer version, update the `VERSION` variable in your `.env` file and run:
134147
```bash
135148
task helm-upgrade
136149
```
150+
10. **(Caution) Reset Block Node Server Data**: To reset the Block Node Server (clear data and install version), run:
151+
152+
```bash
153+
task reset-upgrade
154+
```
155+
11. **Uninstall Block Node Server**: To uninstall the Block Node Server and remove all associated resources, run:
156+
157+
```bash
158+
task clear-release
159+
```

0 commit comments

Comments
 (0)