Commit Graph

166 Commits (deepcrayon)

Author SHA1 Message Date
jebba 7ba8d7f143 s/github/spacecruft 2021-04-05 12:59:11 -06: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
Martin Boehm 67e47adf04 Reset BlockbookAppInfo metrics to avoid duplicate values 2018-09-26 11:26:38 +02:00
Jakub Matys db39b5ef51 Interrupt connectBlocks on OS signal while initial sync 2018-09-25 13:40:52 +02:00
Jakub Matys 5f0b4e5c5a Disables process renaming because it causes incorrect log rotation 2018-09-20 12:29:13 +02:00
Martin Boehm d6b9cd496b Start public interface in limited mode before initial sync #51 2018-09-20 12:15:46 +02:00
Martin Boehm 562b06202e Add prometheus metrics BlockbookAppInfo 2018-09-19 16:51:16 +02:00
Martin Boehm 142f3d46c7 Improve blockbook flag description 2018-09-18 11:49:54 +02:00
Martin Boehm 184f2e9ca6 Add maxOpenFiles rocksdb flag 2018-09-18 11:49:39 +02:00
Martin Boehm 503ff4389a Merge branch 'master' into v0.0.7 2018-09-11 13:44:36 +02:00
Martin Boehm 8bdf4b0ae3 Prepare notification of block height in OnNewBlock 2018-09-11 13:37:12 +02:00
Martin Boehm 6dcf3fd45d Send the side of address (input/output) for a new tx notification 2018-09-11 13:19:56 +02:00
Jakub Matys 8f5835a94d Set user-friendly name of Blockbook's process 2018-09-06 12:02:31 +02:00
Martin Boehm b1e749dab9 Add logging of memory status 2018-08-26 21:29:10 +02:00
Martin Boehm 16275601f4 Decrease default db cache size to reduce memory footprint 2018-08-26 18:33:07 +02:00
Martin Boehm 7d708ef868 Unify handling and error handling of pages in public interface 2018-08-24 16:17:43 +02:00
Martin Boehm 328312e48a Add dbcache configuration flag, tune db options 2018-08-23 21:19:12 +02:00