Commit Graph

71 Commits

Author SHA1 Message Date
Martin Boehm
e143215288 Fix linting issues 2021-11-28 21:27:16 +01:00
David Hill
13527bda06 build: go module support 2020-03-05 11:54:42 -05:00
Martin Boehm
7f46fbab0d Fix incorrect order of utxos 2020-02-24 23:11:46 +01:00
Martin Boehm
d583028721 Check the order of utxos 2020-02-24 23:11:46 +01:00
Martin Boehm
2e37cbb974 Insert utxos in the right order in disconnect block 2020-02-24 23:11:46 +01:00
Vladyslav Burzakovskyy
bef572c494 FiatRates: store rates as float64 instead of json.Number 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
6cfb881a04 Add GetBalanceHistory for an address of bitcoin type 2019-11-04 10:55:00 +01:00
Martin Boehm
b33414cdba Fix formatting and linting issues 2019-05-27 12:51:42 +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
3d10d9c2c5 Ensure ordering of address and xpub txs in the same block 2019-03-05 13:48:11 +01:00
Martin Boehm
499d65460f Fix coding style and formatting issues 2019-01-24 15:24:56 +01:00
Martin Boehm
171e15c9f7 Fix unit test build tags 2019-01-23 16:34:35 +01:00
Martin Boehm
07108b8c4f Store txs in column addresses in reverse order 2019-01-07 13:38:58 +01:00
Martin Boehm
97e0844a4b Update references to forked btcd, btcutil and bchutil libraries 2019-01-04 14:05:51 +01:00
Martin Boehm
ab077d882c Update references to forked btcd, btcutil and bchutil libraries 2019-01-04 13:47:28 +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
9a04c862d6 Filter address transactions by input/output or token 2018-12-04 11:54:15 +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
4448c57ba8 Introduce BitcoinType and EthereumType distinction of blockchains 2018-11-15 16:16:01 +01:00
Martin Boehm
017c6b3736 Add socket.io unit tests 2018-10-19 16:37:49 +02:00
Martin Boehm
cc11ae1e57 Setup public http server test 2018-10-19 16:37:48 +02:00
Martin Boehm
caab79ed94 Extract rocksdb_test data to dbtestdata package for reusibility 2018-10-19 16:37:48 +02:00
Jakub Matys
8c7f383e9a Explicit registration of network parameters + cleanup in tests 2018-10-02 17:02:57 +02:00
Martin Boehm
184f2e9ca6 Add maxOpenFiles rocksdb flag 2018-09-18 11:49:39 +02:00
Martin Boehm
bebddbcd11 Implement list of blocks 2018-09-14 12:10:03 +02:00
Martin Boehm
676aabfaa6 Make AddressDescriptor as type,expose DB/mempool methods working with it 2018-08-30 22:43:37 +02:00
Martin Boehm
be19523065 Refactor of address handling, renamed addrID to addr descriptor addrDesc 2018-08-29 15:31:19 +02:00
Martin Boehm
ad5ddbd029 Write height column in bulk mode 2018-08-23 23:20:07 +02:00
Martin Boehm
328312e48a Add dbcache configuration flag, tune db options 2018-08-23 21:19:12 +02:00
Martin Boehm
59497e3c97 Get address data for explorer using index v3 - WIP 2018-08-22 00:48:53 +02:00
Martin Boehm
c9471bf867 Store extended info about block in heigth column 2018-08-21 16:36:14 +02:00
Martin Boehm
78f6162d5c Add height to TxAddresses as required by explorer 2018-08-21 13:16:29 +02:00
Martin Boehm
c67306ad09 Make AddrBalance and TxAddresses publicly loadable from DB 2018-08-20 18:35:46 +02:00
Martin Boehm
d45d028ef2 Implement bulk connect blocks 2018-08-19 00:23:26 +02:00
Martin Boehm
878d25ea42 Fix handling of coinbase txs in db, add test for it 2018-08-17 23:48:36 +02:00
Martin Boehm
745d7af92d Implement index v3 WIP 2018-08-17 16:33:42 +02:00
Martin Boehm
f5b29b3a17 Implement index v3 WIP 2018-08-15 19:22:26 +02:00
Martin Boehm
8e3c7f851b Clean up the rocksdb sources and disconnect UTXO blocks WIP 2018-08-03 19:26:16 +02:00
Martin Boehm
fb93c9ff7a Add unit test for pack/unpack txAddress 2018-08-02 16:10:28 +02:00
Martin Boehm
a2bbf3f9de Implement and test connectBlock for index v3 2018-08-02 14:30:45 +02:00
Martin Boehm
e558c10da9 Implement pack and unpack of big.Int 2018-07-27 19:46:21 +02:00
Jakub Matys
9409907f80 Tests are classified by tags 2018-06-14 17:27:03 +02:00