Skip to content

Bitcoin full node monitoring dashboard for terminal in CLI interface

License

Notifications You must be signed in to change notification settings

st3b1t/SatoshiTop

Repository files navigation

SatoshiTop

Bitcoin full node monitoring dashboard for terminal.

NPM

DONATE

Donate via LightningNetwork ⚡ to incentivize future development and bug fixes.

image

Proposals and reporting problems: New issue or contribute by voting with a 👍 in proposals issues

Follow me for last updates: @st3b1t or full list of Releases

system

Sober and useful evolution of the senseless SatoshiBanner

Use case

You can define it an htop for Bitcoin... having a modern dashboard that displays a lot of informations similar to a modern bitcoin explorer, but keeping very poor requirements, it doesn't need a graphical environment (output is ncurses) and the data exchange is minimal suitable for slow connections like Tor and monitors/lcds with low resolution and low fps.

Features

  • general system resources: cpu, mem, disk, network, processes, temperature
  • bitcoin core specific: status, blocks, uptime, tor, peers... (WORK IN PROGRESS)
  • all in one rpc client to control all services in your full node

Other possibilities:

  • http rest interface: this would allow viewing through a browser, while maintaining a tiny, text-only data exchange.
  • send output via tty to mini LCD with low resolution and poor in colors.

Many other features are work in progress, many more Blessed widgets and contrib will be able to be integrated. This project has been organized in small readable and easy to edit files to encourage contributions from the active community of developers and bitcoiners, every Pull Request and suggestion is welcome.

Requirements

  • Linux / OSX / Windows (maybe partial support)
  • Node.js >= v18 and NPM

If you see question marks(?) or other different characters, try to run it with these environment variables:

export LANG=en_US.utf8 TERM=xterm-256color

you can add this in your ~/.profile file.

get terminal size, chars rows and columns:

$ stty size

it should be at least 33x100, otherwise change using setfont command.

In Embedded devices having little display you can use this terminal to show unicode fonts

$ apt install fbterm
$ fbterm

Quick Start

Install last stable version in global from official npm package (Installing packages from NPM repositories is always a quick but unsafe way if you want to keep your system free of malicious packages or dependencies)

$ npm install satop -g
$ satop --rpccookiefile=/home/<user>/.bitcoin/.cookie

The path /home/<user>/.bitcoin/.cookie depends from your Bitcoin datadir config

Or use username and password

$  satop --rpcuser=<username> --rpcpassword=<password>

(All commands entered are stored in the bash history file. But we don't want the password to be stored where anyone can find it. For this, put a space in front of the command shown above.) If rpccookiefile has valid value(file exists and readble) auth method bypass any values of rpcuser/rpcpassword and it use only the cookie file.

Configuration

Satop config file is located in user home directory $HOME/.satoprc each parameter by command line has its counterpart inside this file, read the comments in it for more details. If the file not exists can be generated by command:

$ satop --confgen

Source Code Installation

Get source code:

$ git clone https://github.com/st3b1t/SatoshiTop.git
$ cd ./SatoshiTop

Now you have the development version, master branch.

Choice a stable release from https://github.com/st3b1t/SatoshiTop/releases. Or select latest automagically:

$ git checkout $(git describe --tags `git rev-list --tags --max-count=1`)

Verify

Copy the example config file dot.satoprc.example in your home path:

$ cp ./dot.satoprc.example ~/.satoprc
$ chmod 0600 ~/.satoprc

Now uncomment and set rpccookiefile with path od Bitcoin cookie file or set rpcuser and rpcpassword. (Don't forget to set restrictive read permissions for this file in case of storing rpcuser and rpcpassword)

Install dependencies and satop command in the global way and try it:

$ npm install
$ npm install -g .
$ satop --version
$ satop --help

Docker and Snap setup is work in progress...

Usage

Start SatoshiTop with the satop command in system terminal(the same system whose resources you want to monitor).

$ satop

If Bitcoin daemon listening in different address(127.0.0.1) or a different port(8333), you can use command line parameters:

$ satop --rpcconnect=192.168.0.3 --rpcport=18332

Or via Environment variable:

$ RPCCONNECT=192.168.0.3 RPCPORT=18332 satop

To stop satop use q, or ctrl+c in most shell environments.

Learn more about Environment and Command line parameters...

RPC client

From version v2.5.0 SatoshiTop include an additional command defined in bin/satoprpc. This allows you to send RPC methodi to your full node. Learn more:

$ satoprpc --help 

Show all rpc commands available in your Bitcoin RPC Node:

$ satoprpc help 

Now you can run only Bitcoin rpc methods. Coming soon are Electrum Server rpc methods and other commands for to control Lightning Network node... all in one command line!

Development

$ git clone https://github.com/st3b1t/SatoshiTop
$ cd SatoshiTop
$ npm install
$ npm run dev

This script Set environment var FAKEMODE=true to allow simulate a RPC connection for debugging without Bitcoin Core.

Additional parameter --intervalrpc=1000 allows to speed up data polling and nodemon to reload the code at each edits.

Contributing

Pull Requests are welcome, please make sure that your changes are tested

In order of priority how you can help out:

  1. share this project in your social channels and click stars!
  2. testing and report bugs in new issue
  3. try to resolve easy issues)
  4. search //TODO in the source code
  5. add new features

License

Copyright (c) 2023 st3b1t

PGP: 0xAF2E5D05D21BA845

Released under MIT license.