# Build and Run a Node on HeLa Chain

Hela Chain supports two primary types of nodes: **non-validator nodes** and **validator nodes**. This document provides a complete, step-by-step guide to building, deploying, and running both types of nodes on Hela Chain.

The guide is designed to be beginner-friendly, by following it closely, you should be able to set up a node successfully with minimal chances of error.

### 1. Prerequisites

Before you begin, ensure the following prerequisites are installed and configured on your system:

* **Operating System:** Linux (Ubuntu 20.04+ recommended).
* **Go:** Version **1.18.x** or **1.19**. ( Later versions may cause compatibility issues.)
* **Git:** Latest version.
* System packages:
  * [Bubblewrap](https://github.com/projectatomic/bubblewrap) (at least version 0.3.3).
  * [GCC](http://gcc.gnu.org/) (including C++ subpackage).
  * [Clang](https://clang.llvm.org/) (including development package).
  * [Protobuf](https://github.com/protocolbuffers/protobuf) compiler.
  * [GNU Make](https://www.gnu.org/software/make/).
  * [CMake](https://cmake.org/).
  * [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config).
  * [OpenSSL](https://www.openssl.org/) development package.
  * [libseccomp](https://github.com/seccomp/libseccomp) development package.
* **Docker & Docker Compose (optional):** For containerized deployments.

Reference: [Oasis Core Development Setup Prerequisites](https://docs.oasis.io/core/development-setup/prerequisites)

### 2. Building Hela Chain Components

Hela Chain is built on top of Oasis Core. To run a node, you must build and install the following components:

1. **Oasis Core (Hela Node)**
2. **Emerald ParaTime & Oasis SDK (Hela EVM runtime)**
3. **Web3 Gateway**

#### 2.1 Build Oasis Core (Hela Node)

Clone the repository and build from source:

1. Oasis Core go to oasis-core folder and build from source to binary

```
make all
```

The binary file: `/oasis-core/go/oasis-node/hela-node`<br>

2.2 Build Emerald ParaTime & Oasis SDK

The ParaTime runtime enables EVM compatibility on Hela Chain. Build it from source:

```
make
```

This will export the runtime artifact: `hela-evm.orc`

#### 2.3 Build Web3 Gateway

The Web3 Gateway connects external applications to Hela Chain using Ethereum-compatible RPC APIs.

```
make
```

The build will produce the binary: `hela-web3-gateway`

### 3. Deploying a Hela Node

Hela supports **non-validator nodes** and **validator nodes**. \
Below are deployment steps for non-validator nodes first, followed by validator configuration.

#### 3.1 Prepare the Working Directory : Non-validator nodes

* ParaTime client node:

Follow the Oasis documentation for <mark style="color:$success;">setting up your node directory structure:</mark> <https://docs.oasis.io/node/run-your-node/prerequisites/oasis-node>

**Create the directory with required permissions:**

<mark style="background-color:$success;">use config.yml here: /mainnet/client</mark>\
\
create folder node with: `mkdir -m700 -p ./node/{etc,bin,runtimes,data}`  and copy the following files into the `./node` folder:

* `config.yml` (example: `/mainnet/client/config.yml`)
* Genesis file
* `hela-evm` runtime

#### 3.2 Run a Non-Validator (Client) Node

Start the node:

```bash
hela-node --config ./node/etc/config.yml &
```

Check node status:

```bash
hela-node control status -a unix:./node/data/internal.sock
```

#### 3.3 Run the Web3 Gateway

Use the Web3 Gateway documentation: [Oasis Web3 Gateway](https://docs.oasis.io/node/web3)

Prepare a config file (example: `/mainnet/web3-gateway/config.yml`) and run:

```bash
hela-web3-gateway --config <path-to-config-file> &

```

Test RPC interaction using QuickNode reference:

[eth\_getBlockByNumber](https://www.quicknode.com/docs/ethereum/eth_getBlockByNumber)

### 4. Running Specialized Nodes

#### 4.1 ParaTime Node

Runs specific runtimes (EVM, confidential compute, etc.). Setup follows the same steps as client nodes, but requires ParaTime runtime registration.

#### 4.2 Key Manager Node

Dedicated node for handling key management operations. Requires additional configuration (to be documented separately).

#### 4.3 Validator Node

Validators participate in consensus and secure the network. Setting up a validator requires:

* Key generation
* Stake delegation
* Validator-specific configuration in `config.yml`

*(Full validator setup documentation to follow in the dedicated Validator Guide.)*

### 5. Running a Node with Docker

For users preferring containerized environments, Hela supports Docker-based deployment.

#### 5.1 Install Docker and Docker Compose

Ensure both are installed and functional:

```bash
docker --version
docker-compose --version
```

#### 5.2 Build the Docker Image

```bash
docker-compose build hela-core
```

#### 5.3 Start Node Service

```bash
docker run --name=hela-node -d  -v /node:/node -p 3000:3000 ubuntu_hela-core:latest
```

#### 5.4 Attach to the Container

Access the container shell:

```bash
docker exec -it hela-node bash
```

#### 5.5 Run Web3 Gateway inside Docker

Once inside the container, configure and run the Web3 Gateway as per:

[Oasis Web3 Gateway Documentation](https://docs.oasis.io/node/web3)<br>

## Support :&#x20;

If you encounter any issues during setup or require assistance, please join the [**HeLa Community**](https://discord.gg/NEBtTztJCj) for direct support and guidance.
