Running the Alert System
Last updated
Last updated
The following instructions describe running the Bitcoin SV Alert System using tools available in most mainstream Linux distributions. The assumption has been made that you are using a Bourne-like shell such as bash
.
Hosting an Alert System that uses a P2P IPFS layer on some infrastructure providers like Hetzner could lead to problems due to their abuse detection mechanisms. The IPFS layer involves port scanning to find peers, which Hetzner might mistake for malicious activity. This can trigger Hetzner's automated systems to block or restrict your account.
Since continuous operation is crucial for an Alert System, Hetzner's sensitivity to port scanning makes it an unsuitable hosting choice for such an application. Please note that the Alert System only requires RPC access to a node and as such can run on different infrastructure than your node. Make sure to configure the proper security rules to restrict access to the RPC interface, for example using Hetzner's firewall rules.
In order to run the Alert System for each given network, there are some environment variables that should be set.
Environment Variable | Description | Example Values |
---|---|---|
With the proper environment variables set, the alert-system
binary can be run directly without any arguments.
To start the install of the Alert System, make sure you use an account that can use su
or sudo
to install software into directories owned by the root user.
Download the zipped release of your choosing from the Github release page, for this example we are using 0.1.1 which is the latest release at the time of writing:
Locate the file you downloaded and extract it using the unzip
command:
Create a symbolic link from a new directory called alert-system
to the alert-system-0.1.1 directory you just made by unzipping for easier use and updates:
To run the alert system, pass in the location of the bitcoind configuration file so that it can connect over RPC:
Create the alert-system.service
file:
Then start:
Follow the logs using journalctl
If you are hosting the Alert System on the same host as the bitcoind
, make sure only 1 instance of the Alert System is running on that host.
You can host multiple Alert Systems on a single instance or Kubernetes cluster, but then you will need to make sure they all run on a unique port and take care of any firewall considerations. For these setups it's easier to use a config.json
to define the port and RPC credentials for the nodes. An example config can be found in the alert-system repo at app/config/envs/mainnet.json.
Docker images for the Alert System can be found on Docker Hub.
ALERT_SYSTEM_ENVIRONMENT
The environment to start the Alert System with. Set this to the network type you'd like to run on.
mainnet
testnet
stn
ALERT_SYSTEM_BITCOIN_CONFIG_PATH
Path to a valid bitcoin.conf
file. Alert System will read the RPC configuration values from this file to communicate to the Bitcoin node.
/home/user/.bitcoin/bitcoin.conf
ALERT_SYSTEM_DISABLE_RPC_VERIFICATION
If this is set to true, then the Alert System will not attempt to verify the provided RPC credentials on startup. This is useful if bitcoind
is not running.
false
ALERT_SYSTEM_ALERT_WEBHOOK_URL
Webhook URL for the Alert System to send human readable alert messages to. See later in the doc for details.
http://example.com/webhook
ALERT_SYSTEM_P2P__PORT
Port for libp2p to serve on. (Defaults to 9906
)
9906
ALERT_SYSTEM_WEB_SERVER__PORT
Port for the local apiserver to serve on. (Defaults to 3000
)
3000
ALERT_SYSTEM_LOG_OUTPUT_FILE
Rather than logging to stdout, configure the server to log directly to a file on disk.
/var/log/alert-system
ALERT_SYSTEM_DATASTORE__SQLITE__DATABASE_PATH
Path to where the SQLite3 database for the alert-system should be saved. (Defaults to ./alert_system_datastore.db
/home/user/.bitcoin/alert_system_datastore.db