NOTE: This article contains both upgrade instructions, AND install-from-fresh instructions.
This article is designed for those running a previous version of my Steem-in-a-box software, or for those looking to set up a new witness server.
If you want to learn more about witnesses and what they do, check out my article here: @someguy123/seriously-what-is-a-witness-why-should-i-care-how-do-i-become-one-answer
NEW FEATURES
new features include:
dlblocks
(downloads blocks from @gtg's server, decompresses them into the right folder)install_docker
(downloads and installs docker. if not running as root, auto adds your current user to the docker group)remote_wallet
(runs cli_wallet against steemd.steemit.com)
UPGRADING FROM HF18
If you have a previous installation of Steem-in-a-box, simply do the following:
Update your steem-in-a-box scripts:
git pull
Disable your witness, or change it to your backup key
./run.sh wallet
locked>> unlock "supersecurepassword"
unlocked>> update_witness "someguy123" "yoururl" "STM1111111111111111111111111111111114T1Anm" {"account_creation_fee":"0.200 STEEM","maximum_block_size":131072,"sbd_interest_rate":0} true
Now stop the witness server
./run.sh stop
Now, make sure you delete the /dev/shm files, as they will not be compatible with HF19 and need to be re-built
rm -rf /dev/shm/*
Finally, update your STEEM image, then start it with replay
./run.sh install
./run.sh replay
You can now check the logs with ./run.sh logs and see that it's rescanning the blockchain.
Once it's fully replayed, you can re-broadcast your witness :)
update_witness "someguy123" "yoururl" "STM1abcdabcdabcdabcdabcdbdcabacbdcab" {"account_creation_fee":"0.200 STEEM","maximum_block_size":131072,"sbd_interest_rate":0} true
Installing a NEW witness
To become a witness, you'll require a server with at LEAST 8GB of RAM, 100GB disk, and a fast, reliable network. I recommend @privex - they accept STEEM, are affordable, and sell servers with a Zero Block Miss SLA
I personally use @privex for my own witness, as proof of their quality - I haven't missed a block since moving to them months ago, and I get almost 60 per day. (DISCLAIMER: I'm the CEO of Privex Inc. however you'll find plenty of people here on STEEM unaffiliated with us, praising our servers and network)
You're free to use any other server provider. I don't recommend trying to run a witness on your home internet, as it is likely not reliable enough for a witness.
Be aware that certain server providers have poor networks or hardware, and may cause missed blocks, so you may be hopping around a few until you can find one that's suitable for a witness node.
If you want to learn more about witnesses and what they do, check out my article: @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 Steem-in-a-box, created by myself.
git clone https://github.com/Someguy123/steem-docker.git
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 download the pre-compiled STEEM image from DockerHub:
./run.sh install
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.
./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
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. Right now, 8GB is the bare minimum, however 12GB is recommended. DO NOT GIVE MORE SHARED MEMORY THAN YOU HAVE ACTUAL RAM AVAILABLE. e.g. if you have an 8GB VPS, only use 8G for your shared memory.
sudo ./run.sh shm_size 8G
Open up the config file in your favourite text editor, nano
is good for beginners:
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 12G, adjust that, if you need to do not make a new line for this.
shared-file-size = 8G
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.
Now, we can start up the witness server
./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. You can ask for help debugging it in the witness channel on
STEEMIT.CHAT.
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
(Image courtesy of @klye, copied from his old guide)
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! :)
Go ahead, vote for yourself (and @someguy123).
How do I know what rank I am?
Check SteemDB: https://steemdb.com/witnesses or steemd: https://steemd.com/witnesses
What about a price feed?
As a witness, you're expected to run a price feed.
I recommend Steemfeed-JS, as it goes nicely with the docker set up.
Do you like what I'm doing for STEEM/Steemit?
Vote for me to be a witness - every vote counts.
Don't forget to follow me for more like this.
Have you ever thought about being a witness yourself? Contact me on STEEMIT.CHAT, or just ask in the witness channel. I'm happy to guide you! Join in shaping the STEEM economy.
Are you looking for a new server provider? My company @privex offers highly-reliable and affordable dedicated and virtual servers for STEEM, LTC, and BTC! Contact me on STEEMIT.CHAT for more information.
Are you looking for a Graphics designer for your project? Logos, PSD mockups, banners? Check out @MaliceRed - he posts about his life as a Freelance Graphics Designer, and is looking for work.