
Repository
https://github.com/dtube/avalon
What Will I learn?
- You will learn about syncing the system clock with ntp servers
- You will learn about interacting with Avalon blockchain through CLI
- You will learn how block production on Avalon blockchain works
System requirements
- Linux server running Ubuntu 16.04 and above
- Relatively modern quad core CPU
- 2GB RAM
- 20GB SSD
- Low latency internet connection
Since Avalon was newly launched (at the time when this was posted), the system requirements are low for running a leader node. As the blockchain grows, the requirements for running one will increase over time.
Other requirements
- Prior knowledge in Linux command line interface (CLI)
- Participation in DTube community and development
Difficulty
Basic
Required dependencies
- ntpd
- NodeJS version 10 LTS (version 12 may be buggy)
- nvm
- MongoDB
- Screen
- Git
Overview
In this video, we will be looking at setting up a leader node for Avalon, the blockchain for DTC tokens in DTube 0.9 and above. Avalon is a DPoS blockchain written in NodeJS, using MongoDB as chain database backend. Just like Steem, Avalon blockchain leaders produces blocks every 3 seconds, and leaders are rewarded with DTC or vote tokens for every block produced (to be determined later when main net launches). Currently, block production is done by the top 7 voted leaders (stake weighted). Leaders outside the top 7 will not get to produce any blocks.
We will be installing all required dependencies using package managers before running Avalon.
Syncing the clock
It is important to have the system clock synced so that the node will produce blocks with the correct timestamp such that it will be accepted by other nodes. This is to keep the block timestamp within the accepted range according to the time slot to prevent any missed blocks.
We will be using ntp
to sync the system clock with the nearest ntp servers.

Running Avalon
After installing all required dependencies and getting the mongo
daemon running and system clock synced with ntp
, it is time to sync up the blockchain and get a leader node running. We will be running Avalon in a screen
session, which allows you to have a terminal session running in the background.
After cloning the Avalon repository, we start by configuring the leader node by modifying start.sh file located in scripts
folder. Here we insert the peers to connect to, and the public and private key associated with the leader account (that has block signing ability). After saving the file, make the start.sh
executable by running chmod +x start.sh
, then start the Avalon blockchain by running ./start.sh
.

After syncing the blockchain, you need to broadcast your leader node details onto your Avalon account profile to announce your intent to be a leader on Avalon.
node src/cli.js profile -K <key> -M <user> '{"node":{"ws":"ws://yourip:yourport"}}'
Note: If you have anything in your profile (such as profile URL, avatar etc), you need to merge the existing JSON in your profile with the JSON object above.
Correction: profile
and node
are two separate keys for the JSON, not that node
is within profile
key. The entire JSON, including the profile
and node
keys are considered as a "Profile" by the CLI wallet, but technically it's just the JSON metadata of the account. So this means you need to copy from the opened curly bracket before the word "profile" up to both closed curly brackets when combining the JSONs. Thank you @tibfox for pointing this out!
Once that's done, you may vote for yourself (and techcoderx) here. At this point, make an Avalon leader announcement post to gain some votes!
DTube video tutorial
NOTE: I have accidentally leaked some passwords, which I have only realized after uploading the video to IPFS. They have already been changed.
Resources
Avalon blockchain documentation: https://github.com/dtube/avalon/blob/master/README.md
NTP pools: https://www.ntppool.org/en/
Managing screen terminal sessions: https://help.ubuntu.com/community/Screen
MongoDB documentation: https://docs.mongodb.com/manual/
MongoDB installation guide: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
Online JSON combiner tool: https://tools.knowledgewalls.com/onlinejsonmerger
GitHub account
▶️ DTube
▶️ IPFS