How to deploy a Steem Witness node by Docker?steemCreated with Sketch.

in #witness2 years ago (edited)

Pre Words

Recently there are some new users coming in Steem ecology and they want to build their witness nodes.

I wrote a simple tutorial to tell people how to deploy it long long ago (https://steemit.com/steem/@ety001/a-simple-tuturial-for-a-dockerize-steem-witness-deployment).

This tutorial uses a tool bash which were wroten by Someguy123. In my tutorial I just use this tool bash ./run.sh start command. Other commands were not tested by me, so I didn't write into my tutorial.

But people always get in confused. They always ask me why ./run.sh install command runs failed or why ./run.sh dlblocks runs failed, etc....

WTF!

I didn't tell you to run those commands. That means these commands are not fully testd by me. I am not responsible for these.

Well. That's why I decide to write a new tutorial without using Someguy123's bash tool.

BTW, please learn some base knowledge of Docker before you decide to deploy witness node by Docker. That will save everyone's time. I don't think explaining every docker command mean is my job.

Tutorial Start

Please do this tutorial under the root user.

Pre Environment

  • A Linux OS
  • Docker installed
  • wget installed
  • lz4 installed
  • Get in root user environment. All commands need be done under root.

Prepare folders

# mkdir -p /data/steem/data/blockchain

Prepare blockchain data

You could get my backup blockchain data from here: https://files.steem.fans/.

  • If you want to replay blockchain data, just download block_log file. Replay data will takes a long time.
# wget https://files.steem.fans/data/block_log_20220714.tar.gz
# gzip -d block_log_20220714.tar.gz
# mv block_log /data/steem/data/blockchain/
  • If you don't want to replay blockchain data, download steem_witness.tar.lz4 file.
# wget https://files.steem.fans/data/steem_witness_20220714.tar.lz4
# tar --use-compress-program=lz4 -xf steem_witness_20220714.tar.lz4 -C /data/steem/data

Notice: maybe the file name contains another date tag. Please refer to https://files.steem.fans.

Prepare sign private key

# docker run -it --rm \
steemit/steem:0.23.x-mira \
/usr/local/steemd/bin/get_dev_key STM your_random_str

Replace your_random_str by a strong random string.

Prepare config file

# wget https://gist.githubusercontent.com/ety001/42aee2d6f32be4baaf55a6f45efd87a9/raw/dce400d1626ed6097ef1646256b4c7f7ed69f3c6/config_witness.ini
# mv config_witness.ini /data/steem/data/config.ini

Edit /data/steem/data/config.ini and add witness= and private-key = config into it.

Run Node

  • If you want to replay, do this command below:
# docker run -itd \
--name witness \
-p 2001:2001 \
-v /data/steem/data:/steem \
ety001/steem-mira:0.23.1 \
steemd --data-dir=/steem --replay-blockchain
  • If you don't want to replay, do this command below:
# docker run -itd \
--name witness \
-p 2001:2001 \
-v /data/steem/data:/steem \
ety001/steem-mira:0.23.1 \
steemd --data-dir=/steem

Check Node Log

# docker logs -f --tail 100 witness

You could edit the tail param to show more info.

Stop Node

# docker network disconnect bridge witness
# docker stop -t 600 witness
# docker rm witness

One more thing

If you replay blockchain data by yourself, please remember to restart node without the --replay-blockchain param after replaying finished.

Any issue, please leave a message for me.


Thank you for reading. I'm a witness. You could find more on my site https://steem.fans

I would really appreciate your witness vote! You can vote by AuthSteem. Or open https://steemitwallet.com/~witnesses page, input ety001 to vote.

2.gif

Thank you!

Sort:  

Thank you for the new tutorial.
One day I'll take the time to set up a node too :-)

Hello @ety001
I've been looking for the latest instructions for days. There are many, but not up to date. I'll try to create a seed node with your tutorial as soon as I've downloded. Unfortunately, the download rate is very low. Would it be possible to send the data quickly? if so, I would be very happy.
Thank you for the great guide, I hope it works.
I had no success with someguy's steem-docker, it hangs when replaying.

Since I'm using a cheap big storage vps, there's nothing I can do to increase my VPS network speed.
I think you can buy a cheap VPS located in US West as a transfer proxy to download.

Hello @ety001 dear friend
I would first like to thank you for the great tutorial.
FullNode works. https://api.campingclub.me/
I tested function here https://fullapis.herokuapp.com/
I would also like to thank @steem-supporter his tutorial just helped me so much https://steemit.com/witness-category/@steem-supporter/installing-a-full-api-server-with-hf-version -0-23-1-with-mira
A big thank you and @steem-supporter

Now I will test for a week

apinode1.png

apinode.png

Hey @ety001

Since tonight I have had a problem with my witness node.
The server was not accessible for some time and apparently there was also a problem with the database during the restart:

62147ms database.cpp:192 open ] args.data_dir: /steem/blockchain args.shared_mem_dir: /steem/blockchain args.shared_file_size: 68719476736
62158ms chain_plugin.cpp:608 plugin_startup ] Error opening database. If the binary or configuration has changed, replay the blockchain explicitly using --replay-blockchain.

I'm going to try a replay_blockchain first. That will probably take a little while.
Or would you recommend downloading a current block_log right away and using that?

I suggest you remove all broken data and then downlaod the block data with status data and restart the witness node.

Download only block_log and replaying it by yourself would take a very long time.

Thank you. I better load the steem_witness file from your server then.

Edit: I got it. I removed the data in the blockchaindirectory and restart the node with the new data. Thank you again! :-)

Hello @ety001,

How to access wallet cli this tutorial?
And should I type the private key of my private-key partitions?

Sorry, I'm not using cli wallet. I can't give you any suggestion about it.

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.034
BTC 66274.97
ETH 3175.04
USDT 1.00
SBD 4.06