Running nano_node as a service - bitcoin-black-bcb/btcb GitHub Wiki

To enable RPC for node edit config.json after first launch

./btcb_node --daemon  
sed -i 's/"rpc_enable": "false"/"rpc_enable": "true"/g' ~/Btcb/config.json   
sed -i 's/"enable_control": "false"/"enable_control": "true"/g' ~/Btcb/config.json  

Launch btcb_node in test mode

./btcb_node --daemon

Check if RPC is enabled with curl (use different terminal or session)

curl -g -d '{ "action": "block_count" }' '[::1]:7076'

To stop node, use

curl -g -d '{ "action": "stop" }' '[::1]:7076'

Launch btcb_node as a service with systemd

sudo touch /etc/systemd/system/btcb_node.service   
sudo chmod 664 /etc/systemd/system/btcb_node.service   
sudo btcb /etc/systemd/system/btcb_node.service   

Paste your specific user, group, path settings (example)

[Unit]
Description=Btcb node service
After=network.target

[Service]
ExecStart=/path_to_btcb_node/btcb_node --daemon
Restart=on-failure
User=username
Group=groupname

[Install]
WantedBy=multi-user.target

Start btcb_node service

sudo service btcb_node start

Enable at startup

sudo systemctl enable btcb_node

To manage node, use RPC commands or CLI


Known issues

Error initiating bootstrap ... Too many open files

Increase max open files limit. Edit /etc/security/limits.conf & add

    *               soft    nofile          65535    
    *               hard    nofile          65535    
    root            soft    nofile          65535    
    root            hard    nofile          65535    

Then restart session & btcb_node service. Check changes with ulimit -n