🔢 Four easy steps to get your Algorand node online!

So you've gone through the steps to get a participation node up and running, now it's time to get that puppy online and participate in the consensus protocol!! The following steps assume a Mac/Linux flavoured command line and the user you're signed in to the server with has permissions to run goal and clerk commands (but not as root!)

Sorry Windows users, you're on your own...

1. 💸 Create a Wallet

The first step is to create a wallet if you don't already have one. A wallet is the container that holds all your accounts.

Check you don't already have a wallet: $ goal wallet list No wallets found. You can create a wallet with `goal wallet new`

So you're good to go on creating a new one. I'll leave it to you to decide if you want to give your wallet a password but for the sake of this run through, I'm skipping by just hitting return twice: $ goal wallet new mywalletname Please choose a password for wallet 'mywalletname': Please confirm the password: Creating wallet... Created wallet 'mywalletname' 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!

Stick the wallet mnemonic somewhere extremely secure! You can now see your wallet shown in the listing command:

$ goal wallet list
##################################################
Wallet: mywalletname (default)
ID:     9e444488397112241b269648f93cbc13
##################################################

2. 🌐 Import an existing account

We can now create or import an account we want to use for participation into our new wallet. I prefer the latter as it can be an account linked to an existing NFD.

$ goal account import -m "this is my twenty five word mnemonic without commas"
Imported RAND0MADDR355NGNZF5F7VCYHTZTN7DU4C7D5UFIGKTFHYBEZUU5B74O4A

So now we have a wallet and an account within it. You can check the address is the one you intended by checking its balance:

goal account balance -a RAND0MADDR355NGNZF5F7VCYHTZTN7DU4C7D5UFIGKTFHYBEZUU5B74O4A
1234567890000 microAlgos

3. 🔑 Generate Participation Keys

So we're now ready for the main show...

Time to generate the participation keys and add to the decentralised network!

We need to define how long our keys are to participate before they need refreshing. For security, it is recommended that the range does not exceed 3,000,000 rounds.

The following two commands populate some convenient variables: roundFirstValid=$(goal node lastround) roundLastValid=$(expr $roundFirstValid + 3000000)

That gives us all we need to generate our keys! This next command really does take a couple of minutes so maybe put the kettle on... $ goal account addpartkey \ -a RAND0MADDR355NGNZF5F7VCYHTZTN7DU4C7D5UFIGKTFHYBEZUU5B74O4A \ --roundFirstValid=$roundFirstValid \ --roundLastValid=$roundLastValid Please stand by while generating keys. This might take a few minutes... Participation key generation successful. Participation ID: DGH64DZUMDNRXG40005Y7YC00000000P2UBDFYQBH3KTRFXVBSEA Generated with goal v3.12.2

You can see the keys now with $ goal account listpartkeys Registered Account ParticipationID Last Used First round Last round no RAND...4O4A DGH64DZU... N/A 25704075 28704075

Pat yourself on the back! You have what it takes to participate in the best of the best consensus protocol!

We're on the home straight!

4. 📝 Register account online

Some time would have passed since we set the round variables so let's get the value for the last round and put it in a var: firstValid=$(goal node lastround)

Then this next command generates the raw transaction file online.txn in your current directory: goal account changeonlinestatus \ --address=RAND0MADDR355NGNZF5F7VCYHTZTN7DU4C7D5UFIGKTFHYBEZUU5B74O4A \ --fee=2000 \ --firstvalid=$firstValid \ --lastvalid=$(expr $firstValid + 100) \ --online=true \ --txfile=online.txn

We then need to sign the transaction which will generate another file online.stxn. If you set a password on your wallet, you'll be prompted to enter it: goal clerk sign --infile="online.txn" --outfile="online.stxn"

And finally... roll on the drums... Send the transaction $ goal clerk rawsend --filename="online.stxn" Raw transaction ID WI7XC5S6AJDJHGMP4KSS3HKJKNR63LMZEPDISIUJXPBYOAW4ZAIQ issued Transaction WI7XC5S6AJDJHGMP4KSS3HKJKNR63LMZEPDISIUJXPBYOAW4ZAIQ still pending as of round 25704912 Transaction WI7XC5S6AJDJHGMP4KSS3HKJKNR63LMZEPDISIUJXPBYOAW4ZAIQ committed in round 824634861576

😎 Congratulations, you are now participating in the Algorand consensus!

Go check out your address on https://algoexplorer.io/ and notice top right it should show status as online.

I almost forgot... P.S.

There is an amazing service by the folks at Metrika that sends alerts if there is any status change on your node. This is extremely useful for reminding you to renew your participation keys! Head over to: https://app.metrika.co/algorand/alerts/home to register for alerts.

Bonus section: Renewing participation keys

After a little under three million rounds, you should get an email from Metrika (if you registered) telling you it's time to renew your participation keys.

There's a great outline of the steps on the Algorand developer portal but I'll drop some cli commands here to make it easy:

lastRound=$(goal node lastround) # Add more or less half an hour roundFirstValid=$(expr $lastRound + 600) # For security, it is recommended that the range does not exceed 3,000,000 rounds. roundLastValid=30000000 roundLastValid=$(expr $roundFirstValid + 3000000) # Hit that generator... goal account addpartkey \ -a RAND0MADDR355NGNZF5F7VCYHTZTN7DU4C7D5UFIGKTFHYBEZUU5B74O4A \ --roundFirstValid=$roundFirstValid \ --roundLastValid=$roundLastValid \ --outdir $ALGORAND_DATA/mainnet-v1.0/

Now you have to wait for the first round of the new key to come around. You can check on the number of rounds to go by using the following command: expr $roundFirstValid - $(goal node lastround)

Once the network reaches the first voting round for the new key, submit an online key registration transaction for the new participation key which we did in section 4. above!