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-cSource the changes
. /etc/profile.d/defaults.shInstall
Your choice may need additional steps, it’s your responsibility
apk add $EDITOR $SUInstall other necessary tools
apk add logrotateAdd 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 satoshiMake this new user a superuser by adding it to the wheel user group
adduser satoshi wheelAllow 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.confLog out
exitLog in with satoshi admin user
ssh satoshi@nakamoto01System update
Do this regularly every few weeks/months for security-related updates.
Update the operating system and all installed software packages
$SU apk updateUpgrade the Alpine Package Manager itself
$SU apk add --upgrade apk-toolsUpgrade all installed packages
$SU apk upgrade --availableAll services that have been upgraded need to be restarted, to begin using the upgraded version
$SU rc-service <service> restartIf the kernel is upgraded, it’s required to reboot to begin using the upgraded version
sync && rebootCheck 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/secIf the measured speeds are more than 150 MB/sec, you’re good