DECENT (DCT) : Witness Node Setup with Troubleshooting Tips (Part 1)

in decent •  7 years ago  (edited)
DECENT to ascent...

If you want to just play around and get the hang of it without spending too much, get an entry level SSD VPS. Expect to pay around 15 USD - 20 USD and a bit of your time. Most of these steps are copied from here (Credits to the Dev Team of DECENT) This is meant to supplement the guide with troubleshooting tips and how to address common problems based from actual experiments with the cheapest possible setup. 

  1. Deploy a VPS with Ubuntu 16.04 LTS 
  2. Secure your server. Install ufw, fail2ban, setup server access with ssh keys and disable root login and password login.
  3. Now, onto the good stuff. 
    1. # Download and build Boost 1.60.0
    2. $ mkdir -p ~/dev/DECENTfoundation/DECENT-Network-third-party
    3. $ cd ~/dev/DECENTfoundation/DECENT-Network-third-party
    4. $ rm -rf boost_1_60_0* boost-1.60.0*
    5. $ wget https://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz
    6. $ tar xvf boost_1_60_0.tar.gz
    7. $ mkdir boost-1.60.0_prefix
    8. $ cd boost_1_60_0
    9. $ export BOOST_ROOT=$(realpath ../boost-1.60.0_prefix)
    10. $ ./bootstrap.sh --prefix=$BOOST_ROOT
    11. $ ./b2 install
    12. $ cd ..
    13. $ rm -rf boost_1_60_0 boost_1_60_0.tar.gz

If you get to this part without seeing any errors... you're in for a good start (pat your back).

  1. Now clone the repo
    $ mkdir -p ~/dev/DECENTfoundation
    $ cd ~/dev/DECENTfoundation

    $ git clone [email protected]:DECENTfoundation/DECENT-Network.git
    $ cd DECENT-Network
    $ git submodule update --init --recursive
     
  2. Build the source  
    $ mkdir -p ~/dev/DECENTfoundation/DECENT-Network-build
    $ cd ~/dev/DECENTfoundation/DECENT-Network-build
    $ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug $ cd ~/dev/DECENTfoundation/DECENT-Network
    $ cmake --build . --target all -- -j -l 3.0
    $ cmake --build . --target install
  3. From here on if you don't see any errors you should have your binaries at ~/dev/DECENTfoundation/DECENT-Network-build/artifacts/prefix/bin
  4. Inside the folder above you will see 
    1. decentd - this is the binary for running the decent daemon connecting and synching your node to the DECENT Network 
    2. cli_wallet - this is where you can interact with the DECENT Network. ie. wallet transactions, network queries, registering and creating new accounts, voting etc. 
    3. DECENT - this is the GUI (graphical user interface) version of (2) above
  5. The next steps would be creating your new account and setting your miner/witness node. I will skip this part for now (I'll elaborate this on the next post) and will detail some of the troubleshooting tips during errors that you might encounter. 

Actions On:

1. Compilation Error when building the DECENT source. 

If you encounter this that means you have a mediocre server. Get a better one if you want to proceed to being a witness in the network. BUT if you want to investigate further or would have to stick with what you have... this error is saying "I can't handle this process because i ran out of memory to process this..." In Ubuntu, you can easily create and configure a swapfile - this will serve as a virtual RAM for your server. On your terminal do the following commands :

  1. $ sudo fallocate -l 4G /swapfile 
  2. $ sudo chmod 600 /swapfile 
  3. $ sudo mkswap /swapfile 
  4. $ sudo swapon /swapfile 

This will create a 4GB of additional virtual memory for your server. IF you think this is enough, go back to building the source again and make sure you clean the project space before starting again. rm -rf>

After successfully building (hopefully) you may opt to remove the swapfile to save some storage space: 

  1. $ sudo swapoff /swapfile
  2. $ sudo rm -rf /swapfile 

2. Running out of storage

When you run ./decentd and sync with the network then suddenly it breaks... check your storage space. If you think 16GB of storage space is enough? No, it's not so don't be a cheapo and get a better server package. After this expirement I ordered a new server with the following specs:  (Which seems to suffice for now)

  • 8GB RAM
  • Xeon E5-2650 4-Core Processor
  • 120GB SSD

-----------

This is it for now. Watch out for my next post on creating accounts, cli_wallet interactions and setting your miner/witness node. Again, I will include troubleshooting tips to those who are still struggling and learning to deploy their own server. 

Shoutout to @tjpezlo for pushing me to be active on DECENT (DCT). Also supporting the endeavors of @steemph.

If you find this post interesting and relevant please upvote or you can also vote me to be a witness on DCT vote_for_miner> precise true true


Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

good luck po s inyo sir on this endeavor,

Upvoted and reesteemed

thanks @kawal always willing to contribute to the community here.

Awesome. Was just looking for the guide to do this today. Thank you for sharing will give it go and if anything I will post in here.

You're welcome @bluudz i know how painful it is to start without references. The aim of this post is to relate my own experience towards a successful setup. Do let me know if you need further assistance.

This is excellent work.

You buy a new server with only 8GB of RAM?