Commit Graph

181 Commits

Author SHA1 Message Date
Martin Boehm
85112a20c7 Enable coingecko pro API endpoint, count coingecko requests in metrics 2023-04-27 17:41:32 +02:00
Martin Boehm
210ec75a3d Refactor fiat rates usage 2023-04-26 21:48:31 +02:00
Martin Boehm
d856618607 Refactor fiat rates handler 2023-04-24 23:58:08 +02:00
kevin
36c744b7df
perf: leverage binary search for managing for Ids and MultiTokenValues (#910)
The change executes a migration, which for ETH mainnet takes about 20 minutes of down time.
2023-04-13 13:22:58 +02:00
Martin Boehm
adf50156bf Enable websocket getBlock only for extended index 2023-03-08 17:04:20 +01:00
Martin Boehm
d52832f6f7 Add extended index option - spendingTxid 2023-03-08 17:04:20 +01:00
Martin Boehm
aebc1c3495 Add secondary currency picker to explorer 2023-02-01 17:58:37 +01:00
Martin Boehm
715567d7f3 Store current ticker in the internal state 2023-02-01 17:58:37 +01:00
Martin Boehm
f485de5e35 Set consensus version as subversion in metrics 2023-02-01 17:58:37 +01:00
Martin Boehm
60df986fb8 Alter memory stats logging levels 2023-02-01 17:58:37 +01:00
Martin Boehm
3f5980abdb Return token exchange rates via API 2023-02-01 17:58:37 +01:00
Martin Boehm
e0be8aa400 Fiat rates refactor, fetch rates for tokens 2023-02-01 17:58:37 +01:00
Martin Boehm
f57bd2e6c3 Download ETH 4byte signatures 2023-02-01 17:58:37 +01:00
Martin Boehm
d5e871818a Minor refactor 2023-02-01 17:58:37 +01:00
Martin Boehm
1d55a66fab Improve xpub cache 2021-05-21 00:24:57 +02:00
Martin Boehm
9a0851b7a1 Add prometheus metrics 2021-05-21 00:24:57 +02:00
kaladin
1f6cddd4ab
Websocket new transaction (#574) 2021-03-21 21:55:25 +01:00
Martin Boehm
3d9954bf79 Improve locking and add panic handlers to websocket functionality 2020-11-12 15:31:59 +01:00
Martin Boehm
0a3ea6e225 Send websocket notification on new tx for input addresses 2020-05-24 17:58:29 +02:00
David Hill
13527bda06 build: go module support 2020-03-05 11:54:42 -05:00
Martin Boehm
9feccfdb2e Automatically check for UTXO inconsitencies 2020-02-24 23:11:46 +01:00
Martin Boehm
0751ed452c Check for error in utxo DB 2020-02-24 23:11:46 +01:00
Vladyslav Burzakovskyy
f6111af5da Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality

* templates.go: use bash from current user's environment

* bitcoinrpc.go: add FiatRates and FiatRatesParams to config

* blockbook.go: add initFiatRatesDownloader kickoff

* bitcoin.json: add coingecko API URL

* rockdb.go: add FindTicker and StoreTicker functions

* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers

* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings

* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests

* blockbook.go, fiat: finalize the CoinGecko downloader

* coingecko.go: do not stop syncing when encountered an error

* rocksdb_test: fix the exported function name

* worker.go: make getBlockInfoFromBlockID a public function

* public.go: apiTickers kickoff

* rocksdb_test: fix the unittest comment

* coingecko.go: update comments

* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result

* rename coingecko -> fiat_rates

* fiat_rates: export only the necessary methods

* blockbook.go: update log message

* bitcoinrpc.go: remove fiatRates settings

* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time

* add /api/v2/tickers tests, store rates as strings (json.Number)

* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory

* public, worker: move FiatRates API logic to worker.go

* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer

* rocksdb_test: remove unneeded code

* fiat_rates: add a "ping" call to check server availability

* fiat_rates: do not return empty ticker, return nil instead if not found

add a test for non-existent ticker

* rocksdb_test: remove Sleep from tests

* worker.go: do not propagate all API errors to the client

* move InitTestFiatRates from rocksdb.go to public_test.go

* public.go: fix FiatRatesFindLastTicker result check

* fiat_rates: mock API server responses

* remove commented-out code

* fiat_rates: add comment explaining what periodSeconds attribute is used for

* websocket.go: implement fiatRates websocket endpoints & add tests

* fiatRates: add getFiatRatesTickersList websocket endpoint & test

* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests

* fiatRates: remove getFiatRatesForBlockID from websocket endpoints

* fiatRates: remove "if test", use custom startTime instead

Update tests and mock data

* fiatRates: finalize websocket functionality

add "date" parameter to TickerList

return data timestamps where needed

fix sync bugs (nil timestamp, duplicate save)

* fiatRates: add FiatRates configs for different coins

* worker.go: make GetBlockInfoFromBlockID private again

* fiatRates: wait & retry on errors, remove Ping function

* websocket.go: remove incorrect comment

* fiatRates: move coingecko-related code to a separate file, use interface

* fiatRates: if the new rates are the same as previous, try five more times, and only then store them

* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses

* vertcoin_testnet.json: remove fiat rates parameters

* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 10:40:02 +01:00
Martin Boehm
d5f11561ac Catch and log panic in blockbook main 2019-06-11 16:27:47 +02:00
Martin Boehm
77bea0ecdc Retry sync in case of error 2019-05-27 12:24:25 +02:00
Martin Boehm
61e096b3f9 Fix computefeestats flag typo 2019-05-27 12:24:24 +02:00
Martin Boehm
984618a0ed Add option to compute fee statistics for chosen blocks 2019-05-27 12:24:24 +02:00
Martin Boehm
d23d0a9e4f Return with non zero exit code in case of fatal error 2019-04-23 14:18:49 +02:00
Martin Boehm
8fb4772331 Swich from Fatal log to Error log in Blockbook main 2019-04-12 15:44:11 +02:00
Martin Boehm
f2dc4a56d8 Store time of mempool transaction 2019-04-01 17:00:53 +02:00
Martin Boehm
c813f76336 Try to load mempool inputs from db to speed up mempool sync 2019-03-29 17:01:20 +01:00
Martin Boehm
d2928b3516 Refactor server init in program startup 2019-03-28 14:44:40 +01:00
Martin Boehm
ce3c7c5e66 Extract mempool interface from blockchain 2019-03-25 16:43:57 +01:00
Martin Boehm
9518f94714 Merge branch 'master' into indexv4 2019-01-03 18:09:30 +01:00
Martin Boehm
2552a429e8 Store data in addresses column in more compact way 2019-01-03 17:19:56 +01:00
Martin Boehm
8e57d23d66 Add flag dbstatsperiod that controls db stats collection period #98 2018-12-27 21:42:33 +01:00
Martin Boehm
bab500d3f8 Notify on mempool erc20 transfer transaction 2018-12-19 10:06:25 +01:00
Martin Boehm
d01081fd83 Allow websocket connections from all origins 2018-12-11 12:14:05 +01:00
Martin Boehm
13f7b48ae6 Add websocket interface 2018-12-10 17:22:37 +01:00
Martin Boehm
9a04c862d6 Filter address transactions by input/output or token 2018-12-04 11:54:15 +01:00
Martin Boehm
e9f5dfdc54 Prolong the period of computation of DB stats to approx 24 hours 2018-10-25 18:37:57 +02:00
Martin Boehm
a16ef2904e Use coin label in the explorer header 2018-10-10 00:23:31 +02:00
Martin Boehm
84b457b34a Use TxAddresses index in TxCache 2018-10-08 14:55:21 +02:00
Martin Boehm
eb5781f218 Use AddressDescriptor as key in socket.io subscribtions to addresstxid 2018-10-06 19:27:54 +02:00
Jakub Matys
503ff9582a Merge branch 'tests' 2018-10-04 16:59:39 +02:00
Martin Boehm
8e057e9e7b Fix incorrect logging formatting directives 2018-10-04 09:19:41 +02:00
Jakub Matys
cb06687ccf Merge branch 'master' into tests 2018-10-03 13:18:50 +02:00
Martin Boehm
2304c77732 Add build time to blockbook_app_info prometheus metrics 2018-10-02 12:09:04 +02:00
Jakub Matys
c5cb1e2e54 Merge branch 'integration-tests-upgrade' into tests 2018-10-01 13:43:38 +02:00
Petr Kracík
e270cf0f95 Metrics, fix version 2018-09-26 12:17:50 +02:00