Commit Graph

143 Commits (b6e3f26eb2c54b52efe36aa94379ad58f9d10353)

Author SHA1 Message Date
Martin Boehm b6e3f26eb2 Insert utxos in fixUtxo in the growing order 2020-02-23 00:24:05 +01:00
Martin Boehm 72e48ce658 Automatically check for UTXO inconsitencies 2020-02-16 23:07:50 +01:00
Martin Boehm 9cfe1f3d25 Fix order of utxos 2020-02-14 16:54:51 +01:00
Martin Boehm 839f67f6eb Fix incorrect order of utxos 2020-02-14 16:33:36 +01:00
Martin Boehm 267c2b22c1 Check the order of utxos 2020-02-14 10:04:12 +01:00
Martin Boehm 5a801ed038 Insert utxos in the right order in disconnect block 2020-02-09 11:46:13 +01:00
Martin Boehm 3c90059994 Alter disconnect block procedure to avoid possible utxo db inconsistency 2020-01-31 09:29:54 +01:00
Martin Boehm a5a5edef9d Optimize and sort correctly fixed utxos 2020-01-29 20:46:58 +01:00
Martin Boehm 923234e97d Improve storing/loading of block info to db 2020-01-29 20:45:22 +01:00
Martin Boehm 358858b418 Fix errors in utxo db 2020-01-27 14:33:58 +01:00
Martin Boehm f903a1d6f9 Handle possible address descriptor mismatch in db column addresses 2020-01-27 14:33:13 +01:00
Martin Boehm 7df8f05b31 Check for error in utxo DB 2020-01-26 20:12:12 +01:00
Vladyslav Burzakovskyy 4b63b483e4 fiatRates: always return rates as a map, even if the ticker is unavailable 2020-01-22 15:26:12 +01:00
Martin 5a604441b4 Fix formatting 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy db8e0938df fiatRates: rename "data_timestamp" field to "ts" 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy 9cec5424e7 fiatRates: fields to camelCase, update output format and tests 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy c58b1538d6 fiatRates: timestamps as int64, errors as -1, update field names and tests 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy bef572c494 FiatRates: store rates as float64 instead of json.Number 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy 14c64410f7 FiatRates: change input & output time values to Unix timestamps
make currency parameter optional, return all rates if it's empty

update tests
2020-01-08 17:57:47 +01:00
Martin Boehm 1cec22ecba Merge branch 'master' into balanceHistory 2019-12-17 11:52:33 +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 bf3d822b87 Add filter from-to to balance history 2019-11-25 18:34:33 +01:00
Martin Boehm b33414cdba Fix formatting and linting issues 2019-05-27 12:51:42 +02:00
Martin Boehm 3f17333be6 Reduce logging of unimportant warnings during block import 2019-05-27 12:24:25 +02:00
Martin Boehm 9e98a4eb39 Improve performance of utxo indexing 2019-05-27 12:24:25 +02:00
Martin Boehm 733c966094 Maintain utxo index on disconnect block 2019-05-27 12:24:24 +02:00
Martin Boehm 995d5c66b5 Add utxos to addressBalance column 2019-05-27 12:24:24 +02:00
Martin Boehm 917840d6b2 Stop indexing OP_RETURN scripts 2019-05-27 12:24:24 +02:00
Martin Boehm 90d7a7f2da Bump required index version to 5 2019-05-27 12:24:24 +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 3d10d9c2c5 Ensure ordering of address and xpub txs in the same block 2019-03-05 13:48:11 +01:00
Petr Kracík d314140dde Change DB size on disk Error to warning 2019-02-13 12:08:19 +01:00
rikardwissing ffa745d390 Validate getTxAddresses return 2019-01-11 21:31:49 +01:00
Martin Boehm 3ca593aff1 Handle error tx not found #94 2019-01-10 16:39:36 +01:00
Martin Boehm 341bf331c1 Add custom handling of unknown input txs during BitcoinType block import 2019-01-09 23:24:25 +01:00
Martin Boehm 07108b8c4f Store txs in column addresses in reverse order 2019-01-07 13:38:58 +01:00
Martin Boehm 2552a429e8 Store data in addresses column in more compact way 2019-01-03 17:19:56 +01:00
Martin Boehm 4e040cb1f0 Store addresses in reverse order for newest blocks to be searched first 2018-12-20 17:33:13 +01:00
Martin Boehm e24115da83 Bump blockbook version to v0.2.0 and index version to 4 2018-12-20 16:16:51 +01:00
Martin Boehm 9a04c862d6 Filter address transactions by input/output or token 2018-12-04 11:54:15 +01:00
Martin Boehm 61177c3750 Fix cleanup of column blockTxs 2018-11-29 15:37:04 +01:00
Martin Boehm 8886256d0b Implement index v3 for ethereum type coin 2018-11-23 22:16:32 +01:00
Martin Boehm eb524c2226 Implement index v3 for ethereum type coin - WIP 2018-11-23 14:08:10 +01:00
Martin Boehm 1ac7a7abca Fix api.GetTransaction for EthereumType blockchain 2018-11-15 16:18:29 +01:00
Martin Boehm 4448c57ba8 Introduce BitcoinType and EthereumType distinction of blockchains 2018-11-15 16:16:01 +01:00
Martin Boehm f1affaf92e FIx GetAddressUtxo 2018-11-14 23:02:42 +01:00
Martin Boehm 7d28b710e3 Add total to db.GetMemoryStats 2018-11-01 18:28:48 +01:00
Martin Boehm c852214407 Complete explorer/api unit tests 2018-10-19 16:37:49 +02:00
Martin Boehm d7ed48a657 Handle not found block in rocksdb.GetBlockInfo 2018-10-19 16:37:48 +02:00
Jakub Matys b5a8cd2fc5 Error is correctly returned 2018-10-16 13:35:50 +02:00