Newbie Getting Started - General - Algorand

Newbie Getting Started

post by Gary on Jul 2, 2019

I had not heard of Algorand until a week before the first auction when I happened across a vblog by Ivan on Tech where he discussed the Algorand forkless blockchain technology and the upcoming auction. Suffering from a sudden dose of FOMO, I set up a wallet on https://auctions.algorand.foundation, bought some USD and sent them to the auction wallet.

My bank did not like that at all. It seems that CoinList raises red flags with banks in Oz, so I received a phone call from the bank almost immediately. I was grilled a bit: did I phone the organization, what research did I do and so on. I managed to convince the bank to let it through because, “as a programmer, I was conducting some research into the technology and I really want to participate”.

After the phone call from the bank, I nervously waited to see my new USD arrive in my wallet. The $$ did arrive to my great relief, but only the day before the auction. So I immediately committed them to the next day’s auction (the first auction).

History shows that the auction completed early with great participation and my purchased Algos arrived in my wallet a week later. Since I jumped in rather hastily, I had to start learning more about Algo World rather than just leaving my Algos sitting in a wallet. The proper way to enter would have been to get involved a year or more ago on DevNet, but you don’t know what you don’t know.

So, where to go?

First of all, after the auction, there is nothing more to see on the auction site, so I scoped around and found the Algorand application (Algo Wallet) on the Apple app store for my iPhone. Eventually, I worked out how to get my auction account into the app (if there is a manual on the app, I don’t know where it is, but there are so few options in the app that pressing buttons eventually gets to Add New Account). The QRCode scanning function proved useful for that bit. Fortunately, I had saved every bit of information that was presented during setup of my first wallet, including an image of the QRCode and 25 word phrase. So, in the app I could see my auction account. I was expecting it to show the Algos I’d bought in the auction. However, there was more in there than I had purchased at auction and I sort of clued in after watching Silvio’s presentation https://www.youtube.com/watch?v=NykZ-ZSKkxM&t=243s that my Algos are already participating.

I’ve gone deeper and set up a MainNet node on Ubuntu 18.04, which is an experience in itself. I’ll discuss that process in a follow-up post.

post by JasonW on Jul 2, 2019

Gary Thanks for sharing. On the Ubuntu install, did you have permission issues? Also we have developer information on developer.algorand.com that may interest you.

post by Gary on Jul 2, 2019

Hi Jason, Indeed I did have permission issues. They continue to crop up now and again. For some reason, new participation keys get root:root and this has to be changed manually to gary:nogroup before it can be seen or used.

After rebooting the server this morning, the node would not start, so I took the sledgehammer approach of changing everything in /var/lib/algorand from algorand:nogroup to gary:nogroup (the installer created the user ‘algorand’) and the node started correctly (at least the default account appears to be participating and ‘goal node status’ is reporting correctly, so I assume the node is running correctly).

post by Gary on Jul 5, 2019

I promised to follow up on my initial post with a ‘how to get started’. Here it is.

Install Ubuntu

Install the server edition of Ubuntu on the server machine. An Algorand node does not need a GUI (the Algorand tool ‘goal’ is a command line tool) and administration of the server can be done remotely via SSH in a terminal session on any Mac or Windows machine. Leaving out the GUI leaves processing capacity for more useful programs.

Partition Configuration on Multiple Disks

The configuration chosen for the partitions is not of much significance when setting up an Algorand node, so if the server has only a single disk (or single RAID array), it’s simpler to let the installer use the whole disk.

If the machine has multiple independent disks or RAID arrays, you’d probably want to specify partitions for each disk. Make sure that the root ‘/’ partition is on the first boot device or the system won’t find the boot partition after installation of the OS.

Personally, if I have two disks, I like to specify a SWAP partition of 100GB (minimum size of twice the RAM) on the boot disk first so that the SWAP space is contiguous and, consequently, fast. UNIX OS’s don’t usually use more than twice the RAM size in the SWAP so much of the 100GB will never be used, but given the typical disk size of 1 or more TB, it’s not really a lot of space to potentially have unused.

Then I specify a root (‘/’) partition and ‘/var’ on the boot disk (roughly 50% of the disk size each) and ‘/home’ and ‘/usr’ on the second disk (roughly 50% of the disk each).

Configuring the IP Address

Note that changing the IP addressing in the installer from DHCP to manual (static) will cause the installer to loop back to the language selection page if you add anything to the domain search field and you’ll be right back at the beginning. You can change anything else in the IP configuration page though. It’s a bug everybody seems to be encountering with the installer in 18.04.2 and leaving the domain search field blank is the only thing I’ve found that will avoid the issue.

Post Ubuntu Installation

After installing the OS, log in and run an upgrade (use ‘sudo’ to run as root):

gary@pond : ~ $ sudo apt-get upgrade

Once the upgrade is complete, run an update (again using ‘sudo’):

gary@pond : ~ $ sudo apt-get update

Installing Algorand

There is a comprehensive set of documents on the Algorand suite here: https://developer.algorand.org/docs/introduction-installing-node

The problem I find with this kind of documentation is that, without examples, the documentation only makes sense once you know how a given command works (which is why I’m blogging this). It’s a kind of chicken and egg situation.

Get some prerequisite packages:

gary@pond : ~ $ sudo apt-get install -y gnupg2 curl software-properties-common

Add the Alogrand repository to the local library:

gary@pond : ~ $ sudo add-apt-repository "deb [https://releases.algorand.com/deb/] (https://releases.algorand.com/deb/) stable main"

Finally, install Algorand connecting to MainNet (default):

gary@pond : ~ $ sudo apt-get install -y algorand

Verify the Algo Daemon:

gary@pond : ~ $ algod -v

At this point, the node is installed and running, although it is free-wheeling (not attached to any wallet or account). Examine the status of the node using the ‘node status’ command of ‘goal’ (do not use ‘sudo’ when executing ‘goal’):

gary@pond : ~ $ goal node status -d /var/lib/algorand

Node Directory Variable Setting

Executing ‘goal’ commands is simplified by setting the environment variable ALGORAND_DATA to the location of the node directory (‘/var/lib/algorand’ by default). This will negate the need to use the -d command line option with every ‘goal’ command. I achieved this by adding one line at the end of the ~/.bashrc file:

After logging back in, the -d option can be omitted from ‘goal’ commands requiring ‘-d /var/lib/algorand’.

File Permissions

In the current version of the Algorand installer, there is a bug with the permission settings that make the main node directory unavailable to the logged in user. Access to ‘/var/lib/algorand’ is critical to successful use of the ‘goal’ command for creating wallets, creating and importing addresses, creating participation keys and the like and even starting the Algo daemon ‘algod’ on reboot. To overcome the permissions issues, with ‘sudo chgrp’ and ‘sudo chown’, change the owner:group file permissions to :nogroup for all files and directories in ‘/var/lib/algorand’ (there is probably a better way to address this issue, but this is the solution that has worked for me):

gary@pond : ~ $ sudo chown -R gary /var/lib/algorand
gary@pond : ~ $ sudo chgrp -R nogroup /var/lib/algorand

Create a Wallet

A wallet is simply a conceptual container for accounts. To create a wallet, use the ‘goal wallet new’ command (I’ve named this new wallet ‘pond’):

gary@pond : ~ $ goal wallet new 'pond’

Import a Cashed Up Account

Now import your cashed up account:

gary@pond : ~ $ goal account import -f -m ‘answer pleasant dry … fool seminal …’ -w 'pond’

Review the account to ensure that the funds you expected to see are present:

gary@pond : ~ $ goal account list

You might want to rename the imported account to something other than ‘Unnamed-0’:

gary@pond : ~ $ goal account rename ‘Unnamed-0’ 'Auction’

Bringing the Account Online

In order to bring the account online as a participating account, a participation key must be created. To create a participation key, you need to know the current round:

gary@pond : ~ $ goal node status

The participation key will be created in the node’s ‘mainnet-v1.0’ directory:

gary@pond : ~ $ goal account listpartkeys -w 'pool’

At this point, the system is now ready to participate once the round exceeds the starting value for the key (360800 in this case).

post by AlGod on Jul 5, 2019

This is a fantastic guide! I have been able to do everything in it except for this.

post by Gary on Jan 15, 2020

The permissions issue will come up again if you upgrade to a later version, like 2.0.2 (as I did today), so you’ll need to redo the permissions reassignment after an upgrade.