With your Energi wallet on your home computer or laptop, you must leave it on all of the time in order to receive the maximum amount of staking rewards. In this guide we will learn how to set up a VPS (Virtual Private Server) to ensure your wallet will always be staking. That way you will be able to access your funds and spend them via your local wallet on your computer, but also have that same wallet on the cloud 24/7 for staking purposes.
1. Edit your local energi.conf
Since you will be staking your NRG on a cloud server 24/7, there is no need to have staking enabled on your local wallet. Also, it is impossible to stake the same wallet more than once, so before we begin we will have to disable staking for your local wallet. To do this, navigate to your EnergiCore folder on your local machine, and add staking=0 to your energi.conf file.
On Windows, it’s in C:\Users\username\AppData\Roaming\EnergiCore
On Mac, it’s in /Users/username/Library/Application Support/EnergiCore
On Linux, it’s in /home/username/.energicore
2. Encrypt your wallet.dat file
Next, once your wallet software is up and running you will want to make sure it is encrypted with a strong password or pass phrase. Click Settings on the menu bar at the top of the wallet, and select Encrypt Wallet...
Some dialogue boxes will pop up asking you to confirm your choice. Once you’ve confirmed, the software will shut down and encrypt the wallet.
3. Relaunch the wallet
You should notice in the lower right corner there is a small green lock icon indicating your wallet is encrypted. This step is very important for the security of your funds, as you will be copying your wallet.dat file to the cloud server.
Choose a server location closest to you for less latency:
For this guide we will be using 64-bit Ubuntu version 18.04, so select the 64-bit version of Ubuntu 18.04.
Choose the server size with 1024 MB (1 GB) of Memory. On Vultr this comes with 25 GB of storage, 1 CPU and 1000GB bandwidth, for $5 per month, which is more than enough for our needs.
Leave the additional features section blank. Also, this guide will not use any startup scripts, so leave that alone as well.
OPTIONAL: You can choose to set up an SSH key to make it easier to securely log into your server. Click add new and follow the tutorial for creating an SSH key. This step is optional, but recommended. Using an SSH key to login is not only easier than using a password, but much more secure.
Enter a hostname and label for your server and click Deploy Now
Wait for your server to install. It should only take a few minutes.
You will receive an e-mail confirming that your server has been created, with information on how to access it remotely.
5. Connect to your server
You can open a console window within Vultr or use any SSH (secure shell) software to connect. If you’re using Windows, I recommend PuTTY. Download psftp.exe while you’re there as you will need an SFTP client to upload your wallet.dat file to the server.
On Mac and Linux both ssh and sftp already come with the system: just open a terminal and type ssh [vultr server ip address].
If you are using PuTTY, enter your server’s IP address, make sure SSH and Port 22 are selected and click “Open”:
You may get a security alert about the server’s rsa2 key fingerprint. Just click yes to trust the server and connect via SSH.
Enter your username (root) and password found on your server information page on my.vultr.com
Once you log on, you should change your password:
6. Create a new user account
Now, you will want to make a non-root sudo user to run your Energi software.
Type adduser [newusername] The adduser program will walk you through the process of setting up a new user account.
then, type usermod -aG sudo newusername to add that user to the sudo group:
Type exit to end your SSH session, and then reconnect as your new user:
7. Update your server
In the console, type the following commands to update your server:
sudo apt update
sudo apt upgrade
Enter “Y” for yes to continue with the system update. It may take a few minutes to install everything.
7. Install the required dependencies
In the console, type the following commands to install the dependencies:
Once downloaded, enter this command to unpack the wallet:
tar -xvzf energicore-2.1.2-linux.tar.gz
TIP: On the command line, you can type a partial filename, and then hit the [TAB] key to autocomplete. This comes in handy for long filenames. If there is more than one option, it will display them in a list.
Then, move/rename the wallet directory to energi
type mv energicore-2.1.2 energi
TIP: use the ls command to list the contents of the directory you’re currently working in. Here, you can observe that the archive file energicore-2.1.2-linux.tar.gz was unpacked into a directory named energicore-2.1.2, and then we used the mv command to move it to energi, effectively renaming it:
9. Update your Environment Variables
Open your ~/.bashrc file with nano, a text editor:
Use your arrow keys to arrow down to the end of the file, and add these 2 lines:
Press ctrl X (or command X on Mac) to save. Enter “Y” and press [ENTER] to confirm.
Then, type exit to log out of the console. Log back in via SSH to update your environment variables that you’ve just specified in .bashrc
Test that the Energi Core software has been installed correctly. In the console, type the following command:
If everything is installed correctly, you should get a help menu, and no errors about missing dependencies. There will be a too few parameters error after the help menu displays. This is normal.
10. Create the .energicore directory and energi.conf file
From your home folder (/home/username), create the .energicore directory:
Once again, press ctrl X (or command X on Mac) to save. Enter “Y” and press [ENTER] to confirm.
11. Copy your encrypted wallet.dat file to the server
Use sftp to copy your local wallet.dat file (containing the NRG you want to stake) to the server. Make sure you have encrypted the wallet before doing this!
NOTE: You will need to specify the exact location, or absolute path of your wallet.dat file, unless you first navigate to the directory where that file resides. Make sure to replace username with your actual user name.
On Windows, type put C:\Users\username\AppData\Roaming\EnergiCore\wallet.dat
On Mac, type put /Users/username/Library/Application Support/EnergiCore/wallet.dat
On Linux, type put /home/username/.energicore/wallet.dat
TIP: The shorter command in the screenshot, put wallet.dat, which uses a relative path will only work if your working directory contains the wallet.dat file. To ensure this, you can either copy and paste your wallet.dat to the location of psftp.exe or move psftp.exe to your EnergiCore folder.
Verify that your .energicore folder contains the energi.conf file you just setup as well as the wallet.dat file you just uploaded
12. Adjust your permissions
type the following command:
chmod -R go= ~/.energicore
(this removes group and other permissions so only the owner of that folder can read those files)
13. Bootstrap your Full Node!
Make sure you are still working within your .energicore directory and type these commands:
NOTE: This will download and unpack the blockchain files to your server much more quickly than letting it sync from scratch!
14. Start your Full Node!
In the console, type energid to start the server. You will have to wait hours for it to sync, unless you bootstrapped it in the previous step. You can check the status by running this command on the server: energi-cli mnsync status