How to setup a witness to 22.5 using a modified version of steem-in-a-box!

in #hashkings4 years ago (edited)

Hello Everyone,

I haven't posted much with everything going on but I wanted to write something a bit more technical or at least update some technical writing in order to benefit the community. (This guide is a work around while I was waiting on privex servers to become available)

Our chain needs more p2p nodes and witnesses so here's a modified and easy to use guide on how to do it.
(Original Post by @justsomeguy123)

Recommended minimum specs:

To become a witness, you'll require a server with at LEAST 16GB of RAM, 500GB disk, and a fast, reliable network.

If you would like to pick up a server now please visit vultr using our referral link and you will receive 110 dollars credit to use on any of their servers.

I'm using a bare metal instance with 32GB of ram, they are 60% off right now and with the link basically free for the first month!!!

NO PURCHASE NECESSARY!



Installing a new witness/p2p/seed Server

If you want to learn more about witnesses and what they do, check out my article: https://steemit.com/witness-category/@someguy123/seriously-what-is-a-witness-why-should-i-care-how-do-i-become-one-answer

First, we install some basic dependencies (assuming you're on Ubuntu).

sudo apt update
sudo apt install git curl wget

Next, we download the modified version of Steem-in-a-box from my github repository

git clone https://github.com/dpdanpittman/steem-docker
cd steem-docker
Now that it's downloaded, and we're in the right folder, we can install Docker.
./run.sh install_docker
NOTE: If you're running this without root, you'll need to log out and back in again after it's done. Remember to cd steem-docker after logging back in.

Now, we attempt to download the pre-compiled 22.5-MIRA image from DockerHub:

Install the 0.22.5 image

./run.sh install someguy123/steem:v0.22.5-mira

A new feature in the HF19 Steem-in-a-box, automatically downloads blocks from @gtg's server, extracts them, and puts them in the right folder. This will take a while, but will dramatically speed up your setup time.

Open up a new screen and download the blocks. (takes anywhere from 90 minutes to several hours depending on your machine)

screen -S witness
./run.sh dlblocks


This next part is for witnesses, if you're wanting to run a seed, don't touch the config!

Open the wallet using a public server with the following command:
./run.sh remote_wallet

Create a key pair for your witness.
suggest_brain_key
image.png


You should get something similar to this:

"wif_priv_key": "5xxxxxxxxxxxxxxxxxxx",
"pub_key": "STMxxxxxxxxxxxxxxxxx"

Put the keys in notepad or something similar for the moment so you don't lose them.

Press CTRL-D to exit the wallet.


Now, you need to decide on how much "shared memory" to give the server.

DO NOT GIVE MORE SHARED MEMORY THAN YOU HAVE ACTUAL RAM AVAILABLE. e.g. if you have an 16B VPS, only use 15G for your shared memory.

sudo ./run.sh shm_size 15G


Open up the config file in your favorite text editor, such as nano or vim

nano data/witness_node_data_dir/config.ini

You should not run a seed if you are a witness, so change
p2p-endpoint = 0.0.0.0:2001
to
# p2p-endpoint = 0.0.0.0:2001
This disables the seed.

On a blank line, put the following:

witness = "YOUR NAME GOES HERE WITHOUT THE @ SIGN"
private-key = 5xxxxxxxxxxxxx

Put in your witness name, and your private key from earlier. Be aware the name needs quotes, while the private key doesn't. You use the private key (wif_priv_key) you generated earlier and put into notepad.

You will also need to adjust shared-file-size to whatever size you decided earlier for the "shared memory". There should already be a line with 15G, adjust that, if you need to do not make a new line for this.

shared-file-size = 15G
Save and close the file (if using nano, press CTRL-X, say yes to saving)

Next, we adjust the steem-in-a-box settings so that it's named correctly, and to disable port forwarding for seeds:

nano .env
The file will be blank. In the file put the following:

PORTS=
DOCKER_NAME=witness

Again, save and close the file with CTRL-X.


Careful on this step.

You will want to modify fstab with your shm size. This is the same as the shared-file-size you set a couple of steps back. Please change 64G to your the size you chose previously when pasting.

First open the text editor

nano /etc/fstab

BE CAREFUL not to change anything else or you could make your system unbootable.

REMEMBER TO CHANGE SIZE and paste the following
tmpfs /dev/shm tmpfs nodev,nosuid,size=64G 0 0


Now, we can start up the witness server. NOTE* (The node will say version 22.4444 but we will fix that afterwards)

./run.sh replay
Check the logs with this command:

./run.sh logs

You should see something similar to this:

344773ms th_a       application.cpp:297           >startup              ] Replaying blockchain on user >request.
344774ms th_a       database.cpp:151              reindex              >] Reindexing Blockchain
344823ms th_a       block_log.cpp:130             open                 >] Log is nonempty
344823ms th_a       block_log.cpp:139             open                 >] Index is nonempty
344823ms th_a       database.cpp:159              reindex              >] Replaying blocks...
344834ms th_a       database.cpp:2571             >show_free_memory     ] Free memory is now 11G
  0.77369%   100000 of 12925066   (12282M free)

If you see lots of red error messages, something went wrong but If it appears to be working, leave it for an hour or so. Check the logs every 10 minutes until you see something like this:

1299055ms th_a       application.cpp:507           >handle_block         ] Got 14 transactions on block >12928269 by pharesim -- latency: 55 ms
1302427ms th_a       application.cpp:507           >handle_block         ] Got 18 transactions on block >12928270 by xeldal -- latency: 426 ms
1305291ms th_a       application.cpp:507           >handle_block         ] Got 26 transactions on block >12928271 by arhag -- latency: 291 ms
1308045ms th_a       application.cpp:507           >handle_block         ] Got 20 transactions on block >12928272 by pfunk -- latency: 45 ms
1311092ms th_a       application.cpp:507           >handle_block         ] Got 23 transactions on block >12928273 by bhuz -- latency: 92 ms

This means your witness is now fully synced.

Go to your profile on Steemit, click Wallet, then Permissions. Next to "Active Key" you should see "Login to show". Click that button and log in. Then press "Show private key", to reveal it. Make sure it begins with a "5".

Copy the key.

Now open the wallet with:

./run.sh wallet

Set a password, unlock the wallet with the same password, then import your ACTIVE private key from steemit (NOT the one in notepad):

set_password "mysupersecurepass"
unlock "mysupersecurepass"
import_key 5zzzzzzzzzzzz

Finally, we can update/create the witness on the network. Replace the STMxxxx key with the public key you saved earlier in notepad, and replace YOURNAME with your witness name on Steemit.

update_witness "YOURNAME" "https://steemit.com/witness-category/@YOURNAME/my-witness-thread" "STMxxxxxxx" {"account_creation_fee":"0.200 STEEM","maximum_block_size":131072,"sbd_interest_rate":0} true```

Assuming there are no big red messages, you're now a witness! :)


Super big shout out to @someguy123 for creating steem-in-the-box and his awesome company privex.io for providing an amazing service.

If you don't want to mess with all of the instructions above simply visit privex.io and they will set you up with a pre-built steem witness at a great price.




Thanks for reading, I really appreciate your time and would love to earn your upvote and follow!!



Have you heard of Brave Browser?

Brave is a free and open-source web browser developed by Brave Software, Inc. based on the Chromium web browser. The browser blocks ads and website trackers, and provides a way for users to send cryptocurrency contributions in the form of Basic Attention Tokens to websites and content creators.

-- wikipedia

Brave also allows you to tip your favorite Brave Verfied Publishers websites like Hashkings! Look for the triangle with the check mark, if you see it then the website is verified.

image.png


Funding

Become a Patron

Pledge at Fundition



Remember to pick up a limited STEEM OG seed from our Seed Market while they last!





This dream of mine is continuously evolving and Hashkings will become more beautiful as we get art. If you know any artists please send them my way! Thank you so much for your support and enjoy your STEEM Cannabis Grow!


Hashkings is independently funded. If you would like to donate please send to @qwoyn-fund


Read what our farmers have to say here and please don't hesitate to reach out in the comments below!

@vcdragon was kind enough to make a video tutorial for Hashkings. Please check it out on youtube.



Community Showcase

image.png

EMS Hemp Network (@emshempnetwork on STEEM) is a community started on the Tron Network. Please give them a nice STEEM welcome and enjoy 15% off of their products with code hashkings.



Hashkings is an official Dutch Passion Affiliate. Visit this link to get fantastic deals on world class cannabis strains.



Vote Hashkings for Witness!



Previous Posts

Hashkings Seeks Funding
Seeds and Pollen and Buds, oh my!
How to get started with Hashkings
Hashkings Update - Steem OG strain and pollen
Sexing and User Requests
Rare Plots and Subdivisions
A Quick look at Hashkings NFTs (Seeds)
Use STEEM Keychain and get plots
Upgrade and Transition Period
NFT Update Coming
Join the Hashkings Team
Hashkings Overview and Update 1-29-2020
Hashkings Market Update
Hashkings Economic Growth
Mobile Update and Hashkings Christmas Gifts
Hashkings Upgrade
A Hashkings Overview
Introducing Hashkings Curation Trail



Sort:  

Are you setting up a witness on Steem, or Hive, or both?

Hi Pennsif,

I'm setting the witness up on STEEM only. I'll be announcing once its up and running properly. Thanks for inquiring!

Thank you for being a part of the INCOME entertainment Fund, where builders are sought and supported!

This service is managed by @ecoinstant.

$trendotoken

Congratulations @ecoinstats, you successfuly trended the post shared by @hashkings!
@hashkings will receive 5.00157788 TRDO & @ecoinstats will get 3.33438525 TRDO curation in 3 Days from Post Created Date!

"Call TRDO, Your Comment Worth Something!"

To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site

This post has been just added as new item to timeline of HashKings on Steem Projects.

If you want to be notified about new updates from this project, register on Steem Projects and add HashKings to your favorite projects.

your witness must be down

Yea I kinda jumped the gun and thought it would be done by now but screwed something up. It'll be running in a couple hours

Congratulations @hashkings, your post successfully recieved 5.00157788 TRDO from below listed TRENDO callers:

@ecoinstats earned : 3.33438525 TRDO curation


To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63501.83
ETH 2650.23
USDT 1.00
SBD 2.81