Introduction to STEEM Blockchain: Part 4 Setup Steem Node
Posted By : Hotam Singh | 28-Aug-2019
Welcome to the series of Introduction of STEEM Blockchain. In previous blogs of this series, I covered the basics of STEEM blockchain. In this part of the series, we are going to setup a node and syncing with blockchain. I have divided node setup guide into four parts which are as given below:
- Clone code
- Configure network(testnet/mainnet)
- Start witness node
Steem blockchain is an open-source and anybody can dispatch the steem blockchain. Steem blockchain chip away at the idea of 'Verification of-Brain' calculation. Evidence of-Brain is a sort of tokens rewards calculation that urges individuals to make and clergyman content.
It's empowering tokens to be dispersed by "upvote" and "like" base calculation and can be incorporated with the site to adjust motivations between application proprietors and network part to goad development.
Step 1: Prerequisites
After download Steem code we need to compile it. (it is written it c++ so we need c++ compiler dependencies).
Note: For running steem blockchain require ubuntu 16.04 for fully compatible.
1.1 Install the following dependencies
sudo apt-get install -y \ autoconf \ automake \ cmake \ g++ \ git \ libbz2-dev \ libsnappy-dev \ libssl-dev \ libtool \ make \ pkg-config \ python3 \ python3-jinja2
1.2 Boost packages (also required)
sudo apt-get install -y \ libboost-chrono-dev \ libboost-context-dev \ libboost-coroutine-dev \ libboost-date-time-dev \ libboost-filesystem-dev \ libboost-iostreams-dev \ libboost-locale-dev \ libboost-program-options-dev \ libboost-serialization-dev \ libboost-signals-dev \ libboost-system-dev \ libboost-test-dev \ libboost-thread-dev
1.3 Optional packages
sudo apt-get install -y \ doxygen \ libncurses5-dev \ libreadline-dev \ perl
Step 2: Clone code
after clone and download dependencies we have to configure and compile our steem blockchain.
git clone https://github.com/steemit/steem
git checkout stable
git submodule update --init --recursive
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_STEEM_TESTNET=ON ..
make -j$(nproc) steemd
make -j$(nproc) cli_wallet
Note: Don’t forget to add .. at the end(cmake command). It’s important.
Note: It will take time to compile the blockchain code for ready to run.
Step 3: Configure Network
After compile code First launches the steemd process once to generate the initial/default config.ini file and print the default private key.
Edit file ./testnet/config.ini and set below configuration. setup the witnesses to produce blocks along with the private key printed above at the time of starting blockchain.
# name of the witness controlled by node (e.g. initminer )
witness = "initminer"
# WIF private key (may specify multiple times)
private-key = 5JNHfZYKGaomSFvd4NUdQ9qMcEAC43kujbfjueTHpVapX1Kzq2n
# Endpoint for P2P node to listen on
p2p-endpoint = 0.0.0.0:2001
# Endpoint for websocket RPC to listen on
rpc-endpoint = 127.0.0.1:9876
# Shared file size(contains blockchain data)
shared-file-size = 54G
# Enable stale production
enable-stale-production = true
# required participation
required-participation = 33
Note: If you are setting up private node, set required-participation = 0 initially. Increase later when node increases.
Step 4: Start the first witness
At this point, we can start the generation of blocks with initminer as unique witness. Being in the steemd folder run
After setup the witness node in testnet/config.ini file, you need to re-start blockchain with the following command
$ ./steemd -d testnet
After that, the blockchain is starting to producing blogs