Steemit Witness Setup 2018, No Docker, No Remote Nodes, So you actually know what you are doing

in #witness-category6 years ago (edited)

After hours trying to figure out where is what to support new user, I decided to put a small tutorial on becoming a witness.

Forgot about dockers, you need Linux basics. It's easier and fun.

tux.jpg

Docker technology was intended to make things easy for non linux users to use Linux software. In reality it actually make it much harder as you will have no idea what's happening in the background.

Assumption: > 100GB RAM, make this according to your needs, but be sure to have at least 64GB.

Source of build instruction:

https://github.com/steemit/steem/blob/master/doc/building.md

Get Ubuntu 16.04

  • Dependencies:
apt-get update

sudo apt-get install -y \
    autoconf \
    automake \
    cmake \
    g++ \
    git \
    libssl-dev \
    libtool \
    make \
    pkg-config \
    python3 \
    python3-jinja2 \
    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 \
    doxygen \
    libncurses5-dev \
    libreadline-dev \
    perl

  • Cloning a repo and compiling

git clone https://github.com/steemit/steem
cd steem
git checkout stable
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) steemd
make -j$(nproc) cli_wallet

Edit /etc/fstab and add a line

ramfs /dev/shm ramfs defaults,noexec,nosuid,size=100G 0 0


reboot now

cd build/programs/steemd/
./steemd
ctrl + c


This will create config.ini in witness_node_data_dir

Edit build/programs/steemd/witness_node_data_dir/config.ini

p2p-endpoint = 0.0.0.0:2001

seed-node = seed.steemnodes.com:2001
seed-node = seed.blackrift.net:2001
seed-node = seed.jerrybanfield.com:2001
seed-node = seed.curiesteem.com:2001
seed-node = seed.minnowshares.net:2001
seed-node = seed.liondani.com:2016
seed-node = steem-seed.altcap.io:40696
seed-node = seed.windforce.farm:2001
seed-node = seed.followbtcnews.com:2001
seed-node = 176.31.126.187:2001
seed-node = seed.rossco99.com:2001
seed-node = seed.esteem.ws:2001
seed-node = seed1.blockbrothers.io:2001
seed-node = seed.bitcoiner.me:2001
seed-node = seed.steem.prcolaco.com:2001
seed-node = steem.global:2001
seed-node = steemd.pharesim.me:2001
seed-node = 104.199.118.92:2001
seed-node = steem-seed1.abit-more.com:2001
seed-node = seed.riversteem.com:2001
seed-node = steem-id.altexplorer.xyz:2001
seed-node = seed.roelandp.nl:2001
seed-node = node.mahdiyari.info:2001
seed-node = seed.jamzed.pl:2001
seed-node = gtg.steem.house:2001
seed-node = seed.steemviz.com:2001

shared-file-dir = /dev/shm/steem
shared-file-size = 60G
rpc-endpoint = 127.0.0.1:8090
rpc-tls-endpoint = 127.0.0.1:8091
public-api = database_api login_api account_by_key_api network_broadcast_api
enable-plugin = witness account_by_key

Remain everything rest as it is and run:

screen
(hit enter)
build/programs/steemd/./steemd --resync-blockchain
CTRL + A + D to detach the screen

After it's done, leave it running and open another screen window:

screen
(hit enter)
cd build/programs/cli_wallet/
./cli_wallet --rpc-http-endpoint 127.0.0.1:8093 --rpc-http-allowip 127.0.0.1
set_password somepassword
unlock somepassword
import_key Active_Private_Key
list_my_accounts
suggest_brain_key
CTRL + A + D to detach this screen as well


Active_Private_Key - is the one you get from permissions tab on steemit.com by clicking on show key. You will be asked for password.
Keep the output of suggest_brain_key, you will need it.

edit config.ini again and put the following

witness = "yourusername"
private-key = wif_priv_key


(wif_priv_key is the one you got from suggest_brain_key)

screen -r -d firstTTY
update_witness "YOURUSERNAMEHERE" "YOURINTRODUCTIONPOSTHERE" "YOURKEYHERE" {"account_creation_fee":"0.200 STEEM","maximum_block_size":65536,"sbd_interest_rate":1000} true

Price Feeds

apt install uuid-dev libssl-dev
luarocks install seawolf
luarocks install luasec
luarocks install dkjson

Download, or clone https://github.com/develCuy/lazy-steem into /home/lazy-steem

Create script /usr/local/bin/updateprice.sh

#!/bin/bash

cd /home/lazy-steem

./publish_feed.lua YOURUSERNAME http://localhost:8093
echo "updated" > /tmp/pricefeeds

crontab -e
1 * * * * /home/lazy-steem/./updateprice.sh

HINTS

  • You can list screens with screen -r -d
  • The Idea is to have 2 of them running all the time, one for steemd one for wallet
  • To connect to any of them, execute screen -r -d 4457.pts-0.steem (where 4457.pts-0.steem is an output of screen -r -d)
  • Always exit steemd with CTRL + C or even better with SIGINT if controlling through script.

Useful wallet commands:

  • list_my_accounts USERNAME
  • get_witness USERNAME

Most Useful Linux command ever:

man application

For example:

man screen

DEBUG:

strace ./steemd

This will log all the system calls performed by steemd or any other linux app, and tell you exactly which one failed to execute and why.



If you would like to support me, you can do that via steemit website:


votegif.gif

If you are an advanced user, You can do it with unlocked cli_wallet by executing:

vote_for_witness "yourusername" "crt" true true

Thanks to all supporters and all the members of Steemit Community.


Post your questions in comment sections, i'll try to address them all so new members can get on-board as quick as possible.

Would you like to become witness without too much headache? I now offer a Turn-Key paid setup services: https://steemit.com/witness-category/@crt/turnkey-paid-witness-setup-service







Sort:  

Good job brat!

Thanks Brat :)

Why does the witness server so much RAM? Must it be physically or can it be virtual RAM?

Witness servers are producing blocks. Compare this website to Facebook. It deals with enormous amounts of data, still, It's fast and efficient. It's run by witnesses who produce blocks and seed nodes that store data, competing with infrastructure and server farms of facebook for example.

While you can theoretically use Virtual RAM or SSD, you are likely to suffer from missing blocks, and network will suffer the speed it needs.

At the time of writing, physical ram is the only way to go. You can query your node, and check the latency, if your node is able to respond with the low latency (<50ms) using any other technology, you could be also good to go.

When I run

./cli_wallet -s ws://127.0.0.1:8090

I get this error:

Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet
2062627ms th_a main.cpp:154 main ] wdata.ws_server: ws://127.0.0.1:8090
0 exception: unspecified
Underlying Transport Error
{"message":"Underlying Transport Error"}
asio websocket.cpp:444 operator()
{"uri":"ws://127.0.0.1:8090"}
th_a websocket.cpp:673 connect

Please perform the following:

netstat -apn | grep 8090

It could be that:

  1. Node is not synced yet.
  2. Node is not started.

It's crucial to start node first, ./steemd detach from screen, CTRL +A +D, and then connect with wallet.

If output of bellow is not showing steemd is listening on port 8090, one of above is the reason.

netstat -apn | grep 8090

If the node is up and running, please paste screen output that's generated on node screen, once you try to connect.

I don't get any output 🤔

Output of:
ps aux | grep steemd

This is output:

root 17416 0.0 0.0 4504 596 pts/0 Ss+ Feb12 0:00 sh -c /usr/local/bin/steemd
root 17459 15.6 42.9 67971308 28209376 pts/0 Sl+ Feb12 1276:49 /usr/local/bin/steemd
root 24903 0.0 0.0 57343492 33892 pts/7 Sl+ 10:31 0:00 build/programs/steemd/./steemd --resync-blockchain
root 25350 146 4.9 66665072 3237996 pts/9 Rl+ 11:32 53:30 build/programs/steemd/./steemd --resync-blockchain
root 25480 0.0 0.0 29944 2840 ? Ss 11:48 0:00 SCREEN ./steemd
root 25481 148 3.6 66731420 2404464 pts/11 Rsl+ 11:48 30:36 ./steemd
root 25638 0.0 0.0 16976 988 pts/0 S+ 12:08 0:00 grep --color=auto steemd

Huh, you seem to have 6 steemd processes running. It should be only one. Also, the processes that are run as steemd --resync-blockchain are most likely still in resync.

You should make sure only single steemd is running.
(Not sure how you managed to start the process 6 times. It should be only one screen that runs steemd, and you should detach with CTRL +A +D, and Attach when you need it with screen -r -d pid).

(If PS Aux shows steemd process is running, you should not start another one).

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.030
BTC 58613.96
ETH 3153.58
USDT 1.00
SBD 2.43