Deploy NEAR Validator Node

In this tutorial, we will learn how to deploy a NEAR validator node, and load a validator key into it.

Generate Validator Key

Generate validator account using NEAR CLI tool. Which can be installed using:

npm install -g near-cli
near generate-key validator

An ed25519 private key will be generated and saved in current user home directory under .near-credentials/testnet

cat ~/.near-credentials/testnet/validator.json

It will return an output similar to the following

{
  "account_id": "validator",
  "public_key": "ed25519:CdTBLXMmu9gzoCbNKdUnej1tJNMz5tzRjJF2a9DwAgUr",
  "private_key": "ed25519:4k83DwbSpD3zzai4ZPdeRJcfXttU3Uq68mWWhni6ra2RKnG3jyVKEZyP14gDJZ9W1oqFujpAkidoNrYY4TLqijsG"
}

Generate Secret for Validator Private Key

Create a Kubernetes secret from the generated private key in the previous step:

Deploy NEAR Validator Node

The following manifest describes a NEAR node that syncs NEAR testnet network: testnet, enables HTTP JSON-RPC server rpc: true, loads validator key from the Kubernetes secret that we've created in the previous step, and uses NEAR Core client:

Apply near.yaml manifest:

Kotal operator will notice your near-node and will create all the necessary pods, persistent volumes, services, configmaps, and secrets neccessary.

You can fetch the deployed NEAR Node using:

It will return an output similar to the following:

Note that validator is true in the prevous output πŸ˜‡

Fetch Node Logs

Get the pods that has been created by Kotal for the node:

It will return an output similar to the following:

Get the logs of the running node:

It will return node logs similar to the following:

Finally you can delete the node by:

Kubernetes garbage collector will delete all the resources that has been created by Kotal NEAR Node controller.

Further Reading

Last updated

Was this helpful?