Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Build Avalon Node DTube in Debian 10

September 16, 2022
in Blog
0
ADVERTISEMENT

Table of Contents

Avalon install procedure for debian 10

1. Make sure debian is up-to-date and download git and a few other packages from the debian repos.

sudo apt-get -y update && sudo apt-get -y upgrade && \
sudo apt-get install git wget tmux htop jq unzip curl -y && \
git clone https://github.com/dtube/avalon.git && \
cd avalon

2. Install NodeJS + NPM

curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt-get -y install nodejs npm
node -v

3. Check node version with node -v. Avalon runs with node v14 and v16 only. If needed, install NVM and install and use other node versions:

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile 
nvm install v16
nvm use v16

4. Now install MongoDB:

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org

5. Enable and start MongoDB deamon:

sudo systemctl enable mongod
sudo systemctl start mongod

6. And install NPM modules that Avalon uses.

npm install

Sync your Avalon node

Once your avalon node and dependencies are setup correctly, if you run it with ./scripts/start.sh, it will start a new developement chain. Instead, you probably want to sync your node to the mainnet.

First, we need to download the genesis block (block #0) and save it as ./genesis/genesis.zip:

mkdir genesis
cd genesis
wget https://backup.d.tube/genesis.zip
cd ..

You will need to add some default peers to use to connect to the network. Near the bottom of the scripts/start.sh script:

export PEERS=ws://34.65.228.228:6001,ws://dseed.techcoderx.com:6001
export MAX_PEERS=50
Bg1710

You would also need to specify the path to the folder containing blocks.bson file in BLOCKS_DIR, which is a read and append only file that stores all blocks.

export BLOCKS_DIR=/var/blocks

You can wipe the mongodb database (assuming you are using the default avalon db name).

mongo avalon --eval "db.dropDatabase()"

Replay the blocks and transactions

This is the fastest method that reverifies locally all the past blocks and transactions, and therefore the current blockchain state. You will need to download the blocks.bson file into the folder specified in BLOCKS_DIR env var.

Note To speed up the rebuild process further, you may opt to skip block validations with REBUILD_NO_VALIDATE=1 env var.
wget -P /var/blocks -c https://backup.d.tube/blocks.bson
REBUILD_STATE=1 ./scripts/start.sh
Bg1712

A file named blocks.index will be constructed (if not already exists) which stores the pointers to each block in blocks.bson. This may take a few minutes.

Bg1711

Start the node

./scripts/start.sh

Enabling your node for block production

If you want to start producing blocks on avalon, your account will need to define a leader key. Generate one into a file with

node src/cli key > leader-key.json
Bg1713

Secondly, you will need to enter your username, public leader key, and private leader key at the bottom of the scripts/start.sh file, and restart your node.

Bg1714

Finally, you will need to associate your public leader key with your account by using the on-chain transaction.

node src/cli enable-node YOUR_LEADER_PUB_KEY -M YOUR_USERNAME -K YOUR_KEY
root@avalon:/home/avalon# node src/cli enable-node 279ebwnDEDbRMSTBHnFZtCvz3HbKnyN7UWBNLJBWWEU4K -M freemskeys84 -K ********
19012394
This transaction must be signed with your master key, or a custom key that allows this transaction. Once this step is done, you can head to the leader election page and vote yourself. If your leader key is properly associated to your account, you should see yourself uncrossed.
Bg1717
Note Note: DTube limits number of leaders (currently 15) are elected and are in charge of producing new blocks and securing the infrastructure.
5/5 - (1 vote)
Previous Post

How to Disable IPv6 on Linux Operating System

Next Post

How to Show the Tables or Collections in a Mongo Database

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory