Steem-in-a-box - Deploy a new seed, witness, or RPC server with a one-liner

in steem •  3 years ago

Anyone who has tried to run a STEEM server knows it's not the nicest thing to set up.

I've been working on getting a Docker set up that would allow me to deploy new servers with very little effort, except many people don't have docker installed, nor do they know how to use it.

Introducing Steem-in-a-box

Steem-in-a-box is a small shell script that handles all of the docker magic behind the scenes, and comes with a ready-to-go seed config, which can be modified as needed, e.g. change it to be a witness, or an RPC server, whatever you want.


Cardboard Box by Hay Kranen / Public Domain

How easy is it?

Grab a 4 or 8GB RAM server from DigitalOcean ($10 free for signing up),

I've fully tested this on a brand new Ubuntu 16.04 box on DigitalOcean, so anyone can get a seed/witness up in no time.

Spin up a new Ubuntu 16.04 server (other distributions may or may not work), copy and paste this command, then sit back and relax:

apt update && apt install curl git && \
curl https://get.docker.com | sh && \
git clone https://github.com/Someguy123/steem-docker.git && \
cd steem-docker && \
./run.sh build && ./run.sh start

Be aware that STEEM is very resource hungry, you'll need a bare minimum of 4GB of ram, but I strongly recommend at least 8GB.

After you paste this command (as root), you can sit back and relax. When the commands finish, you'll have a seed server up and running, without needing to configure a thing! How great is that?

Be aware that the build can take a while depending on how fast your system is. Once it's done, you'll have a seed up and running listening on port 2001, automatically exposed. Don't want a seed? Just look in the data/witness_node_data_dirfolder, and edit config.ini as needed.

Changed the config? No problem. No need to rebuild, just ./run.sh restart and you'll be good to go.

Keeping track of the STEEM server as simple as ./run.sh status to see if it's running or not, and of course ./run.sh logs to see what it's doing right now.

As usual, the source code is up on Github, and is released under the GNU AGPL open source licence: https://github.com/Someguy123/steem-docker

Like what I'm doing? Vote for me to be a witness on the witness voting page, @someguy123 - and don't forget to follow me for more

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:  

·

This is interesting. I wonder if its really this easy to setup. By the way what does the witness do?

·

There's various posts on Steemit explaining what witnesses do. By default, this is just a normal seed server (sort-of like a bitcoin super-node), but you can use this for witnesses too, just gotta adjust the config.

It's definitely easy to set up. On a default ubuntu box, you can copy and paste that one-liner command, and you're done. Ready to go. No configuring at all.

Great information here. Thanks for making everything easier for the community.

Thanks a lot. I will give it a try in one of the next nights...

You are saying that 4 GB is a minimum. What about a 4 GB Ubuntu VM inside WIndows 10 host? With VirtualBox or VMware?

If I only want to mine, what should I comment out in the config.ini? Or better asked - what should I define? Threads, seed, witness, miner, ... anything else?

This is me asking from the head and not looking at your config file, of course :)

·

I have no idea about mining sorry.

VBox and VMware should work similarly, but VMWare normally has better performance. I don't know how far you'll get with 4GB of RAM, I can't guarantee that'll work, but it might.

@ someguy123

Hi. I tried it out anyways but didn't succeed:

[ 14%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/task.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
make[2]: *** [libraries/fc/CMakeFiles/fc.dir/src/thread/thread.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
libraries/fc/CMakeFiles/fc.dir/build.make:182: recipe for target 'libraries/fc/CMakeFiles/fc.dir/src/thread/thread.cpp.o' failed
make[1]: *** [libraries/fc/CMakeFiles/fc.dir/all] Error 2
make: *** [all] Error 2
CMakeFiles/Makefile2:380: recipe for target 'libraries/fc/CMakeFiles/fc.dir/all' failed
Makefile:127: recipe for target 'all' failed
The command '/bin/sh -c cd ~/steem &&   cmake -DCMAKE_BUILD_TYPE=Release . &&   make -j3 && make install' returned a non-zero code: 2

I will try again from fresh because at first I didn't notice that you have to be root (obviously).

·

That error means you're out of RAM.

As said in the article, you probably need at least 8GB. I'd also recommend at least 1GB of swap, otherwise when your RAM gets full, things will die instantly.

·
·

TNX. OK, I'll ditch all home made VM's and try with some cloud offering like Digital Ocean. Eventually, I'll succeed :)

If I'm running this as root, how do I know I'm not getting p0wned?

·

You check the source code. It's a single shell script, and it's on github.

if you don't know how to read BASH scripting, then you'd have to trust me (notice my 58 reputation), otherwise read the shell script.

·
·

Can you get a code audit / review from a few people?

·
·
·

If you find anyone that wants to audit/review it, feel free to ask them.

It's a single file, less than 200 lines long. Could be "audited" in about 30 seconds. https://github.com/Someguy123/steem-docker/blob/master/run.sh

·
·
·
·

done ;-)

·
·

It's 60, actually :)

Wow that's great. Going to sign up soonest. Thanks a million

Wow! This is really cool, will try it out soon. I've heard of great things about DigitalOcean but never used.. so if I get the free $10 for signing up, can I get a cheap subscription and cancel it after that $10 is used up?

·

If you use a card, yes, yes you can, you could totally use $10, then disappear, not that I would recommend that, since it's pretty douchey.

If you use Paypal, they don't do subscriptions on that, so you'd have to deposit some credit.

·
·

Ah I see.. well I probably won't hit and run, but this is kinda like getting a free year of Free Tier on AWS and leaving after the trial. Haha. Thanks!

·
·
·

I just remembered, there is a catch. They won't sell you the more expensive servers until they know you're legit. So you couldn't use that $10 on like a 64gb RAM server with 16 cores and burn through it in a day.

·
·
·
·

Hmm.. this is different than other cloud providers like Azure.. if you have the credit, you can spend it on whatever you want until you run out, in which you'll have to refill or stop using.

·
·
·

Difference is, places like Azure are expensive as hell. They do not care at all about how much of a reliable customer you are. The equivalent $5 server on DigitalOcean is roughly $30/mo on Azure

·
·
·
·

There is always the solution of using your own box in the corner in the closet, even coupled with dynamic dns. Haha. But then, the landlord or ISP may cut you off =O

great stuff @someguy123 !

I love this community and how fast we are growing!

Adding this to my todo list, thanks!!!

I know a very little about Bitcoin, but I know almost nothing about steem. What is the purpose of the seed? witness? RPC server? and what is an RPC server (or what does RPC stand for)? Is one of them similar to a Bitcoin Core instance? It is my understanding that they process blocks in the chain and communicate with other similar entities (by some process that I do not understand).

·

A seed is sort-of like a BitTorrent seed, or a Bitcoin supernode. It's a public server designed to serve blocks, and connect other nodes to the network.

A witness is a key part of Bitshares-based systems, i.e. Steem, they do many things including generate blocks (yes miners don't mean much on STEEM), handle the valuation of STEEM dollars by producing a price feed, decide on Account Creation Fees, among many other important things.

An RPC server is similar to having a public Bitcoin server, which would normally be an absolutely terrible idea, except with Steem, the wallet and server are 100% separated, so it's completely fine to run a public one. They allow people to interact with the STEEM network from their applications, WITHOUT installing a STEEM daemon locally, which uses a lot of resources.

·
·

Thanks for your reply; I appreciate the information.

This is fucking amazing! You won steemit for today.

That's great! But I would suggest against popular hosting provider choices as it would not be good to have too many of witness nodes in the same cloud controlled by a single hosting company.