---
title: Lemon Validator Set Up
slug: lemon-validator-set-up
docTags: 
createdAt: 2025-01-04T02:06:25.032Z
---

# Set up SSH Key

You will need a SSH key to properly secure you VM which hosts the validator (and for the instructions to properly work. The easiest way to generate a public and private SSH key is through a terminal. If you are using a Mac or Linux machine, a terminal is built right in. If you are using Windows, you will need to install a terminal or jump through hoops using Putty to generate a SSH private and public key pair.

**Windows WSL**
To get a terminal on Windows, you need to install WSL. Please do a google search for setting up WSL or troubleshooting the installation. The basics are as follows:

Type CMD in the search bar, right-click the CMD app that shows up in the search, select “Run as Administrator”


At the command prompt, type the following:

:::BlockQuote
wsl --install
:::

If everything is ready on your machine, it will install and ask you to reboot. If there are problems, it will ask you to turn on some windows services, or maybe turn on virtualization in your bios. Google is your friend.

## Generate an SSH key pair

### Using Terminal (mac)

Below document describes how to generate SSH key pairs using the Linux terminal - this is a common task for secure remote access and authentication.

Open your terminal and use the `ssh-keygen` command:

:::BlockQuote
ssh-keygen -t rsa -b 4096 -C "[your\_email@example.com](mailto\:your_email@example.com)"
:::

Where:
`-t rsa` specifies the type of key (RSA)
`-b 4096` sets the key length to 4096 bits for strong security
`-C` adds a comment (usually your email) to help identify the key


You'll may be prompted to choose a location to save the key pair (otherwise it will create it in the folder you are currently in; if you change the name, pay attention to what you name it):

:::BlockQuote
Enter file in which to save the key (/home/username/.ssh/id\_rsa):
:::

Press Enter to accept the default location, or specify a custom path.

Next, you'll be asked to enter a passphrase **(DON’T use a passphrase)**:

:::BlockQuote
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
:::

While optional, a passphrase adds an extra layer of security.

The system will generate your key pair and show a confirmation like:

:::BlockQuote
Your identification has been saved in /home/username/.ssh/id\_rsa
Your public key has been saved in /home/username/.ssh/id\_rsa.pub
:::

View your public key with (this displays the key in text in the terminal; you can copy it to paste it into a text editor, or most importantly, into the SSH key upload field when creating your Validator VM):

:::BlockQuote
cat \~/.ssh/id\_rsa.pub
:::

You'll now have two files:

`id_rsa:` Your private key (keep this secure and never share it)
`id_rsa.pub:` Your public key (this can be shared with services like GitHub or servers)

### PuTTY on Windows

To create and use SSH keys on Windows, you need to download and install both PuTTY, the utility used to connect to remote servers through SSH, and PuTTYgen, a utility used to create SSH keys.


On the PuTTY website, download the .msi file in the Package files section at the top of the page, under MSI (‘Windows Installer’). Next, install it on your local computer by double clicking it and using the installation wizard.


After the programs are installed, start the PuTTYgen program through your Start Menu or by tapping the Windows key and typing puttygen. The key generation program looks similar to this:

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-vrdbh68feQKcOgDzIFLAc-20250104-030625.png" size="58" width="490" height="476" position="center" showCaption="false"}

You can customize the **Parameters** at the bottom if you like, but the default values are appropriate in most situations.


When you’re ready, click the **Generate** button on the right-hand side.


You might be prompted to “generate some randomness by moving the mouse over the blank area”. This randomness, known as entropy, is used to create keys in a secure fashion so that other people can’t reproduce them.


::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-zIvMF-Ddrt4tD2gY9EAxS-20250104-030728.png" size="58" width="462" height="132" position="center" showCaption="false"}

When the key is generated, you see the public key displayed in a text box. Copy this into your clipboard now if you plan to add it to your DigitalOcean account or to servers. Scroll carefully within the text area so you copy the entire key.


Next, you are prompted to enter a passphrase for your SSH key. This improves security by preventing someone who gains access to your private key from using it without also knowing the passphrase. You need to provide your passphrase every time you use this key (unless you use SSH agent software that stores the decrypted key).

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-qhvSb8xjui5Vo8R5j0uk1-20250104-030809.png" size="68" width="478" height="468" position="center" showCaption="false"}

When you’re done, click the **Save private key** button and select a secure location to keep it. You can name your key whatever you’d like, and the extension .ppk is automatically added.


If you have not entered a passphrase, you need to confirm that you want to save the key without one. We strongly recommend using a passphrase, but you can press ENTER to bypass this prompt.

**Optional: Convert to OpenSSH format**

- Click "Conversions" in the menu
- Select "Export OpenSSH key" for compatibility with Linux systems

**Working with PuTTY’s Public Key Format**


You can click **Save public key** as well, but take note: The format PuTTYGen uses when it saves the public key is incompatible with the OpenSSH `authorized_keys` files used for SSH key authentication on Linux servers.


If you need to see the public key in the right format after the private key has been saved:


1. Open PuTTYgen.
2. Next to **Load an existing private key file**, click the **Load** button.
3. Navigate to the private key in your file system and select it.
4. Click **Open**.


# Set up your Validator VM with iN8 Morpheus

Follow the directions below to set up a VM on the Morpheus Cloud Console:

:::Iframe{iframeHeight="0" code="<iframe src=&#x22;https://scribehow.com/embed/Deploying_an_Ubuntu_Validator_Instance_in_iN8_Cloud_Morpheus__75agSvBaTR-wLqbFjLfFfA?removeLogo=true&as=scrollable&#x22; width=&#x22;100%&#x22; height=&#x22;640&#x22; allowfullscreen frameborder=&#x22;0&#x22;></iframe><!-- <p>paste iframe code here</p> -->"}

:::

# Lemon Installation:&#x20;

## Connect to the VM via SSH

### With Terminal

Open terminal and type (replace ‘.ssh/id\_rsa’ with the name of your private key file and the location if it is not in the current folder):

:::BlockQuote
`ssh -i .ssh/id_rsa ubuntu@<your public IP here>`
:::

Accept the cert by typing “yes”.

### With Putty

You need to add your private key file to Putty in the proper section and make sure to save the profile so you can reload it in the future when you connect again. Again, Google is your friend. After that, connect in the main window using:


ubuntu@\<your public IP here>


It should look something like this:

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-qCD6sPZPdul-NReKMOtgT-20250104-031814.png" size="80" width="670" height="572" position="center" showCaption="false"}

# Lemon Install Continued

Run the following commands (You can highlight the whole thing and copy it; You paste into the terminal by right-clicking):

:::BlockQuote
wget [https://assets.allthingslemon.io/validators/setup\_node.bash](https://assets.allthingslemon.io/validators/setup_node.bash) -P \~/
chmod 744 \~/setup\_node.bash
:::

This downloads an optimized script written by Kory. We will be modifying it to work with the iN8 Morpheus VM’s.

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-S34VNTsCNZ8x3wjh5DaDx-20250104-031932.png)

Next we need to find out where our volume is located so we can mount it to the right place.

:::BlockQuote
lsblk
:::

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-211cZD_3yCe1sbAtCTSFZ-20250104-032059.png" size="58" width="294" height="181" position="center" showCaption="false"}

You are looking for the disk that is 1000G, the take note of the name. You will need this in the next step.

:::BlockQuote
nano setup\_node.bash
:::

This will open the nano editor program to edit the setup\_node.bash file. You need to use your arrow keys to navigate in the editor. You can’t use go places using the mouse.

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-ChqAGyKrOYAv6BGmitK2Z-20250104-032249.png" size="76" width="571" height="481" position="center" showCaption="false"}

You need to use the arrow key to move the cursor and change the 3 “nvme1n1” entries to the name of 1000GB drive.

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-sy7wVZ6hBkFelYQcpWu8j-20250104-032332.png" size="62" width="405" height="361" position="center" showCaption="false"}

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-FrTblCVTiGwigcDazgDAK-20250104-032449.png" size="78" width="577" height="324" position="center" showCaption="false"}

You need to delete the last two lines of the file.

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-5guwlWrX9SA40Fm48aE2b-20250104-032759.png)

We are doing this so the script will complete (and we can make sure there are no error) before starting the validator into archive mode and syncing the blockchain). After making the changes, press CTRL-X. It will prompt you to “Save modified buffer?”

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-U1U1T1xyprbX9koTlCOCf-20250104-032911.png" size="58" width="455" height="100" position="center" showCaption="false"}

Press 'Y'.


It will then ask you the file name to write. It will be already populated. Just press the “Enter” key.

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-KmGexBu5_jLVqPyPknqn7-20250104-033015.png" size="60" width="533" height="88" position="center" showCaption="false"}

Now, enter the following command to start the script:

:::BlockQuote
\~/setup\_node.bash
:::

This will install and compile everything you need for the validator. It may complain about an ext files system on the volume that you are going to overwrite, just hit 'y'.


It should complete with no error. If you have any errors, make note and bring it to the Validator group for community help.

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-XRVLqDS39e518Tz2YO_V5-20250104-033300.png" size="84" width="1782" height="322" position="center" showCaption="false"}

From here, we will start the validator into archive mode by running the following command:&#x20;

:::BlockQuote
\~/start\_node.bash
:::

**It will run for around two hours (as of this writing) to sync the chain.**


If you want to monitor the progress (and make sure it is working properly), enter the following command:

:::BlockQuote
tail -f \~/nohup.validator
:::

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-tu2--ihiblKdOb2frshxq-20250104-033439.png" size="94" width="1882" height="620" position="center" showCaption="false"}

You can get back to the command prompt by pressing CTRL-C (this will not stop the validator).

## Configure cron job

You need to configure a cron job so your validator starts up in the event of a reboot of the VM.


Run crontab and select option 1, nano

:::BlockQuote
crontab -e
:::

::Image[]{src="https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-q8iWj-OZaidua_YJU9WQC-20250104-033725.png" size="90" width="2302" height="784" position="center" showCaption="false"}

Use the arrow keys to move the cursor to the end of the file (below all the hash lines)

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-yPwbyW_-AbGP254CeN7pF-20250104-033813.png)

Paste the following:

:::BlockQuote
@reboot sleep 30 && /home/ubuntu/start\_node.bash
:::

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-9E1EgvZRxGKW7Jnnw0bpq-20250104-033925.png)

Press CTRL-X; Y to save buffer; and \< Enter > to save it to the file.


Enter the following command:

:::BlockQuote
sudo systemctl enable cron.service
:::

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-6X4AwblGAHgCT8ywYEbzT-20250104-034112.png)

## Create Wallet & Prepare Validator

Open nano.

:::BlockQuote
nano
:::

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-PRmK21Ym-V1oPqoo60i1--20250104-034231.png)

Paste the following code into nano.

:::BlockQuote
\#!/bin/bash
\###############################################################
\#This script is to create the wallet and deploy the validator#
\###############################################################
\#Check if Validator is already initialized
if \[ -f /extra/validator ]
then
echo "Validator file is already there so stoping Deployment"
exit 0
fi
\# Create Validator Wallet
echo "Creating your Validator Wallet"
echo "Please enter a strong password: - Recommended it be 20 or more characters -"
read walletpwd
echo "$walletpwd" >> /home/ubuntu/privpwd
\~/go-opera/build/opera account new --datadir=/extra/lemon/data --password=/home/ubuntu/privpwd > /extra/validator 2> /extra/validator.errors
echo "Wallet Password: $walletpwd"
rm -rf /home/ubuntu/privpwd

\# Create Validator Key
echo "Creating Validator Key"
echo "Please enter a strong password: - Recommended it be 20 or more characters -"
read valkeypwd
echo "$valkeypwd" >> /extra/lemon/password
\~/go-opera/build/opera validator new --datadir=/extra/lemon/data --password=/extra/lemon/password >> /extra/validator 2>> /extra/validator.errors
echo "Validator Key Password: $valkeypwd"
chmod 400 /extra/lemon/password

\# Prep preload.js file

wallet\_address=\`cat /extra/validator | grep 'Public address'\`&#x20;
wallet\_key=\`cat /extra/validator | grep 'Public key'\`&#x20;

\#Storing password, public key and public address in preload.js
password=\`cat /extra/lemon/password\`&#x20;
publickey=\`cat /extra/validator | grep "Public key" | cut -d ":" -f 2 | tr -d " "\`&#x20;
publicaddress=\`cat /extra/validator | grep "Public address" | cut -d ":" -f 2 | tr -d " "\`&#x20;
preload\_file=preload.js
preload=/extra/$&#x7B;preload\_file}
asset\_base\_url="[https://assets.allthingslemon.io/validators](https://assets.allthingslemon.io/validators)"

\# Downloading file and appending the contents to make sure no duplication
\# echo "Deleting existing file to make sure copy is updated"
rm -rf /extra/preload.js

\# echo "Downloading preload file for $&#x7B;network}"
wget -O "$&#x7B;preload}" "$&#x7B;asset\_base\_url}/$&#x7B;preload\_file}"

pass=\`echo $password |sed -e 's/^/"/;s/$/"/'\`&#x20;
echo -e "\npassword = $pass"  >> /extra/preload.js

pubkey=\`echo $publickey |sed -e 's/^/"/;s/$/"/'\`&#x20;
echo "publickey = $pubkey" >> /extra/preload.js

pubaddress=\`echo $publicaddress |sed -e 's/^/"/;s/$/"/'\`&#x20;
echo "wallet = $pubaddress" >> /extra/preload.js

echo "tokenstake = 250.00" >> /extra/preload.js

if \[ -f /extra/validator ]
then
echo "Validator Deployment is completed"
echo
echo "Generating Details for you"
echo "Wallet Address"
echo -e "$wallet\_address"
echo
echo "Wallet Private Key -- Copy this and save to a text editor with .json extention"
for privatekey in /extra/lemon/data/keystore/UT\*; do
cat "$privatekey"
done
echo
echo "Private Key Password: -- WRITE THIS DOWN, DO NOT LOSE"
echo "$walletpwd"
echo
echo -e "$wallet\_key"
echo
echo "Public Key Password -- This has been saved to /extra/lemon/password so you don't need to enter it every time your validator starts."
echo "$valkeypwd"
echo
echo
echo "Your Wallet is now ready to fund. Make sure to fund 250.1 LEMX before moving to the next steps."
fi
:::

Press CTRL-X
Press Y


Save files as:

:::BlockQuote
wallet\_setup.sh
:::

At the command prompt run the following:

:::BlockQuote
chmod 744 wallet\_setup.sh
./wallet\_setup.sh
:::

You will be prompted for a password for your wallet creation. Do yourself a favor and use a password generator with 20 characters and paste it in. You only get one time to enter this, so make sure you have what you want before hitting enter. The password will be displayed to you at the end of this process for you to copy if you didn’t have it copied already.

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-t-oofT1aijMZ_A7Ox2IGr-20250104-035421.png)

You will then be prompted for a password for the Validator Key. Do yourself a favor and use a password generator with 20 characters and paste it in. You only get one time to enter this, so make sure you have what you want before hitting enter. The password will be displayed to you at the end of this process for you to copy if you didn’t have it copied already.

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-qW3ySVehhHxA0wj6PP7KK-20250104-035504.png)

The process will finish and present you with all your addresses, passwords, keys for you to copy and paste places (this includes the Private Key for you to copy and paste into a text editor)

**Copy important stuff**
With everything listed, take the time to highlight the information, copy and paste it to your local computer.


In particular, copy the Private Key, paste it into a text editor, then save that file with the .json extension.

Fund Wallet



Take your new found wallet information and go fund your wallet with 250.1 LEMX. You cannot proceed further without funding your wallet. Make sure to stake your tokens before moving to the next step.

# Complete Validator Setup

**This process ONLY works if you used the above scripts to create your wallet.&#x20;**&#xA;**AFTER** you have funded your wallet with 250.1 LEMX and staked move to this next step.


Open nano.

:::BlockQuote
nano
:::

![](https://api.archbee.com/api/optimize/ROEj5RueoOCS4Dw_lImLy-H7kZ3zUBqrpsYu0aob65K-20250104-035729.png)

Paste the following code into nano.

:::BlockQuote
\#!/bin/bash

\# This script is for completing validator setup after staking

\# Check to see if the wallet\_setup.sh script was used to create the wallet
if \[ -f /extra/validator ]
then

echo "Proceeding"


public\_key=\`cat /extra/validator | grep "^Public key" | sed -e 's/Public key://g' | tr -d " "\`&#x20;
validator\_id=\`/home/ubuntu/go-opera/build/opera attach --preload /extra/preload.js --datadir=/extra/lemon/data --exec '!!abi && !!sfcc ? sfcc.getValidatorID(wallet) : console.log("PROBLEM")'\`&#x20;

sed -i 's/startup\_mode=1/startup\_mode=3/g' /home/ubuntu/start\_node.bash
sed -i "s/^validator\_id=/validator\_id=$next/g" /home/ubuntu/start\_node.bash
sed -i "s/^public\_key=/public\_key=$public\_key/g" /home/ubuntu/start\_node.bash
sed -i "s/cache=4096/cache=12288/g" /home/ubuntu/start\_node.bash


echo -e "Finalizing the final Registration Process"

echo "Running node in Validator Mode"
bash /home/ubuntu/start\_node.bash
echo "Process is complete"
elseif
&#x20;echo "This script is only compatible with the use of the wallet\_setup.sh   script for wallet creation and validator preparation."
&#x20;exit 0
fi
:::

Press CTRL-X

Press Y

Save files as:

:::BlockQuote
valmode\_setup.sh
:::

At the command prompt run the following:

:::BlockQuote
chmod 744 valmode\_setup.sh
./valmode\_setup.sh
:::

This script will check to make sure the setup files created in with the wallet\_setup script are present before proceeding. It will then proceed to setup the validator: get a validator ID, stake the validator, properly config the start\_node.bash file (including adjusting the memory cache to the proper recommendation), and restart the validator in validator mode.

**\*Note: I got the opportunity to test this with a user. For whatever reason, it is not retrieving the validator ID.&#x20;**&#x59;ou will need to manually add the validator ID. When you register your wallet (prior to staking), the dashboard will show you your validator ID. Make note of that. Use nano to edit the start\_node.bash file and add the validator ID to the file where it says “validator\_id=” After you add that, save the file, the run:

:::BlockQuote
\~/start\_node.bash
:::

Everything is done. If you want to retrieve your validator id, you can type:

:::BlockQuote
nano start\_node.bash
:::

It will be the value listed “validator\_id=”

**Enjoy!**
