Skip to content

Instantly share code, notes, and snippets.

@sydneyitguy
Created March 17, 2020 15:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sydneyitguy/a7ff50d707be0587bf71f85ab8aa05fc to your computer and use it in GitHub Desktop.
Save sydneyitguy/a7ff50d707be0587bf71f85ab8aa05fc to your computer and use it in GitHub Desktop.
Steem Witness Stackscript
# MARK: - System updates
sudo update-locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove
git clone https://github.com/someguy123/steem-docker.git
cd ~/steem-docker
./run.sh dlblocks
./run.sh install_docker
./run.sh build v0.22.1 ENABLE_MIRA=OFF
docker tag steem:v0.22.1 steem:latest
./run.sh remote_wallet
suggest_brain_key
vim data/witness_node_data_dir/config.ini
```
shared-file-size = 63G
shared-file-dir = /dev/shm/
witness = "____"
private-key = 5XXX
```
mv example.env .env
```
DOCKER_NAME="witness"
PORTS=
```
# Maybe not necessary for MIRA?
./run.sh shm_size 63G
# MARK - Optimization
sudo sysctl -w vm.swappiness=1
sudo sysctl -w vm.dirty_background_ratio=75
sudo sysctl -w vm.dirty_expire_centisecs=12000
sudo sysctl -w vm.dirty_ratio=80
sudo sysctl -w vm.dirty_writeback_centisecs=30000
sudo sysctl -w vm.dirtytime_expire_seconds=43200
sudo vim /etc/sysctl.conf
```
vm.swappiness=1
vm.dirty_background_ratio=75
vm.dirty_expire_centisecs=12000
vm.dirty_ratio=80
vm.dirty_writeback_centisecs=30000
vm.dirtytime_expire_seconds=43200
```
sudo su
echo 5120 > /sys/block/nvme0n1/queue/read_ahead_kb
echo 16 > /sys/block/nvme0n1/queue/nr_requests
# Open file limits
/etc/security/limits.conf
```
* soft nproc 999999
* hard nproc 999999
* soft nofile 999999
* hard nofile 999999
root soft nproc 999999
root hard nproc 999999
root soft nofile 999999
root hard nofile 999999
```
ulimit -n
# Time synchronization
apt-get install ntp
echo "minpoll 5" >> /etc/ntp.conf ; echo "maxpoll 7" >> /etc/ntp.conf
systemctl enable ntp ; systemctl restart ntp
timedatectl
# -------
./run.sh replay # This takes few days.. lol
./run.sh start
set_password "MY_PASSWORD"
unlock "MY_PASSWORD"
import_key 5XXXXX
# account_creation_fee 3.000 STEEM
# maximum_block_size 65,536
# sbd_interest_rate 0
# account_subsidy_budget 797 => (86400/3)*(797/10000) = 2295 accounts per day
# account_subsidy_decay 347,321
# account_subsidy_budget is the per-block budget.
# A value of 10,000 (STEEM_ACCOUNT_SUBSIDY_PRECISION) represents a budget of one subsidized account per block.
# account_subsidy_decay is the per-block decay rate. A value of 2^36 (STEEM_RD_DECAY_DENOM_SHIFT) represents 100% decay rate.
# The default decay rate (347321) corresponds to a half-life of 5 days
# https://github.com/steemit/steem/blob/master/doc/witness_parameters.md
witness_set_properties
# Replacing with the real public key will initiate the block creation
update_witness "steemhunt" "https://steemit.com/@steemhunt" "STM1111111111111111111111111111111114T1Anm" {"account_creation_fee":"6.000 STEEM","maximum_block_size":65536,"sbd_interest_rate":0} true
# Check
docker logs witness | grep "blockchain version"
./run.sh wallet
about
info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment