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
[sudo] password for gary:
Reading package listsā¦ Done
Building dependency tree
Reading state informationā¦ Done
Calculating upgradeā¦ Done
The following packages will be upgraded:
ā¦
140 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 55.5 MB of archives.
After this operation, 3,621 kB disk space will be freed.
Do you want to continue? [Y/n]
Once the upgrade is complete, run an update (again using āsudoā):
gary@pond : ~ $ sudo apt-get update
[sudo] password for gary:
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 252 kB in 3s (72.2 kB/s)
Reading package listsā¦ Done
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
Reading package listsā¦ Done
Building dependency tree
Reading state informationā¦ Done
curl is already the newest version (7.58.0-2ubuntu3.7).
software-properties-common is already the newest version (0.96.24.32.9).
The following NEW packages will be installed:
gnupg2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,668 B of archives.
After this operation, 52.2 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 gnupg2 all 2.2.4-1ubuntu1.2 [4,668 B]
Fetched 4,668 B in 1s (4,655 B/s)
Selecting previously unselected package gnupg2.
(Reading database ā¦ 66981 files and directories currently installed.)
Preparing to unpack ā¦/gnupg2_2.2.4-1ubuntu1.2_all.deb ā¦
Unpacking gnupg2 (2.2.4-1ubuntu1.2) ā¦
Setting up gnupg2 (2.2.4-1ubuntu1.2) ā¦
Processing triggers for man-db (2.8.3-2ubuntu0.1) ā¦
Get the Algorand public key:
gary@pond : ~ $ sudo apt-key adv --fetch-keys https://releases.algorand.com/key.pub
Executing: /tmp/apt-key-gpghome.BUp8x6TnWL/gpg.1.sh --fetch-keys https://releases.algorand.com/key.pub
gpg: requesting key from āhttps://releases.algorand.com/key.pubā
gpg: key EDACD29DA10A4EA6: public key āAlgorand developers dev@algorand.comā imported
gpg: Total number processed: 1
gpg: imported: 1
Add the Alogrand repository to the local library:
gary@pond : ~ $ sudo add-apt-repository "deb https://releases.algorand.com/deb/ stable main"
Get:1 https://releases.algorand.com/deb stable InRelease [4,121 B]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 https://releases.algorand.com/deb stable/main amd64 Packages [501 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 257 kB in 3s (90.7 kB/s)
Reading package listsā¦ Done
Update the sources list:
gary@pond : ~ $ sudo apt-get update
Hit:1 https://releases.algorand.com/deb stable InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 252 kB in 4s (70.6 kB/s)
Reading package listsā¦ Done
Finally, install Algorand connecting to MainNet (default):
gary@pond : ~ $ sudo apt-get install -y algorand
Reading package listsā¦ Done
Building dependency tree
Reading state informationā¦ Done
The following NEW packages will be installed:
algorand
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 87.4 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://releases.algorand.com/deb stable/main amd64 algorand amd64 1.0.27 [87.4 MB]
Fetched 87.4 MB in 36s (2,403 kB/s)
Selecting previously unselected package algorand.
(Reading database ā¦ 66988 files and directories currently installed.)
Preparing to unpack ā¦/algorand_1.0.27_amd64.deb ā¦
Unpacking algorand (1.0.27) ā¦
Setting up algorand (1.0.27) ā¦
Created symlink /etc/systemd/system/multi-user.target.wants/algorand.service ā /lib/systemd/system/algorand.service.
Verify the Algo Daemon:
gary@pond : ~ $ algod -v
4294967323
1.0.27.stable [rel/stable] (commit #ee904b7b)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand
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
Last committed block: 14080
Time since last block: 0.0s
Sync Time: 310.2s
Last consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Next consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Round for next consensus protocol: 14081
Next consensus protocol supported: true
Genesis ID: mainnet-v1.0
Genesis hash: wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=
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ā (the node directory).
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. This is illustrated here:
gary@pond : ~ $ ls -laR /var/lib/algorand
/var/lib/algorand:
total 401540
drwxrwxr-x 5 algorand root 4096 Jul 5 05:09 .
drwxr-xr-x 36 root root 4096 Jul 5 05:08 ā¦
-rw-rār-- 1 algorand nogroup 351597978 Jul 5 06:27 agreement.cdv
-rw------- 1 algorand nogroup 0 Jul 5 05:09 algod.lock
-rw-rār-- 1 algorand nogroup 15 Jul 5 05:09 algod.net
-rw-rār-- 1 algorand nogroup 6 Jul 5 05:09 algod.pid
-rw-rār-- 1 algorand nogroup 64 Jul 5 05:09 algod.token
drwxr-xr-x 2 algorand nogroup 4096 Jul 5 05:09 .algorand
-rw-rw-r-- 1 algorand root 1340 Jun 20 15:42 config.json.example
drwxrwxr-x 5 algorand root 4096 Jul 5 05:08 genesis
-rw-rw-r-- 1 algorand root 24972 Jun 20 15:42 genesis.json
drwx------ 2 algorand nogroup 4096 Jul 5 05:09 mainnet-v1.0
-rw-rār-- 1 algorand nogroup 59494851 Jul 5 06:27 node.log
-rw-rw-r-- 1 algorand root 23 Jun 20 15:42 system.json
/var/lib/algorand/.algorand:
total 12
drwxr-xr-x 2 algorand nogroup 4096 Jul 5 05:09 .
drwxrwxr-x 5 algorand root 4096 Jul 5 05:09 ā¦
-rw-rār-- 1 algorand nogroup 157 Jul 5 05:09 logging.config
/var/lib/algorand/genesis:
total 20
drwxrwxr-x 5 algorand root 4096 Jul 5 05:08 .
drwxrwxr-x 5 algorand root 4096 Jul 5 05:09 ā¦
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 devnet
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 mainnet
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 testnet
/var/lib/algorand/genesis/devnet:
total 20
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 .
drwxrwxr-x 5 algorand root 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 algorand root 8859 Jun 20 15:42 genesis.json
/var/lib/algorand/genesis/mainnet:
total 36
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 .
drwxrwxr-x 5 algorand root 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 algorand root 24972 Jun 20 15:42 genesis.json
/var/lib/algorand/genesis/testnet:
total 44
drwxrwxr-x 2 algorand root 4096 Jul 5 05:08 .
drwxrwxr-x 5 algorand root 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 algorand root 34754 Jun 20 15:42 genesis.json
ls: cannot open directory ā/var/lib/algorand/mainnet-v1.0ā: Permission denied
Access to ā/var/lib/algorand/mainnet-v1.0ā 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 <user>: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
[sudo] password for gary:
gary@pond : ~ $ sudo chgrp -R nogroup /var/lib/algorand
gary@pond : ~ $ ls -laR /var/lib/algorand
/var/lib/algorand:
total 466036
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:09 .
drwxr-xr-x 36 root root 4096 Jul 5 05:08 ā¦
-rw-rār-- 1 gary nogroup 408080237 Jul 5 06:39 agreement.cdv
-rw------- 1 gary nogroup 0 Jul 5 05:09 algod.lock
-rw-rār-- 1 gary nogroup 15 Jul 5 05:09 algod.net
-rw-rār-- 1 gary nogroup 6 Jul 5 05:09 algod.pid
-rw-rār-- 1 gary nogroup 64 Jul 5 05:09 algod.token
drwxr-xr-x 2 gary nogroup 4096 Jul 5 05:09 .algorand
-rw-rw-r-- 1 gary nogroup 1340 Jun 20 15:42 config.json.example
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:08 genesis
-rw-rw-r-- 1 gary nogroup 24972 Jun 20 15:42 genesis.json
drwx------ 2 gary nogroup 4096 Jul 5 05:09 mainnet-v1.0
-rw-rār-- 1 gary nogroup 69062238 Jul 5 06:39 node.log
-rw-rw-r-- 1 gary nogroup 23 Jun 20 15:42 system.json
/var/lib/algorand/.algorand:
total 12
drwxr-xr-x 2 gary nogroup 4096 Jul 5 05:09 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:09 ā¦
-rw-rār-- 1 gary nogroup 157 Jul 5 05:09 logging.config
/var/lib/algorand/genesis:
total 20
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:08 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:09 ā¦
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 devnet
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 mainnet
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 testnet
/var/lib/algorand/genesis/devnet:
total 20
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 gary nogroup 8859 Jun 20 15:42 genesis.json
/var/lib/algorand/genesis/mainnet:
total 36
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 gary nogroup 24972 Jun 20 15:42 genesis.json
/var/lib/algorand/genesis/testnet:
total 44
drwxrwxr-x 2 gary nogroup 4096 Jul 5 05:08 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:08 ā¦
-rw-rw-r-- 1 gary nogroup 34754 Jun 20 15:42 genesis.json
/var/lib/algorand/mainnet-v1.0:
total 27364
drwx------ 2 gary nogroup 4096 Jul 5 05:09 .
drwxrwxr-x 5 gary nogroup 4096 Jul 5 05:09 ā¦
-rw-rār-- 1 gary nogroup 4096 Jul 5 05:09 crash.sqlite
-rw-rār-- 1 gary nogroup 32768 Jul 5 05:09 crash.sqlite-shm
-rw-rār-- 1 gary nogroup 8272 Jul 5 05:09 crash.sqlite-wal
-rw-rār-- 1 gary nogroup 17453056 Jul 5 06:39 ledger.block.sqlite
-rw-rār-- 1 gary nogroup 32768 Jul 5 06:39 ledger.block.sqlite-shm
-rw-rār-- 1 gary nogroup 5026432 Jul 5 06:39 ledger.block.sqlite-wal
-rw-rār-- 1 gary nogroup 978944 Jul 5 06:37 ledger.tracker.sqlite
-rw-rār-- 1 gary nogroup 32768 Jul 5 06:39 ledger.tracker.sqlite-shm
-rw-rār-- 1 gary nogroup 4420792 Jul 5 06:39 ledger.tracker.sqlite-wal
Create a Wallet
A wallet is simply a conceptual container for accounts. I have not succeeded in importing an existing wallet (I havenāt decoded the command syntax), but it is possible to import accounts to a locally created wallet. The advantage is that you probably already have an account with Algos in it and rather than transfer Algos from some other account to a locally created account and incur transaction costs, you simply import the already cashed up account. The disadvantage is that while backing up the local wallet automatically includes local accounts, it does not backup imported accounts.
To create a wallet, use the āgoal wallet newā command (Iāve named this new wallet āpondā):
gary@pond : ~ $ goal wallet new 'pondā
Please choose a password for wallet āpondā:
Please confirm the password:
Creating walletā¦
Created wallet āpondā
Your new wallet has a backup phrase that can be used for recovery.
Keeping this backup phrase safe is extremely important.
Would you like to see it now? (Y/n): Y
Your backup phrase is printed below.
Keep this information safe ā never share it with anyone!
** Record the mnemonic for the wallet. **
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ā
Please enter the password for wallet āpondā:
Imported 2MDITZS63Sā¦
Note that the 25 word mnemonic is for the existing account, not the new wallet. In my case, I imported the account into which the proceeds from the auction were placed.
Review the account to ensure that the funds you expected to see are present:
gary@pond : ~ $ goal account list
Please enter the password for wallet āpondā:
[offline] Unnamed-0 2MDITZS63Sā¦ 500000000 microAlgos *Default
You might want to rename the imported account to something other than āUnnamed-0ā:
gary@pond : ~ $ goal account rename āUnnamed-0ā 'Auctionā
Renamed account āUnnamed-0ā to ā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 (so far I have found that you can only begin participation if the current āRoundā is within the range you set for the participation key). A number of commands will show the current round, one of which is ānode statusā:
gary@pond : ~ $ goal node status
Last committed block: 360704
Time since last block: 0.0s
Sync Time: 425.9s
Last consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Next consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Round for next consensus protocol: 360705
Next consensus protocol supported: true
Genesis ID: mainnet-v1.0
Genesis hash: wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=
In this example, the current round was 360705. At the current rate, 3 million rounds would be expected to keep the account participating for 5 Ā½ to 6 months. So, generating a participation key with a range of 3 million starting at 360800 would look like this:
gary@pond : ~ $ goal account addpartkey -a ā2MDITZS63Sā¦ā --roundFirstValid 360800 --roundLastValid 3361000 -w 'pondā
WARN[0001] dbatomic(w): tx took 1.299196031s file=dbutil.go function=github.com/algorand/go-algorand/util/db.Accessor.Atomic.func1 line=141
Participation key generation successful
Obviously Warnings are significant and this one was unexpected. Iāll have to explore it a bit more, later. On the surface it looks like an issue with network speed (transaction time). The key was created anyway.
The key will be created in the nodeās āmainnet-v1.0ā directory:
gary@pond : ~ $ goal account listpartkeys -w 'poolā
Filename Parent address First round Last round First key
2MDITZS63Sā¦.360800.3361000.partkey 2MDITZS63Sā¦ 360800 3361000 36.0
This system is now ready to participate once the round exceeds the starting value for the key (360800 in this case).
In the time itās taken me to write this, the current round has come within the range of the participation key, so I can now change the account to online:
gary@pond : ~ $ goal account changeonlinestatus -a ā2MDITZS63Sā¦ā -o=1 -w 'pondā
Please enter the password for wallet āpondā:
Transaction id for status change transaction: H5CTAPYP4Lā¦
All things being equal, your account will go online and will be debited the transaction fee (typically 0.1 Algo cents). Participation rewards will then accumulate in the online account. Actually, if you have Algos in an account, participation rewards accumulate even without a node.
gary@pond : ~ $ goal account rewards -a ā2MDITZS63Sā¦ā -w 'pondā
2102044 microAlgos
As an aside (and this is only what I have observed), if an account is already participating at a node (itās online), as soon as you add it to a new wallet on some other node (such as this one just built), it is reported as being online and it canāt be brought online again (at least until the original participation key expires). I am not familiar with how the Algorand blockchain is coded, but it would be logical for the system to immediately recognise accounts that are already online.