Steem Pressure #7: Go Fork Yourself. Step by step guide to building and setting up a MIRA powered HF21-ready Steem consensus node.

in #steem-pressure5 years ago

The date of the next, 21st HardFork, has been set, and it is approaching quickly.

<p dir="auto">There's plenty of info around the web on how to build a Steem node from scratch.<br /> I also wrote a guide some time ago: <a href="/@gtg/steem-pressure-3-steem-node-101">Steem Pressure #3: Steem Node 101.<br /> But the trouble is that such tutorials are getting old and obsolete. <p dir="auto">My previous one was made for version 19 at its early development stages.<br /> Now, we have version 21 released, so it is a good opportunity for an update. <p dir="auto"><center><br />
<sup>Video created for <a href="https://steemit.com/created/steem-pressure" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Steem Pressure series.<br /> <h1>Hardware <p dir="auto">Nothing fancy.<br /> Actually we will use something reasonably modest and cheap. <p dir="auto">Meet the <strong><code>mirabelle:<br /> <strong>Intel Xeon CPU W3530 @2.80GHz<br /> <strong>16GB DDR3 ECC 1333MHz RAM<br /> <strong>2x 240GB SSD <h1>Operating system <p dir="auto">Ubuntu 18.04 LTS <p dir="auto">Clean, basic server install.<br /> No fancy tweaks or customizations.<br /> <code>/home is <strong>RAID0 because we need speed and space.<br /> In the case of a failure, we just use a new one. <h1>Let's Go <p dir="auto">Few steps needs to be done as <code>root: <h6>Make sure that your system is up to date: <p dir="auto"><code>apt update && apt upgrade <h6>Use <code>ntp or <code>chrony to keep your system clock in sync: <p dir="auto"><code>apt install ntp <h6>Create an account for steem purposes: <p dir="auto"><code>useradd -s /bin/bash -m steem <h6>Set appropriate values for open files limits needed by MIRA: <pre><code>cat << 'EOF' >> /etc/security/limits.conf steem soft nofile 65535 steem hard nofile 65535 EOF <p dir="auto"><img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmNdB8P3krYeCKN7nSW5EPTU2JcSRxLbSFRPgYX1qyv8CW/limits-conf.gif" alt="limits-conf.gif" /> <h6>Install packages needed for building Steem: <pre><code>apt install \ automake \ build-essential \ cmake \ doxygen \ libbz2-dev \ libboost-date-time-dev \ libboost-chrono-dev \ libboost-context-dev \ libboost-coroutine-dev \ libboost-filesystem-dev \ libboost-iostreams-dev \ libboost-locale-dev \ libboost-program-options-dev \ libboost-serialization-dev \ libboost-system-dev \ libboost-test-dev \ libboost-thread-dev \ libreadline-dev \ libsnappy-dev \ libssl-dev \ libtool \ ncurses-dev <h6>Now we continue as a user <code>steem: <p dir="auto"><code>su - steem <h6>Clone the steem repository: <p dir="auto"><code>git clone https://github.com/steemit/steem <h6>Checkout the latest release: <p dir="auto"><code>cd steem<br /> <code>git checkout v0.21.0 <h6>Create build directory: <p dir="auto"><code>mkdir ~/build <h6>Configure steem build: <p dir="auto"><code>cd ~/build <pre><code>cmake -DCMAKE_BUILD_TYPE=Release \ -DLOW_MEMORY_NODE=ON \ -DCLEAR_VOTES=ON \ -DSKIP_BY_TX_ID=OFF \ -DENABLE_MIRA=ON \ -DSTEEM_STATIC_BUILD=ON \ ../steem <p dir="auto"><img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmer9Kr9r3TgxJZVmoKTx4xPHuf8pZh3iYimrKULfjCGSL/git-checkout-cmake.gif" alt="git-checkout-cmake.gif" /> <h5>Build <code>steemd: <p dir="auto"><code>make -j4 steemd <p dir="auto"><img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmUGjqx58Q68SYQAYi3aGZksXuy3LNbzUmzpUG9TTta238/build-steemd.gif" alt="build-steemd.gif" /> <h6>Build <code>cli_wallet: <p dir="auto"><code>make -j4 cli_wallet <h6>Create local bin directory for convenience: <p dir="auto"><code>mkdir ~/bin <h6>Copy <code>steemd and <code>cli_wallet binaries to local bin directory: <p dir="auto"><code>cp -v ~/build/programs/steemd/steemd ~/bin<br /> <code>cp -v ~/build/programs/cli_wallet/cli_wallet ~/bin <h6>Congratulations! <p dir="auto"><code>~/bin/steemd --version <p dir="auto">Now you have required binaries.<br /> Time to configure and run your node. <h6>Create proper directory tree: <p dir="auto"><code>mkdir -pv ~/.steemd/blockchain <h6>Create minimalistic config file for consensus node: <pre><code>cat << 'EOF' >> ~/.steemd/config.ini plugin = witness plugin = condenser_api network_broadcast_api block_api webserver-http-endpoint = 127.0.0.1:8090 webserver-ws-endpoint = 127.0.0.1:8090 EOF <p dir="auto"><img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmfJxAnAk2jvJMEoo3U3ivLDhie3vPvXxmSU8RfFLMrYcQ/config-ini.gif" alt="config-ini.gif" /> <p dir="auto">Yes, you really don't need more than that for a very basic node defaults are OK. <p dir="auto">To speed up reaching the head block: <h6>Download blocks from a trusted source: <pre><code>wget https://gtg.steem.house/get/blockchain/block_log \ -O ~/.steemd/blockchain/block_log <p dir="auto"><img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmU7ctGwLErG6D3dTXyFeRgGxes3zXqq9KEXP52bvT1645/block_log.gif" alt="block_log.gif" /> <h6>Now run: <p dir="auto"><code>~/bin/steemd --replay<br /> and have fun! <p dir="auto">This configuration is expected to reach the head block within 72 hours. <h1>Footnotes: <ul> <li>You might want to run above inside <code>screen. <li>Once it replays all the blocks from <code>block_log, it will sync with Steem p2p network up to the head block and continue running. <li>Next time start <code>steemd without <code>--replay. You need to do that only if your changes will affect the state (such as adding or re-configuring plugins). <li>You might want to add <code>account_by_key (for <code>cli_wallet’s <code>list_my_accounts feature) and <code>account_history (to track your own account history) but in this guide I wanted to focus on a simplest case. <li>You need to wait for replay to complete before you can use API endpoint. <h1>Previous episodes of Steem Pressure series <p dir="auto"><a href="/@gtg/introducing-steem-pressure-1">Introducing: Steem Pressure #1<br /> <a href="/@gtg/steem-pressure-2-toys-for-boys-and-girls">Steem Pressure #2 - Toys for Boys and Girls<br /> <a href="/@gtg/steem-pressure-3-steem-node-101">Steem Pressure #3 - Steem Node 101<br /> <a href="/@gtg/steem-pressure-the-movie">Steem Pressure: The Movie ;-)<br /> <a href="/@gtg/steem-pressure-4-need-for-speed">Steem Pressure #4 - Need for Speed<br /> <a href="/@gtg/steem-pressure-5-run-block-run">Steem Pressure #5 - Run, Block, Run!<br /> <a href="/@gtg/steem-pressure-6-mira-ymmv-rtfm-tldr-lgtm">Steem Pressure #6 - MIRA: YMMV, RTFM, TLDR: LGTM<br /> Stay tuned for next episodes of Steem Pressure :-) <hr /> <p dir="auto"><sup><br /> If you believe I can be of value to Steem, please vote for me (<a href="/@gtg"><strong>gtg) as a witness on <a href="https://steemitwallet.com/~witnesses" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Steemit's Witnesses List or set (<a href="/@gtg"><strong>gtg) as a proxy that will vote for witnesses for you.<br /> <strong><em>Your vote does matter!<br /> You can contact me directly on <a href="https://steem.chat" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">steem.chat, as <a href="https://steem.chat/direct/gandalf" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Gandalf<br /> <br /> <center><br /><br /> <a href="/">Steem On<br /> <span> <img src="https://images.hive.blog/768x0/https://steemitimages.com/DQmSheuDfCHizk1xvHPcrFjQNKfBzgun9UXDxdEp6JJCum9/steem_wide.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/DQmSheuDfCHizk1xvHPcrFjQNKfBzgun9UXDxdEp6JJCum9/steem_wide.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/DQmSheuDfCHizk1xvHPcrFjQNKfBzgun9UXDxdEp6JJCum9/steem_wide.png 2x" />
Sort:  
Loading...

I would be interested to see benchmarks on the new AMD Epyc chips...

Unfortunately I don't have such hardware available. Ideally it will be same disks, similar RAM setup, and just a difference with CPU/MB vs some high performance Intel setup.

PS
Please take a look at your node, it's missing blocks and it will continue as there's no longer witness shutdown vop in place due to 51% escalation issue, so the only way currently to disable it, is operator nullifying signing key.

Oh, I didn't know that. I'll shut it down.

Better yet - come back! :-)

I have no time unfortunately.

So if a full-fledged system is to be made from the instructions you have given here, how much time would it take for it to be made available to the public and what about the security of the chain?

In this configuration node will not be available to the public in other means than just being a part of Steem p2p network. It's a consensus node. In this configuration it can serve you as a simple API node (with subset of supported API calls), you can use it for example to broadcast transactions to the network.

<p dir="auto">To turn it into a public seed node, you need to add:<br /> <code>p2p-endpoint = 0.0.0.0:2001<br /> which will make it to listen on all interfaces on port 2001 (default p2p port for Steem)<br /> and then let people know on a steem.chat's <a href="https://steem.chat/channel/seed-nodes" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">#seed-nodes channel that a new seed-node is in town ;-)<br /> Static IP is required and some reliable hostname is obviously good to have. <p dir="auto">It will take about 72 hours using that example hardware/software configuration to reach the head block. <p dir="auto">When it finish replaying, its API endpoint will be available. You can use some proxy with SSL termination to make it available to the public too, but keep in mind that API is limited. <p dir="auto">Such node might improve distribution of the system but it doesn't play the same role as in PoW networks.

Hoping this to change a bit on the next SMT model...

its not a standard thing...everyone will have its "crazy" things... I for example, would be more enterprise model... if I had the money to support it. Not that I could not do it with what I have (which I have done in the past)...

Everything depends... ask something more specific, and I might be able to shed some more light. If that's where you want to go.

Thanks. I’ve been looking for an updated Steem Node setup guide. If I have a much more powerful machine with 128Gb RAM what can I add to make it a full node?

Posted using Partiko iOS

I wouldn't recommend using "full node" anymore, i.e. monolithic instance.
I would rather use fat node and low mem node of AH - your machine might be good for one of those. Adding Hivemind and Jussi there, will make it pretty nice set to satisfy full API needs.

@gtg great to see guides coming out to set up MIRA. Loving the console animations.

Posted using Partiko Android

1333MHz RAM 😲

something reasonably modest and cheap

:-)

very! indeed.... I could get tons of it... but I would not have power enough to support it.

Perfect timing 👨🏾‍🚀👍🏽

can get @reggaesteem node up asap

🍻!BEER

Posted using Partiko iOS

It's good to start with a public seed node and try to keep it up and running.
To make your seed node available to general public you will need to add:
p2p-endpoint = 0.0.0.0:2001
and let people know on a steem.chat's #seed-nodes channel that a new seed-node is in town ;-)
Static IP is required and some reliable hostname is preferred.
(above is true for public seed node)

Thank you for this! I swear I’m gonna do this someday!

Posted using Partiko iOS

..sounds like being possible also for me (one day..)..thx..up..follow you..

Amazing howto, amazing title. Forking myself in the next days. ☕️😃

Posted using Partiko iOS

Thanks. I would love to set a node someday. Maybe today? ;)

What the heck is the purpose for a witness proxy?

Off-topic yes, but maybe an idea for you to do a witness episode?

Anyways, this was an awesome and super easy step-by step! Thanks!

Witness proxy is an account that you chose to vote for witnesses on your behalf.
It's meant for people that don't pay that much of attention to what's going on with witnesses and are comfortable trusting their witness proxy to make those choices for them.
So if you set someone to be your witness proxy, whenever they decide to approve or unapprove some witness, your votes will be exactly the same.

Great explanation! I love that you included a use case, thank you!

Everybody is looking forward to the date and the kickstart of the 21 hardfork and I must say, majority people can't wait

True effects of HF21 will not be instant. It might take a month or two before people will adjust their habits.

To learn more.This post earned a total payout of 0.041$ and 0.031$ worth of author reward which was liquified using @likwid.

I would use a hybrid RAID0 NVMe with RAID5/6 disks... but not recommended on Ubuntu... CentOS or RedHAT 100% ok! =) Tested. With snapshots backups daily and MANY recovery tests ...

Doesn't make much sense when it comes to simple consensus node.
That one is just cheap and simple.
What exactly is not recommended on Ubuntu, and why?

cached LVM filesystems... to be specific! Lots of bugs! Especially on converts and recovery situations... and if you don't use extX filesystems even worse...

Nice to see a new steem pressure post. I wonder how many new witnesses there will be and how many will stop over the next year.

Posted using Partiko Android

If I set up a node in this fashion, would I be able to execute RPC calls against it using Beem? I specifically believe I need the reward API from previous discussions.

I would guess I would not be needing condenser in that case. My intent is to test the SFR bot at some point and explore a mechanism so reward flags different coming from downvote mana.

Any thoughts / guidance would be appreciated.

Posted using Partiko Android

While you can use it to perform some calls, LOW_MEMORY_NODE might not be enough for you. Please note that rewards_api is for testing purpose only, and explicitly said that it's not meant for use in production.

I may be getting the API needed confused in that case.

Our bot does approximate flag rshares to SBD conversions using methods of the Beem Steem class for it's voting.

Looks like the method uses get_sbd_per_rshares which calls get_reward_fund. That uses the database API if I am understanding correctly.

That should be fine, right?

Posted using Partiko Android

The rewards_api is something brand new that was used to attempt to model the changes to rewards after HF21.

<p dir="auto">What you are referring to is found in <code>condenser_api which the the api you will use the majority of the time. Sometimes there is the need for <code>database_api but, neither of those are explicitly declared in the config.

This post has been resteemed by @witnessnews.

Follow @witnessnews to keep up with active witness updates.

Go fork yourself

lol

Can I start one with dule core 8 gb ram and 500gb hard drive

Posted using Partiko Android

All depends on details. 8GB RAM itself wouldn't be that bad but you will experience much higher replay times, especially when your drive is a platter drive, i.e. not SSD.

Why do you think 8GB RAM would limit replay speed? When I was replaying my MIRA node, the RAM usage stayed below 3GB the entire time.

I used a platter HDD as well and my replay time was roughly 5 days.

Less for the cache / buffer. Are you using default database.cfg?

Loading...

Geesssss... coming back from the future... I need to reconsider my hardware... EOS made me go... 😣 with my set... Still waiting... when I am confortable, I will launch.


Your post was mentioned in the Steem Hit Parade in the following category:Congratulations @gtg!

  • Pending payout - Ranked 3 with $ 80,84

Max open files on my node is 5mil.
Still the mira replay crashes at 5%.
Too many open files.
0.21.9 did run smoothly though:(

Could you please show some logs / configs?
Either here or on Steem.Chat
(and please be patient)

Did upgrade ulimit - n 65536
And doing currently a block log download and replay.
8 hours to go.
We will see..

I am now 4 days in, without a working witness node, I think I am patient. :)

To view or trade BEER go to steem-engine.com.

<center> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmY5cLULnVCSrQ5f8x6FaK5RL4CsGqtuCbGG1WZrW2fY9J/beertoken%20by%20beerlover.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmY5cLULnVCSrQ5f8x6FaK5RL4CsGqtuCbGG1WZrW2fY9J/beertoken%20by%20beerlover.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmY5cLULnVCSrQ5f8x6FaK5RL4CsGqtuCbGG1WZrW2fY9J/beertoken%20by%20beerlover.png 2x" /> <p dir="auto"><code>BEER token. Enjoy it!<span> Hey <a href="/@gtg">@gtg, here is your <span> Do you already know our [BEER Crowdfunding](<a href="https://steemit.com/cryptocurrency/@beerlover/let-s-grow-and-update-the-beer-token-huge-crowndfunding-as-crowdsale" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://steemit.com/cryptocurrency/@beerlover/let-s-grow-and-update-the-beer-token-huge-crowndfunding-as-crowdsale)

Looking forward for an updated Steem Node setup guide !!!!!!

Maybe you should look backward then? ;-) That's the guide you are looking for.

I've been re-forking myself for over a week now, hoping to finish it up one century soon.