The next Hardfork, HF20 (what is that?), is planned for Tuesday, 25th September 2018 15:00 UTC.
I've already gone ahead and updated steemd on my primary witness-server and my seed-node to v0.20.0.
Instead of relying only on docker scripts, I also build Steem manually. And I know how difficult it is to find information/instructions about this. So I thought I'd make a post about it, for my fellow witnesses and those who want to become one in the future.
Building Steem Manually: Instructions
The official instructions can be found on the Steem Github: https://github.com/steemit/steem/blob/master/doc/building.md
I'm using Ubuntu 16.04 so that's what I'll use as the requirement here. (Other versions of Ubuntu need manually fiddelling with different versions of g++, boost etc.)
Additionally, you need at least 64GB RAM (or know how to deal with lower) in addition with 250GB+ disk space.
Disclaimer: If you read this post much later than the time of posting, the requirements will prob. have changed.
1.) Install Packages
The first step is to install all the needed packages.
Required packages
sudo apt-get install -y autoconf automake cmake g++ git libssl-dev libtool make pkg-config python3 python3-jinja2
Boost packages
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 libsnappy-dev libbz2-dev
Other Packages
sudo apt-get install -y ntp screen
Optional packages (not required, but will make a nicer experience for building)
sudo apt-get install -y doxygen libncurses5-dev libreadline-dev perl
2.) Clone Steem
Afterwards, we're going to clone the repository and checkout the correct branch.
git clone https://github.com/steemit/steem
cd steem
git checkout master #master is v0.20.0, stable is the version before
git submodule update --init --recursive
3.) Build Binaries
Next up we are going to build the binaries - steemd & cli-wallet.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLOW_MEMORY_NODE=ON -DCLEAR_VOTES=ON -DSKIP_BY_TX_ID=ON ..
make -j$(nproc) steemd
make -j$(nproc) cli_wallet
# create a local bin folder and copy the binaries there
mkdir ~/bin
cp programs/steemd/steemd ~/bin
cp programs/cli_wallet/cli_wallet ~/bin
cd ~/bin
4.) Verify Steemd Version
Afterwards, make sure you've got the right steemd version, by entering steemd -v
while inside the ~/bin
folder.
It should look like:
steem_blockchain_version: 0.20.0
steem_git_revision: 9ea7ddf28c13b60df750434ddead8f7182d03e40
fc_git_revision: 9ea7ddf28c13b60df750434ddead8f7182d03e40
------------------------------------------------------
STARTING STEEM NETWORK
------------------------------------------------------
initminer public key: STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX
chain id: 0000000000000000000000000000000000000000000000000000000000000000
blockchain version: 0.20.0
------------------------------------------------------
5.) Set Up TMPFS
If you want to use TMPFS for the shared memory file:
sudo mount -o remount,size=64G /dev/shm #change the size AND/OR the path if you need to
sudo sysctl vm.swappiness=1
6.) Create Config
Once you've got the steemd bin, you need to run it, so that the default config gets created.
If you want to have a global data folder (outside the bin folder), you need to create it first.
#cd ~/bin
steemd -d data/ #data is the directory
# close steemd again
nano data/config.ini
7.) Edit Config
Now, change the following parameters, based on your requirements and save the config.
shared-file-dir = /dev/shm/
shared-file-size = 64G
witness = YOURWITNESSNAME
private-key = PRIVATEKEY
plugin = # use the plugins you need
8.) Download Blocklog
Normally you would need to reindex steemd, which takes a lot of time, instead of just replaying.
So to save time, we'll first download the block-log and decompress it. (or you can download the decompressed version directly)
cd ~/bin/data/blockchain
rm block_log # delete old log
rm block_log.index # delete old index
# Either you can downloaded the compressed version and decompress it
wget https://gtg.steem.house/get/blockchain.xz/block_log.xz
xz -d block_log.xz -v # decompress block_log (will take roughly 1+ hour based on log size)
# Or download the decompressed version directly (it is 3-4x bigger)
wget https://gtg.steem.house/get/blockchain/block_log
Once we've done that, we're nearly done.
9.) Screen Session
The only thing that is left: making sure steemd is running, even if we're not connected via ssh to the server.
For that I'm going to use Screen
with bash scripts (all credits go to @drakos for those)
# First make sure you have screen installed.
sudo apt-get install -y screen
# Then we're going to create the scripts (change path if needed)
cd ~/bin
echo -e '#!/usr/bin/env bash\nsteemd -d ~/data' > ~/bin/steemd-start.sh
echo -e '#!/usr/bin/env bash\nsteemd -d ~/data --replay-blockchain' > ~/bin/steemd-replay.sh
chmod +x ~/bin/steemd*.sh
# Next, we're adding aliases to the ~/.bashrc file
nano ~/.bashrc
# Copy those lines below into the file and save (change path if needed)
echo -e 'logfile steemd.log\nlogfile flush 1\nlog on' > ~/bin/steemd.conf
alias startsteemd='screen -X -S steem quit ; rm ~/steemd.log ; cd ~ ; screen -c ~/bin/steemd.conf -dmSL steem ~/bin/steemd-start.sh'
alias replaysteemd='screen -X -S steem quit ; rm ~/steemd.log ; cd ~ ; screen -c ~/bin/steemd.conf -dmSL steem ~/bin/steemd-replay.sh'
alias entersteemd='screen -x steem'
alias logsteemd='tail ~/steemd.log -f -n30'
Afterwards logout and login or enter source ~/.bashrc
.
Commands
- replaysteemd: replay steemd
- logsteemd: monitor the logs (tail)
- startsteemd: starts a screen session or kills it and starts again. (Exit with CTRl+A+D to leave process running)
When you run startsteemd
or replaysteemd
for the first time, you might get an error. Just enter it again.
Also, you should monitor the steemd.log size and delete it if it gets too big.
10.) NTP
Last but not least, to make sure you have an exact time-source and to prevent missed blocks due to time-differenes, we use NTP.
sudo apt-get install -y ntp # if you haven't already
sudo nano /etc/ntp.conf
# And then add these two lines
minpoll 5
maxpoll 7
# After saving the conf
sudo systemctl enable ntp
sudo systemctl restart ntp
To learn more about NTP: https://steemit.com/howto/@l0k1/howto-configuring-more-frequent-time-synchronisation-on-ubuntu
And that's it.
You should now have a Steem node that is ready to use.
I hope you found this post & the instructions helpful. And if there is an error or typo in this post, please let me know.
With that said:
Take care!
Witness Infrastructure:
Primary Node: 128GB - v0.20.0 | Backup Node: 64GB - v0.19.12 | Seed Node: 64GB - v0.20.0
Projects I've developed on Steem:
Smartsteem.com > Investment & Promotion Service on Steem
Steem Chat-Wallet & Witness Essentials > Github: https://github.com/therealwolf42
If you believe that I'm of value for Steem, then please vote for me as witness. You can also set me as a proxy and I'll vote on great witnesses for you.
Thanks so much for this, I can now get rid of about 20 bookmarks I use in advising people what to do with their witness server.
++
many hugs x
That's why I did it! Glad you found it useful! :)
very useful, I had all the gold snippets and what not scattered across so many past posts, and so many of the newer ones are like.
Durrrrr... Docker...1,2,3..., followed by #witness "why is (insert possible failure SS) happening...I run Docker... posts
rinse and repeat. :)
build it, it will compile.
:)
This is superb. Thanks. Upvoted. Resteemed. Followed.
You've won yourself a Dudeist priest and a Dudeist salute.
Would using systemctl not be more robust? In case of a server reboot, steemd would automatically started.
My /etc/systemd/system/steemd.service:
[Unit] Description=steemd_server After=network.target zram-config.service [Service] WorkingDirectory=/home/holger80/.steemd ExecStart=/usr/bin/steemd --data-dir=/home/holger80/.steemd Restart=on-failure [Install] WantedBy=multi-user.target
The TMPFS file system should also be entered into /etc/fstab in order to be persistent for a reboot:
These command gone upside of my head....
Price will jump after hard fork ??
a bit
hahahhahaha you can be so funny, yet its so subtle! i love it
It will jump, could be a week, a month, a year or a decade. Nobody knows.
Decade! haha lol
I upvoted your post.
Best regards,
@Council
Posted using https://Steeming.com condenser site.
Thanks for this - what is the source of the HF20 specific info? Is it from github somewhere? I'm sure I recall one of the developers (maybe at Steemfest) mentioning that this line would not be necessary in newer builds:
Does anyone remember that?
Sure thing!
Not sure what you mean, but I wasn't at the previous Steemfest.
I just mean that I haven't seen any published info from Steemit inc. referring to specific changes needed for building the code for HF20, so I wondered where you got any changes from. e.g. new dependencies.
I wasn't at steemfest either, but I watched the videos and there were a few from the devs speaking about future releases.
hahaha, this is awesome. When I first saw your post, I am like, hey another way to build up my steem.( Could not figure why the HF20 ready. ) NOT!!!! I am not into programming of anykind but this looks like great info for someone who is. Thanks for sharing @therealwolf.
Great article @therealwolf Do you host your witness node on a cloud platform? i.e AWS, DigitalOcean etc.
Or do you host on your own server locally?
Do you find it profitable? or do you simply host for the greater good of the Steem platform.
I am considering hosting my own witness node.
Hi @therealwolf!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 7.828 which ranks you at #36 across all Steem accounts.
Your rank has not changed in the last three days.
In our last Algorithmic Curation Round, consisting of 499 contributions, your post is ranked at #2. Congratulations!
Evaluation of your UA score:
Feel free to join our @steem-ua Discord server
Thinking to become a witness is still far for me, in that respect, is/are there ways we can build steem manually too?