Commit Graph

52 Commits

Author SHA1 Message Date
cd2357
020547e19b
Remove Order annotation from ExchangeRateProviders
Remove Order annotation from rate providers, which was
used in the case that multiple providers would retrieve
rates for the same currency.

The ExchangeRateService now handles such scenarios, thus
eliminating the need for deciding provider precedence via
the Order annotation.
2020-07-20 18:14:37 +02:00
cd2357
5cffddc9ae
Rewrite else-if clause
Simplify if-else block to avoid redundant use of else-if
in combination with an empty check and a return statement.
2020-07-20 18:14:37 +02:00
cd2357
3e314a9d24
Rename exception variables to ex
Update the name of exception variables to ex for
consistency and better readability.
2020-07-20 18:14:37 +02:00
cd2357
141ead0b2f
Wrap comments at 90 characters
Update comments to reflect bisq-network/style#5 guideline
2020-07-20 18:14:37 +02:00
cd2357
671e80929a
Integrate initial set of ExchangeRateProviders
Add support for a few exchanges to demonstrate and test the pricenode
aggregate rates.

The chose exchanges were selected because they each provide a varied
list of fiat and altcoins, with a substantial overlap between them. This
 provides a robust initial set of datapoints and scenarios for aggregate
  rates.
2020-07-20 18:14:37 +02:00
cd2357
f650115580
ExchangeRateService: Support aggregate rates
Add support for aggregate rates in the ExchangeRateService. If multiple
ExchangeRateProviders contain rates for the same currency, then these
rates will be automatically aggregated (averaged) into one.

This allows the service to transparently scale to multiple providers for
 any specific currency.

The clients index the rates received from the pricenode by currency
code, which means they expect at most a single rate per currency. By
aggregating rates from multiple providers into one per currency, the
ExchangeRateService provides more accurate price data. At the same time,
the service API data structure remains intact, thus preserving backward
compatibility with all clients.
2020-07-20 18:14:37 +02:00
cd2357
f2085b4bf0
Simplify validation in ExchangeRateServiceTest
Update sanity check methods to allow for deeper and more comprehensive
validations of the input data. Accept full ExchangeRateProviders in the
method signatures, instead of just the provider prefix, to allow for
more complex sanity checks within those validation methods.
2020-07-20 18:14:37 +02:00
Devin Bileck
0bab863ee9
Fix command shown in README used to install collectd service
The install_collectd_debian.sh script reads user input to obtain the
onion address. However, when you pipe the output of curl into the shell
you're making the script text be standard input of the shell, which
takes it in as commands to run. After that, there's nothing left to
read. Even if it were to try, it wouldn't get anything from the terminal
input, because it's not connected to it. The pipe has replaced standard
input for the shell process.

Instead, create a pipe for bash to read the output of curl from and
provide it as the script file argument. In this case, the standard input
of the script is still connected to the terminal, and read will work.
2020-06-17 22:35:02 -07:00
Devin Bileck
83e194686d
Update install scripts for Git LFS 2020-06-17 22:35:01 -07:00
mrosseel
54cfc7b563
add commands to update the pricenode 2020-06-04 10:53:21 +02:00
Chris Beams
7064f0f2fe
Rename properties used to configure mempool hostnames 2020-05-11 11:45:33 +02:00
Chris Beams
c79bf3edf1
Eliminate unnecessary use of GenericXmlApplicationContext 2020-05-11 11:45:33 +02:00
Chris Beams
714e49461f
Rename BitcoinFeeRateProvider to MempoolFeeRateProvider
The BitcoinFeeRateProvider name was never great; it should technically
have been something like EarnDotComFeeRateProvider. This change renames
the class to reflect that it (and its new subclasses) are specifically
designed to query the Mempool API as found at https://mempool.space.
2020-05-11 11:45:33 +02:00
Chris Beams
d160d9ec5f
Restore BitcoinFeeRateProvider to package-private visibility
This class had been made public in order to access the MIN/MAX_FEE_RATE
fields and to construct dummy instances in FeeRateServiceTest. This
introduced package cycles between bisq.price.mining and
bisq.price.mining.provider, making the implementation more difficult to
understand and maintain. This commit moves these fields to the
already-public FeeRateProvider base class, where they make more sense
to reside anyway. It also reworks tests to remove the need to access
BitcoinFeeRateProvider directly from FeeRateServiceTest. In the end,
BitcoinFeeRateProvider's visibility is returned to package-private as it
originally was, and all package cycles have been eliminated.
2020-05-11 11:45:33 +02:00
Chris Beams
ae4c256103
Eliminate unnecessary TestBase class 2020-05-11 11:45:33 +02:00
Chris Beams
f8c9c72bc7
Polish style
- Wrap comments at 90 chars per bisq-network/style#5
 - Wrap code at 120 chars per bisq-network/style#3
 - Remove unused imports
 - Remove extra newlines
 - Format code where appropriate
 - Remove unused Javadoc tags, e.g. @return, @param
 - End Javadoc summary sentence with a period where missing
 - Remove HTML formatting in Javadoc, e.g. extra <br>s
2020-05-11 11:45:33 +02:00
cd2357
45636f160e
Fix unit test
Fix a unit test that failed after a few related classes were refactored.
2020-05-09 18:32:57 +02:00
cd2357
9f7eca2734
Update README.md
Add a section explaining how the mining fee average is calculated and
how the queried API endpoints can be modified.
2020-05-09 18:02:49 +02:00
cd2357
1c6a5b22a3
Scale number of fee providers using config
Automatically instantiate up to 5 parallel fee estimation providers
based on configured API endpoints in application.properties.

By default, two endpoints are active.

When none are configured, one primary provider defaults to querying
mempool.space.
2020-05-09 17:50:46 +02:00
cd2357
a5e1d75cfa
Add support for N>1 providers in FeeRateService
Extend FeeRateService with necessary logic to support multiple
BitcoinFeeRateProvider instances. Average the retrieved rates and
provide the average via the service getFee() API.
2020-05-09 16:20:09 +02:00
cd2357
efb1fd835f
Add ExchangeRateService test for N>1 providers
Add unit test which covers the scenario that an ExchangeRateService
queries multiple ExchangeRateProviders.
2020-05-09 12:43:56 +02:00
cd2357
a2c9b18f6a
Extend unit tests for ExchangeRateService
Extend the unit tests with more granular checks.
2020-05-09 12:34:02 +02:00
cd2357
1ad7169682
Add unit test for Version controller
Add unit test for existing functionality of the Version controller.
2020-05-09 09:40:52 +02:00
Chris Beams
86fcecc5d0
Review and polish migration to mempool.space API
- Polish whitespace and newlines; wrap comments at 90 chars

 - Use package-private vs protected visibility when exposing
   BitcoinFeeRateProvider constants for testing

 - Document that 'maxBlocks' is dead code, but do not remove it yet, as
   it would disrupt the process of getting this fix out quickly because
   it would require operators to change the way they start their
   pricenodes.
2020-05-05 17:38:32 +02:00
cd2357
e18f0406af
Switch to more accurate fee estimation endpoint
The API endpoint for fee estimations has been changed to one that delivers more accurate fee estimations.

This is a temporary solution, until a more decentralized approach is found.

Fixes projects/issues/27
2020-05-05 17:11:54 +02:00
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
Florian Reimair
57157c7e4f
Report HS version to pricenode (#4027)
* Report HS version to pricenode

In order to evaluate progress on https://github.com/bisq-network/projects/issues/23,
the Bisq app reports its hiddenservice version.

This change is going to be undone as soon as we do not need the
info anymore.

* Added hsversion scraper script

* Added installer/uninstaller

* Cleanup

* Fix unit name
2020-04-02 16:06:00 +02:00
wiz
71087674f4
Fix using /bin/sh instead of /bin/bash in journalscraper.sh 2020-03-12 22:57:45 +09:00
Christoph Atteneder
114ebd018c
Add an empty dummy exchange rate to prevent warning logs 2020-03-10 17:52:05 +01:00
Christoph Atteneder
537f3d4999
Add documentation 2020-03-09 15:23:25 +01:00
Christoph Atteneder
0b31d13aa1
Re-introduce CoinMarketCap stub to prevent error in existing clients 2020-03-09 14:55:05 +01:00
Christoph Atteneder
ac3e58846b
Merge pull request #4004 from freimair/networkmetric_installer
Adjust NetworkSize metric installer
2020-03-09 11:21:42 +01:00
Chris Beams
cdf0a9b128
Update Poloniex exchange rate provider @Order value
With the removal of CoinMarketCap as an exchange rate provider in the
prior commit, the @Order values of the remaining three provider
implementations are non-contiguous. CoinMarketCap was @Order(3) and with
it gone, the remaining order values became 1, 2, 4. This is not a
problem in practice, but could be confusing for future maintainers, so
this commit simply decrements the Poloniex implementation from 4 to 3 in
order to make the values contiguous once again.

This commit also fixes a typo in ExchangeRateProvider's Javadoc.
2020-03-06 19:16:33 +01:00
wiz
afc1f85c73
Remove CoinMarketCap as dead code 2020-03-07 02:36:20 +09:00
Florian Reimair
bdc4dec716
Apply suggestions from code review 2020-02-27 18:36:14 +01:00
Florian Reimair
cfa55df4b2
Align scraper script 2020-02-27 11:26:26 +01:00
Florian Reimair
ebdff5661d
Amended pricenode readme 2020-02-27 10:25:17 +01:00
Florian Reimair
d1fc9d0d18
Adjust the pricenode installer 2020-02-27 10:25:16 +01:00
wiz
21101f460c
Add pricenode one-command installer script, systemd service, README (#3997)
* Add pricenode one-command installer script, systemd service, README

* Update pricenode/bisq-pricenode.service

Co-Authored-By: Florian Reimair <office@florianreimair.at>

* Update pricenode/install_pricenode_debian.sh

Co-Authored-By: Florian Reimair <office@florianreimair.at>

Co-authored-by: Florian Reimair <office@florianreimair.at>
2020-02-26 12:16:26 +01:00
Florian Reimair
794302678d
Monitoring install scripts (#3985)
* Install script for collectd

* Install script for network size metric

* Apply suggestions from code review

Co-Authored-By: wiz <j@wiz.biz>

* Update monitor/install_collectd_debian.sh

Co-Authored-By: wiz <j@wiz.biz>

* Apply suggestions from code review

Co-Authored-By: wiz <j@wiz.biz>

Co-authored-by: wiz <j@wiz.biz>
2020-02-20 16:48:56 +01:00
battleofwizards
7719851658
Replace bouncycastle Hex with guava Hex
Hex encoding and decoding compatibility has been verified regarding
null, "", character case handling, and incorrect digits handling.
2019-09-03 13:54:32 +02:00
Manfred Karrer
1008e9bc51
Add UTF8 for getBytes calls
Fixes https://github.com/bisq-network/bisq/issues/2729
2019-04-17 19:56:21 -05:00
Oscar Guindzberg
52e36187d1 Remove libdohj dependency 2019-02-05 09:33:58 -03:00
Chris Beams
0a34505cda
Reintroduce pricenode/README.md
In the process of reconsolidating the bisq-network/bisq-pricenode
repository back into this repository as a submodule, this
this README was not carried over. This change simply copies the README
over from the old repo.
2018-11-30 21:31:41 +01:00
Chris Beams
15b81df32f
Pull up remaining pricenode config to root 2018-11-04 17:57:28 +01:00
Chris Beams
cdff12ad9f
Fix incorrect name in pricenode jar and manifest 2018-11-04 16:39:50 +01:00
Chris Beams
1cdb39ab60
Pull up JesusMcCloud repo to root
Not all subprojects need it, but most do.
2018-11-04 14:28:14 +01:00
Chris Beams
4e1fa914a2
Pull up common repositories to root build.gradle 2018-11-04 14:20:55 +01:00
Chris Beams
95c8b8ddfa
Pull up application and configuration of java plugin 2018-11-04 14:20:55 +01:00
Manfred Karrer
ede7d989ba
Fix gradle build files 2018-09-18 23:44:19 -05:00