Welcome to QBIT Blog & Docs Pages
You can use your own home server or better by far to Deploy a VPS instance Here with Vultr
For our setup we will use Ubuntu 18.04 or 20.04 as the operating system for our server. The steps will be mostly the same for any flavor of Linux. You can ssh or use putty or my favourite mobaxterm, https://mobaxterm.mobatek.net/ FREE edition to SFTP to your server, Use the 10 or 20 $ a month server options and name the vps something like daves.publicnode or however you wish.
• MobaXterm Personal Edition v20.3 or current edition.
We now need to add a username to our server as most VPS have root as login. Most of you will know how to do this but for those who may not => Login to terminal on mobaxterm click session on top bar add your server IP in remote host box, add root in specify username box click ok at bottom of box and your connected to your server simple as that. Then do apt update, followed by apt upgrade to bring the server up to date, then do
# sudo adduser < your user name here > use what ever name you like here.
press enter.
Set and confirm the new user password at the prompt. Use a strong password here not your bithday or 1234, If your password comprises one upper case letter, one symbol and one number it will take a computer 34,000 years to crack – if it’s a minimum of 12 characters long. MORE INFO at: Password Hacks Follow the prompts to set the new user information. Accept the defaults by leaving this information blank and just pressing enter.
Next run this command to provide admin rights to your server and switch to the new user
# usermod -aG sudo < your user name here >
# su - < your user name here > | press enter, your now the new sudo user,
To run a command as administrator (user "root"), use "sudo ". see here for more details: https://attacomsian.com/blog/create-user-with-sudo-privileges-on-ubuntu
Now lets build QbitNetwork on our server. First of all, we need to install all the dependencies just follow along with the code and Qbit will build itself.
cd ~
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh && nano nodesource_setup.sh
If useing nano Ctrl + O Enter X
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
The nodejs package contains the nodejs binary as well as npm, so you don’t need to install npm separately.
In order for some npm packages to work "those that require compiling code from source",
you need to install the build-essential package:
sudo apt-get install build-essential
The Node.js runtime is now installed, and ready to run an application.
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install aptitude -y
sudo aptitude install -y -o Aptitude::ProblemResolver::SolutionCost='100*canceled-actions,200*removals'
build-essential clang-6.0 libstdc++-7-dev git libboost-all-dev python-pip libssl-dev
python -m pip install --upgrade pip
sudo pip install cmake
export CC=clang-6.0
export CXX=clang++-6.0
git clone https://github.com/QbitNetwork/Qbit.git
cd Qbit
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -jxxxx or just make
The binaries will be in the src
folder when you are complete.
cd src
./QbitNetworkd --version
This could take some time go grab a coffee till then. When the Qbit build is complete, you’ll be able to see new files in the ~/Qbit/build/src/ directory. If you don’t see them there the build did not complete successfully and you need to execute these steps again.
We want our QbitNetworkd daemon to continue running in a stable manner and non-stop 24x7x365, So we need something that will do this for us.
There’s a good process manager called pm2 wich can be installed with npm, the package manager for nodejs
.
Setting up pm2 on your server is very simple, or you can use Screen,
sudo
npm install -g pm2
Do: Sudo ufw status | if enabled okay, Then Do:
sudo ufw allow 22/tcp
sudo ufw allow 22100
sudo ufw allow 22101
If ufw not enabled: Allow above ports first then Do:
Sudo ufw enable
And you can now start your daemon with the following command
./QbitNetworkd --enable-cors="*" --rpc-bind-ip 0.0.0.0 --rpc-bind-port=22101 --enable-blockexplorer --fee-amount 10 --fee-address < Your QBC wallet address here > you can make your fee any amount but dont make it to high or transactions may use another nodes.
When daemon is building use second terminal and run this command to activate your wallet service api.
./wallet-api --rpc-password your_password --enable-cors "*" --scan-coinbase-transactions.
Then exit to save
pm2 is our favorite production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, More information here: https://www.npmjs.com/package/pm2
Now you can monitor your daemon and check the program logs with pm2 by using:
pm2 monit
pm2 log