# Installation

To install the OneFinity Network validator node on your local machine, follow these steps. First, ensure you have configured user permissions, script settings, and keys. The Validator script, which you'll use to manage your node, supports Mainnet, Devnet, and Testnet.

### Install Your Node(s)&#x20;

Run the following commands:

```
cd ~/of-chain-scripts
./script.sh
```

Upon completing the previous step, a menu will appear offering several options. Choose option `1` to proceed with the installation of the node.

```
 1) install
 2) observing_squad
 3) upgrade
 4) upgrade_squad
 5) upgrade_proxy
 6) remove_db
 7) start
 8) stop
 9) cleanup
 10) github_pull
 11) add_nodes
 12) get_logs
 13) benchmark
 14) quit
 Please select an action:1
```

{% hint style="info" %}
NOTE

Alternatively, you can trigger the installation by running this command:

```bash
~/of-chain-scripts/script.sh install
```

{% endhint %}

* Indicate the number of nodes you want to run, i.e. `1`
* Indicate the name of your validator, i.e. `OneVal`
* Exit without starting (we need keys first) by using `14 - quit`

#### **Prepare your keys**[​](https://docs.multiversx.com/validators/nodes-scripts/install-update#prepare-your-keys): <a href="#prepare-your-keys" id="prepare-your-keys"></a>

Create a new folder "VALIDATOR\_KEYS" to serve as a local backup when updating:

```
cd ~
mkdir -p ~/VALIDATOR_KEYS
```

Generate a certificate file containing your Validator key by running the `keygenerator`:

```
./onefinity-utils/keygenerator
```

Copy the generated `validatorKey.pem` file to the `config` folder of your node(s), and repeat for each node.

```
cp validatorKey.pem ~/onefinify-nodes/node-0/config/
```

{% hint style="info" %}
NOTE

Each node needs its unique `validatorKey.pem` file
{% endhint %}

To ensure your node can restart smoothly after an upgrade, transfer the `validatorKey.pem` file, compressed in a ZIP format, to the `$HOME/VALIDATOR_KEYS/` directory. It's crucial that each node possesses a distinct `validatorKey.pem` file, repeat for each node:

```
zip node-0.zip validatorKey.pem
mv node-0.zip $HOME/VALIDATOR_KEYS/
```

For instructions on backing up and protecting your keys, see the Management section.

#### **Start the node(s)**[​](https://docs.multiversx.com/validators/nodes-scripts/install-update#start-the-nodes): <a href="#start-the-nodes" id="start-the-nodes"></a>

```
~/of-chain-scripts/script.sh start
```

#### **Start the node visual interface**[​](https://docs.multiversx.com/validators/nodes-scripts/install-update#start-the-node-visual-interface): <a href="#start-the-node-visual-interface" id="start-the-node-visual-interface"></a>

After your node is running, monitor its status through the `TermUI` interface. Go to `$HOME/onefinity-utils`, then launch `TermUI` for each node:

```
cd $HOME/onefinity-utils
./termui -address localhost:8080
```

{% hint style="info" %}
NOTE

When setting up your environment, you will start with your first node, named `node-0`, which operates as a REST API and listens on port `8080` by default. Following `node-0`, you will configure `node-1` to run on port `8081`, and you'll continue this pattern for any subsequent nodes, incrementing the port number by one each time.
{% endhint %}

### **Update your node(s)**[​](https://docs.multiversx.com/validators/nodes-scripts/install-update#update-your-nodes): <a href="#update-your-nodes" id="update-your-nodes"></a>

To upgrade your node, run the provided script and choose one of the available options.

* `10 - github_pull` downloads the latest version of the scripts
* `3 - upgrade`
* `7 - start`
* `14 - quit`

```
~/of-chain-scripts/script.sh
```

These are the basic steps. Please carefully read the on-screen instructions and refer to the script's README file. You can also ask questions in the OneFinity Validators chat.

### Secure Your Node: Protect Your Private Keys

To ensure you maintain control over your node, it is crucial to safeguard your private keys. Without them, your ability to manage your node effectively is compromised. Additionally, if a third party gains access to your private keys, you could face a significant financial loss. Therefore, it's important to exercise caution and prioritize the security of your keys.

#### Creating a Safe Backup

1. It's recommended to store a backup of your private keys in a secure location outside the server running your nodes.
2. Locate your keys within the folder path: `$HOME/onefinity-nodes/node-0/config`. If you operate multiple nodes (referred to as “`n`” nodes), ensure you follow this step for each one.
3. Implement strict access controls and encryption to enhance the security of the backup.

By taking these preventative measures, you can better protect your node and secure your investment.

### **Choosing a custom configuration tag or branch**[​](https://docs.multiversx.com/validators/nodes-scripts/install-update#choosing-a-custom-configuration-tag-or-branch) <a href="#choosing-a-custom-configuration-tag-or-branch" id="choosing-a-custom-configuration-tag-or-branch"></a>

{% hint style="danger" %}
WARNING

This option should only be used for debugging or testing ahead of a pre-release tag. Use it at your own risk!
{% endhint %}

The power of the scripts set has been leveraged with a new addition: the possibility to tell the scripts a specified tag or branch (not recommended using a branch due to the fact that an unsigned commit might bring malicious code or configs)

To accomplish this, edit the variables.cfg file

```
cd ~/of-chain-scripts/config
nano variables.cfg
MUST BE CONFiRMED WHEN WE HAVE THE NETWORK IN TESTNET
```

locate the `OVERRIDE_CONFIGVER` option and input a value there, something like `tags/T1.3.14.0`. The `tags/` prefix will tell the scripts to use the tag and not search a branch called `T1.3.14.0`. Call the `upgrade` command on the scripts to install the desired configuration version.

Resetting the value to `""` will make the scripts to use the released version.

{% hint style="danger" %}
WARNING

The `OVERRIDE_CONFIGVER` is not backed up when calling `github_pull` operation.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onefinity.network/technology/run-a-onefinity-node/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
