Commit Graph

72 Commits

Author SHA1 Message Date
Martin Boehm
4c41b414c4 Add getMempoolFilters websocket method 2023-05-11 15:36:03 +02:00
Martin Boehm
d856618607 Refactor fiat rates handler 2023-04-24 23:58:08 +02:00
Martin Boehm
15c19ac1fc Generate typescript documentation from golang types 2023-03-09 13:56:11 +01:00
Martin Boehm
adf50156bf Enable websocket getBlock only for extended index 2023-03-08 17:04:20 +01:00
Martin Boehm
6626f330e9 Add getBlock websocket endpoint 2023-03-08 17:04:20 +01:00
Martin Boehm
76a19b7f10 Add estimate fee and average block period prometheus metrics 2023-02-01 17:58:37 +01:00
Martin Boehm
dca00bf770 Explorer redesing tuning 2023-02-01 17:58:37 +01:00
Martin Boehm
b118bbcd6b Token values in 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
835d0e07ba Return ethereum consensus layer node version via API 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
db91824dc3 Store contract info in DB 2023-02-01 17:58:37 +01:00
Martin Boehm
9a0790a71d Process ERC721 and ERC1155 tokens 2023-02-01 17:58:37 +01:00
Martin Boehm
f5ae7c540c Optimize websocket subscribe and unsubscribe addresses 2021-05-21 00:24:57 +02:00
Martin Boehm
8fd8e17929 Add websocket subscription metrics 2021-05-21 00:24:57 +02:00
Martin Boehm
1482b51503 Get real IP of webscoket connection 2021-05-21 00:24:57 +02:00
Martin Boehm
af0711dc12 Cache estimateFee call for bitcoin type coin 2021-05-21 00:24:57 +02:00
Martin Boehm
1d55a66fab Improve xpub cache 2021-05-21 00:24:57 +02:00
Martin Boehm
c8a8bcdc1b Move OnNeBlock and OnNewTxAddr to goroutine 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
7e54336e0c Return info about backend in websocket getInfo request 2021-01-21 10:31:04 +01:00
Martin Boehm
24a783be50 Move websocket connection close out of channel close mutex 2020-12-04 11:57:11 +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
Martin Boehm
bc001ce3a3 Make logs cleaner by not logging public API errors in websocket 2020-05-22 11:19:37 +02:00
Martin Boehm
76324be8ec Modify logging 2020-05-21 22:43:18 +02:00
Martin Boehm
c43a7a4feb Merge branch 'gomod' of https://github.com/dajohi/blockbook into gomod 2020-03-21 01:17:42 +01:00
Martin Boehm
2a3c5426ca Improve remove empty map on websocket unsubscribe 2020-03-17 00:08:00 +01:00
Kirill Fomichev
c2e32b0a25 Remove empty map on address unsubscribe 2020-03-16 23:58:45 +01:00
David Hill
13527bda06 build: go module support 2020-03-05 11:54:42 -05:00
Martin Boehm
e47fd242cf Add option for lightweight tx details (txslight) to address API #381 2020-03-04 10:45:10 +01:00
Vladyslav Burzakovskyy
4ca66f3b1d fiatRates: accept an array of strings everywhere and return all available rates if it's empty 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
171b7f9b9d balanceHistory: accept a list of currencies, update tests 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
6f06b549df balanceHistory: accept Unix timestamps instead of a date string 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
29af6eb34d currencyRates: make websocket "currency" arguments case-insensitive, like in REST API 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
6919055e30 balanceHistory: sanitize the groupBy parameter in websocket API 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
918e032bfe balanceHistory: add "groupBy" parameter 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
bc0e95f174 websocket: make allFiatRates parameter string a constant 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
225ac85a2a Add optional fiat rate to balance history 2019-12-18 00:02:24 +01:00
Martin Boehm
15e2c0bf41 Add websocket method getBalanceHistory 2019-12-17 14:37:24 +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
4ba0769433 Add "ping" message to the websocket interface #238 2019-07-19 14:59:03 +02:00
Martin Boehm
bf461d0737 Add "gap" parameter to websocket "getAccountInfo" method #206 2019-06-18 12:21:22 +02:00
Martin Boehm
c916d46763 Log context in case of websocket and socketio error 2019-06-10 14:27:11 +02:00