Link

Bitcoin

bitcoin.conf

testnet=0
regtest=1

# mainnet configuration settings
[main]
listen=1
server=1
daemon=1
rpcuser=raspiuser
rpcpassword=mypassword
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rest=1
txindex=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

[test]
# testnet configuration settings
# the header with square brackets is mandatory since Bitcoin v17.0
# testnet is a separate Bitcoin network that's globally available
daemon=1
server=1
listen=1
rpcuser=raspiuser
rpcpassword=mypassword
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rest=1
txindex=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
zmqpubhashtx=tcp://127.0.0.1:28334
zmqpubhashblock=tcp://127.0.0.1:28335

[regtest]
# regtest configuration settings
# regtest is a local-only Bitcoin network for private development & testing
daemon=1
server=1
rpcuser=raspiuser
rpcpassword=mypassword
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rest=1
deprecatedrpc=generate
txindex=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
zmqpubhashtx=tcp://127.0.0.1:28334
zmqpubhashblock=tcp://127.0.0.1:28335

systemd configuration

# Name and required services to start
[Unit]
Description=Bitcoin daemon
After=network.target

# start with these parameters
[Service]
ExecStart=/usr/local/bin/bitcoind -pid=/home/pi/.bitcoin/bitcoin.pid \
                            -conf=/home/pi/.bitcoin/bitcoin.conf \
                            -datadir=/home/pi/.bitcoin \
                            -daemon

# Process management
####################

Type=forking
PIDFile=/home/pi/.bitcoin/bitcoin.pid
Restart=on-failure

# Directory creation and permissions
####################################

# Run as pi:pi
User=pi
Group=pi
# Hardening measures
####################

# Provide a private /tmp and /var/tmp.
PrivateTmp=true

# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full

# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true

# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target