System configuration
You are now on the command line of your own Bitcoin node. Let’s start with the configuration.
Defaults
This guide have no defaults in mind, you can choose whathever tools you want
However, from Microbolt we recommend EDITOR=vim
and SU=doas
Define which text editor, root privileges tool and compile flags defaults you want
vi /etc/profile.d/defaults.sh
# Text editor
export EDITOR=vim # or notepad,vi,neovim,emacs,nano,micro...
# Root privileges tool
export SU=doas # or sudo...
# Compile flags
export CC="clang"
export CXX="${CC}++"
export CFLAGS="-O3 -pipe -march=native -fPIE"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-pie -Wl,--as-needed"
export MAKEFLAGS="-j$(nproc)"
# Environment variables
export CARGO_HOME="./.cargo"
export npm_config_cache="./npm-cache"
export npm_config_devdir="./.gyp"
export ROCKSDB_INCLUDE_DIR=/usr/include
export ROCKSDB_LIB_DIR=/usr/lib
export PROTOC=protoc-c
Source the changes
. /etc/profile.d/defaults.sh
Install
Your choice may need additional steps, it’s your responsibility
apk add $EDITOR $SU
Install other necessary tools
apk add logrotate
Add the admin user
We will use the primary user satoshi
instead of root
to make this guide more
universal.
Create a new user called satoshi
with your password [A]
adduser satoshi
Make this new user a superuser by adding it to the wheel
user group
adduser satoshi wheel
Allow members of the wheel group to use root privileges with $SU
sed 's/# permit persist :wheel/permit persist keepenv :wheel/' /etc/doas.conf > _
mv -f _ /etc/doas.conf
Log out
exit
Log in with satoshi
admin user
ssh satoshi@nakamoto01
System update
Do this regularly every few weeks/months for security-related updates.
Update the operating system and all installed software packages
$SU apk update
Upgrade the Alpine Package Manager itself
$SU apk add --upgrade apk-tools
Upgrade all installed packages
$SU apk upgrade --available
All services that have been upgraded need to be restarted, to begin using the upgraded version
$SU rc-service <service> restart
If the kernel is upgraded, it’s required to reboot to begin using the upgraded version
sync && reboot
Check drive performance
Performant unit storage is essential for your node.
Let’s check if your drive works well as-is.
- Your disk should be detected as
/dev/<drive>
. Check if this is the case by listing the names of connected block devices
blkid
- Install the software to measure the performance of your <drive>
$SU apk add hdparm
- Measure the speed of your drive
$SU hdparm -t --direct /dev/<drive>
/dev/sda:
Timing O_DIRECT disk reads: 690 MB in 3.00 seconds = 229.82 MB/sec
If the measured speeds are more than 150 MB/sec, you’re good