bisq/pricenode
Florian Reimair 1b2c6c90c0
Reduce log output for price nodes
In case a price feed has an error, a stacktrace dumped in the logs
for each incoming getAllMarketPrice request. In detail, there is one
line of log stating that there is a getAllMarketPrice request, one
line of log stating that there is an error and around 150 lines of
stracktrace.
This fills up the logs quite fast, around 7.5G per day which is
unnecessary.
This commit only outputs the stacktrace in debug log configuration.
2020-04-27 09:56:21 +02:00
..
docker Merge pricenode repository at 85df033 2018-09-14 11:45:35 +02:00
src Reduce log output for price nodes 2020-04-27 09:56:21 +02:00
bisq-pricenode.env Add pricenode one-command installer script, systemd service, README (#3997) 2020-02-26 12:16:26 +01:00
bisq-pricenode.service Adjust the pricenode installer 2020-02-27 10:25:16 +01:00
collectd.conf.snippet Monitoring install scripts (#3985) 2020-02-20 16:48:56 +01:00
install_hsversion_debian.sh Report HS version to pricenode (#4027) 2020-04-02 16:06:00 +02:00
install_networksize_debian.sh Monitoring install scripts (#3985) 2020-02-20 16:48:56 +01:00
install_pricenode_debian.sh Add pricenode one-command installer script, systemd service, README (#3997) 2020-02-26 12:16:26 +01:00
journalscraper_hsversion.sh Report HS version to pricenode (#4027) 2020-04-02 16:06:00 +02:00
journalscraper.sh Fix using /bin/sh instead of /bin/bash in journalscraper.sh 2020-03-12 22:57:45 +09:00
Procfile Merge pricenode repository at 85df033 2018-09-14 11:45:35 +02:00
README-HEROKU.md Merge pricenode repository at 85df033 2018-09-14 11:45:35 +02:00
README.md Apply suggestions from code review 2020-02-27 18:36:14 +01:00
TODO.md Merge pricenode repository at 85df033 2018-09-14 11:45:35 +02:00
torrc Merge pricenode repository at 85df033 2018-09-14 11:45:35 +02:00
uninstall_hsversion_debian.sh Report HS version to pricenode (#4027) 2020-04-02 16:06:00 +02:00

bisq-pricenode

Overview

The Bisq pricenode is a simple HTTP service that fetches, transforms and relays data from third-party price providers to Bisq exchange clients on request. Available prices include:

  • Bitcoin exchange rates, available at /getAllMarketPrices, and
  • Bitcoin mining fee rates, available at /getFees

Pricenodes are deployed in production as Tor hidden services. This is not because the location of these nodes needs to be kept secret, but rather so that Bisq exchange clients do not need to exit the Tor network in order to get price data.

Anyone can run a pricenode, but it must be discoverable in order for it to do any good. For exchange clients to discover your pricenode, its .onion address must be hard-coded in the Bisq exchange client's ProvidersRepository class. Alternatively, users can point explicitly to given pricenode (or set of pricenodes) with the exchange client's --providers command line option.

Pricenodes can be deployed anywhere Java and Tor binaries can be run. Instructions below cover deployment on localhost, and instructions how to deploy on Heroku are also available.

Pricenodes should be cheap to run with regard to both time and money. The application itself is non-resource intensive and can be run on the low-end of most providers' paid tiers.

A pricenode operator's main responsibilities are to ensure their node(s) are available and up-to-date. Releases are currently source-only, with the assumption that most operators will favor Git-based "push to deploy" workflows. To stay up to date with releases, operators can subscribe to this repository's releases.atom feed and/or get notifications in the #pricenode Slack channel.

Operating a production pricenode is a valuable service to the Bisq network, and operators should issue BSQ compensation requests accordingly.

Prerequisites for running a pricenode

To run a pricenode, you will need:

  • BitcoinAverage API keys. Free plans are fine for local development or personal nodes; paid plans should be used for well-known production nodes.
  • JDK 8 if you want to build and run a node locally.
  • The tor binary (e.g. brew install tor) if you want to run a hidden service locally.

How to deploy for production

Install

Run the one-command installer:

curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/pricenode/install_pricenode_debian.sh | sudo bash

At the end of the installer script, it should print your Tor onion hostname.

Setting your BitcoinAverage API keys

Open /etc/default/bisq-pricenode.env in a text editor and look for these lines:

BITCOIN_AVG_PUBKEY=foo
BITCOIN_AVG_PRIVKEY=bar

Add your pubkey and privkey and then reload/restart bisq-pricenode service:

systemctl daemon-reload
systemctl restart bisq-pricenode

Test

To manually test endpoints, run each of the following:

curl http://localhost:8080/getAllMarketPrices
curl http://localhost:8080/getFees
curl http://localhost:8080/getParams
curl http://localhost:8080/getVersion
curl http://localhost:8080/info

Monitoring

If you run a main pricenode, you also are obliged to activate the monitoring feed by running

curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/monitor/install_collectd_debian.sh | sudo bash

Follow the instruction given by the script and report your certificate to the @bisq-network/monitoring team or via the Keybase #monitoring channel!

Furthermore, you are obliged to provide network size data to the monitor by running

curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/pricenode/install_networksize_debian.sh | sudo bash

How to deploy elsewhere