Setting up an Amazon AWS Aeon Public node on a FREE EC2 Instance
Everyone likes free stuff right and Amazon is offering free basic AWS EC2 instances of your choice for a year if you don’t have service with them and also have a prime account. Yes, it is free but they are very very basic at that. We are talking 30GB storage space and up to 1gb ram on a single cpu thread. But the good thing with Aeon being so lightweight is that you can run a node on here very easily since the current database size that is already 4 years old is just under 8GB, so it will easily fit and run in the 30GB ssd storage space on an Ubuntu server 16.04 AWS instance. After this, hopefully you will be able to set up a node and start helping out the network become more secure, all from the comfort of your couch. So what are we waiting for, lets get started!
First you need to set up an account on https://aws.amazon.com and also start up an Ubuntu Server 16.04 instance. Click the “Create a Free Account” button on their free instances page: https://aws.amazon.com/free . Make sure you pick the “free” EC2 version with 1GB ram and 30GB ssd storage space when setting up a new instance. When you set it up the first time make sure to pick the location your instance will be at. There are many available locations for AWS servers and in connections depend on location.
After setting this instance up with their basic default security settings lets add in the settings we need for Aeon Daemon to allow the most connections:
Now we need to set up our SSH security to securely connect to our instance from our own home PC. Depending on your choice you can either run Amazon’s CLI tool or if you run OSX you can simply run terminal and ssh directly to that. For this how-to we will be using OSX. To set up SSH follow the instructions here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html
Next after setting up our instance we need to connect via SSH to our AWS instance with the key pairs we set up here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#having-ec2-create-your-key-pair
Store your .pem key pair file in a location you can remember and don’t share this. If you share it, anyone will be able to access your instance. After you set up the key open up terminal and cd to the folder that your key is in (if you are lazy like me just type cd then drag the folder to the terminal window and let go and it will automagically fill in the folder path and hit enter). Now copy/paste the ssh key link from the amazon console window into your terminal and make sure to delete the spaces between the key name and hit enter.
Hey we’re connected to our AWS instance! So cool right, making progress. Take a few sips of covfefe now and lets get back to making the Aeon network more secure and anonymous.
There are two ways to install a daemon:
- Compiling from source or master code (hard)
- Downloading and installing the release version (easy)
Lets do it the easy way shall we? Ok in the terminal lets update ubuntu with the command:
sudo apt update
and hit yes when it blasts you with a bunch of lines to update. Then lets install some dependendencies if we ever want to actually install something else or compile ourselves by entering the big command:
sudo apt install build-essential cmake git libpcsclite-dev pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libminiupnpc-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpcsclite-dev
and hit “Y” when it asks to install. This may take a while to update and install everything but we should be almost good to go to download Aeon 12.5.0 (the latest build at the time of writing this). Before downloading lets install htop so we can view system usage of the CPU/swap/ram ect… with the command:
sudo apt install htop
Whoa, thats some crazy stuff. All these numbers and colors and bars moving around and stuff, its like im playing some cool video game or something! Anyway, lets make a swap file becase lets face it, 1gb ram is not going to cut it doing anything but opening and closing text files or running a fully synced daemon. What is a swap file? Its basically a file on your hard drive that allows data to be written and removed acting as “ram”. As shown in the picture above running AeonD syncing from scratch its using at this moment 1.37GB of memory to update. That swap comes in handy so you can smoothly access and monitor your instance while your daemon is running from your own computer. How do we make a swap file? Lets get started with that now by entering these commands in order:
sudo dd if=/dev/zero of=/mnt/myswap.swap bs=1M count=4000
This will create the file for you. Now we have to let Ubuntu know about that file and make it a swap file:
sudo mkswap /mnt/myswap.swap
Now that Ubuntu knows that file in that location is a swap file, lets activate the file by entering:
sudo swapon /mnt/myswap.swap
Now lets make sure we set the security to only allow the system to access or edit this file :
sudo chmod 600 /mnt/myswap.swap
Good deal. Now that we are secure, lets make sure that every time you reboot it uses that swap file :
sudo nano /etc/fstab
Ok now we are getting somewhere. Using our hard drive as some ram. Whats this window that opened? Oh yea its the file we need to edit so that the swap is used every reboot. Lets arrow down to the next blank line (there should only be one line on a fresh build) and add in this text exactly and hit ctrl+o (thats O not zero) then enter:
/mnt/myswap.swap none swap sw 0 0
Now it should say it wrote a few lines and hit Y to save and then ctrl+x to exit the file bringing us back to the bash terminal. Now go ahead and $ reboot your system (this will close your ssh connection and bring you back to your OSX terminal).
Lets wait a minute and sip some more nectar while we wait for our instance to reboot. OK, now that it has rebooted lets connect back and get that release build installed and the daemon running. In your terminal you can simply press the up arrow for the last command so you dont have to constantly retype this in every time you connect.
Now that we are back connected securely lets download the latest build:
sudo wget “https://github.com/aeonix/aeon/releases/aeon-linux-x64-v0.12.5.0.tar.bz2”
Remember if you are reading this post 12.5 release please visit the current Github page and change the file name text to match the latest build here: https://github.com/aeonix/aeon/releases
Ok now that its downloaded we need to extract the files so we can use them:
tar xf aeon-linux-x64-v0.12.5.0.tar.bz2
Now lets open tmux, a program that allows us to have more than one window open at a time on a CLI style operating system:
This will open this funky looking window showing your IP and everything at the bottom. Now lets rename this instance to aeond since thats what it will be used for from now on:
This lists all the open tmux instances. Yours should be instance 1 (the only one opened). If it isnt 1 (maybe its 0) run this command to change it:
tmux rename-session -t 1 aeond
At the bottom left it should say aeond now. Now we can list the files on the main terminal and cd to the Aeon folder:
Now that we are in the folder we can FINALLY start syncing the daemon with the network. Enter this command to start the sync with max resources available:
sudo ./aeond --block-sync-size 1000 --max-concurrency 15
It should start the sync and once it says its started you can now close the tmux session back to the control prompt by pressing ctrl+b letting go then pressing d. You should now be back at the main control prompt where you can exit and close your ssh session, or you can go back to the tmux session to see how aeonD is syncing:
tmux attach -t aeond
Attach brings you back to the tmux session with aeond running where you can enter “ status ” to check the daemon status and connections, or you can enter “exit ” to save progress and close the daemon. To restart daemon just hit the up arrow and you can see your command.
It will take about 3 days to fully sync (as of the writing of this article). Once you do, ssh in and exit your daemon and then restart it with the following to allow your node to be a public node:
sudo ./aeond --rpc-bind-ip 0.0.0.0 --confirm-external-bind --restricted-rpc
Feel free to use your wallet at home with “remote node” connection and the ip of your public DNS located in the connection command for ssh. If you really want, you can post your public node address on the discord or if there is a public node site that is set up you can post it there. Adter just 16 hours we are showing 70 in connections to our AWS Daemon. Ram usage is 350ish MB and cpu usage is less than 10%. Aeon is VERY lightweight.
Well there we have it folks, we are now running a node for free not only helping secure the AEON network from attacks, but decentralizing the cryptocurrency movement. Thanks for visiting and stay tuned for more of these how-to’s in the future!
Special thanks to the following people in the AEON community for their informational posts. I was able to set this up myself with some help from these write-ups and others from the AEON community:
Basic information on how to set up and compile and run AEON on Linux OS: https://www.hiddenjadestone.com/2017/06/24/aeon/setup-aeon-wallet-using-linux/
What is a public node and how to set one up: https://www.reddit.com/r/Aeon/comments/73qb95/faqhowto_set_up_a_public_node/