Compare commits

..

3321 Commits

Author SHA1 Message Date
wiz
acd342259f Merge pull request #1835 from mempool/simon/transifex-pull-0608
Pulled from Transifex
2022-06-08 05:46:16 +09:00
softsimon
67456c151f Pulled from Transifex 2022-06-08 00:44:04 +04:00
wiz
13ccf55cc8 Merge pull request #1830 from hunicus/faq-projected-mempool
Change "projected block" to "mempool block" in feerate faq
2022-06-08 05:38:48 +09:00
wiz
73bffb5552 Merge pull request #1834 from mempool/nymkappa/bugfix/pools-import
Fix pool import crash
2022-06-08 05:38:38 +09:00
nymkappa
be8ee52af0 Fix pool import crash 2022-06-07 22:18:51 +02:00
hunicus
fbb16d6f22 Change projected to mempool in feerate faq 2022-06-07 14:54:33 -04:00
softsimon
96f8bf4a34 Merge pull request #1829 from mempool/simon/transifex-extract-0607
Extracting i18n
2022-06-07 22:12:44 +04:00
softsimon
2f9a86524a Extracting i18n 2022-06-07 22:11:48 +04:00
softsimon
e617e09ae3 Merge pull request #1827 from hunicus/change-terms
Change 'projected blocks' to 'mempool blocks' in feerate tooltips
2022-06-07 22:09:05 +04:00
wiz
6934aef60b Merge pull request #1828 from mempool/wiz/fix-upgrade-script-exit-code
[ops] Fix upgrade script exit code
2022-06-08 03:08:42 +09:00
hunicus
8f4de39e7b Change 'projected' to 'mempool' in feerate tooltips 2022-06-07 14:06:56 -04:00
wiz
fcb0c51e51 [ops] Fix mempool-build-all script exit code 2022-06-08 03:06:54 +09:00
wiz
ec80eac6b9 Merge pull request #1820 from hunicus/update-feerate-tooltips
Add feerate tooltips
2022-06-08 02:41:02 +09:00
wiz
84e600ac9f Merge branch 'master' into update-feerate-tooltips 2022-06-08 02:26:29 +09:00
wiz
c64d95b0ec Merge pull request #1822 from mempool/nymkappa/bugfix/db-disabled
Add 'db-less' mining pool tagging support
2022-06-08 02:26:02 +09:00
hunicus
3e2ced2e8b Make feerate tooltips appear on top 2022-06-07 13:18:20 -04:00
hunicus
6cc04feda8 Move feerate tooltips to feerate labels 2022-06-07 13:14:30 -04:00
wiz
0b50c17ed0 Merge branch 'master' into nymkappa/bugfix/db-disabled 2022-06-08 01:56:52 +09:00
wiz
81b9153d2b Merge branch 'master' into update-feerate-tooltips 2022-06-08 01:12:38 +09:00
wiz
e7c5307ca4 Merge pull request #1819 from hunicus/update-fee-faq-2
Update fee faq
2022-06-08 01:12:30 +09:00
wiz
8fb377b4eb Merge branch 'master' into update-fee-faq-2 2022-06-08 00:48:43 +09:00
wiz
5642358937 Merge pull request #1824 from hunicus/add-tx-note-1
Add transifex note to issue template
2022-06-08 00:47:39 +09:00
wiz
00cd1386b5 Merge pull request #1825 from hunicus/add-tx-note-2
Add pull request template to discourage tx prs
2022-06-08 00:47:15 +09:00
wiz
da6c72e9b7 Merge pull request #1691 from ayanamitech/cache-static
Handle Error with basic retry while syncing external assets ( Price Data )
2022-06-08 00:46:10 +09:00
hunicus
c318993a79 Add transifex note to issue template 2022-06-07 09:09:38 -04:00
hunicus
87c6e957f0 Remove unnecessary detail in fee faq 2022-06-07 08:56:41 -04:00
hunicus
e133467ea1 Add pull request template to discourage tx prs 2022-06-07 08:41:07 -04:00
hunicus
a0429b243f Make feerate tooltip i18n identifiers unique 2022-06-07 08:32:58 -04:00
nymkappa
21ae1fce2a Fix js crash when sending invalid state to /block page 2022-06-07 12:19:36 +02:00
nymkappa
53bc80e899 Add 'db-less' mining pool tagging support 2022-06-07 11:28:39 +02:00
Ayanami
56dc337672 Temporary disable retries
Until we find out how to sync async
2022-06-07 04:16:37 +09:00
Ayanami
a04bafdb4c Correct the log if the onion address is enabled or not 2022-06-07 04:16:37 +09:00
Ayanami
6ff473ab5d Add an ability to change circuits 2022-06-07 04:16:37 +09:00
Ayanami
40bfc6bff3 Include SocksProxyAgent inside while loop
To address error Socks5 proxy rejected connection - Failure
2022-06-07 04:16:37 +09:00
Ayanami
c610cacee4 Added missing config value
addressing comments from @knorrium
2022-06-07 04:16:36 +09:00
Ayanami
e41a08789a Added configurable user-agent for axios
Will use `mempool/v${backendInfo.getBackendInfo().version}` for default
2022-06-07 04:16:36 +09:00
Ayanami
9d5bbf1f44 Handle Error with basic retry while syncing external assets ( Price Data )
+ Removed unused External Assets value

+ Make static URL dynamic

+ Added config options for syncing pool data

+ Added retry interval & max retry
2022-06-07 04:16:36 +09:00
hunicus
22268b8a33 Add tooltips describing feerate levels 2022-06-06 14:32:16 -04:00
hunicus
0f58ce2322 Show fiat fee tooltip on fiat fee only 2022-06-06 14:17:25 -04:00
hunicus
1aad89ac97 Update fee faq 2022-06-06 13:05:53 -04:00
wiz
e99a684354 Merge pull request #1811 from mempool/simon/reload-mempool-visualizer-on-reconnect
Reload mempool visualization on reconnect
2022-06-06 21:35:05 +09:00
wiz
5360f6dd77 Merge branch 'master' into simon/reload-mempool-visualizer-on-reconnect 2022-06-06 21:23:48 +09:00
wiz
c8d5708155 Merge pull request #1812 from mempool/wiz/fix-foundry-logo-about-page
Use Foundry's dark theme logo on About page
2022-06-06 21:02:06 +09:00
softsimon
ebda00dc74 Send empty list of transactions if data isn't available yet 2022-06-06 14:31:17 +04:00
wiz
789092c76a Update Foundry logo on About page 2022-06-06 06:35:09 +09:00
softsimon
967a2a4461 Reload mempool visualization on reconnect
fixes #1799
2022-06-05 23:40:36 +04:00
wiz
9288628ad7 Merge pull request #1810 from mempool/simon/transifex-pull-0605
Transifex pull
2022-06-06 04:20:12 +09:00
wiz
0384ebb2ff Merge pull request #1745 from antonilol/multisig-label
stricter multisig check + detect bare multisig when spent
2022-06-06 04:19:57 +09:00
wiz
869c40e835 Merge branch 'master' into multisig-label 2022-06-06 04:06:43 +09:00
wiz
579af85544 Merge pull request #1806 from knorrium/cypress10_upgrade
Cypress v10 upgrade
2022-06-06 04:06:24 +09:00
wiz
97f72c1faf Merge branch 'master' into cypress10_upgrade 2022-06-06 03:53:09 +09:00
wiz
262c3af33e Merge pull request #1808 from mempool/nymkappa/bugfix/fix-blocks-list-loading
Make sure blocks list rxjs observable triggers at least once
2022-06-06 03:43:59 +09:00
softsimon
dd7d9b66e5 Transifex pull 2022-06-05 22:39:36 +04:00
wiz
f688da957c Merge branch 'master' into nymkappa/bugfix/fix-blocks-list-loading 2022-06-06 03:37:39 +09:00
wiz
866ac3d5b8 Merge pull request #1809 from mempool/simon/mempool-logo-svg-bugfix
Fix for mempool logo SVG issue
2022-06-06 03:36:41 +09:00
softsimon
63fce2a3ca Fix for mempool logo SVG issue 2022-06-05 22:29:05 +04:00
nymkappa
33e0859847 Make sure blocks list rxjs observable triggers at least once 2022-06-05 17:33:23 +02:00
Felipe Knorr Kuhn
b71922fabf Update Cypress Github Action to v4 2022-06-03 20:59:31 -07:00
Felipe Knorr Kuhn
ce0564a89c Update Cypress Github Action to v4 2022-06-03 20:59:03 -07:00
Felipe Knorr Kuhn
2a287b8d66 Update Cypress triggers back to push and pull request 2022-06-03 20:52:59 -07:00
Felipe Knorr Kuhn
69713ae156 Update to Cypress v10 2022-06-03 20:46:33 -07:00
Antoni Spaanderman
b930b9bf4f stricter multisig check + detect bare multisig when spent 2022-06-03 18:47:44 +02:00
wiz
412f118d22 Merge pull request #1801 from mempool/nymkappa/feature/cache-log
Improve disk cache logging
2022-06-04 01:21:55 +09:00
nymkappa
b60c2a9341 Improve disk cache logging 2022-06-03 18:00:14 +02:00
wiz
1efac916b7 Merge pull request #1800 from mempool/nymkappa/bugfix/missing-cache-version
Re-added missing cache version
2022-06-04 00:25:38 +09:00
wiz
3202629c44 Merge pull request #1772 from mempool/nymkappa/feature/websocket-block-count
Refactor pool ranking rxjs observable
2022-06-04 00:08:24 +09:00
nymkappa
3bc55d80ce Re-added missing cache version 2022-06-03 17:04:52 +02:00
wiz
89699f9b7e Merge branch 'master' into nymkappa/feature/websocket-block-count 2022-06-03 23:56:52 +09:00
wiz
95dd436be5 Merge pull request #1795 from hunicus/blocks-extras-v2
Update /api/blocks docs
2022-06-03 23:56:38 +09:00
wiz
efede07b5c Merge branch 'master' into blocks-extras-v2 2022-06-03 23:47:43 +09:00
wiz
a8123cddf7 Merge pull request #1792 from mempool/wiz/update-v2.4.0-screenshot
Update dashboard screenshot for v2.4.0 release
2022-06-03 23:47:21 +09:00
wiz
7764cceb86 Merge pull request #1797 from mempool/nymkappa/feature/automatic-disk-cache-reset
Skip blocks disk cache loading after db migration
2022-06-03 23:46:59 +09:00
nymkappa
256dbc8c8e Add disk cache versioning 2022-06-03 13:31:45 +02:00
hunicus
9ff006e61e Update /api/blocks in docs (bisq) 2022-06-02 18:08:09 -04:00
hunicus
9de6c716b7 Update /api/blocks in docs (liquid) 2022-06-02 17:51:23 -04:00
hunicus
538a1b1666 Replace blocks-extras with blocks in docs (bitcoin) 2022-06-02 17:29:13 -04:00
nymkappa
56e996c893 Refactor pool block list observable 2022-06-02 22:01:53 +02:00
nymkappa
429b4f2bc6 Refactor pool ranking rxjs observable 2022-06-02 22:01:53 +02:00
softsimon
3196c188f1 Merge pull request #1794 from mempool/simon/transifex-extract-6-2
Extracting i18n strings
2022-06-02 22:42:50 +04:00
softsimon
672833930d Extracting i18n strings 2022-06-02 22:42:27 +04:00
wiz
74ee35e273 Merge pull request #1793 from mempool/wiz/update-about-page-logos-for-v2.4
Update the Enterprise Sponsor logos on About page
2022-06-03 03:35:19 +09:00
wiz
8095a8a5f5 Fix size of Exodus logo on About page 2022-06-03 03:27:00 +09:00
wiz
ed3a614fb7 Change Gemini logo on About page to dark theme 2022-06-03 03:26:42 +09:00
wiz
cabfdcf49c Re-arrange Enterprise Sponsor logos on About page 2022-06-03 03:17:58 +09:00
wiz
69e1474c53 Update Exodus logo on About page 2022-06-03 03:01:12 +09:00
wiz
11f5056871 Merge pull request #1784 from hunicus/node-version-requirement
Make node 16.15 required not recommended
2022-06-03 02:53:55 +09:00
wiz
10ccad16e9 Update dashboard screenshot for v2.4.0 release
Fixes #1778
2022-06-03 02:48:38 +09:00
wiz
18c1be0bd0 Merge pull request #1790 from mempool/nymkappa/feature/fee-redesign-2
Updated new fee widget design
2022-06-03 01:23:58 +09:00
nymkappa
fe32ef75a2 Updated new fee widget design 2022-06-02 17:44:44 +02:00
wiz
a6517ebdc5 Merge pull request #1779 from mempool/simon/projected-block-transactions-fixes
Minor refactor for projected block transactions
2022-06-02 21:30:57 +09:00
hunicus
83660e9cf3 Make node 16.15 required not recommended 2022-06-01 22:54:46 -04:00
softsimon
f0a2ddf57b Minor refactor for projected block transactions 2022-06-02 01:29:03 +04:00
wiz
ddab579111 Merge pull request #1774 from mononaut/projected-block-overview
Feature: Projected block visualization
2022-06-02 05:35:07 +09:00
wiz
82471073c3 Merge branch 'master' into projected-block-overview 2022-06-02 00:35:07 +09:00
wiz
c9b98ed841 Merge pull request #1766 from mempool/nymkappa/feature/fee-redesign
Rewamp the fee widget
2022-06-02 00:34:57 +09:00
Mononaut
57cecee3af Add contributors agreement for mononaut 2022-06-01 13:48:58 +00:00
Mononaut
6cd8c448b4 Projected block loading spinner & WebGL detection 2022-06-01 13:48:58 +00:00
Mononaut
3ffc4956f4 Stream projected block deltas instead of full data 2022-06-01 13:48:58 +00:00
Mononaut
c2802253b7 Smarter update algorithm for projected block viz 2022-06-01 13:48:35 +00:00
Mononaut
1aac96a6f6 Projected block overview mouse events & tx preview 2022-06-01 13:48:34 +00:00
Mononaut
d4c9f6decb Implement WebGL projected block visualization 2022-06-01 13:48:34 +00:00
Mononaut
79dae84363 Data pipeline for projected mempool block overview 2022-06-01 13:48:34 +00:00
nymkappa
34576c0609 Update gradient as soon as we receive the fees 2022-06-01 12:53:36 +02:00
nymkappa
ec24549602 Hide minimum and economy on mobile 2022-06-01 12:28:42 +02:00
wiz
7f8834a2eb Merge branch 'master' into nymkappa/feature/fee-redesign 2022-06-01 17:22:01 +09:00
wiz
ee5cd1cd96 Merge pull request #1769 from mempool/nymkappa/bugfix/divergence-fix
Re-add hash field in the mysql block query
2022-06-01 17:20:38 +09:00
wiz
9ab3b3293a Merge pull request #1765 from mempool/simon/init-data-fees
Send fee info with init data
2022-06-01 17:08:09 +09:00
nymkappa
d860344be4 Re-add hash field in the mysql block query 2022-06-01 10:06:18 +02:00
nymkappa
cefc927b06 Tweaks fee widget 2022-06-01 09:47:00 +02:00
wiz
72cc2e4df0 Merge branch 'master' into nymkappa/feature/fee-redesign 2022-06-01 15:14:56 +09:00
nymkappa
b4fd98f565 Rewamp the fee widget 2022-05-31 22:31:01 +02:00
softsimon
2ee1f197d1 Send fee info with init data 2022-06-01 00:03:25 +04:00
wiz
e629173304 Merge pull request #1642 from mempool/nymkappa/bugfix/bisq-dump-file
If bisq data folder is not ready, retry every 3 minutes instead of exit
2022-06-01 03:58:24 +09:00
wiz
6210936ef4 Merge pull request #1752 from mempool/wiz/use-svg-logo-for-mempool.space
Use inline SVG for mempool.space logo
2022-06-01 03:52:40 +09:00
wiz
de8a51fe9a Merge branch 'master' into nymkappa/bugfix/bisq-dump-file 2022-06-01 03:47:12 +09:00
wiz
260f883d02 Merge pull request #1764 from mempool/nymkappa/bugfix/fx-rate-db-disable
Only attempt to save fx rate if database is enabled
2022-06-01 03:47:05 +09:00
softsimon
e81dfbcc7f Adding missing ngIf check 2022-05-31 22:39:15 +04:00
nymkappa
c7e9b47aa0 Only attempt to save fx rate if database is enabled 2022-05-31 20:29:43 +02:00
wiz
7f6ea58c74 Merge branch 'master' into wiz/use-svg-logo-for-mempool.space 2022-06-01 03:22:52 +09:00
softsimon
5dcde1c702 Store SVG images in a separate component 2022-05-31 22:21:59 +04:00
wiz
4c90d8e811 Merge branch 'master' into nymkappa/bugfix/bisq-dump-file 2022-06-01 03:10:50 +09:00
wiz
dbce727695 Merge pull request #1741 from mempool/nymkappa/feature/remove-fee-calculation-frontend
Remove fee calculation from the frontend
2022-06-01 03:03:09 +09:00
wiz
39f33dded2 Merge branch 'master' into nymkappa/feature/remove-fee-calculation-frontend 2022-06-01 02:44:48 +09:00
wiz
4b445b1191 Merge pull request #1763 from mempool/wiz/fix-backend-starting-syslog-msg
Change backend start syslog message from DEBUG to NOTICE
2022-06-01 02:43:25 +09:00
wiz
a9515f8fc1 Merge pull request #1751 from mempool/simon/handle-nonstandard-inputs
Handle nonstandard inputs
2022-06-01 02:42:57 +09:00
wiz
4ccd786fe9 Change backend start syslog message from DEBUG to NOTICE 2022-06-01 01:09:08 +09:00
wiz
72c3eea863 Merge branch 'master' into nymkappa/bugfix/bisq-dump-file 2022-06-01 00:14:43 +09:00
wiz
6a3df95d4c Merge pull request #1723 from mempool/nymkappa/feature/historical-rates
Save bisq aggregate exchange rates in the database for each new block
2022-06-01 00:14:05 +09:00
wiz
ce49dca7c8 Merge branch 'master' into nymkappa/feature/historical-rates 2022-05-31 23:58:51 +09:00
wiz
f84fee1ba0 Merge pull request #1624 from mempool/dependabot/npm_and_yarn/frontend/clipboard-2.0.11
Bump clipboard from 2.0.10 to 2.0.11 in /frontend
2022-05-31 23:55:07 +09:00
wiz
8c8299ebe0 Merge pull request #1750 from mempool/simon/dropdown-button-links-fix
Changed menu buttons to links
2022-05-31 23:52:47 +09:00
wiz
8d8fe8c528 Merge branch 'master' into simon/dropdown-button-links-fix 2022-05-31 23:15:25 +09:00
wiz
48b051f892 Merge pull request #1742 from mempool/simon/update-packages
Upgrading packages
2022-05-31 19:05:52 +09:00
wiz
44215a2108 Merge branch 'master' into simon/update-packages 2022-05-31 18:54:34 +09:00
wiz
6b2b10960a Merge branch 'master' into nymkappa/feature/remove-fee-calculation-frontend 2022-05-31 18:34:49 +09:00
wiz
cee15020fd Merge pull request #1738 from mempool/nymkappa/feature/additional-fee-tiers
Add `economyFee` field in /api/fees/recommended API
2022-05-31 18:34:32 +09:00
wiz
1cb772da39 Merge branch 'master' into nymkappa/feature/additional-fee-tiers 2022-05-31 18:28:33 +09:00
wiz
9a9be2538a Merge pull request #1739 from mempool/nymkappa/bugfix/block-url-link
Use block hash instead of block height in urls
2022-05-31 18:28:18 +09:00
wiz
260fd030b5 Merge branch 'master' into nymkappa/bugfix/block-url-link 2022-05-31 18:20:47 +09:00
wiz
8dd68728fa Merge pull request #1730 from hunicus/doc-page-titles
Fix doc page titles
2022-05-31 18:20:37 +09:00
nymkappa
c246ed958f Create rates table on all networks 2022-05-31 11:20:31 +02:00
wiz
d182128069 Merge branch 'master' into doc-page-titles 2022-05-31 18:13:27 +09:00
nymkappa
f20cf266b6 Remove frontend fee calculation and read it from the websocket instead 2022-05-31 10:41:43 +02:00
nymkappa
09b2e21fea Add economyFee field in /api/fees/recommended API 2022-05-31 10:40:58 +02:00
wiz
0ecc03e484 Merge branch 'master' into nymkappa/feature/historical-rates 2022-05-31 17:35:54 +09:00
wiz
ac0e430495 Merge pull request #1719 from mempool/nymkappa/bugfix/pool-parser-db-check
Don't try to run pools parser if db is not enabled
2022-05-31 17:35:15 +09:00
wiz
82161d4edf Use SVG logo for mempool.space 2022-05-31 17:31:31 +09:00
wiz
288a96ed43 Merge branch 'master' into nymkappa/bugfix/pool-parser-db-check 2022-05-31 17:09:41 +09:00
wiz
768be0cc70 Merge pull request #1716 from mempool/nymkappa/feature/bitcoind-offline-support
Mining dashboard still runs fine if Bitcoin Core becomes unavailable
2022-05-31 17:09:08 +09:00
wiz
687310f6f0 Merge branch 'master' into nymkappa/feature/bitcoind-offline-support 2022-05-31 16:50:11 +09:00
softsimon
85b17927d6 Handle nonstandard inputs
fixes #1744
2022-05-31 04:13:13 +04:00
softsimon
9ce4057ad4 Changed menu buttons to links
fixes #1073
2022-05-31 03:49:03 +04:00
softsimon
d542671993 Updating some more packages 2022-05-31 02:21:05 +04:00
softsimon
3935aef841 Upgrading packages 2022-05-31 02:21:05 +04:00
wiz
69f06ae257 Merge pull request #1747 from mempool/simon/transifex-pull
Transifex pull
2022-05-30 18:35:16 +09:00
softsimon
7be22b8236 Transifex pull 2022-05-30 13:26:54 +04:00
nymkappa
99902e70c7 Use block hash instead of block height in urls 2022-05-27 20:43:14 +02:00
wiz
fcbf7d9c57 Merge pull request #1733 from mempool/simon/angular-13.3-update
Angular 13.3.10 update
2022-05-27 18:59:20 +09:00
wiz
b63b02b8ad Merge pull request #1736 from hunicus/update-faq-stuck
Adjust stuck tx faqs for angry people
2022-05-27 18:49:41 +09:00
wiz
ec4ea7e732 Merge pull request #1735 from hunicus/remove-keybase
Remove keybase link from about page
2022-05-27 18:46:58 +09:00
wiz
41f0e784e2 Merge branch 'master' into simon/angular-13.3-update 2022-05-27 18:45:52 +09:00
wiz
6718bd7332 Merge pull request #1718 from mempool/nymkappa/feature/block-list-loading
Add loading spinner in /blocks page
2022-05-27 18:45:48 +09:00
wiz
18143a3807 Merge pull request #1728 from hunicus/add-faq-emptyblocks
Add faq on empty blocks
2022-05-27 18:42:57 +09:00
wiz
a8a5313eb4 Merge branch 'master' into nymkappa/feature/block-list-loading 2022-05-27 18:38:36 +09:00
wiz
dd9a704af8 Merge pull request #1717 from mempool/simon/ngb-boostrap-imports
NgBootstrap library import optimization
2022-05-27 18:38:24 +09:00
wiz
dea1e0acca Merge branch 'master' into add-faq-emptyblocks 2022-05-27 18:29:21 +09:00
nymkappa
be3d8b5ed9 Mining dashboard still runs fine if Bitcoin Core becomes unavailable 2022-05-27 11:26:56 +02:00
wiz
4d748eb585 Merge branch 'master' into simon/ngb-boostrap-imports 2022-05-27 18:23:51 +09:00
wiz
1ba0077666 Merge pull request #1714 from hunicus/install-manual
Move manual install notes to separate docs
2022-05-27 18:22:13 +09:00
wiz
36eeb84359 Merge pull request #1699 from mempool/simon/liquid-fixes
Liquid empty miner UX fix
2022-05-27 18:15:03 +09:00
nymkappa
e590759b7b Don't try to run pools parser if db is not enabled 2022-05-27 10:31:49 +02:00
hunicus
b7c918b79d Mention "esplora" value for blockstream/electrs 2022-05-26 22:13:37 -04:00
hunicus
d944362c7d Broaden guidance for hosting frontend 2022-05-26 19:33:54 -04:00
hunicus
28439bff7d Add recommended versions for node and npm 2022-05-26 18:19:58 -04:00
hunicus
c69d0e8148 Add note on mysql install brought up in #1731 2022-05-26 17:57:48 -04:00
hunicus
24e745e85d Add manual frontend setup notes to frontend/ readme 2022-05-26 17:42:15 -04:00
hunicus
3e82e432c6 Add manual backend setup notes to backend/ readme 2022-05-26 17:42:15 -04:00
hunicus
9a45dea52f Caution about manual installs in docker readme 2022-05-26 17:42:14 -04:00
hunicus
24f4644379 Orient stuck tx faqs for normies 2022-05-26 17:27:11 -04:00
softsimon
e5470b9e40 Angular 13.3.10 update 2022-05-26 18:31:11 +04:00
hunicus
68b4b66058 Fix doc page titles 2022-05-25 23:59:48 -04:00
hunicus
b7f4444d14 Remove keybase link from about page 2022-05-25 22:53:22 -04:00
hunicus
f0acff2f42 Add faq on empty blocks 2022-05-25 22:44:26 -04:00
softsimon
63ab2d7c2b Reseting statistics fix 2022-05-25 23:43:31 +04:00
softsimon
36f56de4f1 Liquid UX fixes
fixes #1683
fixes #1681
2022-05-25 23:43:31 +04:00
softsimon
3bdd11ab37 Merge pull request #1727 from mempool/simon/i18n-extract-25-5
i18n extract
2022-05-25 19:03:43 +04:00
softsimon
428401891e i18n extract 2022-05-25 19:03:25 +04:00
softsimon
7a51572082 NgBootstrap library import optimization 2022-05-25 18:56:10 +04:00
wiz
cba9930410 Merge pull request #1687 from mempool/nymkappa/feature/use-block-count-timespan
Replace all oldestIndexedBlockTimestamp with X-total-count header
2022-05-25 20:32:44 +09:00
wiz
2a486a1762 Merge pull request #1701 from hunicus/lighthouse-parents-2
Add role attributes for doc nav elements
2022-05-25 20:30:45 +09:00
wiz
989d5b3263 Merge branch 'master' into lighthouse-parents-2 2022-05-25 20:17:56 +09:00
wiz
df9c9e334d Merge branch 'master' into nymkappa/feature/use-block-count-timespan 2022-05-25 20:16:32 +09:00
wiz
07797d36bc Merge pull request #1712 from mempool/simon/npm-audit-fix-24-5
npm audit fix
2022-05-25 20:16:21 +09:00
wiz
aac92404d2 Merge branch 'master' into simon/npm-audit-fix-24-5 2022-05-25 20:09:34 +09:00
wiz
8372ca1cf0 Merge pull request #1700 from mempool/simon/block-transactions-error-catcher
Block transactions list error handling
2022-05-25 20:09:05 +09:00
wiz
1880e3a59b Merge branch 'master' into simon/block-transactions-error-catcher 2022-05-25 19:22:31 +09:00
wiz
b8463b833b Merge pull request #1696 from mempool/nymkappa/feature/merge-blocks
Merge legacy and mining /blocks components and APIs
2022-05-25 19:22:24 +09:00
nymkappa
f9bcdfb1e5 Update API documentation 2022-05-25 12:10:10 +02:00
nymkappa
c402422682 Remove last trace of legacy oldestIndexedBlockTimestamp 2022-05-25 12:10:09 +02:00
wiz
aac9dda9ef Merge branch 'master' into nymkappa/feature/merge-blocks 2022-05-25 18:55:13 +09:00
wiz
e059b9d379 Merge pull request #1685 from mempool/nymkappa/feature/update-api-case
Update case in some mining API endpoint response
2022-05-25 18:54:47 +09:00
wiz
ce04942803 Merge pull request #1710 from hunicus/add-schildbach
Add schildbach bitcoin wallet to about page
2022-05-25 18:37:46 +09:00
wiz
fae54797e8 Merge branch 'master' into add-schildbach 2022-05-25 18:26:21 +09:00
wiz
b136db933f Merge pull request #1707 from mempool/nymkappa/feature/chart-button-bitcoin-only
Hide graph selection button on non bitcoin networks
2022-05-25 18:26:11 +09:00
wiz
aebeb600a3 Merge pull request #1708 from mempool/nymkappa/bugfix/blocks-list-widget
Fix missing tx column in main dashboard on mobile
2022-05-25 18:18:01 +09:00
nymkappa
875040c329 Save bisq aggregate exchange rates in the database for each new block 2022-05-25 10:51:35 +02:00
wiz
72014eb0b3 Merge branch 'master' into nymkappa/feature/chart-button-bitcoin-only 2022-05-25 17:27:43 +09:00
wiz
c16c7ee0cd Merge branch 'master' into nymkappa/bugfix/blocks-list-widget 2022-05-25 17:13:45 +09:00
hunicus
f55590269e Move manual install docs away from main readme
Replace with links to docker/, frontend/, and /backend.
2022-05-24 12:38:05 -04:00
nymkappa
406d4101c0 Add loading spinner in /blocks page 2022-05-24 11:55:43 +02:00
nymkappa
584fb47de7 Fix widget size mining dashboard 2022-05-24 11:19:09 +02:00
nymkappa
9e0fdec053 Merge branch 'master' into nymkappa/feature/merge-blocks 2022-05-24 10:14:06 +02:00
wiz
b91654886a Merge pull request #1635 from mempool/nymkappa/bugfix/reindex-when-fast-forward 2022-05-24 14:37:13 +09:00
Felipe Knorr Kuhn
9fbd014df9 Merge branch 'master' into nymkappa/bugfix/reindex-when-fast-forward 2022-05-23 21:08:54 -07:00
softsimon
2e9eb46caa npm audit fix 2022-05-24 04:57:08 +04:00
hunicus
f8d6dd7c7b Add schildbach bitcoin wallet to about page 2022-05-23 08:34:04 -04:00
nymkappa
88fba3f506 For non Bitcoin network, run legacy API code, but keep the same endpoint 2022-05-23 13:02:18 +02:00
nymkappa
8f57272ea0 Fix /blocks skeleton on Liquid 2022-05-23 12:08:52 +02:00
nymkappa
dc81f7cfeb Fix missing tx column in main dashboard on mobile 2022-05-23 10:56:12 +02:00
nymkappa
3723380a36 Hide graph selection button on non bitcoin networks 2022-05-23 09:44:09 +02:00
nymkappa
2da7ec2519 Use ngClass to avoid multiple [class] conflict 2022-05-23 09:08:42 +02:00
nymkappa
ffcfa4a659 Setup redirect from /mining/blocks to /blocks - Update router links 2022-05-23 09:08:41 +02:00
nymkappa
8db440f164 Update cache warmer 2022-05-23 09:08:41 +02:00
nymkappa
37b7ea6702 Merge legacy and mining /blocks components and APIs 2022-05-23 09:08:40 +02:00
hunicus
49074cc3df Add role attributes for doc nav elements
To address #1668.
2022-05-21 08:20:35 -04:00
softsimon
a1fb89963c Block transactions list error handling 2022-05-21 02:30:38 +04:00
wiz
f42da0e3ac Merge branch 'master' into nymkappa/feature/update-api-case 2022-05-21 03:18:57 +09:00
wiz
b4beb29f31 Merge pull request #1657 from mempool/nymkappa/bugfix/update-log
Add escaped slug into logs when slug does not match any pool
2022-05-21 03:13:09 +09:00
wiz
6cd3c312dd Merge branch 'master' into nymkappa/bugfix/update-log 2022-05-21 03:03:56 +09:00
wiz
3a6f64b2e3 Merge pull request #1643 from mempool/simon/lazy-load-inputs
Lazy load tx inputs in Bitcoin Core mode
2022-05-21 03:03:35 +09:00
softsimon
521418bd25 Progressbar calculation fix 2022-05-20 21:50:01 +04:00
wiz
dabfa05337 Merge branch 'master' into simon/lazy-load-inputs 2022-05-21 02:47:24 +09:00
wiz
e58b10d552 Merge pull request #1697 from hunicus/fix-ws
Fix websockets tab
2022-05-21 02:36:02 +09:00
softsimon
e092fa6286 Adding fee reveal text 2022-05-20 21:30:01 +04:00
softsimon
fb63817282 Lazy load tx inputs in Bitcoin Core mode
fixes #465
2022-05-20 21:30:01 +04:00
wiz
85ce3ba9af Merge branch 'master' into fix-ws 2022-05-21 02:23:44 +09:00
wiz
2ba506515c Merge pull request #1695 from mempool/simon/round-miners-reward
Round miners reward to full dollar
2022-05-21 02:22:35 +09:00
hunicus
85defd076f Fix websockets tab
Caused by show/hide property for JS examples
introduced in e8ef4a39ec.
2022-05-20 12:46:30 -04:00
softsimon
0ba51a9362 Round miners reward to full dollar 2022-05-20 19:21:20 +04:00
wiz
20301b9e0c Merge pull request #1694 from mempool/simon/reward-stats-i18n-fix
Reward stats i18n fix
2022-05-20 23:57:50 +09:00
wiz
ad9cf2ada3 Merge pull request #1677 from mempool/simon/transifex-pull-19-05
Pull from transifex
2022-05-20 23:56:04 +09:00
softsimon
3d425c366f Reward stats i18n fix 2022-05-20 18:49:14 +04:00
wiz
7962d5a8d8 Merge branch 'master' into simon/transifex-pull-19-05 2022-05-20 23:46:42 +09:00
wiz
774cd98aa2 Merge pull request #1690 from mempool/simon/liquid-routing-fix
Fixes for Liquid module routing
2022-05-20 23:32:55 +09:00
wiz
639364bd60 Merge pull request #1667 from mempool/simon/loading-indicator-ux
Improving loading indicator UX
2022-05-20 23:27:56 +09:00
softsimon
75b3b0fde5 Fixing the /graphs link and make it consistent 2022-05-20 18:22:04 +04:00
softsimon
db1720e3b4 Fixes for Liquid module routing 2022-05-20 17:54:06 +04:00
wiz
159b6ad04b Merge branch 'master' into nymkappa/feature/update-api-case 2022-05-20 21:03:41 +09:00
wiz
55f2cf06af Merge pull request #1688 from mempool/simon/mempool-tx-fee-bug
Fixes broken fee rate calculation for mempool transactions
2022-05-20 21:03:34 +09:00
wiz
7617cedae3 Merge pull request #1686 from mempool/nymkappa/bugfix/mining-blocks-api-expiration
Set /mining/blocks/xxx APIs expiration to 60 seconds instead of 5 min
2022-05-20 21:01:02 +09:00
wiz
b76f20f780 Merge pull request #1680 from hunicus/mining-doc-rev2
Add feedback for mining API docs
2022-05-20 21:00:32 +09:00
wiz
97e0a5092b Merge branch 'master' into simon/mempool-tx-fee-bug 2022-05-20 20:56:57 +09:00
wiz
c872c07b71 Merge pull request #1682 from mempool/simon/lazy-loaded-modules
Moving graphs and mining dashboard to a lazy loaded module
2022-05-20 20:56:40 +09:00
softsimon
062a864a17 Pre-load all lazy loaded modules 2022-05-20 15:08:45 +04:00
softsimon
5028df31ba Fixes broken fee rate calculation for mempool transactions
fixes #1684
2022-05-20 13:41:30 +04:00
nymkappa
018914a4b6 Set /mining/blocks/xxx APIs expiration to 60 seconds instead of 5 minutes 2022-05-20 09:53:24 +02:00
nymkappa
897126d56f Update API documentation for e101c4e2 2022-05-20 09:49:13 +02:00
nymkappa
e101c4e218 Replace all avg_XXX with avgXXX for consistency 2022-05-20 09:44:29 +02:00
nymkappa
cac8c717ad Merge branch 'master' into simon/loading-indicator-ux 2022-05-20 09:16:32 +02:00
softsimon
e6c4b87b8b Moving graphs and mining dashboard to a lazy loaded module 2022-05-20 04:34:41 +04:00
Felipe Knorr Kuhn
449d6b17aa Merge branch 'master' into nymkappa/bugfix/reindex-when-fast-forward 2022-05-19 10:01:06 -07:00
hunicus
a402c5c861 Remove smaller time periods for hashrate endpoints
And clarify real-time hashrate data in /mining/hashrate.
2022-05-19 12:55:20 -04:00
wiz
0f0a46cd5c Merge pull request #1654 from hunicus/mining-api-docs
Add mining api docs
2022-05-20 01:39:53 +09:00
hunicus
5e5ff91280 Make small wording change for reward-stats 2022-05-19 12:21:41 -04:00
softsimon
e531289d46 Pull from transifex 2022-05-19 20:12:21 +04:00
wiz
dae9af7864 Merge branch 'master' into mining-api-docs 2022-05-20 01:05:43 +09:00
wiz
f3c20d91d9 Merge pull request #1676 from mempool/nymkappa/bugfix/duplicate-stats-call
Additional expiration header for mining pool API endpoints
2022-05-20 00:48:15 +09:00
nymkappa
a58d5b84b6 Set expiration to 1 min for /mining/reward-stats/:blockCount and /blocks-extras/:height 2022-05-19 17:20:42 +02:00
nymkappa
2a8314efc5 Move indexing logic into Indexer class 2022-05-19 16:41:14 +02:00
nymkappa
7f8696c88d Make sure to re-index skipped block when backend is offline for too long 2022-05-19 16:41:13 +02:00
wiz
6562a35f14 Merge branch 'master' into mining-api-docs 2022-05-19 20:45:20 +09:00
wiz
ae13f6119e Merge pull request #1674 from mempool/nymkappa/feature/block-api-cache
Cache /block API response for 10 min on user side
2022-05-19 19:38:15 +09:00
wiz
b2775509e2 Merge branch 'master' into nymkappa/feature/block-api-cache 2022-05-19 19:31:32 +09:00
wiz
63890a654f Merge pull request #1673 from mempool/nymkappa/feature/index-block-hash
Index blocks.hash
2022-05-19 19:31:19 +09:00
nymkappa
75dcfdd851 Cache /block API response for 10 min on user side 2022-05-19 12:17:26 +02:00
nymkappa
04bc41df3b Index blocks.hash 2022-05-19 12:13:43 +02:00
wiz
50b040524e Merge pull request #1670 from mempool/wiz/fix-about-page-resource-URLs
Don't prepend apiBasePath for services backend resources
2022-05-19 18:51:43 +09:00
wiz
2176af7ef9 Merge pull request #1672 from knorrium/cypress_961
Upgrade Cypress to v9.6.1
2022-05-19 18:49:36 +09:00
hunicus
ec3e1f9e70 Add testnet and signet for mining api docs 2022-05-19 05:39:35 -04:00
Felipe Knorr Kuhn
1da44cd4a6 Upgrade Cypress to v9.6.1 2022-05-18 22:01:28 -07:00
hunicus
e8ef4a39ec Hide js tabs for mining endpoints 2022-05-18 17:33:52 -04:00
hunicus
455412d2a0 Add mining api docs 2022-05-18 13:48:54 -04:00
wiz
b75f263c7e Don't prepend apiBasePath for services backend resources 2022-05-19 01:54:08 +09:00
wiz
aa08ac6edc Merge pull request #1669 from mempool/wiz/fix-prod-install-script-nodejs-v16.15
[installer] Add base64 to list of OS package deps
2022-05-19 01:31:49 +09:00
wiz
feafe02ac1 [installer] Add base64 to list of OS package deps 2022-05-19 01:30:02 +09:00
nymkappa
f402bfb097 Remove unescessary log 2022-05-18 15:01:24 +02:00
wiz
6f3739feb7 Merge branch 'master' into simon/loading-indicator-ux 2022-05-18 21:37:40 +09:00
wiz
4dd75cd24e Merge pull request #1664 from mempool/simon/i18n-additions
Adding some missing i18n strings
2022-05-18 21:37:24 +09:00
wiz
b7ed45cbe7 Merge branch 'master' into simon/i18n-additions 2022-05-18 21:18:05 +09:00
wiz
cf1ea34dad Merge pull request #1660 from mempool/wiz/fix-prod-install-script-nodejs-v16.15
Production installation fixes
2022-05-18 21:16:35 +09:00
wiz
4d213a89cc Merge pull request #1666 from ayanamitech/fix-nginx
Remove unused config from nginx
2022-05-18 21:13:50 +09:00
wiz
b22cae8da1 Merge pull request #1649 from ayanamitech/fix-poolupdater
pools-updater: Support secure Tor connection to sync data with Github
2022-05-18 21:11:32 +09:00
wiz
82ced490f2 Merge pull request #1637 from mempool/simon/optimize-reconnection
Tweaking the websocket retry timers
2022-05-18 20:52:23 +09:00
wiz
8022cec36b Merge branch 'master' into simon/optimize-reconnection 2022-05-18 20:41:03 +09:00
wiz
bd324fe287 Merge pull request #1632 from mempool/simon/outspends-cache-fix
Reset outspends cache when switching to new tx page.
2022-05-18 20:39:53 +09:00
wiz
a9012234f1 Merge branch 'master' into simon/outspends-cache-fix 2022-05-18 20:28:32 +09:00
wiz
d84ee4b264 Merge pull request #1665 from mempool/simon/getrawtransaction-recursive-fix
Fix for transaction inputs being fetched recursively
2022-05-18 20:26:50 +09:00
wiz
f91d9239e6 Merge branch 'master' into simon/getrawtransaction-recursive-fix 2022-05-18 20:11:20 +09:00
wiz
eadabf6e62 Merge pull request #1661 from mempool/nymkappa/feature/10min-blocktime-after-adjustment
Define avg block time to 10 min until we have at least 146 block in the current epoch
2022-05-18 20:10:08 +09:00
softsimon
b12b7d38d7 Adding some missing i18n strings 2022-05-18 15:06:58 +04:00
softsimon
2dad8ba8ec Fix for transactions being fetched recursively 2022-05-18 15:06:44 +04:00
wiz
dddf83a2d3 Merge branch 'master' into nymkappa/feature/10min-blocktime-after-adjustment 2022-05-18 20:02:29 +09:00
wiz
f42c9e1497 Merge pull request #1659 from mempool/nymkappa/feature/cleanup-mining-api-endpoints
Cleanup mining API endpoints
2022-05-18 20:01:05 +09:00
wiz
3fd2d74f81 Merge branch 'master' into nymkappa/feature/cleanup-mining-api-endpoints 2022-05-18 19:51:38 +09:00
wiz
383addc470 Merge pull request #1658 from mempool/nymkappa/bugfix/passive-listener
Use passive listeners to improve scrolling performance
2022-05-18 19:51:04 +09:00
wiz
25d5b31f1f Merge branch 'master' into nymkappa/bugfix/passive-listener 2022-05-18 19:38:31 +09:00
wiz
39660243b3 Merge pull request #1653 from mempool/nymkappa/feature/ctrlf-addresses
Allow CTRL F an address on the transaction list component
2022-05-18 19:30:07 +09:00
wiz
9c73e5be78 Merge branch 'master' into nymkappa/feature/ctrlf-addresses 2022-05-18 19:15:48 +09:00
wiz
b07826347a Merge pull request #1652 from mempool/nymkappa/bugfix/always-use-btc-mining
Always use BTC unit in blocks list
2022-05-18 19:14:49 +09:00
wiz
6fb8a88fc8 Merge branch 'master' into nymkappa/bugfix/always-use-btc-mining 2022-05-18 19:01:42 +09:00
softsimon
1093efe844 Improving loading indicator UX 2022-05-18 08:43:24 +04:00
Ayanami
fdb035c0d2 Remove unused config from nginx 2022-05-18 11:23:51 +09:00
Ayanami
d1671c4f1b add contributor sign for ayanamidev 2022-05-18 11:20:28 +09:00
Ayanami
0b351b9fcb pools-updater: Support secure Tor connection to sync data with Github
Use Axios instead of native https
2022-05-18 11:20:28 +09:00
softsimon
68116ab055 Merge pull request #1663 from mempool/simon/i18-corrections
Minor i18n corrections
2022-05-17 21:16:56 +04:00
softsimon
c09c694fb1 Minor i18n corrections 2022-05-17 19:27:41 +04:00
wiz
ca418e8c2a Merge pull request #1627 from mempool/simon/i18n-2.4
Correcting and harmonizing i18n strings
2022-05-18 00:01:33 +09:00
wiz
7cf01d6e34 Merge branch 'master' into simon/i18n-2.4 2022-05-17 23:04:38 +09:00
wiz
8af9c1d64f Merge pull request #1662 from mempool/nymkappa/bugfix/remove-useless-log
Delete useless log
2022-05-17 22:59:27 +09:00
nymkappa
5da94fa793 Delete useless log 2022-05-17 15:58:11 +02:00
wiz
1697f6df8e Merge pull request #1629 from mempool/nymkappa/feature/widget-size-align
Polish dashboards second widgets line
2022-05-17 22:33:55 +09:00
wiz
d364a53368 Merge branch 'master' into nymkappa/feature/widget-size-align 2022-05-17 21:58:51 +09:00
wiz
cabf486394 Merge pull request #1625 from knorrium/update_node_version
Update the recommended node version to v16.15.0 (LTS)
2022-05-17 21:57:27 +09:00
nymkappa
47bb073b9a Define avg block time to 10 min until we have at least 146 block in the current epoch 2022-05-17 14:40:18 +02:00
nymkappa
df59c21cfe Cleanup mining API endpoints 2022-05-17 12:02:50 +02:00
nymkappa
4463dae46b Use passive listeners to improve scrolling performance #1605 2022-05-17 11:39:13 +02:00
wiz
ece1cbbaa9 [installer] Fix mempool checkout for bisq instance 2022-05-17 17:43:35 +09:00
wiz
30337095cf [prod] Clarify syslog.conf syntax for priorities to keybase 2022-05-17 17:26:05 +09:00
wiz
5698468fbf [installer] Checkout top-level mempool using master branch 2022-05-17 17:25:31 +09:00
wiz
d2e041ec65 [installer] Fix electrs patch sed pattern typo introduced in #1628 2022-05-17 17:13:17 +09:00
wiz
c505ed5f0b [installer] Configure nvm to install Node.js v16.15.0 / npm v8.5.5 2022-05-17 17:13:03 +09:00
wiz
da3f516388 Merge pull request #1639 from hunicus/add-fullmempool-faqs
Add simple faq on full mempool
2022-05-17 17:08:58 +09:00
wiz
f879887fc5 Merge pull request #1556 from mempool/nymkappa/feature/update-block-api
Update block API
2022-05-17 16:20:11 +09:00
wiz
094257a9df Merge branch 'master' into nymkappa/feature/update-block-api 2022-05-17 15:57:05 +09:00
wiz
2fd0c06092 Merge pull request #1591 from mempool/nymkappa/bugfix/chain-validation-block-height
Skip missing blocks during block hash chain validation
2022-05-17 15:56:27 +09:00
wiz
4e96b1885e Merge pull request #1644 from mempool/nymkappa/feature/img-alt
Added some missing alt tags on some img
2022-05-17 15:55:48 +09:00
nymkappa
9be6f80cb9 Allow CTRL F an address on the transaction list component 2022-05-16 16:50:42 +02:00
nymkappa
fd42b12fcf Always use BTC unit in blocks list 2022-05-16 11:24:38 +02:00
nymkappa
0f39914a60 Added some missing alt tags on some img 2022-05-13 15:34:26 +02:00
nymkappa
7e8e4b1e6c If bisq data folder is not ready, retry every 3 minutes instead of exit 2022-05-13 11:54:52 +02:00
nymkappa
9377faea9c Skip missing blocks during block hash chain validation 2022-05-13 10:34:32 +02:00
wiz
e63aaedbc0 Merge pull request #1640 from knorrium/fix_electrum_tls_enabled_var 2022-05-13 03:12:05 +09:00
Felipe Knorr Kuhn
9f4ef70682 Merge branch 'master' into fix_electrum_tls_enabled_var 2022-05-12 10:21:21 -07:00
Felipe Knorr Kuhn
5d5be6f05d Fix ELECTRUM_TLS_ENABLED Docker variable 2022-05-12 10:17:53 -07:00
hunicus
858ad752c8 Add simple faq on "full" mempool 2022-05-12 11:50:23 -04:00
nymkappa
e59637128e Polish dashboards second widgets line 2022-05-12 17:05:31 +02:00
softsimon
a8d8a360ec Tweaking the websocket retry timers
fixes 1560
2022-05-12 15:21:27 +04:00
wiz
25e497ce2b Merge pull request #1636 from mempool/wiz/fix-minfee-node-bitcoin.conf
Modify minfee node bitcoin.conf to connect to external peers
2022-05-12 19:43:00 +09:00
wiz
4fdcf39639 Modify minfee node bitcoin.conf to connect to external peers 2022-05-12 19:35:58 +09:00
wiz
0b0b37b5aa Merge pull request #1633 from knorrium/fix_socks5_connection
Fix the socks5 connection after updating the socks lib
2022-05-12 16:20:42 +09:00
nymkappa
433bddab1f Remove unused pools.json observable definition 2022-05-12 08:13:42 +02:00
nymkappa
d26b1436b5 Always expose /block/{hash} API in the node backend 2022-05-12 08:13:42 +02:00
nymkappa
6ae44c6f7e Call node backend block API instead of electrs 2022-05-12 08:13:42 +02:00
nymkappa
384c8d17cf Only process mining pools on Bitcoin networks 2022-05-12 08:13:41 +02:00
nymkappa
964bf2671e Delete MinerComponent 2022-05-12 08:13:41 +02:00
nymkappa
ff74e6ea8c If block exists in memory cache, return it directly for /block API 2022-05-12 08:13:41 +02:00
nymkappa
067d160f33 Use block.extras on bitcoin network for fees/subsidy 2022-05-12 08:13:41 +02:00
nymkappa
057b5bd2e1 Update block API to use indexing if available 2022-05-12 08:13:40 +02:00
Felipe Knorr Kuhn
5ca9de5a42 Fix the socks5 connection after updating the socks lib 2022-05-11 19:08:41 -07:00
softsimon
3be67ea023 Reset outspends cache when switching to new tx page.
fixes #1613
fixes #1164
2022-05-12 03:28:34 +04:00
softsimon
9d33270970 Restoring the Confirmed string and re-localized the Multisig tag 2022-05-12 02:42:24 +04:00
softsimon
98c33ab08b Correcting and harmonizing i18n strings 2022-05-11 16:29:45 +04:00
wiz
b50f9b4e2d Merge pull request #1628 from mempool/wiz/reduce-production-electrs-loop-time-1s
[ops] Reduce electrs loop time from 5 seconds to 1 second
2022-05-11 19:01:55 +09:00
wiz
074e484cee Merge pull request #1630 from hunicus/update-issue-templates 2022-05-11 13:03:47 +09:00
hunicus
ec5d2134aa Remove bulb emoji
So users pay max attention to option titles and
pick the right one.
2022-05-10 18:31:42 -04:00
wiz
ab1bbaf8fd Merge pull request #1597 from mempool/nymkappa/feature/block-size-weight
Add block sizes vs weights graph
2022-05-10 23:59:19 +09:00
nymkappa
e9620b7b48 Add block sizes and weights graph 2022-05-10 16:41:40 +02:00
nymkappa
3e90650536 Add /api/v1/mining/blocks/sizes-weights/:interval API 2022-05-10 16:41:23 +02:00
wiz
250978ea91 Merge pull request #1561 from antonilol/recvd-htlcs
detect received lighting HTLC outputs
2022-05-10 23:23:45 +09:00
wiz
b17f882c64 Merge branch 'master' into recvd-htlcs 2022-05-10 23:11:28 +09:00
wiz
61a054b40f Merge pull request #1596 from mempool/nymkappa/feature/indexing-progress
Create indexing progress sticky notification
2022-05-10 23:02:48 +09:00
nymkappa
df177e0ea7 Localize indexing progress notifications 2022-05-10 15:48:21 +02:00
nymkappa
8398c3bcc5 Hide indexing notification in widget mode 2022-05-10 15:48:21 +02:00
nymkappa
de7c4774ec Added indexing progress indicator for hashrates, update logging 2022-05-10 15:48:21 +02:00
nymkappa
802e10e0a9 Create indexing sticky notification that show indexing progress in all mining dashboard related pages 2022-05-10 15:48:20 +02:00
wiz
11cdbb3118 Merge pull request #1601 from mempool/nymkappa/feature/chart-download
Add graph download feature
2022-05-10 22:45:14 +09:00
wiz
b47e4a93b6 Merge branch 'master' into nymkappa/feature/chart-download 2022-05-10 22:41:01 +09:00
wiz
8fb41eed44 [ops] Reduce electrs loop time from 5 seconds to 1 second 2022-05-10 21:52:07 +09:00
wiz
6803562daa Merge pull request #1617 from hunicus/address-lookups-faq
Add faq on address lookups
2022-05-10 21:44:07 +09:00
wiz
1988769c5f Merge branch 'master' into nymkappa/feature/chart-download 2022-05-10 21:43:33 +09:00
nymkappa
271f3c2317 [Chart download] Add .svg to file name, fix chart background colors 2022-05-10 14:32:57 +02:00
nymkappa
c62ed62db6 Change download button position so it's not hidden on mobile 2022-05-10 14:32:57 +02:00
nymkappa
7a487046b9 Add download button on pool ranking and mempool graphs 2022-05-10 14:32:57 +02:00
nymkappa
e8bb18fbc3 Add download feature on mining charts 2022-05-10 14:32:57 +02:00
wiz
7b15b2a475 Merge pull request #1618 from hunicus/remove-fiat-prompts-2
Remove $ from commands in repo docs
2022-05-10 20:48:16 +09:00
Felipe Knorr Kuhn
212cced969 Update the recommended node version to v16.5.0 (LTS) 2022-05-09 21:59:09 -07:00
dependabot[bot]
20db11f9d8 Bump clipboard from 2.0.10 to 2.0.11 in /frontend
Bumps [clipboard](https://github.com/zenorocha/clipboard.js) from 2.0.10 to 2.0.11.
- [Release notes](https://github.com/zenorocha/clipboard.js/releases)
- [Commits](https://github.com/zenorocha/clipboard.js/compare/v2.0.10...v2.0.11)

---
updated-dependencies:
- dependency-name: clipboard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-10 02:09:37 +00:00
hunicus
8dde4510b5 Remove keybase from issue templates
Also link to #mempool.support instead of #mempool
matrix rooms.
2022-05-09 17:57:43 -04:00
hunicus
7fe425360c Remove keybase link and emphasize matrix link
By using a bolder emoji.
2022-05-09 17:57:43 -04:00
hunicus
0548263213 Make electrum server faq answer a list 2022-05-09 15:04:34 -04:00
Antoni Spaanderman
f61b8bf0fd detect received lighting HTLC outputs 2022-05-09 17:08:59 +02:00
hunicus
9a2043fab2 Remove $ from commands in repo docs 2022-05-09 02:35:03 -04:00
wiz
953f9405fc Merge pull request #1611 from hunicus/refine-prod-readme
Refine production deployment doc
2022-05-09 15:19:49 +09:00
wiz
2b9d9f985b Merge branch 'master' into address-lookups-faq 2022-05-09 15:18:42 +09:00
wiz
2d4401a336 Merge pull request #1594 from mempool/dependabot/npm_and_yarn/backend/express-4.18.1
Bump express from 4.17.1 to 4.18.1 in /backend
2022-05-09 15:17:23 +09:00
wiz
f359e956c1 Merge pull request #1593 from mempool/dependabot/npm_and_yarn/backend/ws-8.6.0
Bump ws from 8.3.0 to 8.6.0 in /backend
2022-05-09 15:09:36 +09:00
hunicus
48ed9fe824 Add faq link to address lookup error 2022-05-09 01:17:59 -04:00
hunicus
c019c7bc76 Add faq on address lookups / electrs issues 2022-05-09 01:17:59 -04:00
hunicus
f8cec63ad3 Add versions for node.js and npm 2022-05-09 01:07:21 -04:00
hunicus
88711b1d54 Remove fiat from commands 2022-05-09 00:57:48 -04:00
wiz
468ee7bcb1 Merge pull request #1585 from mempool/dependabot/npm_and_yarn/backend/typescript-4.6.4
Bump typescript from 4.4.4 to 4.6.4 in /backend
2022-05-09 11:49:35 +09:00
wiz
d5069985ef Merge pull request #1538 from mempool/dependabot/npm_and_yarn/backend/crypto-js-4.1.1
Bump crypto-js from 4.0.0 to 4.1.1 in /backend
2022-05-09 11:48:34 +09:00
dependabot[bot]
072c192d9a Bump ws from 8.3.0 to 8.6.0 in /backend
Bumps [ws](https://github.com/websockets/ws) from 8.3.0 to 8.6.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.3.0...8.6.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 02:42:41 +00:00
dependabot[bot]
06451f5342 Bump crypto-js from 4.0.0 to 4.1.1 in /backend
Bumps [crypto-js](https://github.com/brix/crypto-js) from 4.0.0 to 4.1.1.
- [Release notes](https://github.com/brix/crypto-js/releases)
- [Commits](https://github.com/brix/crypto-js/compare/4.0.0...4.1.1)

---
updated-dependencies:
- dependency-name: crypto-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 02:40:04 +00:00
dependabot[bot]
074104e973 Bump typescript from 4.4.4 to 4.6.4 in /backend
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.4 to 4.6.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.4...v4.6.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 02:39:48 +00:00
wiz
f13816a5d9 Merge pull request #1598 from antonilol/fix-lightning-csv-delay
fix lightning force close label with CSV delay <= 16
2022-05-09 10:55:18 +09:00
wiz
a892e569a3 Merge pull request #1590 from mempool/nymkappa/feature/hashrate-around-midnight
Run hashrate indexing after midnight
2022-05-09 10:45:24 +09:00
wiz
dd8dc74fe9 Merge pull request #1609 from hunicus/fix-readme-intro 2022-05-08 13:20:16 +09:00
wiz
61e2297f52 Merge pull request #1610 from hunicus/revert-docker-link 2022-05-08 13:19:19 +09:00
hunicus
e3c7dc1e4d Refine production readme 2022-05-07 18:35:17 -04:00
hunicus
015a419bb8 Change faq docker link since docker docs moved 2022-05-07 17:36:54 -04:00
hunicus
57bba2f806 Add back overwritten sentence to main readme 2022-05-07 17:20:58 -04:00
wiz
2b0270042a Merge pull request #1565 from mempool/nymkappa/bugfix/initial-indexing
Update pools table before fetching the first blocks
2022-05-07 15:25:51 +09:00
wiz
5281c48697 Merge branch 'master' into nymkappa/bugfix/initial-indexing 2022-05-07 13:51:24 +09:00
dependabot[bot]
3baf6fdcdc Bump express from 4.17.1 to 4.18.1 in /backend
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.1)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 06:27:56 +00:00
wiz
da3c7588b8 Merge pull request #1584 from mempool/simon/npm-audit-fix-04-28
Upgrading npm packages and
2022-05-06 15:26:55 +09:00
wiz
5336ba8160 Merge branch 'master' into simon/npm-audit-fix-04-28 2022-05-06 15:11:28 +09:00
wiz
d385924777 Merge pull request #1568 from mempool/simon/docs-module
Moving Docs and Faq to separate lazy loaded module
2022-05-06 15:09:59 +09:00
wiz
023f8222f3 Merge branch 'master' into simon/docs-module 2022-05-06 15:01:51 +09:00
wiz
e00a6aa123 Merge pull request #1587 from knorrium/fix_tiny_typo
Fix datababse typo
2022-05-06 15:01:23 +09:00
wiz
ff57762935 Merge pull request #1600 from hunicus/update-screenshot-2.4.0
Add screenshot for 2.4.0 to readme
2022-05-06 15:00:05 +09:00
wiz
6b7e8f457b Merge branch 'master' into update-screenshot-2.4.0 2022-05-06 14:59:38 +09:00
wiz
7672deef31 Merge pull request #1599 from hunicus/refresh-readme
Revise main readme and docker install docs
2022-05-06 14:58:03 +09:00
wiz
1ff51e60db Merge branch 'master' into nymkappa/bugfix/initial-indexing 2022-05-06 14:55:29 +09:00
wiz
f45dc25a08 Merge pull request #1592 from mempool/nymkappa/feature/realtime-estimated-hashrate
Show current network hashrate and difficulty using core RPC
2022-05-06 14:35:30 +09:00
wiz
ab28c0344c Merge branch 'master' into nymkappa/feature/realtime-estimated-hashrate 2022-05-06 13:40:11 +09:00
wiz
178251370e Merge pull request #1580 from mempool/nymkappa/bugfix/skeleton-titles
Fix reward stats skeleton titles
2022-05-06 13:31:10 +09:00
wiz
452e9277b0 Merge branch 'master' into nymkappa/bugfix/skeleton-titles 2022-05-06 13:23:02 +09:00
hunicus
e27892e597 Clarify dependencies for manual install
h/t to antonilol.
2022-05-04 11:59:23 -04:00
hunicus
0aca907a67 Adjust main readme 2022-05-03 14:08:26 -04:00
hunicus
38b2beb9f7 Edit manual install section 2022-05-03 14:08:26 -04:00
hunicus
9753af1fed Move docker docs to ./docker/readme + edit 2022-05-03 14:08:26 -04:00
hunicus
f92036f8da Edit installation methods list + 1-click section
Remove HA item.
2022-05-03 14:08:26 -04:00
hunicus
a02e443130 Adjust opening readme description 2022-05-03 14:08:26 -04:00
hunicus
2a75aae628 Add screenshot for 2.4.0 to readme 2022-05-03 14:07:14 -04:00
Antoni Spaanderman
222696f859 fix lightning force close label with CSV delay <= 16 2022-05-03 17:26:32 +02:00
softsimon
9dcf421216 Upgrading npm packages and 2022-05-02 20:04:04 +04:00
nymkappa
3972e7b8f0 Show current network hashrate and difficulty even if indexing is in progress 2022-05-02 17:39:03 +09:00
nymkappa
1f4cf1710a Show getnetworkhashps core result in dashboard + update unit formatting 2022-05-02 17:33:52 +09:00
wiz
b6fcf40565 Merge pull request #1579 from mempool/nymkappa/bugfix/bisq-dump-loading
Clean local block cache before loading dump
2022-05-02 11:47:51 +09:00
wiz
0aac410958 Merge branch 'master' into nymkappa/bugfix/bisq-dump-loading 2022-05-02 11:29:05 +09:00
nymkappa
b56f110f28 Run hashrate indexing after midnight 2022-04-30 17:54:49 +09:00
Felipe Knorr Kuhn
0f4e0c7413 Fix datababse typo 2022-04-29 22:01:22 -07:00
nymkappa
540a8da64c Fix reward stats skeleton titles 2022-04-27 17:50:25 +09:00
nymkappa
6565c363f8 Update pools table before fetching the first blocks 2022-04-27 16:57:07 +09:00
nymkappa
6d308fc81c Clean local block cache before loading dump: 2022-04-27 13:06:16 +09:00
softsimon
9b4c6b9e2c Moving Docs and Faq to separate lazy loaded module 2022-04-26 13:02:13 +04:00
wiz
bf314be7eb Merge pull request #1571 from hunicus/docker-faq-link 2022-04-25 23:31:42 +00:00
wiz
14e23831eb Merge pull request #1569 from mempool/nymkappa/bugfix/bisq-dump-loading
Read bisq dump blocks line by line and parse manually
2022-04-25 23:06:03 +00:00
wiz
addfa45548 Merge branch 'master' into nymkappa/bugfix/bisq-dump-loading 2022-04-25 22:55:56 +00:00
wiz
d701bbb2d8 Merge pull request #1564 from mempool/nymkappa/bugfix/binance-regex
Ignore case on coinbase tag regexes
2022-04-25 22:38:49 +00:00
hunicus
a3bbd286d6 Update docker faq 2022-04-24 23:12:35 -04:00
nymkappa
0ad267b07f Read bisq dump blocks line by line and parse manually 2022-04-25 11:49:04 +09:00
wiz
58d361df06 Merge pull request #1563 from mempool/nymkappa/feature/remove-block-extras-loading-indicator
Remove loading indicator for blocks-extras API
2022-04-24 07:25:27 +00:00
wiz
3189525bb6 Merge pull request #1554 from mempool/nymkappa/bugfix/fast-forward-re-org
Validate block hash chain after indexing and for new blocks
2022-04-24 06:53:15 +00:00
wiz
8d279edfe7 Merge branch 'master' into nymkappa/bugfix/fast-forward-re-org 2022-04-24 05:54:42 +00:00
wiz
e15abe6851 Merge pull request #1553 from mempool/nymkappa/bufix/blocks-list-skeleton
Update blocks list skeleton
2022-04-24 04:03:19 +00:00
wiz
97bd7ebbdd Merge branch 'master' into nymkappa/bufix/blocks-list-skeleton 2022-04-24 03:52:18 +00:00
wiz
71334516e2 Merge pull request #1548 from mempool/nymkappa/feature/timespan-selector-update
Use block count instead of oldest block for timespan selection
2022-04-24 03:51:47 +00:00
nymkappa
0803fed0f4 Fix pool component hashrate api response handling 2022-04-23 15:51:00 +09:00
wiz
6ae20ead63 Merge branch 'master' into nymkappa/feature/timespan-selector-update 2022-04-23 06:23:23 +00:00
wiz
369a986714 Merge pull request #1521 from mempool/nymkappa/feature/fee-range-chart
Add block fee rates percentiles chart
2022-04-23 06:08:34 +00:00
wiz
ed495cc019 Merge branch 'master' into nymkappa/feature/fee-range-chart 2022-04-23 04:44:03 +00:00
wiz
aea86e520e Merge pull request #1558 from mempool/nymkappa/bugfix/liquid-icons 2022-04-23 00:51:36 +00:00
nymkappa
c51216f97c Remove hardcoded liquid.network in asset icons url 2022-04-23 08:56:55 +09:00
nymkappa
0565471ecf Wait for external assets file writers to complete 2022-04-22 04:03:08 -04:00
nymkappa
0860e16b2b Ignore case on coinbase tag regexes 2022-04-22 03:25:34 -04:00
nymkappa
77fddc7ed9 Remove loading indicator for blocks-extras API 2022-04-22 00:49:02 -04:00
softsimon
e8d6872620 Merge pull request #1555 from mempool/wiz/add-mercury-wallet
Add mercury wallet in the about page
2022-04-20 14:07:42 +04:00
nymkappa
a68bab2c96 Add Mercury Wallet on About page as Wallet Integration 2022-04-19 22:38:25 +09:00
nymkappa
84b72f8b32 Manually re-index the last 10 blocks when the new block previoushash does not match latest block hash 2022-04-19 15:45:06 +09:00
nymkappa
900e02d9a5 Validate block hash chain after indexing and for new blocks 2022-04-18 17:49:22 +09:00
nymkappa
a2ad69beb1 Update blocks list skeleton 2022-04-18 11:54:52 +09:00
nymkappa
f7d57a2737 Use block count instead of oldest block for timespan selection 2022-04-15 20:43:10 +09:00
nymkappa
d0b27813b0 Save fee rates legend preference - Fix xaxis label 2022-04-15 19:39:27 +09:00
nymkappa
31ded69a4c Update cache warmer 2022-04-15 18:05:58 +09:00
nymkappa
b79fb6265c 24h/3d block fee rates chart is clickable 2022-04-15 16:16:18 +09:00
nymkappa
3ce6e81a39 Add block fee rate percentiles chart 2022-04-15 16:16:15 +09:00
nymkappa
078c7ac228 Add /api/v1/mining/blocks/fee-rates/{interval} API 2022-04-15 16:14:20 +09:00
wiz
653ce3e40c Merge pull request #1546 from mempool/nymkappa/bugfix/liquid-icon 2022-04-15 05:02:54 +00:00
nymkappa
4f4f76f067 Add try/catch liquid icon loading 2022-04-15 13:20:54 +09:00
wiz
ae98c49986 Merge pull request #1433 from knorrium/download_assets_over_tor
Allow syncing external backend assets using Tor
2022-04-14 21:46:55 +00:00
wiz
89d62b7be2 Merge branch 'master' into download_assets_over_tor 2022-04-14 21:35:59 +00:00
wiz
1c3d0363b0 Merge pull request #1341 from naveensrinivasan/naveen/pin-workflow-actions
Pin actions by SHA and set permissions for workflow
2022-04-14 21:34:40 +00:00
wiz
9cb8f64bbd Merge pull request #1518 from mempool/simon/remove-locutus-lib
Breaking out strtotime from locutus lib
2022-04-14 21:33:21 +00:00
wiz
026e66302a Merge branch 'master' into simon/remove-locutus-lib 2022-04-14 21:25:36 +00:00
wiz
3ea854dad2 Merge pull request #1339 from naveensrinivasan/naveensrinivasan/dependabot
Create dependabot.yml
2022-04-14 21:11:48 +00:00
wiz
45cc8b8775 Merge pull request #1505 from mempool/simon/sponsor-page-ux
Sponsor page revamped
2022-04-14 21:05:15 +00:00
wiz
bba4b5d32c Merge branch 'master' into simon/sponsor-page-ux 2022-04-14 20:51:49 +00:00
wiz
417542a217 Merge branch 'master' into simon/remove-locutus-lib 2022-04-14 20:27:58 +00:00
wiz
97f5e5883c Merge pull request #1517 from mempool/nymkappa/feature/refactor-db
Refactor database pool use
2022-04-14 20:12:11 +00:00
wiz
05f58026b0 Merge branch 'master' into nymkappa/feature/refactor-db 2022-04-14 20:11:53 +00:00
softsimon
14f25e7d63 Merge pull request #1499 from mempool/wiz/fix-newsyslog-for-backend
Fix log rotation configuration for mempool backend logs
2022-04-13 18:13:39 +04:00
softsimon
6919393e6c Refactored the DB class into a regular singleton class. 2022-04-13 17:38:42 +04:00
nymkappa
6fb0571b06 Refactor database pool use 2022-04-13 21:46:39 +09:00
softsimon
ec4405b07a Merge pull request #1519 from mempool/nymkappa/feature/cleanup-logs
Cleanup mining related backend logs
2022-04-13 14:58:18 +04:00
nymkappa
bee0dbd400 Cleanup mining related backend logs 2022-04-13 16:30:49 +09:00
softsimon
762c75803a Merge pull request #1473 from hunicus/add-faq
Add faq
2022-04-13 02:34:35 +04:00
hunicus
01f474628a Add websocket service to avoid issues with blocks 2022-04-12 18:06:32 -04:00
hunicus
1348e953a6 Merge branch 'master' into add-faq 2022-04-12 16:03:28 -04:00
hunicus
e50b58b8aa Add live mempool blocks to faq (h/t @softsimon) 2022-04-12 15:58:20 -04:00
hunicus
88c50f7107 Resolve conflict resulting from 315b759 2022-04-12 15:33:24 -04:00
hunicus
039e6bbe77 Add answers, fix accordions, tweak footer styling
Main purpose of this commit is to remove iframes from git
history. This commit squashes several commits that came
after iframes were added.
2022-04-12 15:31:45 -04:00
softsimon
cb894221dd Merge pull request #1502 from antonilol/script-display-2
fix wrong display of other sighash types + p2sh redeemScript when <=4 bytes + consistency with esplora backend + tapscript fixes
2022-04-12 22:32:21 +04:00
softsimon
b273f71d60 Breaking out strtotime from locutus lib 2022-04-12 17:52:30 +04:00
Antoni Spaanderman
b9127538ce Merge branch 'master' into script-display-2 2022-04-11 21:46:06 +02:00
softsimon
dd03629d20 Merge pull request #1495 from mempool/nymkappa/bugfix/fix-z-warning
Set zlevel for all graphs series
2022-04-11 17:18:57 +04:00
softsimon
d97bf332d1 Merge branch 'master' into nymkappa/bugfix/fix-z-warning 2022-04-11 16:54:04 +04:00
softsimon
5633fcb955 Merge pull request #1513 from mempool/nymkappa/feature/block-reward-graph
Add block rewards graph
2022-04-11 16:53:36 +04:00
nymkappa
d8915ad385 Update cache warmer 2022-04-11 21:20:20 +09:00
nymkappa
25c55b53a2 Set zlevel for all graphs series 2022-04-11 21:17:15 +09:00
nymkappa
8fb488a675 Add block rewards chart 2022-04-11 20:57:13 +09:00
softsimon
233af87eb4 Merge pull request #1512 from mempool/nymkappa/feature/reward-fee-graph
Add block fees graph
2022-04-11 15:17:11 +04:00
nymkappa
7dd0173e84 Improve mining graphs timespan selection UX 2022-04-11 18:17:36 +09:00
nymkappa
848e02eca0 Add new api to cache warmer 2022-04-11 15:32:17 +09:00
nymkappa
08e19a612c Add block fees graph 2022-04-11 15:32:16 +09:00
nymkappa
15cc503387 Move graph mining chart link into dropdown 2022-04-11 15:31:39 +09:00
softsimon
4b57dc8833 Merge pull request #1369 from nymkappa/feature/detect-re-org
[Indexing] - Support 10 blocks depth reorgs
2022-04-10 12:48:45 +04:00
softsimon
2abd22778f Merge pull request #1514 from antonilol/fix-address-labels
Fix Lightning HTLC detection with options_anchors
2022-04-10 12:48:12 +04:00
nymkappa
90ca668bcb [Indexing] - Support 10 blocks depth reorgs 2022-04-10 16:28:22 +09:00
Antoni Spaanderman
b4fce5cb00 Fix Lightning HTLC detection with options_anchors
rename `OP_CHECKSEQUENCEVERIFY` to `OP_CSV` in regex
2022-04-10 00:20:19 +02:00
softsimon
ac5749f493 Merge pull request #1506 from TechMiX/rtlFixes2
fix RTL layout issues
2022-04-10 00:32:13 +04:00
softsimon
627ff46541 Merge pull request #1511 from mempool/nymkappa/feature/handle-poolsjson-change
Use github api to fetch and update the pools database, once a week
2022-04-08 14:26:19 +04:00
nymkappa
ba12b10f9d Handle empty pools table error 2022-04-07 18:14:28 +09:00
nymkappa
e451b40084 Catch http request error - Fix 24h retry period 2022-04-07 16:14:43 +09:00
nymkappa
2d29b9ef89 Upon error, re-run the PoolsUpdater within 24h instead of 7d 2022-04-07 14:51:23 +09:00
nymkappa
1969f2a275 Use github api to fetch and update the pools database, once a week 2022-04-07 14:37:16 +09:00
softsimon
4d0f47b2ca Merge pull request #1510 from mempool/simon/fix-broken-npm-start
Npm run start broke
2022-04-06 15:40:48 +04:00
softsimon
bc9063e490 Npm run start broke 2022-04-06 15:40:26 +04:00
softsimon
f5c558e055 Merge pull request #1492 from mempool/nymkappa/bugfix/unknown-miner-tag
If mining dashboard is enabled, set block miner to "Unknown" by default
2022-04-06 14:35:50 +04:00
softsimon
33001ce96c Merge pull request #1503 from mempool/nymkappa/feature/additional-pool-data
Updated pool summary page to display more info on hashrate and blocks
2022-04-06 14:31:53 +04:00
nymkappa
6d876ad219 Update addresses button 2022-04-06 15:02:24 +09:00
TechMiX
9a389cc9cd add contributer signiture for TechMiX 2022-04-05 21:26:17 +02:00
TechMiX
0c3f9c895e fix RTL layout issues 2022-04-05 20:37:18 +02:00
softsimon
1a35c8ce42 Sponsor page revamped 2022-04-05 21:00:36 +04:00
softsimon
cec857eb63 Merge pull request #1504 from mempool/nymkappa/feature/update-link
Update AS142052 link
2022-04-05 12:46:26 +04:00
nymkappa
c733782d04 Update AS142052 link 2022-04-05 01:57:45 +09:00
nymkappa
c4db7ec5f6 Updated pool summary page to display more info on hashrate and blocks 2022-04-05 00:36:00 +09:00
Antoni Spaanderman
53d68a3571 name tapscript by its name + OP_CHECKSIGADD tapscript opcode detection 2022-04-04 17:16:34 +02:00
softsimon
6386f4c68a Merge pull request #1486 from mempool/simon/bitcoin-api-roundings
Rounding bitcoin api satoshis
2022-04-04 13:18:10 +04:00
Antoni Spaanderman
096f2172c6 more direct opcode comparison 2022-04-03 21:58:53 +02:00
Antoni Spaanderman
dfb5ba5c36 Completely rewrote convertScriptSigAsm
it now gives identical output to esplora, tested with the following TXs (testnet):

88710a9a6751827490f260e307757543f533c0f18bcd6865794713d263d5f5a4
446b2aad074de94efa28a1e82d2e6016dcb8a8ca38aca1a5a8eac6ef54e56a2e
4cfc410092e9514c14f48b61e20d2d3baf540ae7e981a821dd8c05dd4b7cd591
4b55dde38173174ab09e5571ebffffca798ba11143d28b9770600ff376dc778a
2022-04-03 21:41:12 +02:00
softsimon
ba92284e44 Merge pull request #1487 from mempool/nymkappa/bugfix/invalid-pool-handling
Send 404 when accessing non existing mining pool
2022-04-03 17:37:09 +04:00
softsimon
effe85f7c0 Merge pull request #1498 from mempool/nymkappa/bugfix/avoid-duplicated-indexing
Avoid parralel hashrate indexing when initial query is too slow
2022-04-03 15:57:43 +04:00
softsimon
ab8d0a02c7 Merge pull request #1501 from mempool/simon/opcode-coloring
Correcting op_code coloring
2022-04-03 15:31:11 +04:00
softsimon
4bd3030322 Correcting op_code coloring 2022-04-03 15:22:35 +04:00
softsimon
e27d80865f Merge pull request #1500 from mempool/simon/opcodes-fixes
Correcting wrong or missing op_codes display
2022-04-03 14:49:15 +04:00
softsimon
3115dcbe52 Correcting wrong or missing op_codes display
fixes #1210
2022-04-03 13:59:26 +04:00
nymkappa
f393cb0839 Wrap initial query in try/catch to reset the flag upon error 2022-04-03 15:47:33 +09:00
nymkappa
2ef2a34766 Avoid parralel hashrate indexing when initial query is too slow 2022-04-03 15:47:29 +09:00
softsimon
8d97351598 Merge pull request #1488 from mempool/nymkappa/feature/testnet-signet-empty-pool-addresses
Return empty pool addresses on testnet and signet
2022-04-03 01:13:35 +04:00
softsimon
f6b7a94b36 Merge pull request #1496 from mempool/nymkappa/bugfix/dont-assume-init-block-count
Mining stats does not depends on the websocket blocks number anymore
2022-04-03 01:08:24 +04:00
softsimon
d2fb80fb2c Merge pull request #1464 from antonilol/lightning-scripts
Detect more lightning scripts
2022-04-03 00:28:18 +04:00
softsimon
c9d4f90c15 Merge pull request #1401 from mempool/nymkappa/bugfix/mobile-ui-mining-dashboard
Fix some mobile UI issues on mining dashboard
2022-04-02 23:02:05 +04:00
nymkappa
2b79d6c935 Fix some mobile UI issues on mining dashboard 2022-04-03 03:19:25 +09:00
wiz
918798aca3 Fix newsyslog configuration for mempool backend 2022-04-02 10:14:22 -04:00
nymkappa
c3a3289fcf Mining stats does not depends on the websocket blocks number anymore 2022-04-01 12:41:25 +09:00
softsimon
2374f98ca8 Merge pull request #1482 from mempool/nymkappa/feature/remove-unused-endpoint
Remove unused `/api/v1/mining/difficulty/{interval}` endpoint
2022-03-31 19:38:24 +04:00
softsimon
94e0416951 Merge pull request #1493 from mempool/nymkappa/bugfix/websocket-graphs
Subscribe to websocket blocks update for all graphs components
2022-03-31 19:36:26 +04:00
nymkappa
52735553dd Subscribe to websocket blocks update for all graphs components 2022-04-01 00:25:46 +09:00
nymkappa
2521661c69 Remove unfiltered using input from log 2022-03-31 18:35:03 +09:00
softsimon
08accbca5d Merge pull request #1491 from hunicus/docs-scrolling
Apply smooth scrolling to docs only
2022-03-31 13:30:13 +04:00
nymkappa
0b5cba15d6 If mining dashboard is enabled, set block miner to "Unknown" by default 2022-03-31 00:14:12 +09:00
softsimon
b89eb58928 Merge pull request #1490 from mempool/nymkappa/bugfix/miner-tag-no-slug
Don't use `slugs` if it's not available in pools.json frontend
2022-03-30 17:48:16 +04:00
hunicus
315b7593bf Apply smooth scrolling to docs only 2022-03-30 09:44:41 -04:00
nymkappa
68f3022420 Don't use slugs if it's not available in pools.json frontend 2022-03-30 22:18:03 +09:00
wiz
ad89d9d9e8 Merge pull request #1475 from mempool/wiz/enable-nginx-warm-caching-for-all-mining-apis
Enable nginx warm cache for all /api/v1/mining API endpoints
2022-03-30 12:26:47 +00:00
wiz
188723cb55 Merge pull request #1483 from mempool/nymkappa/feature/cache-warn-mining
Add missing mining API endpoint to cache warmer
2022-03-30 12:25:50 +00:00
softsimon
0503bc6de8 Merge pull request #1485 from mempool/nymkappa/bugfix/pool-page-label
Update pool detail page label - Fix no data text
2022-03-30 16:24:53 +04:00
softsimon
a79a410859 Merge pull request #1489 from mempool/nymkappa/bugfix/single-call-pool-page
Fix spam call to `/api/v1/mining/pool/{slug}`
2022-03-30 15:42:08 +04:00
nymkappa
d70e183236 Add missing endpoints to cache warmer 2022-03-30 19:52:06 +09:00
nymkappa
12ec6bbf67 /api/v1/mining/difficulty/{interval} is not used 2022-03-30 19:46:17 +09:00
nymkappa
4b2698eee6 Use local block buffer to trigger pagination api call 2022-03-30 19:02:05 +09:00
nymkappa
a20c401c83 Fix spam call to /api/v1/mining/pool/{slug} 2022-03-30 18:43:01 +09:00
nymkappa
84394e13fa Return empty pool addresses on testnet and signet 2022-03-30 16:49:28 +09:00
softsimon
fb0e7ec240 Merge pull request #1484 from mempool/nymkappa/feature/block-reward-all-network
Show block reward on blockchain blocks for all Bitcoin networks
2022-03-30 11:39:36 +04:00
nymkappa
ccafe4a066 Send 404 when accessing non existing mining pool 2022-03-30 16:27:17 +09:00
softsimon
9a4d3817c5 Rounding bitcoin api satoshis
fixes #1466
2022-03-30 11:12:55 +04:00
nymkappa
f3847e483d Update pool detail page label - Fix no data text 2022-03-30 16:11:18 +09:00
nymkappa
1f20a56ae7 Show block reward on blockchain blocks for all Bitcoin networks 2022-03-30 15:47:47 +09:00
wiz
b1749ee6b6 Enable nginx warm cache for all /api/v1/mining API endpoints 2022-03-29 12:07:16 -05:00
wiz
796db0de4b Merge pull request #1474 from mempool/nymkappa/bugfix/cache-warmer-pool-slug
Use slugs in cache warmer
2022-03-29 16:43:00 +00:00
wiz
a33d558294 Fix nginx cache warmer script for url slugs 2022-03-29 11:40:37 -05:00
wiz
0561a207d9 Add jq to production deps in install script 2022-03-29 11:25:25 -05:00
nymkappa
1088655b1f Use slugs in cache warmer 2022-03-30 01:06:42 +09:00
softsimon
021a748e11 Merge pull request #1472 from mempool/nymkappa/feature/pool-chart-timespan
Add data zoom on pool hashrate chart
2022-03-29 19:52:56 +04:00
softsimon
51ddc3a959 Merge branch 'master' into nymkappa/feature/pool-chart-timespan 2022-03-29 19:00:19 +04:00
Antoni Spaanderman
105b67e566 Merge branch 'master' into lightning-scripts 2022-03-29 16:26:20 +02:00
Antoni Spaanderman
493b44d4b9 detect bare multisigs with handleVout 2022-03-29 16:16:20 +02:00
Antoni Spaanderman
b5ef148b82 replace 3 seperate labels with one AddressLabelsComponent.label?: string
+ consistency: move comments in the `if` blocks
2022-03-29 15:47:48 +02:00
softsimon
0965140bd5 Merge pull request #1457 from mempool/nymkappa/feature/address-list-collapse
Pool addresses collapse - Cleanup mobile layout
2022-03-29 15:28:36 +04:00
nymkappa
b465b7abba Add data zoom on pool hashrate chart 2022-03-29 18:20:00 +09:00
softsimon
ae8830d68b Merge branch 'master' into nymkappa/feature/address-list-collapse 2022-03-29 13:08:11 +04:00
softsimon
ec36faf98f Merge pull request #1468 from mempool/nymkappa/feature/blocks-pool-link
Use mining pool slug in block component
2022-03-29 13:07:43 +04:00
softsimon
cbb157a94c Merge pull request #1470 from mempool/nymkappa/bugfix/insert-unknown-pool
Fix query to insert unknown mining pool
2022-03-29 11:45:28 +04:00
nymkappa
7ab950d03c Add slug when we insert a mining pool for the first time 2022-03-29 16:31:26 +09:00
nymkappa
f51ea5b537 Fix query to insert unknown mining pool 2022-03-29 14:37:17 +09:00
nymkappa
8fba450033 Use mining pool slug in block component 2022-03-29 13:34:25 +09:00
wiz
7f7f8a490d Merge pull request #1459 from mempool/simon/about-page-wallets-arrange
Rearrange wallet providers on About page.
2022-03-29 04:24:53 +00:00
wiz
cb1a5ed976 Merge branch 'master' into simon/about-page-wallets-arrange 2022-03-29 04:14:43 +00:00
wiz
d516566f90 Merge pull request #1467 from mempool/nymkappa/bugfix/pool-slug-missing
Use slug instead of id in mining blocks list component
2022-03-29 04:14:33 +00:00
nymkappa
cc27b963d3 Use slug instead of id in mining blocks list component 2022-03-29 12:50:57 +09:00
nymkappa
5d9e8d0177 Fix pool page skeleton 2022-03-29 10:52:50 +09:00
Antoni Spaanderman
56656839b3 Detect more lightning scripts:
- expired htlc
- anchor
- swept anchor

Fix indentation what i messed up in 7565aa7

Add explanation
2022-03-27 16:13:48 +02:00
softsimon
9de8f78b30 Merge pull request #1463 from mempool/simon/3-27-audit-fix
npm audit fix
2022-03-27 14:33:57 +04:00
softsimon
32792f4f74 npm audit fix 2022-03-27 14:26:06 +04:00
hunicus
663cf100d1 Add no-sanitize pipe 2022-03-27 01:19:48 -04:00
hunicus
c6c335921c Finish adding non-graphical faq content 2022-03-26 23:31:49 -04:00
hunicus
ef2c845714 Generalize api-docs components to accommodate faq
Also add chunk of faq content.
2022-03-26 09:09:37 -04:00
softsimon
dc9ef154d4 Merge pull request #1456 from mempool/nymkappa/feature/pool-slug-url
Use mining pool slug in urls
2022-03-26 11:07:48 +04:00
nymkappa
9b04b3bcd6 Merge branch 'master' into nymkappa/feature/pool-slug-url 2022-03-26 12:08:39 +09:00
softsimon
3198feb46d Rearrange wallet providers on About page. 2022-03-25 21:52:00 +04:00
softsimon
b02c690924 Merge pull request #1458 from mempool/nymkappa/bugfix/jumping-tooltip
Disable glitchy angular tooltips animation
2022-03-25 19:15:02 +04:00
softsimon
7f6c8fdbac Merge pull request #1451 from mempool/nymkappa/bugfix/handle-crash-pool-parser
If pool slug does not exist, generate one on the fly, avoid crash
2022-03-25 19:11:46 +04:00
softsimon
fc5b769e2b Merge pull request #1450 from mempool/nymkappa/bugfix/relative-pool-url
Use relative pipe for pie chart click event
2022-03-25 18:27:28 +04:00
softsimon
7e7dd1213e Merge branch 'master' into nymkappa/bugfix/relative-pool-url 2022-03-25 17:20:30 +04:00
nymkappa
0a57f57a93 Disable angular tooltip animation globally 2022-03-25 22:15:16 +09:00
softsimon
acd4ab5357 Merge pull request #1449 from mempool/nymkappa/bugfix/echart-warning
Remove unnecessary echart init option
2022-03-25 16:54:26 +04:00
softsimon
f87da211dc Merge pull request #1428 from mempool/bugfix/blocks-list-css
Fix blocks list mobile layout
2022-03-25 16:52:45 +04:00
softsimon
fcaa6100b7 Merge pull request #1445 from mempool/nymkappa/bugfix/avg-fee-rounding
Fix rounding issue in reward stats
2022-03-25 16:52:08 +04:00
nymkappa
ef49457ec6 Pool addresses collapse - Cleanup mobile layout 2022-03-25 17:48:24 +09:00
nymkappa
352ea950a2 Use mining pool slug in urls 2022-03-25 14:22:22 +09:00
nymkappa
810c335759 If pool slug does not exist, generate one on the fly, avoid crash 2022-03-25 12:31:09 +09:00
nymkappa
c5837ab9df Round using AmountShortenerPipe 2022-03-25 11:39:29 +09:00
nymkappa
b075fedd7c Use relative pipe for pie chart click event 2022-03-25 10:57:34 +09:00
nymkappa
27d2127d46 Remove unnecessary echart init option 2022-03-25 10:08:20 +09:00
wiz
a016d1c071 Merge branch 'master' into nymkappa/bugfix/avg-fee-rounding 2022-03-24 16:30:57 +00:00
wiz
8114ffe1c8 Merge pull request #1446 from mempool/nymkappa/feature/pool-slug
Added slug into `pools` table
2022-03-24 16:29:54 +00:00
hunicus
289ed7b9b3 Make faq tab default when navigating to docs 2022-03-24 10:52:50 -04:00
hunicus
61faf31644 Fix routing for faq tab
Make API links relative + add routing for signet and
testnet.
2022-03-24 10:41:09 -04:00
hunicus
37e2786c5e Add faq tab placeholder 2022-03-24 08:55:20 -04:00
nymkappa
bb0fd78f28 Added slug into pools table 2022-03-24 19:44:22 +09:00
nymkappa
f1bb742341 Fix rounding issue in reward stats 2022-03-24 18:03:12 +09:00
wiz
a384328f50 Merge branch 'master' into bugfix/blocks-list-css 2022-03-24 00:55:36 +00:00
wiz
77df0c524c Merge pull request #1437 from mempool/nymkappa/bugfix/truncate-hashrates
Truncate hashrates after #1435 - Fix hashrate indexing logs
2022-03-24 00:55:15 +00:00
nymkappa
185dddd8c7 Truncate hashrates after #1435 - Fix hashrate indexing logs 2022-03-24 07:40:03 +09:00
wiz
80a103acab Merge pull request #1435 from mempool/simon/last-hashrate-indexing-millisecond-check
Last hashrate indexing check needs to be in milliseconds
2022-03-23 20:34:27 +00:00
softsimon
dcaa7fc4e8 Last hashrate indexing check needs to be in milliseconds 2022-03-24 00:24:17 +04:00
wiz
46405438d3 Merge pull request #1434 from knorrium/fix_git_commit_error
Fix git commit error
2022-03-23 19:49:14 +00:00
wiz
223dc46bd5 Merge branch 'master' into fix_git_commit_error 2022-03-23 19:49:04 +00:00
Felipe Knorr Kuhn
9c3fc9f75a Update frontend git commit hash logic 2022-03-23 12:33:47 -07:00
Felipe Knorr Kuhn
230fbdbc8e Fix empty revision case 2022-03-23 12:33:15 -07:00
Felipe Knorr Kuhn
4bb6f49950 Copy the git commit hash logic to the backend 2022-03-23 12:17:23 -07:00
Felipe Knorr Kuhn
f88af9c3f9 Add the DOCKER_COMMIT_HASH env var to the backend Dockerfile 2022-03-23 12:16:21 -07:00
wiz
3f58145e7b Merge pull request #1424 from mempool/nymkappa/bugfix/hashrate-native-js-timestamp
Set weekly hashrates timestamp to midnight
2022-03-23 18:28:33 +00:00
Felipe Knorr Kuhn
3e2e23417a Allow syncing external backend assets using Tor 2022-03-23 08:11:22 -07:00
nymkappa
fae49ba66e Merge branch 'master' into bugfix/blocks-list-css 2022-03-23 19:10:55 +09:00
nymkappa
a91fa797fa Merge branch 'master' into nymkappa/bugfix/hashrate-native-js-timestamp 2022-03-23 19:10:21 +09:00
softsimon
aaa8945b09 Merge pull request #1427 from mempool/nymkappa/feature/reward-stats-api
More dynamic mining reward
2022-03-23 11:41:57 +04:00
nymkappa
dcd50802e4 Use fee estimation box layout for reward stats and show USD amounts 2022-03-23 12:15:58 +09:00
nymkappa
fb7e81af57 Add more verbose description for stats + i18n 2022-03-23 11:54:36 +09:00
nymkappa
8cc005cb2c Refresh reward stats when a new block is mined 2022-03-23 11:54:36 +09:00
nymkappa
2644f2fb07 Move reward stats to component - Add /api/v1/mining/reward-stats/{blockCount} 2022-03-23 11:54:31 +09:00
wiz
7ace0cfbc0 Merge branch 'master' into nymkappa/bugfix/hashrate-native-js-timestamp 2022-03-23 00:09:55 +00:00
softsimon
5c629dfe98 Merge pull request #1430 from mempool/nymkappa/feature/pool-page-skeleton
Improve skeleton on pool detail page
2022-03-23 01:49:14 +04:00
softsimon
a1c796766e Merge branch 'master' into nymkappa/feature/pool-page-skeleton 2022-03-23 01:34:24 +04:00
softsimon
829ee9f460 Merge pull request #1429 from mempool/nymkappa/feature/format-incoming-vbytes-sec
Format Transaction vBytes per second (vB/s) tooltip value
2022-03-23 01:29:38 +04:00
softsimon
7a88f28a1d Merge branch 'master' into nymkappa/feature/format-incoming-vbytes-sec 2022-03-23 01:07:49 +04:00
softsimon
2ddb23beb5 Merge pull request #1431 from mempool/nymkappa/feature/remove-hover-blocks-dashboard
Don't show coinbase tooltip on mining dashboard
2022-03-22 14:21:01 +04:00
nymkappa
e9b83e6167 Don't show coinbase tooltip on mining dashboard 2022-03-22 18:31:28 +09:00
nymkappa
1566a831ed Improve skeleton on pool detail page 2022-03-22 17:19:34 +09:00
nymkappa
ff77a8ef47 Format Transaction vBytes per second (vB/s) tooltip value 2022-03-22 16:03:54 +09:00
nymkappa
7c1155ec93 Make sure blocks list container is at least 100vh on mobile 2022-03-22 15:43:04 +09:00
nymkappa
e1623b9234 Fix blocks list pagination on mobile 2022-03-22 15:16:15 +09:00
nymkappa
e5fd92b734 Most recent week was missing from indexing - Post merge fixes 2022-03-22 09:20:16 +09:00
nymkappa
74f4a6fcb4 Work using native javascript milliseconds timestamp 2022-03-22 08:44:54 +09:00
wiz
502ef29e54 Merge pull request #1423 from mempool/nymkappa/bugfix/hashrate-indexing
If we have incomplete data for the day/week, don't index hashrate
2022-03-21 22:11:26 +00:00
wiz
e9d8245d26 Merge branch 'master' into nymkappa/bugfix/hashrate-indexing 2022-03-21 22:11:18 +00:00
wiz
0bada4b079 Merge pull request #1425 from mempool/wiz/disable-cluster-for-bisq-backend
Disable cluster mode in prod bisq backend config
2022-03-21 18:15:31 +00:00
wiz
07612a144b Disable cluster mode in prod bisq backend config 2022-03-21 15:03:36 +00:00
nymkappa
077177ecc4 If we have incomplete data for the day/week, don't index hashrate 2022-03-21 20:32:57 +09:00
wiz
4c14278da6 Merge pull request #1422 from mempool/nymkappa/bugfix/halving-calculation
Use 10 minutes avg block time for halving calculation
2022-03-21 03:32:45 +00:00
nymkappa
3e8a34f3fd Use 10 minutes avg block time for halving calculation 2022-03-21 12:16:41 +09:00
wiz
14a4be743a Merge pull request #1420 from mempool/wiz/add-minfee-node-to-install-script
Add minfee node setup to production install script
2022-03-20 23:14:51 +00:00
wiz
46437919f9 Merge pull request #1419 from mempool/wiz/fix-crontab-backup-script-path
Fix path in mempool crontab for daily backup script
2022-03-20 23:14:40 +00:00
wiz
b23fd886aa Merge pull request #1416 from mempool/wiz/enable-full-indexing-all-networks
Enable full block indexing on all Bitcoin networks
2022-03-20 23:14:27 +00:00
wiz
dc54ed5b12 Add minfee node setup to production install script 2022-03-20 23:01:28 +00:00
wiz
5e58db23bb Fix path in mempool crontab for daily backup script 2022-03-20 22:19:03 +00:00
softsimon
69e4e194df Merge pull request #1417 from knorrium/address_highlighting_tests
Address highlighting tests
2022-03-20 13:45:21 +04:00
softsimon
153c63b242 Merge branch 'master' into address_highlighting_tests 2022-03-20 13:34:12 +04:00
softsimon
ebc9894bf7 Merge pull request #1418 from knorrium/cypress_9_5_2
Update Cypress to v9.5.2
2022-03-20 13:33:51 +04:00
Felipe Knorr Kuhn
a69719ad36 Update Cypress to v9.5.2 2022-03-19 22:33:56 -07:00
Felipe Knorr Kuhn
827760cae5 Add tests for the address highlighting feature 2022-03-19 22:16:22 -07:00
Felipe Knorr Kuhn
bbc6b8cfbf Use the new data-cy directive for deterministic tx locators 2022-03-19 22:15:37 -07:00
Felipe Knorr Kuhn
2d4d9d80bd Add new directive for UI tests 2022-03-19 22:14:37 -07:00
Felipe Knorr Kuhn
db4a13389a Update liquid tests to use the new css selector 2022-03-19 22:12:44 -07:00
Felipe Knorr Kuhn
cacbad38cc Change table-vx-* from id to class 2022-03-19 22:11:46 -07:00
wiz
d077098154 Enable full block indexing on all Bitcoin networks 2022-03-20 01:29:01 +01:00
wiz
6123f94785 Merge pull request #1415 from mempool/simon/miner-dashboard-websocket-push-fix
Subscribe to blocks and mempool updates in the mining dashboard
2022-03-19 20:38:21 +00:00
softsimon
4f441d3f30 Subscribe to blocks and mempool updates in the mining dashboard
fixes #1414
2022-03-19 23:32:01 +04:00
wiz
91d55e02d6 Merge pull request #1413 from mempool/wiz/create-zfs-filesystem-for-backups
Create zfs filesystem for /backup and chown to mempool
2022-03-19 16:08:29 +00:00
wiz
d8de9cb934 Create zfs filesystem for /backup and chown to mempool 2022-03-19 16:02:14 +00:00
wiz
cc0fbace18 Merge pull request #1412 from mempool/wiz/install-mempool-crontab
Install mempool crontab from install script
2022-03-19 15:57:26 +00:00
wiz
97e280f876 Install mempool crontab from install script 2022-03-19 15:56:29 +00:00
wiz
51b2f9581d Merge pull request #1411 from mempool/wiz/fix-upgrade-script-for-keybase-alerts
Set build script to notify new location based Keybase channels
2022-03-19 15:55:06 +00:00
wiz
28bd7d059f Merge pull request #1410 from mempool/wiz/configure-syslog-from-install-script
Configure syslog for keybase alerts from install script
2022-03-19 15:54:50 +00:00
wiz
7222198c48 Set build script to notify new location based Keybase channels 2022-03-19 15:44:00 +00:00
wiz
b99eb1d533 Add keybase to install script packages for alerts 2022-03-19 15:31:47 +00:00
wiz
bdc028ecc0 Install syslog and newsyslog configuration for keybase alerts 2022-03-19 15:29:45 +00:00
wiz
58ab9cce46 Merge pull request #1400 from mempool/simon/default-redirect-fix
Don't navigate to root when sub network url is wrong.
2022-03-17 18:57:31 +00:00
wiz
d1ca91985f Merge branch 'master' into simon/default-redirect-fix 2022-03-17 18:47:08 +00:00
softsimon
e700cc36bc Merge pull request #1398 from mempool/nymkappa/feature/blocks-list-link
Show pools in main dashboard in mining dashboard is enabled
2022-03-17 19:23:34 +01:00
nymkappa
a7900f6466 If mining dashboard is enabled, shows pools instead of timestamp 2022-03-17 19:04:12 +01:00
nymkappa
7481e27ec2 If mining dashboard is enabled, opens /mining/blocks instead of /blocks 2022-03-17 19:04:11 +01:00
softsimon
a117e325e8 Don't navigate to root when sub network url is wrong.
fixes #1399
2022-03-17 18:51:59 +01:00
wiz
bdfe31c601 Merge pull request #1390 from mempool/nymkappa/feature/mining-pool-data-ref-update
Use our forked repo of mining pool data
2022-03-17 16:38:36 +00:00
nymkappa
e8e4fd3457 mempool.space/.../pools.json => raw.githubusercontent.com/.../pools.json 2022-03-17 16:07:58 +01:00
nymkappa
84006b2012 Use our forked repo of mining pool data 2022-03-17 14:16:57 +01:00
softsimon
b781b3b065 Merge pull request #1373 from antonilol/difficulty
fix and improve block time predictions
2022-03-17 12:17:27 +01:00
softsimon
18e9fc8717 Merge branch 'master' into difficulty 2022-03-17 11:43:29 +01:00
wiz
9001369eeb Merge pull request #1383 from mempool/nymkappa/bugfix/hashrate-difficulty-crash
Fix javascript crash when disable hashrate/difficulty chart line
2022-03-16 20:30:04 +00:00
nymkappa
07deaa23ef Fix javascript crash when disable hashrate/difficulty chart line 2022-03-16 21:20:42 +01:00
wiz
5bc1dfcfba Merge pull request #1376 from nymkappa/bugfix/blocks-list-pagination
Fix pagination on /mining/blocks
2022-03-16 20:17:54 +00:00
wiz
cf9a258a7b Merge branch 'master' into bugfix/blocks-list-pagination 2022-03-16 20:17:44 +00:00
softsimon
35f9658d3b Merge pull request #1382 from mempool/nymkappa/feature/coinbase-tooltip-style
Apply coinbase style to blocks list tooltip
2022-03-16 21:10:20 +01:00
nymkappa
9252a45971 Fix pagination on /mining/blocks 2022-03-16 21:00:40 +01:00
nymkappa
f8c5584be7 Apply coinbase style to blocks list tooltip 2022-03-16 20:54:32 +01:00
softsimon
5c4aa6efac Merge pull request #1381 from mempool/nymkappa/feature/pool-page-blocks
Updated blocks list in pool details page
2022-03-16 20:43:22 +01:00
nymkappa
41fed984cb Fix pool get blocks API undefined start block behavior 2022-03-16 20:19:39 +01:00
nymkappa
dfff57d204 Fix pool page skeleton 2022-03-16 20:10:01 +01:00
nymkappa
96dc3fb24a Rename ScriptSig to Coinbase Tag 2022-03-16 19:26:56 +01:00
nymkappa
63a47c14d9 Fix duplicated blocks in pool details page 2022-03-16 19:17:33 +01:00
nymkappa
56bf267664 Updated blocks list in /pool/{id} page 2022-03-16 18:12:02 +01:00
softsimon
226b345c0a Merge pull request #1380 from mempool/nymkappa/bugfix/disable-mining-non-bitcoin
Force disable mining dashboard if base_module not mempool
2022-03-16 18:11:25 +01:00
nymkappa
71648bf01e Force disable mining dashboard if base_module not mempool 2022-03-16 17:28:00 +01:00
softsimon
32f3acd2f0 Merge pull request #1379 from mempool/nymkappa/bugfix/hide-mining-charts-non-bitcoin
Hide tabs in /graphs page is mining not available
2022-03-16 15:03:12 +01:00
nymkappa
92142cd531 Hide tabs in /graphs page is mining not available 2022-03-16 14:48:37 +01:00
wiz
4ecacde10b Merge pull request #1375 from nymkappa/feature/index-coinbase-scriptsig
Index asciiScriptSig and display it in /mining/blocks
2022-03-16 11:30:50 +00:00
nymkappa
ffb5db69a8 Store hex in coinbase raw - Improve scripsig parsing 2022-03-16 12:10:18 +01:00
nymkappa
94dbec46cf Index asciiScriptSig and display it in /mining/blocks 2022-03-15 23:33:51 +01:00
wiz
9c60c7ba79 Merge pull request #1374 from nymkappa/feature/improve-rpc-calls
Optimize RPC calls
2022-03-15 20:24:45 +00:00
nymkappa
3cd1505128 Optimize RPC calls 2022-03-15 21:16:02 +01:00
Antoni Spaanderman
dbcc46be5f fix and improve block time predictions
dce775e but then on the backed after refractor #1352
2022-03-15 20:39:25 +01:00
softsimon
53777e84c9 Merge pull request #1371 from mempool/simon/address-amount-fix
Address value did not calculate self transfers
2022-03-15 18:01:57 +01:00
softsimon
7854b6fcb3 Address value did not calculate self transfers 2022-03-15 16:26:49 +01:00
wiz
a292745ea7 Merge pull request #1370 from mempool/simon/merge-rpc-api
Merge node-bitcoin into the project
2022-03-15 15:26:41 +00:00
softsimon
e26beee44c Merge node-bitcoin into the project 2022-03-15 14:44:31 +01:00
wiz
622a003a2a Merge pull request #1354 from hunicus/mobile-refinements
Fix docs navigation on mobile
2022-03-15 09:38:17 +00:00
wiz
d769226061 Merge branch 'master' into mobile-refinements 2022-03-15 09:28:10 +00:00
wiz
32b24b8eeb Merge pull request #1366 from nymkappa/bugfix/hashrate-widget-typo 2022-03-14 21:46:41 +00:00
nymkappa
aac3bd5942 Fix typo in hashrate widget 2022-03-14 21:12:29 +01:00
wiz
b846e9fbda Merge pull request #1361 from hunicus/code-link-labels
Capitalize js package labels in docs
2022-03-14 19:25:21 +00:00
wiz
39598ad4c7 Merge pull request #1362 from nymkappa/feature/update-hashrate-widget
Make the hashrate/difficulty widget simpler
2022-03-14 19:24:16 +00:00
wiz
b3847bcbcb Merge branch 'master' into feature/update-hashrate-widget 2022-03-14 19:12:31 +00:00
wiz
46b0a8da8f Merge pull request #1363 from mempool/simon/double-websocket-fix
Remove duplicate websocket push.
2022-03-14 19:12:11 +00:00
nymkappa
b19d9c1af2 Cleanup hashrate/difficulty widget 2022-03-14 20:00:19 +01:00
softsimon
96ba7f7456 Remove duplicate websocket push. 2022-03-14 19:52:34 +01:00
hunicus
5a58ce0ab3 Fix loose ends
Add space above footer, add better delay for height
adjustment, and add conditions to prevent errors for
websocket endpoint and no endpoint.
2022-03-14 14:41:32 -04:00
wiz
dbd58ca53a Merge pull request #1364 from mempool/simon/websocket-difficulty-mock-data
Updated websocket mock data with difficulty adjustment
2022-03-14 18:39:10 +00:00
softsimon
e3dc90f40f Updated websocket mock data with difficulty adjustment 2022-03-14 19:25:17 +01:00
wiz
d1ecfccfdb Merge pull request #1309 from nymkappa/feature/graphs-reorg
Move all charts into /graphs page
2022-03-14 18:00:53 +00:00
hunicus
4c8ac3a585 Resize docs code templates on open (mobile) 2022-03-14 13:49:16 -04:00
hunicus
838725a862 Implement custom accordion for mobile docs 2022-03-14 13:48:45 -04:00
hunicus
85100a93f8 Remove mobile docs menu 2022-03-14 13:31:46 -04:00
nymkappa
8e61720e09 Add active router links - Disable graph touch scroll 2022-03-14 18:25:16 +01:00
nymkappa
77a99a97cc Move all charts into /graphs page - Fix mining charts layouts 2022-03-14 18:07:35 +01:00
wiz
c4e5e45855 Merge pull request #1352 from mempool/simon/difficulty-adjustment-refactor
Difficulty adjustment refactor
2022-03-14 16:33:55 +00:00
softsimon
8637059119 Difficulty adjustment refactor
fixes #1157
2022-03-14 16:48:59 +01:00
softsimon
8d18a143cb Merge pull request #1342 from hunicus/desktop-refinements
Fix docs navigation on desktop
2022-03-14 16:46:46 +01:00
wiz
ab3f80220c Merge branch 'master' into desktop-refinements 2022-03-14 15:31:57 +00:00
wiz
74e8c18b9d Merge pull request #1304 from mempool/simon/highlight-address
Address page highlight and transfer value
2022-03-14 15:31:23 +00:00
softsimon
f466498988 Address page highlight and transfer value 2022-03-14 16:19:37 +01:00
wiz
822c4256d7 Merge pull request #1358 from mempool/wiz/increase-default-indexing-blocks-amount
Increase default INDEXING_BLOCKS_AMOUNT by 10x to 11000 blocks
2022-03-14 13:15:54 +00:00
wiz
4d9dfaa260 Merge pull request #1360 from dsbaars/feature/backend-unixsocket2
Add support for MySQL connections over UNIX sockets
2022-03-14 13:15:16 +00:00
wiz
2023d36603 Cleanup MySQL unix socket code and add to sample config 2022-03-14 13:11:04 +00:00
Djuri Baars
465529b03f sed and config fix for MySQL socket, accept CLA for @dsbaars 2022-03-14 13:45:50 +01:00
Djuri Baars
7fd9e27cc2 Add MySQL socket support 2022-03-14 13:45:34 +01:00
wiz
1052b19fae Merge pull request #1351 from nymkappa/bugfix/hashrates-indexing-duplicates
Fix duplicate hashrate data points in "difficulty vs hashrate" chart
2022-03-13 23:05:45 +00:00
nymkappa
edddf25917 Remove unnecessary migration version 15 2022-03-13 16:08:33 +01:00
nymkappa
0730053d5d Use bitcoin RPC getblock because esplora returns int for difficulty - Fix some css in mining dashboard 2022-03-13 16:08:33 +01:00
nymkappa
bec3f214b5 Make sure to set avg_hashrate field to double unsigned 2022-03-13 16:08:32 +01:00
nymkappa
ab486bfe6e Use correct url for blocks-extras API - Fix amountShortner pipe 2022-03-13 16:08:32 +01:00
nymkappa
33897b029f Set db connection to UTC - Fix hashrate indexing 2022-03-13 16:08:31 +01:00
wiz
81984e9df5 Increase default INDEXING_BLOCKS_AMOUNT by 10x to 11000 blocks 2022-03-13 13:57:20 +00:00
wiz
456e6a7296 Merge pull request #1357 from mempool/simon/reorg-integrations
Reorganizing community integrations
2022-03-13 13:22:24 +00:00
softsimon
b8e30ad91f Reorganizing community integrations 2022-03-13 13:13:47 +00:00
hunicus
142566f4f9 Rename method
Method scope widened in #1354. Changing its name here to
avoid merge conflicts later.
2022-03-12 16:07:45 -05:00
softsimon
d4cd614bbc Merge pull request #1353 from nymkappa/bugfix/mining-dashboard-font-size
Fix font size in reward stat widget
2022-03-12 18:04:43 +01:00
nymkappa
9f5d64cf4a Fix font size in reward stat widget 2022-03-12 17:56:00 +01:00
softsimon
0dbee1461d Merge pull request #1335 from nymkappa/feature/new-blocks-page
Create new /mining/blocks page
2022-03-12 17:45:50 +01:00
nymkappa
a893e87347 Add more padding to the blocks list page 2022-03-12 17:33:07 +01:00
nymkappa
11de94cf90 Pool icon clickable - blocks list pagination margin 2022-03-12 16:49:16 +01:00
nymkappa
d6a0d84d71 Update mining/blocks in real time 2022-03-12 16:49:16 +01:00
nymkappa
123af53de2 Added latest block on mining dashboard 2022-03-12 16:49:15 +01:00
nymkappa
d8e986996f Add pagination on /mining/blocks 2022-03-12 16:49:15 +01:00
nymkappa
0e0331d8ab Create working template for the new blocks page 2022-03-12 16:49:15 +01:00
softsimon
77334e130d Merge pull request #1336 from nymkappa/feature/fix-empty-diff-adjust
Fix empty diff adjust table
2022-03-12 16:47:13 +01:00
softsimon
fe7f14f9a2 Merge pull request #1340 from nymkappa/bugfix/only-reset-hashrate-state-bitcoin
Fix database migration/typing issues
2022-03-12 15:48:51 +01:00
nymkappa
0dbc725c39 int -> bigint for all satoshis related indexed data 2022-03-12 15:48:22 +01:00
nymkappa
cd12e9bde9 Only insert hashrate states for bitcoin 2022-03-12 15:48:21 +01:00
nymkappa
87405ec4a5 Don't try to reset hashrates states if not bitcoin 2022-03-12 15:48:14 +01:00
wiz
d17a78715a Merge pull request #1347 from mempool/wiz/add-mysql-to-install-script
Add mariadb-server and mysql db creation to install script
2022-03-12 13:16:40 +00:00
wiz
4b9eef5464 Merge pull request #1350 from mempool/wiz/add-symlinks-for-mempool-scripts-to-installer
Create symlinks for mempool scripts in installation script
2022-03-12 12:45:54 +00:00
wiz
6073d4559b Create symlinks for mempool scripts in installation script 2022-03-12 12:41:33 +00:00
wiz
32bbee960c Merge pull request #1349 from mempool/wiz/set-git-to-always-rebase
Set git to always rebase from install script
2022-03-12 12:28:03 +00:00
nymkappa
1ea9c13a26 Fix empty diff adjust table 2022-03-12 13:27:45 +01:00
wiz
03faa18bfc Set git to always rebase from install script 2022-03-12 12:27:24 +00:00
wiz
0daf49b8ad Add mariadb-server and mysql db creation to install script 2022-03-12 12:19:49 +00:00
wiz
800fff1744 Merge pull request #1346 from mempool/wiz/remove-old-mempool-install-script
Remove old install script, merge remaining stuff into upgrade script
2022-03-12 11:59:31 +00:00
wiz
ed488a763d Remove old install script, merge remaining stuff into upgrade script 2022-03-12 11:52:19 +00:00
wiz
d84bf66c35 Merge pull request #1345 from mempool/wiz/add-production-frontend-configurations
Install production backend/frontend configurations from master
2022-03-12 10:55:59 +00:00
wiz
9786f1794f Install production backend/frontend configurations from master 2022-03-12 10:53:37 +00:00
wiz
b3cbe8a60e Merge pull request #1344 from mempool/wiz/add-production-frontend-configurations
Add production frontend configurations
2022-03-12 10:50:41 +00:00
wiz
597c62ede3 Remove INDEXING_BLOCKS_AMOUNT from mainnet frontend configuration 2022-03-12 10:39:28 +00:00
wiz
f8787e525b Add production frontend configurations 2022-03-12 10:34:17 +00:00
Naveen
486f9a126d Merge branch 'master' into naveensrinivasan/dependabot 2022-03-11 18:36:40 -06:00
hunicus
b71df774f5 Fix anchor links when navigating to current anchor 2022-03-11 19:09:42 -05:00
naveensrinivasan
8f8c22b829 Pin actions by SHA and set permissions for workflow
- Pinned dependencies https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
- Restricting permissions for github actions https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
2022-03-11 22:48:15 +00:00
Naveen
b456419de7 Create dependabot.yml
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-03-11 22:46:44 +00:00
hunicus
2d4b824862 Add smooth scrolling 2022-03-11 16:28:52 -05:00
wiz
dab6dd4a0e Merge pull request #1338 from nymkappa/bugfix/increase-fee-data-type
Make blocks.fees larger data type
2022-03-11 20:39:31 +00:00
nymkappa
afe7a360f7 Make blocks.fees larger data type 2022-03-11 20:42:07 +01:00
softsimon
e4f4a421d7 Merge pull request #1337 from mempool/revert-1327-bugfix/overflow-y
Revert "Always show scrolbar to avoid horizontal jumpy UI"
2022-03-11 20:10:15 +01:00
softsimon
bd55f65714 Revert "Always show scrolbar to avoid horizontal jumpy UI" 2022-03-11 20:09:57 +01:00
wiz
387c51b5e8 Merge pull request #1321 from mempool/wiz/installer2
Add new production installation script and related files
2022-03-11 16:42:31 +00:00
hunicus
6dbc621fef Capitalize js package labels in docs 2022-03-11 11:25:17 -05:00
wiz
6fc0311b8e Merge branch 'master' into wiz/installer2 2022-03-11 16:17:51 +00:00
wiz
e7ab595811 Fix order of operations in install script breaking things 2022-03-11 15:03:14 +00:00
wiz
ca2e29acf8 Install nvm.sh and build NodeJS from install script 2022-03-11 14:51:08 +00:00
wiz
589f3c5bb5 Create $HOME/.zshrc file for all users in install script 2022-03-11 14:35:58 +00:00
wiz
22f1ef9d22 Remove sudoers file modifications from install script 2022-03-11 14:14:45 +00:00
wiz
bee0cf2c65 Fix electrs-start-liquidtestnet configuration in install script 2022-03-11 14:11:38 +00:00
softsimon
9dbfd96249 Merge pull request #1320 from antonilol/regtest-1
regtest fixes
2022-03-11 14:07:58 +01:00
softsimon
5caaa1633a Merge pull request #1330 from nymkappa/feature/index-more-data
Index more data using getblockstats core RPC
2022-03-11 14:05:03 +01:00
nymkappa
9a71c15b49 Fix block indexing log 2022-03-10 14:23:29 +01:00
nymkappa
8ca3f6e72b Index more data using getblockstats core RPC 2022-03-10 14:21:11 +01:00
nymkappa
d82f9c4998 Index more data using getblockstats core RPC 2022-03-10 14:08:01 +01:00
softsimon
e83e1067c1 Merge pull request #1331 from nymkappa/feature/show-indexing-progress
Show current indexing progress in charts without data
2022-03-10 14:07:15 +01:00
nymkappa
609bb15b77 Split difficult adjustment table - Update indexing progress every 60sec 2022-03-10 14:02:43 +01:00
nymkappa
18f3018170 Show current indexing progress in charts without data 2022-03-10 14:02:43 +01:00
softsimon
ba3a737ab9 Merge pull request #1327 from nymkappa/bugfix/overflow-y
Always show scrolbar to avoid horizontal jumpy UI
2022-03-10 13:56:30 +01:00
wiz
a140d28a0e Fix zfs filesystems and permissions in installation script 2022-03-10 12:14:40 +00:00
nymkappa
758381725f Always show scrolbar to avoid horizontal jumpy UI 2022-03-10 13:11:02 +01:00
softsimon
8535599e34 Merge pull request #1326 from nymkappa/bugfix/firefox-pool
Fix pool detail page on Firefox
2022-03-10 12:50:03 +01:00
nymkappa
7957ca8f94 Fix pool detail page on Firefox 2022-03-10 12:42:11 +01:00
softsimon
192c61f9cb Merge pull request #1333 from nymkappa/feature/weekly-hashrate-indexing-monday
Index weekly hashrates using last Monday midnight - Fix charts tooltip
2022-03-10 12:39:31 +01:00
nymkappa
9ccb23f651 Index weekly hashrates using last Monday midnight - Fix charts tooltip 2022-03-10 11:53:49 +01:00
wiz
1bc9f106a1 Add signet and liquidtestnet to install script 2022-03-09 20:59:12 +01:00
softsimon
f62146a649 Merge pull request #1328 from antonilol/testnet-block-estimation
improve testnet block time estimations
2022-03-09 20:38:42 +01:00
softsimon
3f0befc055 Merge pull request #1329 from nymkappa/bugfix/missing-db-version-increment
Increment db version to 10 (26ee4204ac)
2022-03-09 18:53:02 +01:00
nymkappa
643e5ceb7f Increment db version to 10 (26ee4204ac) 2022-03-09 18:51:27 +01:00
Antoni Spaanderman
2cd24624b9 Merge branch 'master' into regtest-1 2022-03-09 17:55:09 +01:00
Antoni Spaanderman
2be18fe179 improve testnet block time estimations 2022-03-09 17:38:37 +01:00
softsimon
fd1514177f Merge pull request #1323 from mempool/simon/unknown-output-support
Display unknown for non standard output types
2022-03-09 16:29:04 +01:00
softsimon
381a310216 Display unknown for non standard output types
fixes #1262
2022-03-09 16:28:26 +01:00
softsimon
211e5ab3fe Merge pull request #1325 from nymkappa/feature/add-plus-sign-diff-adjust
Show `+` sign on positive diff adjust
2022-03-09 13:47:40 +01:00
nymkappa
1995eef37d Show + sign on positive diff adjust 2022-03-09 13:47:10 +01:00
softsimon
18d83b6f3a Merge pull request #1324 from nymkappa/bugfix/difficulty-adj-table-skeleton
Fix skeleton for difficulty adjustment table
2022-03-09 12:19:26 +01:00
nymkappa
47da8c023b Add message if on mining charts if there is no data to display 2022-03-09 12:17:31 +01:00
nymkappa
8d7546d2b5 Fix skeleton for difficulty adjustment table 2022-03-09 12:17:31 +01:00
Antoni Spaanderman
8d42b38234 simplify if statement 2022-03-09 11:51:36 +01:00
wiz
742df00701 Add missing electrs-start-liquid in install script 2022-03-08 21:22:11 +01:00
Antoni Spaanderman
b2f9c7db2d add non null assertion 2022-03-08 20:59:46 +01:00
softsimon
f0f9d33dac Merge pull request #1317 from nymkappa/feature/pool-hashrate
Added pool hashrate chart
2022-03-08 20:52:16 +01:00
wiz
1e87c3857b Add new production installation script and related files 2022-03-08 20:46:58 +01:00
nymkappa
171246f4ef Fix skeleton layout jumping in pool detail page 2022-03-08 20:46:20 +01:00
nymkappa
71d500d750 Fix pool detail page layout - add loading skeleton 2022-03-08 20:46:19 +01:00
nymkappa
f23f7f1cfa Cleanup empty block in api response - Update cache warmer 2022-03-08 20:46:19 +01:00
nymkappa
2b5d972e8d Only show relevant hashrate in the pool page 2022-03-08 20:46:18 +01:00
nymkappa
ad2dcc46e4 Added pool hashrate chart 2022-03-08 20:46:14 +01:00
Antoni Spaanderman
7a1a903599 oops 2022-03-08 20:40:44 +01:00
Antoni Spaanderman
71402f21c6 revert "add network regtest" 1f0ae60 2022-03-08 19:59:18 +01:00
Antoni Spaanderman
d179a563e4 Merge branch 'master' into regtest-1 2022-03-08 19:45:03 +01:00
softsimon
0cc82bbf1d Merge pull request #1318 from mempool/simon/rbf-cache
Replace by fee storage
2022-03-08 19:20:14 +01:00
softsimon
8267344cdc Don't push full RBF-transactions to prevent old states. 2022-03-08 18:54:49 +01:00
softsimon
b15de021f7 Fixing bug where RBF wasn't detected when using bitcoind 2022-03-08 18:39:53 +01:00
softsimon
f85771e03f Replace by fee storage
fixes #1222
2022-03-08 18:39:53 +01:00
softsimon
d504d0ecc0 Merge pull request #1319 from nymkappa/feature/index-blocks-timestamps
Index blocks.blockTimestamp for faster hashrates indexing
2022-03-08 17:23:12 +01:00
nymkappa
26ee4204ac Index blocks.blockTimestamp 2022-03-08 17:10:29 +01:00
wiz
39f1f4c05a Merge pull request #1316 from Bosch-0/zeus 2022-03-08 16:12:59 +09:00
bosch
2ea78566a6 Added new Zeus logo. 2022-03-08 11:09:43 +08:00
softsimon
ba12a75532 Merge pull request #1311 from nymkappa/feature/difficulty-table-update
Replace difficulty adjustment timestamp with block height
2022-03-07 20:46:50 +01:00
nymkappa
b7254e7aca Replace difficulty adjustment timestamp with block height 2022-03-07 20:42:59 +01:00
softsimon
5d16a30cf2 Merge pull request #1312 from nymkappa/feature/shorter-stats
Shorten reward stats
2022-03-07 20:37:06 +01:00
softsimon
9e68b0a597 Merge branch 'master' into feature/shorter-stats 2022-03-07 20:36:53 +01:00
softsimon
5a373f6518 Merge pull request #1313 from nymkappa/bugfix/pie-chart-click-fix
Fix broken navigation when clicking on pie chart
2022-03-07 20:36:03 +01:00
softsimon
81a82b619e Merge branch 'master' into bugfix/pie-chart-click-fix 2022-03-07 20:35:49 +01:00
softsimon
42cd08798c Merge pull request #1315 from nymkappa/feature/mining-dashboard-skeleton
Add skeleton in the mining dashboard page
2022-03-07 20:34:01 +01:00
softsimon
593e82d8f4 Merge branch 'master' into feature/mining-dashboard-skeleton 2022-03-07 20:33:54 +01:00
softsimon
47e46b7996 Merge pull request #1314 from mempool/simon/utxo-tracking-refactor
UTXO spent tracking refactor
2022-03-07 20:07:40 +01:00
nymkappa
2b91ced4d6 Add skeleton in the mining dashboard page 2022-03-07 19:54:17 +01:00
softsimon
6f3443faba UTXO spent tracking refactor
refs #1301
2022-03-07 19:45:09 +01:00
nymkappa
1318c4aa36 Fix broken navigation when clicking on pie chart 2022-03-07 18:42:47 +01:00
nymkappa
2435e7bfe9 Shorten reward stats 2022-03-07 18:19:02 +01:00
softsimon
09e3791cee Merge pull request #1310 from nymkappa/bugfix/auto-refresh-reward-stats
Bugfix/auto refresh reward stats
2022-03-07 17:18:57 +01:00
nymkappa
8837b8c882 Actually use the past 8 blocks for reward stats 2022-03-07 17:17:08 +01:00
softsimon
beae88778b Merge pull request #1308 from nymkappa/bugfix/fix-db-migration
Truncate hashrates table only for bitcoin (db migration v9)
2022-03-07 15:57:20 +01:00
nymkappa
32d66c03c6 Truncate hashrates table only for bitcoin (db migration v9) 2022-03-07 15:56:07 +01:00
softsimon
ecdd9bdf91 Merge pull request #1306 from mempool/simon/liquid-missing-asset-inputs
Handle missing asset registry for inputs
2022-03-07 15:24:47 +01:00
softsimon
8d4bc201ff Merge pull request #1305 from mempool/simon/track-utxos
UTXO spent tracking
2022-03-07 15:12:49 +01:00
softsimon
00ad58c26d Merge branch 'master' into simon/track-utxos 2022-03-07 15:12:36 +01:00
softsimon
d188ab3c09 Handle missing asset registry for inputs
refs #1246
2022-03-07 13:14:34 +01:00
softsimon
641fa91a48 Merge pull request #1303 from nymkappa/feature/update-mining-dashboard
Mining dashboard polishing
2022-03-07 12:03:09 +01:00
nymkappa
05342079b3 Disable mining charts iteration on mobile widgets 2022-03-07 11:51:00 +01:00
nymkappa
bc13393778 Implement temporary reward stats for the mining dashboard 2022-03-07 11:51:00 +01:00
nymkappa
84ef424752 Fix halving calculation 2022-03-07 11:50:59 +01:00
nymkappa
d45f3c32cf Show more stats in pool ranking pie widget 2022-03-07 11:50:59 +01:00
nymkappa
f9e361a9c0 "view more" links - placeholders 2022-03-07 11:50:59 +01:00
nymkappa
cf4336eb2e Move small pie share into "other" - align labels 2022-03-07 11:50:58 +01:00
nymkappa
6cdd41a8f7 Add difficulty adjustment table in mining dashboard 2022-03-07 11:50:58 +01:00
nymkappa
b2dec5e20a Mining dashboard layout matches main dashboard layout 2022-03-07 11:50:57 +01:00
softsimon
16331d1be7 Merge pull request #1302 from nymkappa/bugfix/weekly-pool-hashrate-indexing
Fix hashrate indexing backend logic (split daily/weekly indexing logic, timezone issue, unclosed db connection)
2022-03-06 20:32:17 +01:00
softsimon
059e82a805 UTXO spent tracking
fixes #1301
2022-03-06 18:27:13 +01:00
nymkappa
2570dbfab4 Fix incorrect state naming 2022-03-06 17:06:55 +01:00
nymkappa
3d1a10cdfc Use the latest timestamp in hashrate data ticker 2022-03-06 16:57:40 +01:00
nymkappa
2a170c07d1 Remove unnecessary await 2022-03-06 16:50:59 +01:00
nymkappa
4b859eb4f6 Re-index hashrates because we have different timestamp handling 2022-03-06 16:48:14 +01:00
nymkappa
89411f23d8 Set connection pool timezone to UTC - Close mysql connections upon error 2022-03-06 16:44:09 +01:00
nymkappa
1ced44d970 Remove useless mining function wrapper in backend 2022-03-06 12:52:39 +01:00
nymkappa
8532d13a0d Update hashrate indexing logs 2022-03-06 12:52:39 +01:00
nymkappa
7314582dd1 Split network daily hashrate indexing and weekly pool hashrate indexing 2022-03-06 12:52:38 +01:00
softsimon
3e50e4541b Merge pull request #1185 from antonilol/fee-visibility
fix 0 sat/vB not displaying
2022-03-06 10:28:51 +01:00
softsimon
50cd8e01bd Merge branch 'master' into fee-visibility 2022-03-06 10:28:43 +01:00
softsimon
35f81200d0 Merge pull request #1293 from mempool/simon/shorten-address-prefix-result
Shorten address search with middle ellipsis
2022-03-05 17:09:29 +01:00
softsimon
5de77c7ae4 Merge branch 'master' into simon/shorten-address-prefix-result 2022-03-05 17:09:23 +01:00
softsimon
5ac2c1cf34 Merge pull request #1291 from mempool/simon/address-prefix-bug
Only return unique address prefix autocomplete
2022-03-05 17:08:29 +01:00
softsimon
552c717693 Merge branch 'master' into simon/address-prefix-bug 2022-03-05 17:08:23 +01:00
softsimon
f990d30a22 Merge pull request #1300 from nymkappa/bugfix/stop-block-chunk-indexing-upon-error
Pause block indexing chunk upon error and retry later
2022-03-05 16:30:35 +01:00
softsimon
8b1a0fe706 Merge branch 'master' into bugfix/stop-block-chunk-indexing-upon-error 2022-03-05 16:30:26 +01:00
softsimon
e131ec883b Merge pull request #1298 from nymkappa/feature/fix-hashrate-indexing-try-catch
Make sure to reset hashrates indexing flags upon error
2022-03-05 16:30:12 +01:00
nymkappa
92dc5a78d8 Make sure to reset hashrates indexing flags upon error 2022-03-05 16:25:38 +01:00
nymkappa
773ac4d44b Pause block indexing chunk upon error and retry later 2022-03-05 15:50:48 +01:00
softsimon
c398d164ba Merge pull request #1297 from nymkappa/feature/fix-hashrate-indexing
Only reset hashrate state flag after database migration - Fix weekly …
2022-03-05 14:59:26 +01:00
softsimon
daa7079338 Address search with middle ellipsis mobile fix 2022-03-05 14:19:44 +01:00
nymkappa
5f6c1c6ccf Only reset hashrate state flag after database migration - Fix weekly hashrate indexing bug 2022-03-05 13:54:07 +01:00
Antoni Spaanderman
590170a0df Merge branch 'master' into fee-visibility 2022-02-28 13:10:12 +01:00
Antoni Spaanderman
e2ef58c5dd Merge branch 'master' into regtest-1 2022-02-28 13:09:51 +01:00
softsimon
e5b2440b45 Shorten address search with middle ellipsis 2022-02-27 20:05:32 +03:00
softsimon
056a31fc79 Only return unique address prefix autocomplete
fixes #1290
2022-02-27 15:58:09 +03:00
wiz
5f19b6dd07 Merge pull request #1288 from nymkappa/feature/merge-hashrate-pool-ranking
Merge pool share and dominance into one widget
2022-02-25 21:44:05 +09:00
nymkappa
b427548973 Merge pool pie and dominance into one widget 2022-02-25 21:16:35 +09:00
softsimon
7228d07b52 Merge pull request #1285 from nymkappa/feature/pool-hashrate
Create pools hashrate dominance chart
2022-02-25 13:20:29 +04:00
nymkappa
434b60ef8b Removed debug console.log 2022-02-25 18:17:43 +09:00
nymkappa
88dd956354 Hide 'dot' when hovering charts 2022-02-25 13:06:33 +09:00
nymkappa
c419b7dd1a Add new api endpoint to cache warmer 2022-02-25 10:21:16 +09:00
nymkappa
ec40231f93 warn on re-index - fix hash indexing state issue - cleanup ui mining 2022-02-24 20:21:14 +09:00
nymkappa
54ccfe070e Move pool pie chart at the bottom of the mining dashboard 2022-02-24 20:21:14 +09:00
nymkappa
e358a553c1 Match pool color between pools pie and pools stack 2022-02-24 20:21:13 +09:00
nymkappa
78fa3e33cd Create stacked pools historical hashrates to see dominance over time 2022-02-24 20:21:12 +09:00
nymkappa
a214c5ca20 Disable difficulty adjustment table for now until loadMore is implemented 2022-02-24 20:21:12 +09:00
wiz
4060c05015 Merge pull request #1284 from mempool/simon/update-package-versions
Upgrade frontend deps: Angular 13.2, echarts 5.3, fortawesome
2022-02-24 10:35:40 +00:00
softsimon
204e1c2a84 Npm install 2022-02-23 21:07:49 +04:00
softsimon
ab7b66c9a8 Bumping echarts 2022-02-23 20:52:38 +04:00
wiz
b1d6021406 Merge pull request #1283 from knorrium/update_cypress_to_v9.5.0 2022-02-23 06:53:46 +00:00
wiz
238b398cc0 Merge branch 'master' into update_cypress_to_v9.5.0 2022-02-23 06:30:42 +00:00
wiz
0dfd7ea26b Merge pull request #1282 from knorrium/fix_footer_test 2022-02-23 06:30:34 +00:00
Felipe Knorr Kuhn
30e41007a2 Update Cypress to v9.5.0 2022-02-22 22:14:59 -08:00
Felipe Knorr Kuhn
ac4d54950a Fix status page regex 2022-02-22 22:11:18 -08:00
wiz
b2d591b5bd Merge pull request #1281 from mempool/simon/footer-transactions-bar-fix 2022-02-23 03:35:54 +00:00
wiz
d05d7f1e27 Merge branch 'master' into simon/footer-transactions-bar-fix 2022-02-23 03:19:06 +00:00
wiz
57e6348936 Merge pull request #1280 from mempool/simon/display-unblinded-tx-sum
Show tx value sum if complete unblinding data is provided
2022-02-23 03:18:39 +00:00
wiz
e617e14901 Merge branch 'master' into simon/display-unblinded-tx-sum 2022-02-23 03:09:44 +00:00
wiz
5f0a0c0ac7 Merge pull request #1279 from mempool/simon/liquid-testnet-proxy
Add proxy support for Liquid Testnet
2022-02-23 03:09:34 +00:00
wiz
96ab1aae6e Merge branch 'master' into simon/liquid-testnet-proxy 2022-02-23 03:09:09 +00:00
wiz
e3e6e63a1e Merge pull request #1278 from mempool/simon/liquid-asset-issuance-output
Handle missing asset registry assets
2022-02-23 03:08:59 +00:00
wiz
dd2a52be65 Merge branch 'master' into simon/liquid-asset-issuance-output 2022-02-23 02:55:15 +00:00
wiz
c52f1c6973 Merge pull request #1277 from nymkappa/feature/mempool-show-only-fees
Remove block subsidy from mempool blocks
2022-02-23 02:55:03 +00:00
wiz
6c5253a7c4 Merge branch 'master' into feature/mempool-show-only-fees 2022-02-23 02:19:14 +00:00
wiz
8d1a60028b Merge pull request #1275 from nymkappa/feature/merge-hashrate-difficulty
Merge hashrate and difficulty components - Cleanup mining design overall
2022-02-23 02:19:00 +00:00
nymkappa
c1092adfd9 Add blocks.extras.totalFees and show it in blockchain blocks component 2022-02-22 23:57:54 +09:00
nymkappa
807ef2288a Don't assume two difficulty with the same value is impossible 2022-02-22 22:53:47 +09:00
softsimon
cd7cb56890 Fixed incoming transactions bar on the status page
fixes #1106
2022-02-22 17:37:04 +04:00
nymkappa
8aa1fe48dc Remove debug console.log 2022-02-22 22:04:52 +09:00
softsimon
f11c703e87 Show tx value sum if complete unblinding data is provided
fixes #1174
2022-02-22 16:53:59 +04:00
softsimon
411ac8d019 Add proxy support for Liquid Testnet 2022-02-22 16:39:53 +04:00
softsimon
78c0fe0e04 Handle missing asset registry assets
fixes #1246
2022-02-22 16:32:54 +04:00
nymkappa
201eff593b Remove block subsidy from mempool blocks 2022-02-22 20:37:17 +09:00
nymkappa
38eb8cbcfd Fix tooltip text alignment in mining dashboard 2022-02-22 20:30:14 +09:00
nymkappa
3f0bf81726 Improve hashrate chart and mining dashboard design 2022-02-22 20:16:19 +09:00
nymkappa
dcd84680fc Remove difficulty component 2022-02-22 20:16:19 +09:00
nymkappa
cfbf863a44 Move difficulty adjustment table in the merged hashrate component 2022-02-22 20:16:18 +09:00
nymkappa
83a382a0cb Merge hashrate and difficulty into one chart 2022-02-22 20:16:18 +09:00
wiz
98e0e1e9c1 Merge pull request #1273 from mempool/simon/asset-amount-filter
Display asset circulating amount more nicely fixing overflow
2022-02-22 03:11:42 +00:00
wiz
d750b5ccd3 Merge branch 'master' into simon/asset-amount-filter 2022-02-22 03:11:17 +00:00
wiz
55ca5087e0 Merge pull request #1274 from nymkappa/feature/mempool-blocks-reward
Show block reward in the mining dashboard
2022-02-22 03:11:09 +00:00
wiz
e748775f96 Merge branch 'master' into feature/mempool-blocks-reward 2022-02-22 02:59:08 +00:00
wiz
84cbb0222d Merge pull request #1272 from nymkappa/feature/cleanup-tooltips
Tweak new charts design
2022-02-22 02:57:47 +00:00
nymkappa
d23b9d8cf6 Replace block size => block reward in the mining dashboard 2022-02-22 11:16:18 +09:00
softsimon
3e6dba2d58 Display asset circulating amount more nicely fixing overflow
fixes #1264
2022-02-21 22:33:03 +04:00
nymkappa
e770520f0e Add data zoom to difficulty 2022-02-22 00:26:16 +09:00
nymkappa
7da4187638 Tweak charts color - Apply mempool tooltip style 2022-02-22 00:26:16 +09:00
wiz
3f5a749352 Merge pull request #1269 from nymkappa/feature/hashrate-chart
Created hashrate chart component
2022-02-21 15:08:27 +00:00
nymkappa
976017dbef Update database migration log levels 2022-02-21 23:57:44 +09:00
nymkappa
938a978900 Make sure to try/catch indexing code in case db is not available 2022-02-21 23:46:25 +09:00
nymkappa
b2f872c4cc Show unit in the yaxis for hashrate chart 2022-02-21 18:37:34 +09:00
nymkappa
beeda5fa87 Fix hashrate chart padding 2022-02-21 18:24:24 +09:00
nymkappa
413cf3ccaa Fix 'active' menu when using mining dashboard 2022-02-21 18:19:03 +09:00
nymkappa
6e62c62855 Add /api/v1/mining/hashrate/* apis to the cache warmer 2022-02-21 18:01:09 +09:00
nymkappa
649ad2e859 Hashrates indexing waits for blocks indexing - Batch hashrates I/O ops 2022-02-21 17:34:07 +09:00
nymkappa
537e50c682 Reduce log spam during hashrate indexing 2022-02-21 16:54:43 +09:00
nymkappa
bb1c5d0b31 Add --reindex command line parameter to force full re-indexing 2022-02-21 16:38:18 +09:00
nymkappa
e5907159b8 Refactor power of ten conversion into one wrapper 2022-02-21 15:55:27 +09:00
nymkappa
e4721e8574 Improve hashrate indexing logs 2022-02-21 14:49:00 +09:00
nymkappa
ac118141ce Make hashrate chart more responsive 2022-02-21 14:49:00 +09:00
nymkappa
53a8d5b246 Add network hashrate to mining dashboard 2022-02-21 14:48:59 +09:00
nymkappa
e61df324ea Index new hashrates once every 24 hours 2022-02-21 14:48:59 +09:00
nymkappa
358604ad85 Added hashrate chart 2022-02-21 14:48:58 +09:00
nymkappa
6fe8f6fa1e Generate daily average hashrate data 2022-02-21 14:48:57 +09:00
nymkappa
38b37a3ee7 Re-define sub mining routes properly and use router outlet 2022-02-21 14:48:50 +09:00
softsimon
50f86ba152 Merge pull request #1223 from antonilol/address-labels
detect lightning htlc and unilateral close + fix multisig badge
2022-02-20 20:14:40 +04:00
softsimon
cd00953fa7 Merge branch 'master' into address-labels 2022-02-20 20:12:20 +04:00
wiz
a4db02e1f9 Merge pull request #1268 from mempool/wiz/inline-enterprise-sponsor-logos
Inline all Enterprise Sponsor logos on About page
2022-02-20 11:20:25 +00:00
wiz
3b7d36e9e9 Fix mouseover CSS for inline SVG on About page 2022-02-20 20:11:31 +09:00
wiz
ce41e1e65d Merge branch 'master' into wiz/inline-enterprise-sponsor-logos 2022-02-20 11:09:11 +00:00
softsimon
b70df576d4 Fixing enterprise sponsors margin 2022-02-20 13:33:46 +04:00
wiz
0e037d5c8f Merge pull request #1267 from mempool/wiz/move-sponsor-button-on-about-page 2022-02-20 08:43:56 +00:00
wiz
22087bf6cd Merge branch 'master' into wiz/move-sponsor-button-on-about-page 2022-02-20 08:14:08 +00:00
wiz
1545dad2d2 Merge pull request #1265 from mempool/wiz/add-nixbitcoin-to-community-integrations 2022-02-20 08:13:34 +00:00
wiz
d837bcb791 Merge branch 'master' into wiz/add-nixbitcoin-to-community-integrations 2022-02-20 08:06:00 +00:00
softsimon
aa22aafe1d Merge pull request #1266 from mempool/wiz/tweak-about-page-text
Tweak text on About page so it can be displayed on all networks
2022-02-20 12:01:56 +04:00
wiz
edb8f5ecd1 Inline all Enterprise Sponsor logos on About page 2022-02-20 13:01:02 +09:00
wiz
a37430cc9e Move the Become Sponsor button higher on About page 2022-02-20 11:48:46 +09:00
wiz
6f939e1bad Tweak text on About page so it can be displayed on all networks 2022-02-20 09:19:31 +09:00
wiz
af8d4a8514 Add nix-bitcoin to Community Integrations on About page 2022-02-20 08:43:59 +09:00
wiz
3a0e272aff Merge pull request #1245 from mempool/simon/dashboard-assets
Display top featured assets on Liquid dashboard
2022-02-18 19:11:28 +00:00
softsimon
b111d576b5 Merge branch 'master' into simon/dashboard-assets
# Conflicts:
#	frontend/src/app/app.module.ts
2022-02-18 22:49:32 +04:00
wiz
a6abfd3ca6 Merge pull request #1259 from nymkappa/feature/show-miner-blocks
Show miner tag under blocks in the mining dashboard
2022-02-18 15:37:50 +00:00
wiz
47c88891b6 Merge branch 'master' into feature/show-miner-blocks 2022-02-18 15:25:51 +00:00
nymkappa
008a4b51cc Remove duplicated ChangeDetectorRef in blockchains blocks component 2022-02-18 22:25:31 +09:00
wiz
efada32440 Merge pull request #1261 from knorrium/update_default_loglevel
Update docker default min loglevel to info
2022-02-18 06:11:35 +00:00
Felipe Knorr Kuhn
0740049cbc Update docker default min loglevel to info 2022-02-17 20:51:04 -08:00
softsimon
e816f53637 Flip Liquid dashboard locations 2022-02-18 00:37:37 +04:00
Antoni Spaanderman
3679f197ba Merge branch 'master' into address-labels 2022-02-17 16:05:53 +01:00
Antoni Spaanderman
e32ef6c0df Merge branch 'master' into fee-visibility 2022-02-17 16:05:40 +01:00
Antoni Spaanderman
243055ceae Merge branch 'master' into regtest-1 2022-02-17 16:05:22 +01:00
nymkappa
fb2c0345a7 Show miner tag under blocks in the mining dashboard 2022-02-17 22:57:10 +09:00
wiz
5ab4c0e611 Merge pull request #1258 from nymkappa/feature/truncate-blocks-schema-change
When blocks need re-indexing, truncate the table
2022-02-17 11:19:07 +00:00
wiz
1d26390da7 Merge branch 'master' into feature/truncate-blocks-schema-change 2022-02-17 11:18:54 +00:00
wiz
49dd475b4e Merge pull request #1254 from nymkappa/feature/mining-dashboard
Create mining dashboard page
2022-02-17 11:18:24 +00:00
nymkappa
2e2c144cc9 Fix widgets title in mining dashboard 2022-02-17 18:51:16 +09:00
nymkappa
6d4458db8b Fix difficulty chart xaxis label 2022-02-17 18:30:52 +09:00
nymkappa
9b4e7a5fe1 View more mining dashboard links are centered 2022-02-17 18:10:50 +09:00
nymkappa
b18115f71a Reverts part of 6f25ecd98d9fdf1079dd550ecde4162ebe8d62d5 2022-02-17 18:08:00 +09:00
nymkappa
7761e75d4c Fix routes for /mining - Share blockchain component instances - remove animations 2022-02-17 18:08:00 +09:00
nymkappa
538ae3b757 [mempool | blockchain] position changes between main/mining dashboards 2022-02-17 18:07:59 +09:00
nymkappa
b1bd6f8fdb Database schema version 6 truncate the blocks table 2022-02-17 18:07:59 +09:00
nymkappa
1c575f1c93 Added difficulty chart to mining dashboard 2022-02-17 18:07:58 +09:00
nymkappa
8f9804a996 Fix pools ranking titles 2022-02-17 18:07:57 +09:00
nymkappa
750ea033f2 Renamed /mining/dashboard -> /mining 2022-02-17 18:07:57 +09:00
nymkappa
923a2ce7f6 Create basic layout for mining dashboard page - Show miner in blocks 2022-02-17 18:07:56 +09:00
wiz
86aa45f7e0 Merge branch 'master' into feature/truncate-blocks-schema-change 2022-02-17 09:07:39 +00:00
wiz
4a86699199 Merge pull request #1257 from nymkappa/feature/pool-pie-chart-colors
Change pool ranking pie chart colors
2022-02-17 09:07:28 +00:00
nymkappa
15ba487ee4 When blocks need re-indexing, truncate the table 2022-02-17 18:02:55 +09:00
nymkappa
c131c865ee Change pool ranking pie chart colors 2022-02-17 17:52:12 +09:00
wiz
53ff599ccd Merge pull request #1255 from nymkappa/feature/difficulty-chart
Create difficulty chart component
2022-02-17 02:15:11 +00:00
nymkappa
1630ff717e On mobile, show power of ten difficulty instead of full number 2022-02-17 10:15:41 +09:00
nymkappa
f45103e7e3 Add difficulty chart timespan selection 2022-02-17 09:41:05 +09:00
nymkappa
9fa7e58d82 Show all difficulty adjustment in a table - Need pagination 2022-02-16 22:56:06 +09:00
softsimon
b6f89b1a3e Moving ticker to circulating amount 2022-02-16 17:32:12 +04:00
nymkappa
7270b1ccac Create difficulty chart component 2022-02-16 21:20:28 +09:00
wiz
e2e3546934 Merge pull request #1253 from nymkappa/feature/index-more-data
Index more block data
2022-02-16 11:39:44 +00:00
nymkappa
0c1fa2b4aa Cleanup blocks/pools fields data type - Index more block data 2022-02-16 15:22:55 +09:00
softsimon
0a529ea98a Merge pull request #1242 from nymkappa/feature/pool-stats-page
Created mining pool stats page
2022-02-15 15:56:55 +04:00
nymkappa
5448e8c292 Merge branch 'master' into feature/pool-stats-page 2022-02-15 20:42:06 +09:00
softsimon
afe228f2c3 Merge pull request #1250 from nymkappa/feature/disable-mining
Provide a way to completely disable block indexing and mining menu
2022-02-15 15:23:48 +04:00
nymkappa
ca766bf40d Provide a way to completely disable block indexing and mining menu 2022-02-15 19:51:26 +09:00
nymkappa
fa8607c57d [Pool page] - Parse regexes and addresses in the backend 2022-02-15 18:45:53 +09:00
nymkappa
1e96c93557 Fix rendering issue when clicking on block link from pool page 2022-02-15 18:36:58 +09:00
softsimon
02523f574d Merge pull request #1252 from nymkappa/bugfix/fix-duplicated-tests
Remove duplicated tests
2022-02-15 12:09:40 +04:00
softsimon
a064f2931a Merge branch 'master' into bugfix/fix-duplicated-tests 2022-02-15 12:09:03 +04:00
softsimon
93f872efe5 Merge pull request #1243 from nymkappa/feature/start-indexing-before-mempool-sync
Don't wait for 100% mempool sync before starting block indexing
2022-02-15 12:07:30 +04:00
nymkappa
e9ba38755c Re-apply test updates from bogus commit 73019b485f 2022-02-15 16:19:58 +09:00
nymkappa
1c928582a2 Revert "Update tests - Replace button click blocks -> pools"
This reverts commit 73019b485f.
2022-02-15 15:56:40 +09:00
nymkappa
a88d6d2fca Don't wait for 100% mempool sync before starting block indexing 2022-02-14 17:57:55 +09:00
nymkappa
87170247bd Revert "Merge pull request #1240 from nymkappa/feature/mempool-sync-threshold"
This reverts commit 2f921f4cc7, reversing
changes made to 877be47e5b.
2022-02-14 17:57:03 +09:00
softsimon
820daf377e Merge pull request #1248 from antonilol/api-mempool
implement /api/mempool for home users (romanz/electrs backend)
2022-02-14 12:24:16 +04:00
nymkappa
f381da0f78 Show correct reward in pool stat page 2022-02-14 14:11:55 +09:00
nymkappa
a436d3a173 Fix label width being too small on mobile 2022-02-14 14:08:34 +09:00
nymkappa
09180c4f91 Renamed /mining/pool-blocks/xxx -> /mining/pool/:poolId/blocks 2022-02-14 14:08:34 +09:00
nymkappa
4f02efd7fe Fix block link in pool page - Click on chart slice open pool page 2022-02-14 14:08:33 +09:00
nymkappa
d8e58ee622 Set reward to 0 by default until reward indexing is available 2022-02-14 14:08:33 +09:00
nymkappa
c28f3fd4b6 Disable query logger spam 2022-02-14 14:08:33 +09:00
nymkappa
763ea0ce6f Show pool addresses in a scrollable div with href 2022-02-14 14:08:32 +09:00
nymkappa
9e64592aca Add mining pool logo in the pool stats page 2022-02-14 14:08:32 +09:00
nymkappa
e1f3c662b2 Show block reward in the pool stat page 2022-02-14 14:08:31 +09:00
nymkappa
f2abedfbaa Add timespan switch for pool stats and load more for pool's blocks 2022-02-14 14:08:31 +09:00
nymkappa
3f55aabc53 Mining pool detail page draft PoC 2022-02-14 14:08:30 +09:00
nymkappa
a168a22360 Link PoolRanking page with new pool page 2022-02-14 14:08:11 +09:00
nymkappa
fbda0d8186 Added /mining/pool/:poolId empty page 2022-02-14 14:08:11 +09:00
nymkappa
b854c071d0 Added mining/pool/:poolId and mining/pool/:poolId/:interval APIs 2022-02-14 14:08:10 +09:00
Antoni Spaanderman
3a3392423d set fee_histogram to [] 2022-02-13 16:13:46 +01:00
Antoni Spaanderman
2e1348550e implement /api/mempool 2022-02-13 13:52:04 +01:00
wiz
219c1a8615 Merge branch 'master' into simon/dashboard-assets 2022-02-13 11:21:39 +00:00
softsimon
294d7915e1 Liquid dashboard assets updates 2022-02-13 00:46:42 +04:00
wiz
039a627d1c Merge pull request #1235 from nymkappa/feature/blocks-extras
Added /api/v1/blocks-extras endpoint
2022-02-12 11:30:49 +00:00
Antoni Spaanderman
9796b87975 Merge branch 'master' into address-labels 2022-02-12 12:29:05 +01:00
Antoni Spaanderman
effab583ee Merge branch 'master' into fee-visibility 2022-02-12 12:28:49 +01:00
Antoni Spaanderman
9c992a61c5 Merge branch 'master' into regtest-1 2022-02-12 12:28:37 +01:00
nymkappa
ba36ab3134 Merge branch 'feature/blocks-extras' of github.com:nymkappa/mempool into feature/blocks-extras 2022-02-12 20:18:22 +09:00
nymkappa
b8e40494aa Remove fields that won't be used in the frontend for now 2022-02-12 20:16:51 +09:00
wiz
82350b5331 Merge branch 'master' into feature/blocks-extras 2022-02-12 10:35:57 +00:00
wiz
7e82967444 Merge pull request #1239 from hunicus/refactor-docs-2
Refactor docs
2022-02-12 10:19:45 +00:00
wiz
43e604507d Merge branch 'master' into refactor-docs-2 2022-02-12 10:07:52 +00:00
softsimon
738381702f Display top featured assets on Liquid dashboard 2022-02-12 00:15:13 +04:00
nymkappa
aa0e6b807a Add missing docker configuration variable 2022-02-11 14:22:59 +09:00
hunicus
d7b4e4b698 Use variables for empty code examples 2022-02-10 16:51:12 -05:00
nymkappa
ef43da05c9 Improve block indexing logging 2022-02-10 23:02:12 +09:00
nymkappa
fac49d0b98 Added /api/v1/blocksExtras endpoint 2022-02-10 22:11:10 +09:00
softsimon
2f921f4cc7 Merge pull request #1240 from nymkappa/feature/mempool-sync-threshold
Consider we're synced with the mempool if we cached 99% of pending txs
2022-02-10 16:28:13 +04:00
softsimon
b7f93a5726 Merge branch 'master' into feature/mempool-sync-threshold 2022-02-10 16:28:05 +04:00
softsimon
877be47e5b Merge pull request #1220 from nymkappa/bugfix/fix-duplicate-indexing
Duplicated db blocks insertion attempts are expected
2022-02-10 16:23:07 +04:00
softsimon
98d819b3d2 Merge branch 'master' into bugfix/fix-duplicate-indexing 2022-02-10 16:23:00 +04:00
nymkappa
af02e9b533 Consider we're synced with the mempool if we cached 99% of pending txs 2022-02-10 19:19:54 +09:00
softsimon
11e6602315 Merge pull request #1192 from nymkappa/feature/tv-view-timespan-switch
Allow TV view time span switch through url fragment
2022-02-10 11:52:07 +04:00
nymkappa
055c587351 Fix bug when loading /tv and cleanup Observable flow 2022-02-10 00:24:01 +09:00
nymkappa
cd9eaf816b Refactor TV component subscription 2022-02-10 00:24:01 +09:00
nymkappa
aa77faf314 Use switchMap param instead of re-reading this.route.snapshot.fragment 2022-02-10 00:24:00 +09:00
nymkappa
c9ad316ed5 Allow /tv view timespan to be changed through url fragment 2022-02-10 00:23:55 +09:00
softsimon
4b6ff5e776 Merge pull request #1232 from mempool/bugfix/remove-debug-return
Remove debug return which break the UX the first time we open mempool
2022-02-09 17:13:23 +04:00
softsimon
4e076566db Merge branch 'master' into bugfix/remove-debug-return 2022-02-09 17:13:13 +04:00
Antoni Spaanderman
42fa7c1023 Merge branch 'master' into address-labels 2022-02-09 10:42:41 +01:00
Antoni Spaanderman
8e0394e837 Merge branch 'master' into regtest-1 2022-02-09 10:42:23 +01:00
Antoni Spaanderman
89d811096c Merge branch 'master' into fee-visibility 2022-02-09 10:42:05 +01:00
hunicus
ac21c47540 Fix url for mempool post endpoint 2022-02-08 17:51:19 -05:00
hunicus
bb6a22192c Improve spacing at top of navs 2022-02-08 14:30:18 -05:00
hunicus
22137fef5a Add liquidtestnet endpoints 2022-02-08 13:44:50 -05:00
hunicus
82f70eaefe Show liquid link for liquid endpoint
Error from previous PR.
2022-02-08 13:44:50 -05:00
hunicus
ee8eef2806 Implement 27ce863735 2022-02-08 13:44:50 -05:00
hunicus
4979187468 Implement b1c9334119 2022-02-08 13:44:50 -05:00
hunicus
60160ac0f6 Implement 31c911cb59 2022-02-08 13:44:50 -05:00
hunicus
1a23a9c1c5 Rebase 1036 to master manually 2022-02-08 13:44:50 -05:00
wiz
b232a9b6c2 Merge pull request #1233 from nymkappa/feature/add-mining-pool-logos
sync-assets: Download pool logos from github
2022-02-08 05:53:31 +00:00
wiz
f485c702bd Merge branch 'master' into feature/add-mining-pool-logos 2022-02-08 05:41:22 +00:00
wiz
59530e0f95 Merge pull request #1234 from knorrium/cypress_improvements
Cypress improvements
2022-02-08 05:36:03 +00:00
wiz
ac60ee6857 Merge branch 'master' into feature/add-mining-pool-logos 2022-02-08 05:29:26 +00:00
Felipe Knorr Kuhn
e513b464d8 Add tests status badge to the top level README 2022-02-07 21:24:05 -08:00
Felipe Knorr Kuhn
0c7a907451 Update Cypress event trigers to master and PRs 2022-02-07 21:15:40 -08:00
Felipe Knorr Kuhn
37ba43d0eb Adjust merge messages and add tags for pushes and PRs 2022-02-07 20:50:10 -08:00
nymkappa
c704bfedeb Download pool logos from github 2022-02-08 12:56:26 +09:00
nymkappa
f9a6110c69 Remove debug return which break the UX the first time we open mempool 2022-02-08 11:20:19 +09:00
wiz
4b871468bc Merge branch 'master' into bugfix/fix-duplicate-indexing 2022-02-07 14:55:38 +00:00
wiz
5ede05c67c Merge pull request #1180 from antonilol/log-priority
add log priority option for stdout log
2022-02-07 12:38:31 +00:00
wiz
8868a02716 Merge branch 'master' into log-priority 2022-02-07 12:23:22 +00:00
wiz
e60aff2618 Merge pull request #1230 from mempool/simon/remove-liquidtestnet-asset-test
Disable featured assets test for testnet
2022-02-07 12:23:04 +00:00
softsimon
e36fb27704 Disable featured assets test for testnet 2022-02-07 14:49:14 +04:00
wiz
bd10d3f9b3 Merge branch 'master' into log-priority 2022-02-07 10:36:54 +00:00
softsimon
f260203833 Disable Featured assets on Liquid testnet
fixes #1229
2022-02-07 14:24:18 +04:00
Antoni Spaanderman
62990a95f8 Merge branch 'master' into log-priority
i first forgot to fetch upstream in github, conflicts are fixed
2022-02-07 09:15:42 +01:00
Antoni Spaanderman
5c4f6d6ada Merge branch 'master' into log-priority 2022-02-07 08:59:01 +01:00
wiz
1649cfbde0 Merge pull request #1225 from knorrium/external_assets_defaults
Add EXTERNAL_ASSETS defaults to the Docker start script and the README
2022-02-07 06:35:00 +00:00
wiz
3448d1be2a Merge branch 'master' into external_assets_defaults 2022-02-07 06:34:54 +00:00
wiz
32c6ca5e89 Merge pull request #1224 from mempool/simon/liquid-asset-grouping
Featured assets and asset groups
2022-02-07 03:24:00 +00:00
softsimon
f5193218e5 Mobile responsiveness fixes 2022-02-07 03:34:16 +04:00
softsimon
cd88692d3d Changing Asset proxy redirects to liquid.network 2022-02-07 03:34:16 +04:00
softsimon
99c7d7fac4 Removing /liquid from asset grouping base path. 2022-02-07 03:34:16 +04:00
wiz
01d6f4f737 Fix nginx configuration for liquid assets APIs 2022-02-07 03:34:16 +04:00
softsimon
4c2c6396ba Renaming assets-group to assets/group 2022-02-07 03:34:15 +04:00
wiz
f0398e906d Add nginx configuration for liquid assets APIs 2022-02-07 03:34:15 +04:00
softsimon
b634984ca6 Correcting more tests. 2022-02-07 03:34:15 +04:00
softsimon
1dbae4cd62 Fixing liquidtestnet tests. 2022-02-07 03:34:15 +04:00
softsimon
0863405671 Correcting tests. i18n strings and asset links. 2022-02-07 03:34:15 +04:00
softsimon
ff4c097c48 Mobile layout fixes. 2022-02-07 03:34:15 +04:00
softsimon
91082f27e7 SEO and various render fixes. 2022-02-07 03:34:15 +04:00
softsimon
d33c12cdee Asset search 2022-02-07 03:34:15 +04:00
softsimon
2e5c8bdfd3 Featured assets and asset groups 2022-02-07 03:34:14 +04:00
softsimon
755c1da8b3 Merge pull request #1228 from knorrium/add_staging_targets
Run tests in Staging
2022-02-07 03:33:50 +04:00
Felipe Knorr Kuhn
90784ea1ee Update CI Cypress config to hit staging 2022-02-06 15:13:31 -08:00
Felipe Knorr Kuhn
18a7b13077 Add new targets to run locally hitting the staging backends 2022-02-06 15:12:03 -08:00
Felipe Knorr Kuhn
4af0a75aad Add new proxy config for staging 2022-02-06 15:11:13 -08:00
Felipe Knorr Kuhn
ad38e5fa2d Add mining pools resources route 2022-02-06 15:10:35 -08:00
Antoni Spaanderman
9f3a3bd4d7 also detect uncompressed pubkeys + fix errors 2022-02-06 12:41:37 +01:00
wiz
b383f9fc67 Merge pull request #1213 from knorrium/fetch_conversion_rates_over_tor
Fetch conversion rates over Tor
2022-02-06 08:04:50 +00:00
wiz
aae780de6e Merge branch 'master' into fetch_conversion_rates_over_tor 2022-02-06 07:53:59 +00:00
Felipe Knorr Kuhn
81ee0e39bc Add EXTERNAL_ASSETS defaults to the Docker start script and the README 2022-02-05 21:24:24 -08:00
Felipe Knorr Kuhn
4afeb3998a Change fiat conversion logs to DEBUG 2022-02-05 15:38:03 -08:00
Antoni Spaanderman
bb8bfa0e3a copy paste moment 2022-02-05 17:29:42 +01:00
Antoni Spaanderman
148e340ea6 actually test htlc, fix indentation (again) and detect multisig 2022-02-05 17:26:50 +01:00
Antoni Spaanderman
7565aa7a25 fix indentation + detect htlc with option_anchors 2022-02-05 16:58:41 +01:00
Felipe Knorr Kuhn
6b2900345a Rename PRICENODE to PRICE_DATA_SERVER 2022-02-05 07:58:35 -08:00
Antoni Spaanderman
1f6504898a detect lightning htlc and unilateral close 2022-02-05 16:50:10 +01:00
softsimon
e2bcb82b59 Merge pull request #1218 from mempool/simon/dev-proxy-refactor
Local dev proxy working with all base modules
2022-02-05 13:58:14 +04:00
wiz
46ac307329 Merge branch 'master' into simon/dev-proxy-refactor 2022-02-05 09:47:08 +00:00
wiz
d3969afef5 Merge pull request #1219 from mempool/simon/add-mixed-proxy
Adding a "mixed" dev proxy
2022-02-05 09:13:16 +00:00
softsimon
a45c371e27 Adding a "mixed" dev proxy 2022-02-05 13:05:52 +04:00
softsimon
006ed39bf2 Local dev proxy working with all base modules 2022-02-05 13:02:22 +04:00
Felipe Knorr Kuhn
ee7f8d8d18 Reduce currency rates polling interval from 1 hour to 10 minutes 2022-02-05 00:33:16 -08:00
nymkappa
12b53d9ace Duplicated db blocks insertion attempts are expected 2022-02-05 15:50:57 +09:00
Felipe Knorr Kuhn
452375aaf7 Make the Currency Conversion Service URLs configurable and log when queried 2022-02-04 22:48:16 -08:00
Antoni Spaanderman
20996cfb49 Update docker/backend/mempool-config.json
oops (2)

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>
2022-02-04 20:03:36 +01:00
Antoni Spaanderman
30c79a2025 Update docker/backend/start.sh
oops i just copied the line above and forgot that one

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>
2022-02-04 20:03:25 +01:00
Antoni Spaanderman
174907cf6a add STDOUT_LOG_MIN_PRIORITY to README and docker config 2022-02-04 19:19:32 +01:00
wiz
1ada92f03e Merge pull request #1212 from nymkappa/feature/blocks-refactoring
Wrap custom blocks fields into a sub object of IEsplora.Blocks
2022-02-04 17:16:11 +00:00
wiz
2c60a81c1e Merge branch 'master' into feature/blocks-refactoring 2022-02-04 16:53:42 +00:00
wiz
c60e355453 Merge pull request #1215 from mempool/simon/fixing-local-proxy-endpoints
Proxy all /api and /api/v1 requests to local nodejs server
2022-02-04 16:52:41 +00:00
Antoni Spaanderman
d08d2a16d3 Merge branch 'master' into regtest-1
for cla bot
2022-02-04 12:34:42 +01:00
Antoni Spaanderman
9e9837133b Merge branch 'master' into log-priority
fix conflicts in backend/src/config.ts and backend/mempool-config.sample.json
2022-02-04 12:32:08 +01:00
Antoni Spaanderman
9fc4297e86 Merge branch 'master' into fee-visibility
for cla bot
2022-02-04 12:26:47 +01:00
nymkappa
456bd5a18e Renamed extra to extras 2022-02-04 19:28:00 +09:00
softsimon
02e15cbea4 Proxy all /api and /api/v1 requests to local nodejs server 2022-02-04 13:47:34 +04:00
Felipe Knorr Kuhn
b1dde4d8b1 Query conversion rates service over clearnet or Tor with mempool User-Agent 2022-02-03 23:23:57 -08:00
Felipe Knorr Kuhn
8a996cedb4 Update README, reference config files and Docker with the new SOCKS config 2022-02-03 23:21:19 -08:00
Felipe Knorr Kuhn
0a954e8bcf Allow synthetic default imports due to the socks library 2022-02-03 23:16:30 -08:00
Felipe Knorr Kuhn
0400deacf2 Add socks-proxy-agent dependency 2022-02-03 23:14:56 -08:00
nymkappa
9f0b09295d Move our custom fields to a BlockExtension sub object of the IEsploraApi.Block interface 2022-02-04 12:51:45 +09:00
softsimon
5c1fc7344d Merge pull request #1160 from antonilol/genesis-outspend
outputs of genesis coinbase are always unspent
2022-02-03 13:48:30 +04:00
softsimon
319f646fe2 Merge branch 'master' into genesis-outspend 2022-02-03 13:48:19 +04:00
wiz
1ae08aff66 Merge pull request #1207 from nymkappa/feature/fix-mining-pool-page-title
Set proper mining pool page title - Rename "Name" to "Pool"
2022-02-02 14:59:32 +00:00
wiz
4b79f09538 Merge branch 'master' into feature/fix-mining-pool-page-title 2022-02-02 14:47:50 +00:00
wiz
5fd05b3602 Merge pull request #1208 from nymkappa/feature/pools-api-endpoint-update
Replaced /mining/pools?interval=X by /mining/pools/X
2022-02-02 14:26:24 +00:00
wiz
77e75d3d8c Merge branch 'master' into feature/pools-api-endpoint-update 2022-02-02 14:26:15 +00:00
wiz
117f3eb99a Merge pull request #1189 from antonilol/cla
sign cla
2022-02-02 14:03:39 +00:00
nymkappa
e48a2f73e4 Replaced /mining/pools?interval=X by /mining/pools/X 2022-02-02 19:03:07 +09:00
nymkappa
ae9afe2f81 Set proper mining pool page title - Rename "Name" to "Pool" 2022-02-02 18:46:06 +09:00
wiz
95c8e72b58 Merge pull request #1200 from mempool/wiz/add-contributor-cla-files
Add staff contributor/{username}.txt files for new CLA bot
2022-01-29 08:23:50 +00:00
wiz
19dda17d50 Add staff contributor/{username}.txt files for CLA bot 2022-01-29 07:48:58 +00:00
wiz
a913a85dea Merge pull request #1199 from mempool/wiz/let-backend-set-its-own-http-cache-time-headers
Let backend set its own HTTP cache time headers for APIs
2022-01-29 04:28:22 +00:00
wiz
f842316636 Let backend set its own HTTP cache time headers for APIs 2022-01-28 13:59:04 +00:00
wiz
05fd433ad7 Merge pull request #1198 from mempool/wiz/enable-nginx-warm-cache-for-mining-pools-data
Enable nginx warm cache for mining pools API data
2022-01-28 13:51:44 +00:00
wiz
55652130a8 Enable nginx warm cache for mining pools API data 2022-01-28 13:33:29 +00:00
wiz
6a8874a9e0 Merge pull request #1193 from mempool/wiz/increase-nginx-timeouts
Increase nginx send_timeout and keepalive_requests
2022-01-28 13:22:21 +00:00
wiz
0afcb53abd Merge pull request #1162 from nymkappa/feature/backend-block-pool-data
Mining dashboard (2/2) - Dashboard PoC
2022-01-28 10:09:17 +00:00
nymkappa
620a7f0718 Fix mining pools wrong default timespan value 2022-01-28 18:49:06 +09:00
nymkappa
9df490373b Fixes post rebase 2022-01-28 15:01:24 +09:00
nymkappa
6ebbc5667d Small improvements on the mining page UX
- INDEXING_BLOCKS_AMOUNT = 0 disable indexing, INDEXING_BLOCKS_AMOUNT = -1 indexes everything
- Show only available timespan in the mining page according to available datas
- Change default INDEXING_BLOCKS_AMOUNT to 1100

Don't use unfiltered mysql user input

Enable http cache header for mining pools (1 min)
2022-01-28 15:01:24 +09:00
nymkappa
d66bc57165 Move block indexing start logic in blocks.ts 2022-01-28 15:01:23 +09:00
nymkappa
73019b485f Update tests - Replace button click blocks -> pools 2022-01-28 15:01:23 +09:00
nymkappa
647f12ffaa Added MEMPOOL.INDEXING_BLOCKS_AMOUNT in the config (default 432 blocks) 2022-01-28 15:01:23 +09:00
nymkappa
a271c39ba8 Wrap block indexing into a try/catch since we don't use async when calling that function 2022-01-28 15:01:22 +09:00
nymkappa
f8f9108ae1 Polish mining page UI
Make sure to wait for all mining pools queries before continuing
2022-01-28 15:01:22 +09:00
nymkappa
40e529ece7 Don't try to identify the mining pool on liquid/bisq 2022-01-28 15:01:21 +09:00
nymkappa
df960ab9ba Import pools file for testnet and signet as well - Added missing express routes 2022-01-28 15:01:21 +09:00
nymkappa
8eaa9b3c7b Add share % in pie chart label 2022-01-28 15:01:21 +09:00
nymkappa
5b32ab6dde DROP -> DROP IF EXISTS 2022-01-28 15:01:20 +09:00
nymkappa
f982f6b4b6 Hide epoch data from the mining page 2022-01-28 15:01:20 +09:00
nymkappa
aa457e316b Drop legacy blocks table during migration - Fix linter issues 2022-01-28 15:01:19 +09:00
nymkappa
b8410f00d9 Fix xxxWindowPreference management 2022-01-28 15:01:19 +09:00
nymkappa
4b9bfd6ca0 Basic block indexing WIP - Default mining pool icon - Only show mining hashrate on 1d scale 2022-01-28 15:01:15 +09:00
nymkappa
b9a047b22d Add difficulty adjustment in mining page + Fix pools table on mobile 2022-01-28 14:52:12 +09:00
nymkappa
091027cc79 When a new blocks is mined, refresh the mining stats 2022-01-28 13:54:59 +09:00
nymkappa
0a267affaf Add pie chart and rewrite the pool ranking component 2022-01-28 13:54:59 +09:00
nymkappa
18a63933fa Increment migration schema version to 3 and re-add pools and blocks table creation queries 2022-01-28 13:53:29 +09:00
nymkappa
bfe9f99c35 Generate mining basic pool ranking (sorted by block found) for a specified timeframe 2022-01-28 13:52:35 +09:00
nymkappa
37031ec913 Refactor blocks.ts and index 10k block headers at launch 2022-01-28 13:51:14 +09:00
nymkappa
031f69a403 Add backend README - Backend watchers setup 2022-01-28 13:50:58 +09:00
nymkappa
1a22923cd8 Migrate pools.json to the database in one command - Updated latest pools.json file from Blockchain-Known-Pools master 2022-01-28 13:50:58 +09:00
wiz
4212a649f1 Merge pull request #1194 from AaronDewes/patch-1
Change Citadel link to core
2022-01-27 09:03:12 +00:00
Aaron Dewes
8a4a003620 Change Citadel link to core 2022-01-27 08:11:18 +01:00
wiz
493dbb1b1a Increase nginx send_timeout and keepalive_requests
Fixes #425
2022-01-27 05:56:38 +00:00
Antoni Spaanderman
2aaa42716a sign cla 2022-01-25 16:50:03 +01:00
wiz
356dda96c8 Merge pull request #1188 from mempool/wiz/add-cla
Add new Contributor License Agreement policy
2022-01-25 10:22:21 +00:00
softsimon
f2a9933d21 Accept the CLA for @softsimon 2022-01-25 13:41:28 +04:00
wiz
bd033541b7 Update copyright years in legal notices 2022-01-25 09:36:02 +00:00
wiz
707ae7be01 Accept the CLA for @wiz 2022-01-25 09:35:48 +00:00
wiz
000dfc4d9e Add new Contributor License Agreement policy 2022-01-25 09:30:11 +00:00
wiz
cba46a82aa Merge pull request #1173 from mempool/simon/liquid-asset-precision-fix
Fixing Liquid asset precision
2022-01-25 08:15:20 +00:00
wiz
1263d05ac8 Merge pull request #1187 from nymkappa/bugfix/mysql-transactions
Remove useless autocommit=0 in db migration script
2022-01-25 07:51:31 +00:00
nymkappa
703b4cc92a Remove useless autocommit=0 in db migration script 2022-01-25 16:45:52 +09:00
wiz
6ad0344ea5 Merge pull request #1163 from nymkappa/feature/pools-migration
Mining dashboard (1/2) - Import mining pools into the database - Increment db schema to 3
2022-01-25 06:27:10 +00:00
Antoni Spaanderman
7902f68ada fix 0 sat/vB not displaying 2022-01-24 21:35:13 +01:00
Antoni Spaanderman
f68ac944ed fix dashboard TXs issue 2022-01-24 20:51:30 +01:00
Antoni Spaanderman
1beafd137b fix dashboard blocks issue 2022-01-24 20:44:05 +01:00
Antoni Spaanderman
f111c006ce fix block height out of range on full page blocks viewer 2022-01-24 20:26:02 +01:00
Antoni Spaanderman
44021a3cb3 prefer const over let 2022-01-24 20:25:22 +01:00
softsimon
eb32b13acb Merge pull request #1182 from nymkappa/bugfix/statistics-db-error-handling
Wrap statistics db ops with try/catch
2022-01-24 17:05:48 +04:00
softsimon
f1400909a8 Merge pull request #1183 from nymkappa/feature/cleanup-master-page
Cleanup master-page template
2022-01-24 17:03:16 +04:00
softsimon
c91b6b473a Merge pull request #1177 from knorrium/fix_broken_bisq_tx_link
Fix broken link on the Bisq transaction page
2022-01-24 13:23:11 +04:00
nymkappa
68320dc117 Cleanup master-page template 2022-01-24 18:22:15 +09:00
nymkappa
a805c86697 Wrap statistics db ops with try/catch 2022-01-24 16:22:38 +09:00
nymkappa
1322298a06 Make sure to wait for all mining pools queries before continuing 2022-01-24 14:34:03 +09:00
Antoni Spaanderman
3ceab1493e add log priority option for stdout log 2022-01-23 12:20:32 +01:00
softsimon
230f563235 Merge pull request #1178 from knorrium/update_e2e_tests
Update e2e tests: new scenarios for Liquid, Bisq and refactor button selectors
2022-01-23 14:25:11 +04:00
softsimon
d1ed3c4b93 Merge pull request #1179 from mempool/simon/frontend-npm-audit-fix
Npm audit fix
2022-01-23 12:58:39 +04:00
softsimon
c1f90e0c26 Npm audit fix 2022-01-23 12:58:16 +04:00
Felipe Knorr Kuhn
0ff6cd19c3 Update tests: use ids for nav bar items and new scenarios for bisq and liquid 2022-01-22 14:23:09 -08:00
Felipe Knorr Kuhn
a5ca0cda14 Add ids to nav bar items, liquid and bisq components 2022-01-22 14:21:46 -08:00
Antoni Spaanderman
30632e9e11 fix error with invalid chaintips 2022-01-22 15:13:10 +01:00
Felipe Knorr Kuhn
0560496154 Fix broken link on the Bisq transaction page 2022-01-21 23:12:18 -08:00
softsimon
e2dfdc0064 Merge pull request #1175 from knorrium/update_to_cypress_931
Update Cypress to v9.3.1
2022-01-21 15:37:54 +04:00
softsimon
a09910522b Merge pull request #1176 from knorrium/update_liquid_tests
Update Liquid tests
2022-01-21 15:37:20 +04:00
wiz
145bdca3af Merge pull request #1172 from mempool/simon/liquid-asset-overflow
Asset name overflow fix
2022-01-21 08:55:50 +00:00
Felipe Knorr Kuhn
af38ef8ee7 Merge branch 'master' into update_liquid_tests 2022-01-20 21:54:23 -08:00
Felipe Knorr Kuhn
7bb95ff177 Update Cypress GHA spec list 2022-01-20 21:43:13 -08:00
Felipe Knorr Kuhn
c885187971 Add an amount class vins and vouts to improve testing 2022-01-20 21:31:14 -08:00
Felipe Knorr Kuhn
6637477ac9 Update Liquid tests 2022-01-20 21:30:22 -08:00
Felipe Knorr Kuhn
cf5cce23f3 Add Liquid Testnet tests 2022-01-20 21:30:03 -08:00
Felipe Knorr Kuhn
9f2d0c5172 Update config script defaults 2022-01-20 21:29:45 -08:00
Felipe Knorr Kuhn
80e4141612 Update Cypress to v9.3.1 2022-01-20 21:27:52 -08:00
softsimon
a8c04624f0 Fixing liqud asset precision
fixes #1166
2022-01-21 01:32:19 +04:00
softsimon
36b4812e93 Asset name overflow fix 2022-01-21 00:16:18 +04:00
softsimon
347c386815 Merge pull request #1171 from knorrium/fix_liquid_proxy
Fix Liquid proxy settings
2022-01-20 23:42:57 +04:00
softsimon
b2fac709f9 Merge pull request #1170 from mempool/simon/liquid-loading-fixes
Liquid asset loading fixes
2022-01-20 23:30:44 +04:00
Felipe Knorr Kuhn
35e69f2e3d Fix Liquid proxy settings 2022-01-20 11:27:50 -08:00
softsimon
88a9e22abe Liquid asset loading fixes 2022-01-20 23:00:43 +04:00
Antoni Spaanderman
e8986e5fdc stop for loop after genesis block
prevHash == undefined for the genesis block
2022-01-20 19:24:30 +01:00
Antoni Spaanderman
e581ef7fe3 add regtest class 2022-01-20 19:10:36 +01:00
Antoni Spaanderman
1f0ae601c5 add network regtest 2022-01-20 17:19:16 +01:00
wiz
2b1367afd8 Merge pull request #1167 from mempool/simon/asset-icons
Display Liquid asset icons
2022-01-20 16:11:12 +00:00
softsimon
a2b167fc07 Display Liquid asset icons 2022-01-20 19:51:02 +04:00
Antoni Spaanderman
4bf167d3e1 fixed arrow not pointing to genesis block 2022-01-20 15:57:53 +01:00
nymkappa
87175869dd Fix typescript miss use 2022-01-20 23:31:32 +09:00
nymkappa
a1a2e9363f Make sure to release all db connections 2022-01-20 23:07:20 +09:00
nymkappa
19a564062b Add pools.json file in default config.ts - Handle file exception - Only import pools for MAINNET 2022-01-20 22:59:10 +09:00
nymkappa
8d1cc40459 Fix add 'Unknown' pool logic 2022-01-20 16:56:25 +09:00
nymkappa
1210643e8e Fix linter issues and typo 2022-01-20 16:34:14 +09:00
nymkappa
979c52d3c4 Add pools.json to EXTERNAL_ASSETS - Now supports updating the table 2022-01-20 13:53:08 +09:00
Antoni Spaanderman
e59f610a75 display genesis block 2022-01-19 17:11:35 +01:00
Antoni Spaanderman
3608fa6f19 load blocks with height under INITIAL_BLOCKS_AMOUNT 2022-01-19 16:58:56 +01:00
nymkappa
2848f56c2b Import mining pools into the database - Increment db schema to 3 2022-01-19 18:50:52 +09:00
softsimon
ab6a0eae09 Merge pull request #1158 from antonilol/coinbase
dont use hardcoded genesis coinbase and block hash
2022-01-19 13:33:45 +04:00
softsimon
bc925a409f Merge pull request #1152 from nymkappa/feature/split-difficulty-component
Move difficulty adjustment code to separate module
2022-01-19 13:19:17 +04:00
Antoni Spaanderman
fac40b1515 rethrow the error if it wasnt the genesis coinbase 2022-01-19 08:27:51 +01:00
Antoni Spaanderman
63939ddbe4 outputs of genesis coinbase are always unspent 2022-01-18 22:25:38 +01:00
Antoni Spaanderman
d4719245f5 dont use hardcoded genesis coinbase and block hash
fixes #1128
2022-01-18 21:55:09 +01:00
wiz
3a67bc6425 Merge pull request #1154 from nymkappa/bugfix/extreme-filter-only-mainnet
Only apply vbytes/sec cap on Bitcoin mainnet - Fix linter issues
2022-01-17 21:06:02 +09:00
nymkappa
08a9cc30ba Only apply vbytes/sec cap on Bitcoin mainnet - Fix linter issues 2022-01-17 20:19:20 +09:00
wiz
9641a00bb4 Merge pull request #1151 from nymkappa/feature/save-zeroed-statistics
Insert zeroed statistics in the database if the mempool is empty
2022-01-17 19:08:35 +09:00
nymkappa
fcca911377 Move difficulty adjustment code to separate module 2022-01-17 13:33:07 +09:00
wiz
274ca33664 Merge pull request #1150 from mempool/release/v2.3.0 2022-01-16 18:56:08 +09:00
nymkappa
a570812d70 Insert zeroed statistics in the database if the mempool is empty 2022-01-16 16:20:45 +09:00
wiz
dbdc87eeae Bump version number to v2.4.0-dev 2022-01-16 15:41:23 +09:00
wiz
b9067ed912 Release v2.3.0 2022-01-16 15:36:48 +09:00
wiz
11cc14f5b0 Merge pull request #1149 from mempool/wiz/20220116-pull-from-transifex
Pull translated strings from Transifex
2022-01-16 15:31:44 +09:00
wiz
4133bf31c6 Merge pull request #1147 from mempool/simon/gettxout
Utilize gettxout to display spent/unspent
2022-01-16 15:29:53 +09:00
wiz
bfeee747c2 Merge pull request #1148 from mempool/simon/liquid-testnet-statuspage
Adding missing Liquid Testnet Status page
2022-01-16 15:00:42 +09:00
wiz
31fb6f70ab Pull translated strings from Transifex 2022-01-16 14:42:25 +09:00
softsimon
cb38258cf7 Adding missing Liquid Testnet Status page 2022-01-15 23:49:08 +04:00
softsimon
2a16dc5a7f Utilize gettxout to display spent/outspent
fixes #1088
2022-01-15 22:09:04 +04:00
softsimon
20476e1366 Merge pull request #1145 from mempool/wiz/fix-html-theme-color
Fix HTML theme color for iOS status bar
2022-01-15 21:00:01 +04:00
wiz
57b0ccee60 Fix HTML theme color for iOS status bar 2022-01-16 00:19:29 +09:00
wiz
80ec15193c Merge pull request #1132 from mempool/simon/translators
Adding translators to About page
2022-01-15 06:49:01 +00:00
wiz
d61eba8c68 Fix translation for Project Translators on About page 2022-01-15 06:47:51 +00:00
wiz
4787b6353a Merge pull request #1142 from mempool/wiz/update-nginx-conf-for-services-apis
Update nginx.conf for mempool.space services APIs
2022-01-15 06:22:44 +00:00
softsimon
debcd1808e Displaying translators as twitter photos 2022-01-15 04:19:50 +04:00
softsimon
85f471ad08 Adding translators to About page 2022-01-15 04:01:53 +04:00
wiz
c7fa785346 Merge pull request #1144 from mempool/wiz/update-nginx-conf-for-resource-caching 2022-01-14 15:06:11 +00:00
wiz
a710934830 Update production nginx.conf resource cache times 2022-01-14 22:35:25 +09:00
wiz
69e006f640 Merge pull request #1143 from mempool/simon/fix-critical-vulnerability
Fixing high vulnerabilities
2022-01-14 12:53:15 +00:00
softsimon
78c32af062 Fixing high vulnerabilities 2022-01-14 16:43:56 +04:00
wiz
9a47191e10 Update nginx.conf for mempool.space services APIs 2022-01-14 20:56:41 +09:00
wiz
ace5da94a4 Merge pull request #1140 from mempool/wiz/fix-newsyslog-owner-and-pidfile
Fix newsyslog.conf owner and pidfile location
2022-01-14 10:54:27 +00:00
wiz
e7f2f75b05 Merge pull request #1141 from nymkappa/feature/remove-unused-data-statistics
Remove unused fields from statistics queries since we don't use them in the front end
2022-01-14 10:39:07 +00:00
nymkappa
5b39ad2130 Remove id, unconfirmed_transactions and tx_per_second from the statistics queries since we don't use them in the front end 2022-01-14 19:21:54 +09:00
wiz
ee1985bb3d Fix newsyslog.conf owner and pidfile location 2022-01-14 19:21:42 +09:00
wiz
9caa57e81d Merge pull request #1139 from nymkappa/feature/improve-statistics-query-perf
Order by native `statistics.added` field for better query performances
2022-01-14 09:30:01 +00:00
nymkappa
8797ef261f Order by native statistics.added field for better query performances 2022-01-14 18:13:34 +09:00
wiz
fb9a548dfc Merge pull request #1136 from mempool/docker_readme_fixes 2022-01-13 13:53:27 +00:00
Felipe Knorr Kuhn
ad4bfefee7 Fix Docker README 2022-01-13 05:51:36 -08:00
wiz
cd9157488f Merge pull request #1135 from mempool/wiz/fix-typo-nginx-cache-warmer
Fix typo in nginx-cache-warmer script
2022-01-13 09:05:33 +00:00
wiz
b501f7228c Fix typo in nginx-cache-warmer script 2022-01-13 17:59:51 +09:00
wiz
11483852da Merge pull request #1120 from knorrium/docker_updates
Updates to the docker-compose setup
2022-01-13 08:52:08 +00:00
wiz
a6fadc840d Merge pull request #1134 from mempool/wiz/add-nginx-cache-warmer 2022-01-13 08:34:48 +00:00
Felipe Knorr Kuhn
af8c8a2088 Fix typos in the JSON keys 2022-01-13 00:08:07 -08:00
wiz
573cb8f993 Merge pull request #1133 from nymkappa/feature/disable-graph-interaction-mobile
Disable graph touch interaction in dashboard on mobile so we can scroll properly
2022-01-13 07:20:58 +00:00
Felipe Knorr Kuhn
d70c610741 Fetch the dereferenced commit from the tag 2022-01-12 22:36:24 -08:00
wiz
985d19778f Merge pull request #1130 from mempool/simon/remove-backend-cache
Removing statistics cache and setting headers
2022-01-13 06:07:36 +00:00
wiz
2cb50c2351 Add nginx cache warmer script for production use 2022-01-13 15:06:13 +09:00
Felipe Knorr Kuhn
359e111ae4 Normalize Docker environment variables and backend JSON keys 2022-01-12 21:20:14 -08:00
wiz
548f38292f Merge pull request #1131 from hunicus/update-liquidtestnet-docs
Update liquidtestnet docs
2022-01-13 04:12:48 +00:00
nymkappa
5f2350b763 Disable graph touch interaction in dashboard on mobile so we can scroll properly 2022-01-13 12:00:49 +09:00
Felipe Knorr Kuhn
831cd580e0 Delete Docker README 2022-01-12 17:18:52 -08:00
Felipe Knorr Kuhn
47a6969dc9 Move Docker instructions to the top level README 2022-01-12 17:18:33 -08:00
softsimon
29581f325f Removing statistics cache and setting headers 2022-01-12 20:57:25 +04:00
hunicus
fbce72b7fc Update transactions endpoints 2022-01-12 11:51:10 -05:00
hunicus
a894fa5bc0 Update mempool endpoints 2022-01-12 11:51:10 -05:00
hunicus
9ac3c420eb Update fees endpoints 2022-01-12 11:51:10 -05:00
hunicus
10df6985fc Update blocks endpoints 2022-01-12 11:51:10 -05:00
hunicus
27ce863735 Fix block-height endpoint across networks 2022-01-12 11:51:10 -05:00
hunicus
d840d79aea Update block and block-header 2022-01-12 11:51:10 -05:00
hunicus
80dfc81900 Make minor grammatical changes to GET Asset Icons 2022-01-12 11:51:10 -05:00
hunicus
31c911cb59 Rename 'GET Assets' to 'GET Asset'
Confusing since it gets information on 1
asset..."asset" should be singular.
2022-01-12 11:51:10 -05:00
hunicus
0d4160b232 Reorder assets nav items to fit content order 2022-01-12 11:51:10 -05:00
hunicus
f0022f6af9 Update assets endpoints
Currently no testnet assets have icons, so those
responses are blank.
2022-01-12 11:51:10 -05:00
hunicus
a16decfb94 Fix urls in code examples 2022-01-12 11:51:10 -05:00
wiz
ea2a2310a0 Merge pull request #1129 from mempool/wiz/nginx-redirects-for-localized-urls
Improve nginx caching and use redirects for i18n
2022-01-12 16:44:11 +00:00
wiz
7f17ade65c Merge pull request #1113 from mempool/simon/network-language-fix
Adding current language to network dropdown links
2022-01-12 16:41:47 +00:00
softsimon
c8d38740cc Minor language service refactor 2022-01-12 19:08:56 +04:00
wiz
efffd1a929 Suggested changes for Simon's PR #1113 2022-01-12 23:52:52 +09:00
wiz
f0c53a4e5b Improve nginx caching and use redirects for i18n 2022-01-12 23:12:49 +09:00
wiz
a9c1dc3726 Merge pull request #1121 from nymkappa/feature/database-migration-update
Wrap migration with transactions
2022-01-12 11:28:14 +00:00
nymkappa
2944f0b805 Added missing log tags 2022-01-12 17:43:32 +09:00
nymkappa
f494bd6d6a Sleep 10 seconds before ending the process after critical error in database migration 2022-01-12 17:26:10 +09:00
nymkappa
ae2cb05dc5 Extract all CREATE commands from transaction 2022-01-12 16:41:27 +09:00
nymkappa
4e322fe006 Print database engine version when migration script starts 2022-01-12 16:06:45 +09:00
hunicus
5d06d02d64 Fix urls
So that /liquidtestnet is in links and link text.
2022-01-12 01:36:26 -05:00
hunicus
7eabbe30e6 Add /liquidtestnet/ to links 2022-01-12 01:36:26 -05:00
hunicus
c232f6a11d Add boilerplate liquidtestnet examples
Also adjust logic to show them. Doing this prevents
compilation errors and will allow for endpoints to
be reviewed as they are modified.
2022-01-12 01:36:26 -05:00
hunicus
04ffa6d7bb Update address-utxo 2022-01-12 01:36:44 -05:00
hunicus
d46655e5f4 Update address-tx-chain and address-tx-mempool 2022-01-12 01:36:37 -05:00
hunicus
1438300763 Update address and address-tx 2022-01-12 01:36:26 -05:00
nymkappa
cce49bdb7e MariaDB 10.2 does not supports CAST as FLOAT -> Replace with CAST as DOUBLE 2022-01-12 14:51:16 +09:00
nymkappa
fc878b696d Only create statistics.index if needed (supports old mariadb) - Make sure all db connections are released - Fix linter issues - Remove .toString() 2022-01-12 14:10:16 +09:00
wiz
c09fdb656f Merge pull request #1111 from mempool/wiz/add-production-torrc
Add production Tor configuration to repo
2022-01-12 03:45:09 +00:00
wiz
9ac9eb9cc8 Merge pull request #1124 from mempool/simon/bump-angular-ngboostrap
Bumping minor Angular version and major ngBootstrap
2022-01-12 03:44:33 +00:00
wiz
ff5367b0e7 Merge pull request #1125 from knorrium/link_to_commit
Link the git commit hash to GitHub on the About page
2022-01-12 03:32:45 +00:00
Felipe Knorr Kuhn
503adc20dc Link the git commit hash to GitHub on the About page 2022-01-11 17:02:48 -08:00
softsimon
2f5cad9d0a Bumping minor Angular version and major ngBootstrap 2022-01-12 02:42:33 +04:00
hunicus
871329e0fd Remove websocket and js tabs
Since npm packages don't work with liquidtestnet yet.
2022-01-11 17:21:35 -05:00
hunicus
7825b8d732 Remove difficulty endpoint from nav 2022-01-11 15:32:35 -05:00
nymkappa
6bfd9da08c Refactor migrations - Wrap with TRANSACTION 2022-01-11 20:43:59 +09:00
Felipe Knorr Kuhn
ce8518ad58 List all environment variables to override in the README 2022-01-10 23:31:05 -08:00
Felipe Knorr Kuhn
865fe488bf Make the RPC user and pass explicit in the example docker-compose file 2022-01-10 23:30:31 -08:00
Felipe Knorr Kuhn
467cac7d4d Remove the troubleshooting section from the Docker README 2022-01-10 22:11:02 -08:00
Felipe Knorr Kuhn
3a0fb2015a Address feedback on the Docker README 2022-01-10 22:06:15 -08:00
Felipe Knorr Kuhn
bfb5abaa71 Update Docker README file 2022-01-10 21:10:58 -08:00
Felipe Knorr Kuhn
6cb2625303 Update the reference docker-compose.yml file 2022-01-10 21:09:06 -08:00
Felipe Knorr Kuhn
2d292e27b9 Add the empty directories needed by docker-compose 2022-01-10 20:31:36 -08:00
wiz
9b6d679739 Merge pull request #1119 from nymkappa/feature/order-statistics-by-added
statistics: `ORDER BY id` => `ORDER BY added`
2022-01-11 03:38:24 +00:00
wiz
8099349dcc Merge pull request #1118 from nymkappa/bugfix/graph-scroll-main-page
Mouse scroll is not captured anymore by graphs in the dashboard page
2022-01-11 03:31:07 +00:00
nymkappa
b1df17d7a3 statistics: ORDER BY id => ORDER BY added 2022-01-11 12:25:45 +09:00
nymkappa
02798db449 Mouse scroll is not capture anymore by graphs in the dashboard page 2022-01-11 12:16:09 +09:00
wiz
4b71cb6e28 Merge pull request #1116 from mempool/wiz/20220111-pull-from-transifex
Pull translated strings from Transifex
2022-01-11 03:09:44 +00:00
wiz
cee52e69f1 Merge pull request #1112 from nymkappa/feature/index-added-field
INDEX 'added' in statistics table
2022-01-11 03:09:20 +00:00
wiz
a4a8fb64b1 Merge pull request #1110 from nymkappa/feature/filter-out-extreme-values
Cap extreme vbytes_per_second values
2022-01-11 03:07:44 +00:00
nymkappa
0e6cc67c0a Only create INDEX 'added' when it does not already exist 2022-01-11 11:47:04 +09:00
wiz
cc621b10ce Update Tor onion hostnames for bisq.markets and liquid.network 2022-01-11 11:18:22 +09:00
wiz
2eaea44182 Pull translated strings from Transifex 2022-01-11 10:07:50 +09:00
wiz
50734bafbf Merge pull request #1114 from mempool/simon/mempool.js-2.3.0
Bumping mempool.js lib to 2.3.0
2022-01-11 00:50:22 +00:00
Felipe Knorr Kuhn
745b7d6f65 Set statistics to enabled by default 2022-01-10 16:10:34 -08:00
softsimon
4ca730697c Adding current language to network dropdown links
fixes  #1094
2022-01-10 18:00:01 +04:00
softsimon
dc06a3f62a Bumping mempool.js lib to 2.3.0 2022-01-10 15:55:18 +04:00
nymkappa
1e78326ee4 INDEX 'added' in statistics table 2022-01-10 19:48:29 +09:00
nymkappa
45542d5f06 Apply AVG() on vbytes_per_second - Cap extreme vbytes_per_second values 2022-01-10 18:52:56 +09:00
wiz
0106f44129 Add production/torrc file to git repo 2022-01-10 18:37:54 +09:00
Felipe Knorr Kuhn
ba895559bf Fix a few sed commands in the Docker backend start script that needed escaping 2022-01-10 00:42:42 -08:00
Felipe Knorr Kuhn
513886f6d2 Fix typo on the docker start script 2022-01-10 00:08:42 -08:00
Felipe Knorr Kuhn
09fe7346bc Make every backend parameter configurable via environment variables 2022-01-09 22:19:04 -08:00
Felipe Knorr Kuhn
4173486f4d Update the template backend mempool-config.json file used by the Docker image 2022-01-09 22:18:29 -08:00
wiz
d809e85dde Merge pull request #1109 from mempool/wiz/20220110-pull-from-transifex
Pull translated strings from Transifex
2022-01-10 04:21:04 +00:00
wiz
6414f0045e Pull translated strings from Transifex 2022-01-10 13:20:39 +09:00
wiz
39c5393e3b Merge pull request #1107 from mempool/wiz/20220109-pull-from-transifex
Pull translated strings from Transifex
2022-01-09 07:27:49 +00:00
wiz
d2cd396c75 Pull translated strings from Transifex 2022-01-09 16:23:47 +09:00
wiz
ccbb28c8a0 Merge pull request #1104 from mempool/simon/remove-local-bisq-liquid
Ending support for /bisq /liquid and /liquidtestnet
2022-01-09 06:29:46 +00:00
softsimon
afbced3f4d Adapting tests 2022-01-08 20:44:45 +04:00
softsimon
08f2287def Ending support for /bisq /liquid and /liquidtestnet 2022-01-08 17:33:37 +04:00
wiz
5175027948 Merge pull request #1103 from mempool/wiz/fix-matomo-for-bisq-markets
Fix matomo hostname for bisq.markets html
2022-01-08 10:17:46 +00:00
wiz
d0cda447c0 Fix matomo hostname for bisq.markets html 2022-01-08 19:05:06 +09:00
wiz
fd288cd106 Merge pull request #1100 from mempool/simon/configurable-network-urls
Making frontend network URLs configurable
2022-01-08 10:01:52 +00:00
wiz
2d0d7df704 Merge pull request #1102 from mempool/simon/bisq-footer-buttons
Bisq: Adding missing privacy policy, locale selector
2022-01-08 09:37:05 +00:00
softsimon
c41ac34978 Bisq: Adding missing privacy policy, locale selector
fixes #1096
2022-01-07 23:38:31 +04:00
softsimon
47307bc755 Making frontend network URLs configurable
fixes #1095
2022-01-07 20:17:14 +04:00
wiz
bfe5d3ae49 Merge pull request #1099 from mempool/simon/transifex-pull 2022-01-07 09:27:52 +00:00
softsimon
a060816e2c Transifex pull 2022-01-07 12:32:23 +04:00
wiz
898ff5da23 Merge pull request #1093 from mempool/simon/transifex-pull
Transifex pull
2022-01-06 08:33:58 +00:00
softsimon
d78d2c0eca Transifex pull 2022-01-06 12:32:08 +04:00
wiz
a08e77ff3e Merge pull request #1092 from mempool/simon/transifex-pull 2022-01-05 20:17:54 +00:00
softsimon
1e39eb0fa5 Transifex pull 2022-01-06 00:04:02 +04:00
wiz
5de133ae6a Merge pull request #1087 from mempool/simon/removing-sql-import-references
Remove all references to SQL tables import
2022-01-05 10:03:36 +00:00
softsimon
d27b125848 Merge branch 'master' into simon/removing-sql-import-references
# Conflicts:
#	production/README.md
2022-01-05 13:51:58 +04:00
wiz
ad36d53bb5 Merge pull request #1081 from mempool/wiz/update-production-configuration-for-v2.3
Update production configurations + README for v2.3
2022-01-05 09:45:57 +00:00
softsimon
24f76f2f37 Remove all references to SQL tables import
fixes #1045
2022-01-05 13:26:36 +04:00
wiz
691bdda523 Merge pull request #1086 from mempool/simon/transifex-pull
Transifex pull
2022-01-05 09:19:03 +00:00
wiz
81bb31090e Use upstream hostnames in production nginx configuration 2022-01-05 18:12:05 +09:00
softsimon
cc0a0719b6 Transifex pull 2022-01-05 13:10:58 +04:00
softsimon
7dca8ae1a0 Merge pull request #1085 from mempool/wiz/add-citadel-to-about-page
Add Citadel as Community Integration on About page
2022-01-05 13:04:50 +04:00
softsimon
84027d5568 Merge pull request #1084 from mempool/wiz/tweak-page-titles-descriptions
Tweak html description meta tags / SEO service page titles
2022-01-05 13:04:09 +04:00
wiz
4116186c1a Add Citadel as Community Integration on About page 2022-01-05 17:15:11 +09:00
wiz
358301020f Tweak html description meta tags / SEO service page titles 2022-01-05 16:57:24 +09:00
wiz
642022bfd8 Merge pull request #1083 from mempool/simon/transifex-pull
Transifex pull
2022-01-05 01:52:26 +00:00
softsimon
70f25b6c9c Transifex pull 2022-01-04 22:43:09 +04:00
wiz
c778e84247 Add missing } at end of nginx/server-common.conf 2022-01-04 17:27:37 +09:00
wiz
4de1d017ad Update production configurations + README for v2.3
* Refactor production nginx configuration files
* Update README for new networks, SQL, etc.
2022-01-04 16:38:12 +09:00
wiz
61851be23a Merge pull request #1079 from mempool/simon/liquid-fee-range-dropdown
Liquid support to the Graph fee filter dropdown
2022-01-04 04:51:10 +00:00
wiz
5de949eaed Merge pull request #1067 from mempool/simon/liquid-testnet-navbar-color
Liquid testnet navbar color
2022-01-04 04:32:12 +00:00
wiz
de6434a5ba Merge pull request #1080 from mempool/simon/liquid-testnet-asset-data
Fixing missing assets data for Liquid Testnet native asset
2022-01-04 04:24:19 +00:00
softsimon
c8639ec71d Fixing missing assets data for Liquid Testnet native asset
fixes #1068
2022-01-04 05:26:46 +04:00
softsimon
e1275c62cc Liquid support to the Graph fee filter dropdown
fixes #1072
2022-01-04 04:42:19 +04:00
softsimon
be45e88056 Liquid testnet navbar color 2022-01-01 13:37:20 +04:00
softsimon
990ab3da5f Merge pull request #1066 from mempool/simon/liquid-backend-detection-refactor
Refactoring the Liquid and LiquidTestnet check to a common function.
2022-01-01 12:54:39 +04:00
wiz
d1d74ebf37 Merge pull request #1065 from mempool/simon/block-navigation-routing-fix
Block navigation routing fix
2021-12-30 22:31:05 +00:00
softsimon
6ab79b3c35 Refactoring the Liquid and LiquidTestnet check to a common function. 2021-12-31 02:28:40 +04:00
softsimon
4f21fc0d87 Block navigation routing fix 2021-12-31 02:21:12 +04:00
wiz
10c4e47091 Merge pull request #1064 from mempool/wiz/add-liquidtestnet-to-upgrade-script
Add missing liquidtestnet backend to upgrade script
2021-12-30 21:59:37 +00:00
wiz
dd49ff0084 Merge pull request #1062 from mempool/simon/liquidtestnet-backend-fix
Fix backend support for 'liquidtestnet' network
2021-12-30 21:56:55 +00:00
wiz
853314ba58 Add missing liquidtestnet backend to upgrade script 2021-12-31 06:55:16 +09:00
wiz
784e2470df Merge pull request #1060 from mempool/simon/coinbase-unknown-fix
Fixing misplaced Unknown text after the Coinbase
2021-12-30 21:30:18 +00:00
softsimon
350b4922da Fix backend support for 'liquidtestnet' network 2021-12-31 01:26:45 +04:00
softsimon
40fb1792f4 Fixing misplaces Unknown text after the Coinbase 2021-12-30 16:55:42 +04:00
wiz
7ce1cc5103 Merge pull request #1052 from mempool/simon/liquid-testnet
Adding Liquid Testnet as frontend option
2021-12-29 23:34:19 +00:00
wiz
71a4e24900 Delete duplicate production/mempool-config.liquid-testnet.json file 2021-12-30 08:25:44 +09:00
softsimon
a48c2c07b0 Display the transaction grapg instead of L-BTC peg for Liquid Testnet 2021-12-30 03:12:35 +04:00
softsimon
d89d7efbe6 Fix issue when switching between testnet and liquid mainnet 2021-12-30 03:07:08 +04:00
softsimon
5ea4b043d9 Use relativeUrl when redirecting from the Searchbar 2021-12-30 02:30:46 +04:00
softsimon
dd4710b602 Handle Liquid native asset issuance transaction. 2021-12-30 02:18:16 +04:00
wiz
832c0cb3cc Merge pull request #1057 from mempool/wiz/remove-hover-effect-on-about-page
Tweak hover effect on profile photos on About page
2021-12-29 22:03:23 +00:00
wiz
04216e952a Tweak hover effect on profile photos on About page 2021-12-30 06:48:40 +09:00
softsimon
951d0f0039 Merge pull request #1056 from mempool/wiz/update-specter-logo-on-about-page
Update Specter logo on About page
2021-12-30 01:33:20 +04:00
wiz
706f4bbc55 Update Specter logo on About page 2021-12-30 06:11:12 +09:00
softsimon
3fd96e412b Merge pull request #1053 from mempool/wiz/add-liquid-testnet-backend
Add support for liquidtestnet in production backend and nginx
2021-12-29 01:07:38 +04:00
softsimon
766803ded1 Liquid testnet asset frontend support 2021-12-29 00:42:34 +04:00
softsimon
504f46cad9 Support for Test Liquid Native Asset 2021-12-29 00:40:55 +04:00
softsimon
fd34761a93 Adding Liquid Testnet as frontend option
fixes #976
2021-12-28 11:16:33 +04:00
wiz
96e8f45e5b Add support for liquidtestnet in production backend and nginx 2021-12-28 15:20:11 +09:00
wiz
195fae670b Merge pull request #1044 from nymkappa/feature/increase-resolution-charts
Increase graphs data resolution
2021-12-28 05:19:20 +00:00
wiz
dd767f9468 Merge pull request #1043 from mempool/simon/transifex-pull
Pulled from transifex
2021-12-26 21:09:07 +00:00
nymkappa
bc8104eeb4 Increase graphs data resolution 2021-12-26 17:51:38 +09:00
softsimon
2c61eb6227 Pulled from transifex 2021-12-26 11:15:19 +04:00
wiz
5d360d4156 Merge pull request #1003 from mempool/simon/database-migration-feature
Automated database creation and migration
2021-12-23 21:50:10 +00:00
softsimon
91e30fbc3c Merge branch 'master' into simon/database-migration-feature
# Conflicts:
#	backend/src/index.ts
2021-12-24 00:26:33 +04:00
wiz
5b22e2a000 Merge pull request #1010 from mempool/simon/liquid-icons-api
Liquid icons api
2021-12-23 12:28:54 +00:00
softsimon
533653e54a Change Asset Icon API example to only show HTML 2021-12-23 15:35:17 +04:00
wiz
3dc0dc13ad Merge pull request #1038 from nymkappa/feature/increase-resolution-24h
Switch the 24h chart to 1 min data ticks
2021-12-22 18:33:32 +00:00
softsimon
e332789afc Bumping mempool.js to 2.3.0-dev1 and removing unused tsc build step 2021-12-22 19:33:10 +04:00
nymkappa
e4a9fd06b4 Switch the 24h chart to 1 min data ticks 2021-12-22 23:01:32 +09:00
softsimon
5845f2380e Adding sync external assets feature. 2021-12-21 02:00:50 +04:00
softsimon
c29311d831 Upgrading mempool-js with separated Liquid and Bisq 2021-12-20 23:48:26 +04:00
softsimon
252db109bc Adding icons.json to .gitignore 2021-12-20 04:01:40 +04:00
softsimon
b1c9334119 Changing API path and updating API Docs for asset icons. 2021-12-20 04:01:04 +04:00
wiz
ab04247726 Merge pull request #1033 from mempool/simon/extract-i18n
Extracting i18n string
2021-12-19 19:06:11 +00:00
softsimon
e94a85b989 Extracting i18n string 2021-12-19 22:57:31 +04:00
softsimon
a4569788f8 Liquid icons api 2021-12-19 22:09:49 +04:00
wiz
b455814e90 Merge pull request #1027 from hunicus/change-docs-layout
Revamp docs layout
2021-12-19 17:48:26 +00:00
softsimon
7afd0f3fe7 Merge pull request #1032 from mempool/wiz/update-about-page-links
Update links on About page
2021-12-19 21:36:10 +04:00
hunicus
a2a85469cf Streamline api-docs-navs conditionals 2021-12-19 12:29:52 -05:00
wiz
94488a6029 Merge pull request #1031 from mempool/wiz/update-issue-templates
Update GitHub issue templates to redirect support requests to chat
2021-12-19 17:02:57 +00:00
wiz
8e4829146a Rename About page section: Project Staff -> Project Members 2021-12-20 01:54:06 +09:00
wiz
08f185525c Update About page chat links: replace telegram with matrix 2021-12-20 01:52:58 +09:00
wiz
d6b00fe39e Update GitHub issue templates to redirect support requests to chat 2021-12-20 01:31:29 +09:00
softsimon
cec3baeaa4 Merge pull request #1024 from nymkappa/feature/blocks-mouse-scroll
User can drag the blockchain blocks horizontally with the mouse
2021-12-19 12:59:04 +04:00
nymkappa
6e59733cac User can drag the blockchain blocks horizontally with the mouse 2021-12-19 15:20:21 +09:00
hunicus
c5b705ede7 Adjust bisq cypress tests 2021-12-17 16:22:16 -05:00
hunicus
2819e24efe Remove unnecessary file change 2021-12-17 15:08:21 -05:00
hunicus
5f9bc4497a Customize mobile nav button appearance point
Since there are different numbers of topics across
bitcoin, liquid, bisq, faq, etc.
2021-12-17 14:42:21 -05:00
hunicus
086b14e816 Add various ux improvements for mobile doc menu 2021-12-17 11:42:54 -05:00
hunicus
958bfe6d25 Separate docs-nav into new component
Since same markup will be needed for desktop
and mobile menus.
2021-12-16 19:11:54 -05:00
hunicus
e01ab449cf Add skeleton for mobile docs nav 2021-12-16 18:44:39 -05:00
softsimon
eeb0f403a3 Merge pull request #1016 from knorrium/add_failing_test_for_liquid_unconfidential_address
Add failing test for Liquid unconfidential address layout issue
2021-12-16 23:01:24 +04:00
hunicus
9a18019d9d Add :before element for space before anchors
@angular-router's `scrollOffset` property seems to be
global, so it might mess up something else, and it also
wasn't taking effect when navigating directly to an
anchor anyway (i.e. from browser's address bar).
2021-12-16 13:20:30 -05:00
Felipe Knorr Kuhn
bcbc60b456 Fix test assertion 2021-12-16 09:31:02 -08:00
Felipe Knorr Kuhn
0d14c30892 Merge remote-tracking branch 'origin/master' into add_failing_test_for_liquid_unconfidential_address 2021-12-16 09:14:46 -08:00
hunicus
5d8c970351 Update anchor links and add on-page links 2021-12-16 11:30:03 -05:00
hunicus
89fede9e48 Fix inconsistencies in api-docs markup 2021-12-16 09:54:07 -05:00
hunicus
f8a54784d0 Improve styling + switch section headings for tags 2021-12-16 09:54:07 -05:00
hunicus
010381aac4 Convert accordions to plain html 2021-12-16 08:46:51 -05:00
wiz
49c30c7237 Merge pull request #1018 from mempool/simon/liquid-address-overflow–fix
UX: Fixing overflowing unconfidential Liquid address
2021-12-16 07:39:26 +00:00
wiz
7ba0055c61 Merge pull request #1019 from mempool/simon/witness-interface-type-fix
Correcting minor interface typing error
2021-12-16 07:38:57 +00:00
wiz
72b631a4dc Merge pull request #1017 from mempool/simon/restoring-fee-distribution-graph
Revert "Remove dead code FeeDistributionGraphComponent"
2021-12-16 07:38:31 +00:00
hunicus
1a8fd23b05 Add links and styling to fixed desktop docs nav 2021-12-16 00:04:47 -05:00
Felipe Knorr Kuhn
b9a2143a5a Merge remote-tracking branch 'origin/master' into add_failing_test_for_liquid_unconfidential_address 2021-12-15 20:16:22 -08:00
hunicus
3ae46e6ba1 Make desktop docs-nav sticky on scroll 2021-12-15 22:57:10 -05:00
softsimon
815fb62e7d Correcting minor interface typing error 2021-12-16 04:53:27 +04:00
softsimon
7a19da560e UX: Fixing overflowing unconfidential Liquid address
fixes #1013
2021-12-16 04:49:24 +04:00
softsimon
43a1af4509 Revert "Remove dead code FeeDistributionGraphComponent"
This reverts commit 37722fe165.
2021-12-15 23:53:12 +04:00
hunicus
40f1949654 Create skeleton layout for desktop docs nav
This includes switching to a 2-column layout
(1 for nav and 1 for content) and moving footer
links to docs component so floats can be cleared
properly.
2021-12-15 13:17:37 -05:00
softsimon
cf1471acca Merge pull request #1015 from knorrium/add_tests_for_rbf_txs
Add tests for RBF txs
2021-12-15 21:28:45 +04:00
Felipe Knorr Kuhn
a2a69e522c Merge remote-tracking branch 'origin/master' into add_failing_test_for_liquid_unconfidential_address 2021-12-15 08:51:08 -08:00
Felipe Knorr Kuhn
4939941c88 Merge remote-tracking branch 'origin/master' into add_tests_for_rbf_txs 2021-12-15 08:50:28 -08:00
softsimon
a643f50016 Merge pull request #1012 from mempool/simon/cpfp-button-overlap-fix
Correcting CPFP button position on mobile
2021-12-15 13:11:04 +04:00
softsimon
836444a1c5 Merge pull request #1011 from mempool/simon/rbf-transaction-ux-bug
Fixing broken RBF alert
2021-12-15 13:10:31 +04:00
Felipe Knorr Kuhn
24d4b643e5 Add failing test for Liquid unconfidential address layout issue 2021-12-15 00:02:21 -08:00
Felipe Knorr Kuhn
7f045ae5b9 Add tests to detect layout issues in RBF transactions 2021-12-14 23:21:59 -08:00
Felipe Knorr Kuhn
96a2c8ab4e Add methods to detect overlapping components 2021-12-14 23:21:40 -08:00
Felipe Knorr Kuhn
47103d85d3 Update mocked ws tests to use the new syntax 2021-12-14 23:19:10 -08:00
Felipe Knorr Kuhn
0af5d733c4 Small refactor to support mocking RBF txs 2021-12-14 23:16:13 -08:00
Felipe Knorr Kuhn
bc7bbf5fe5 Fix formatting 2021-12-14 23:15:33 -08:00
Felipe Knorr Kuhn
4bc141cd67 Add fixture for RBF transactions 2021-12-14 23:14:55 -08:00
softsimon
1c6b3a46c6 Correcting CPFP button position on mobile
fixes #1006
2021-12-15 02:16:45 +04:00
softsimon
b41e32915f Fixing broken RBF alert
fixes #516
2021-12-15 01:15:16 +04:00
wiz
adb5bfe93f Merge pull request #1009 from mempool/wiz/tweak-xaxis-label-timestamp-format
Tweak the graph x-axis label date formatting for better i18n
2021-12-14 09:48:37 +00:00
wiz
f4b7bbc91c Tweak the graph x-axis label date formatting for better i18n 2021-12-14 18:25:48 +09:00
wiz
687b4af272 Merge pull request #1008 from mempool/wiz/blockstream
Add Blockstream as Enterprise Sponsor
2021-12-14 09:04:20 +00:00
wiz
e67f552fbd Merge pull request #1004 from jorisvial/bug/improve-x-axis-intervals
Improve x-axis labels and graph data ticks
2021-12-14 07:50:14 +00:00
nymkappa
28d3f190ff Update graph tick intervals - Hide label in zoom component - Show hour on 1y graphs 2021-12-14 16:33:17 +09:00
softsimon
2281116504 Automated database creation and migration
fixes #1002
2021-12-13 11:32:04 +04:00
nymkappa
92d745168c Doubled the data points for 1W and 3Y to improve resolution 2021-12-13 14:31:34 +09:00
nymkappa
cf0af20947 Hide xaxis label overlapping - Show current day/month/year below the chart for self better self containing overview 2021-12-13 14:27:05 +09:00
nymkappa
aee319ed51 Initialize graphWindowPreference in localstorage properly 2021-12-13 11:56:24 +09:00
wiz
dc5ced416d Add Blockstream as Enterprise Sponsor 2021-12-12 04:24:18 +09:00
nymkappa
c9f5002dc2 Use avg() mysql value for timespan between [24h, 6m] 2021-12-11 19:15:20 +09:00
nymkappa
6e4985602e Increase the number of data to be as close as possible from prod while keeping rounded intervals 2021-12-11 17:27:52 +09:00
nymkappa
11577842a2 Refactor tooltip formatting into common file and switch to native js localization 2021-12-11 17:10:55 +09:00
wiz
1cc8a9469a Merge pull request #1001 from mempool/simon/i18n-extraction
Extracting updated i18n strings
2021-12-11 06:43:39 +00:00
nymkappa
7e7dbdbaf2 Remove test code 2021-12-11 15:43:20 +09:00
nymkappa
fb152b6d7b Merge branch 'master' into bug/improve-x-axis-intervals 2021-12-11 15:32:10 +09:00
nymkappa
9e8a741d97 Apply proper datetime format according to choosen time scale and force 2h windowPreference in the dashboard 2021-12-11 15:26:59 +09:00
nymkappa
2b0d543ce7 Delete unused code 2021-12-11 15:26:14 +09:00
nymkappa
5e729373bb Use date interval so we leave mysql handle the number of days in a month etc 2021-12-11 15:26:02 +09:00
nymkappa
41f3f0ab46 Fix graph data for incoming transaction graphs 2021-12-11 10:38:13 +09:00
nymkappa
37722fe165 Remove dead code FeeDistributionGraphComponent 2021-12-11 00:24:10 +09:00
nymkappa
cbd187d06f Use time for xAxis type and fix the mempool tooltip accordingly 2021-12-11 00:04:20 +09:00
softsimon
833dd3ef9d Extracting updated i18n strings 2021-12-10 11:22:25 +04:00
softsimon
bd19496350 Merge pull request #1000 from knorrium/liquid_peg_tests
Add Liquid peg in and peg out tests
2021-12-10 11:19:28 +04:00
Felipe Knorr Kuhn
ec420d8f3e Disable Chrome security to allow Cypress to navigate out of localhost 2021-12-09 15:49:15 -08:00
Felipe Knorr Kuhn
9510c7d2ea Add tests for Liquid peg in and peg out addresses 2021-12-09 15:48:58 -08:00
wiz
92d2eb9727 Merge pull request #999 from mempool/simon/documentation-i18n-title 2021-12-09 14:22:50 +00:00
softsimon
72f7284311 Documentation i18n title 2021-12-09 17:49:36 +04:00
nymkappa
2b3463519a Format date properly according to the chosen time scale 2021-12-09 22:29:40 +09:00
nymkappa
00352d7e36 Use "natural" intervals for x-axis in charts 2021-12-09 22:04:23 +09:00
wiz
63e799b225 Merge pull request #998 from mempool/simon/transifex-pull
Pulling from Transifex
2021-12-09 13:04:20 +00:00
wiz
3c1e264464 Merge pull request #994 from hunicus/move-api-docs
Move /api to /docs/api
2021-12-09 12:56:46 +00:00
hunicus
ff148f15c4 Exclude websocket tab on bisq 2021-12-09 07:46:06 -05:00
softsimon
a5c7f152aa Pulling from Transifex 2021-12-09 16:42:41 +04:00
hunicus
f0be19409f Fix relative links on docs tabs 2021-12-09 07:11:04 -05:00
hunicus
936a306dc4 Remove extra padding in websocket api docs tab 2021-12-09 07:01:58 -05:00
hunicus
8ff5748368 Make nav url relative to fix non-mainnet links 2021-12-09 07:01:46 -05:00
softsimon
271726bf58 Merge pull request #996 from mempool/wiz/fix-upgrade-script-for-simon
Tweak upgrade script to search for remote origin branches
2021-12-09 14:29:28 +04:00
wiz
65e11c1aa1 Merge pull request #997 from mempool/simon/backend-libs-upgrade
Upgrading backend libraries
2021-12-09 10:27:59 +00:00
softsimon
0ccc992e4b Merge pull request #995 from hunicus/fix-windows-graph
Fix graph issue in #992
2021-12-09 14:17:51 +04:00
wiz
52397cb341 Merge pull request #993 from mempool/simon/angular-13
Upgrading frontend to Angular 13
2021-12-09 10:16:54 +00:00
softsimon
f7a9b691a8 Upgrading backend libraries 2021-12-09 13:24:29 +04:00
wiz
8f8c9c1fbc Merge pull request #986 from mempool/simon/liquid-peg-in-out-links-fix
Fixing broken Liquid peg-in and peg-out links
2021-12-09 09:21:41 +00:00
wiz
9e8ee4fedc Tweak upgrade script to search for remote origin branches 2021-12-09 18:12:06 +09:00
hunicus
30ffc0b56e Fix graph issues in #992 2021-12-08 17:50:02 -05:00
softsimon
053fb4d1b2 Merge pull request #991 from knorrium/add_nvmrc
Add .nvmrc file
2021-12-08 23:06:30 +04:00
softsimon
53cfda533d Merge pull request #989 from knorrium/update_cypress_deps
Update Cypress dependencies
2021-12-08 22:57:50 +04:00
softsimon
2d557195de Merge pull request #988 from knorrium/pin_node_version_on_gha
Pin node version on e2e GHA
2021-12-08 22:57:24 +04:00
softsimon
ed9b46bae0 Upgrading frontend to Angular 13 2021-12-08 22:08:20 +04:00
hunicus
23c9bf489a Move /api to /docs/api
Also make API docs responsive so they can be viewed
on mobile.

REST docs are at /docs/api/rest and WebSocket docs
are at /docs/api/websocket.
2021-12-08 12:37:42 -05:00
softsimon
7c89dde5d4 Merge pull request #983 from mempool/wiz/fix-about-page-staff-string
Fix string for Project Staff on About page
2021-12-08 14:36:20 +04:00
softsimon
87ca5b85d7 Fixing broken Liquid peg-in and peg-out links
fixes #977
2021-12-08 11:50:51 +04:00
Felipe Knorr Kuhn
a2a43f4647 Add .nvmrc to set node to 16.10.0 when changing into the project 2021-12-07 22:55:10 -08:00
Felipe Knorr Kuhn
9ac77f7113 Update Cypress dependencies 2021-12-07 22:25:10 -08:00
Felipe Knorr Kuhn
b6215dd54f Enable dependency caching on e2e GHA 2021-12-07 21:27:22 -08:00
Felipe Knorr Kuhn
69d5cfe98e Use node 16.10.0 on the e2e GHA 2021-12-07 21:22:21 -08:00
wiz
73d9cd7ab7 Merge pull request #981 from mempool/wiz/fix-npm-install-prod
Move npm deps in package.json to fix `npm install --prod`
2021-12-08 04:24:48 +00:00
wiz
84a6d29914 Fix i18n identifier for About Page -> Project Staff string
Co-authored-by: softsimon <softsimon@users.noreply.github.com>
2021-12-08 04:16:34 +00:00
wiz
4633164f99 Merge pull request #984 from mempool/wiz/update-readme-for-v2.3.0
Update README for upcoming v2.3.0 release
2021-12-08 04:15:32 +00:00
wiz
b22b63c9a2 Update README for upcoming v2.3.0 release 2021-12-08 00:04:24 +09:00
wiz
40cd2a1ac3 Fix string for Project Staff on About page 2021-12-07 23:29:17 +09:00
wiz
e28f5cc403 Merge pull request #982 from mempool/simon/core-contributors
Adding Core Contributors on the About page
2021-12-07 14:16:44 +00:00
softsimon
1594fed853 Adding Core Contributors on the About page 2021-12-07 18:00:49 +04:00
wiz
41c61ef506 Move npm deps in package.json to fix npm install --prod 2021-12-07 10:42:06 +00:00
wiz
53b0bc0e48 Merge pull request #980 from knorrium/docker_node_16_10_0
Set Dockerfiles to use Node v16.10.0
2021-12-07 08:04:53 +00:00
Felipe Knorr Kuhn
e00234dfb9 Set Dockerfiles to use Node v16.10.0 2021-12-06 23:52:23 -08:00
wiz
8412e28073 Merge pull request #974 from mempool/simon/taproot-display-missing-script
Display missing taproot inner script
2021-12-07 07:26:29 +00:00
softsimon
10a110e682 Display missing taproot inner script
fixes #973
2021-12-06 00:27:14 +04:00
softsimon
1e40ec4fd0 Merge pull request #970 from mempool/wiz/center-enterprise-sponsor-logos
Center the Enterprise Sponsor logos on About page
2021-12-03 12:08:06 +04:00
wiz
9998a64fa5 Center the Enterprise Sponsor logos on About page 2021-12-03 16:55:56 +09:00
wiz
d1e3c55a28 Merge pull request #967 from mempool/wiz/rename-square-to-spiral 2021-12-03 06:26:35 +00:00
softsimon
047220bd32 Merge pull request #968 from mempool/i18n/20211203-update-from-transifex
Update i18n strings from Transifex
2021-12-03 10:25:19 +04:00
wiz
1ce05a3ac9 Merge pull request #961 from mempool/simon/remodeling-fee-bands
Remodeling how historical fees are stored and presented.
2021-12-03 02:37:33 +00:00
wiz
0271584b69 Update i18n strings from Transifex 2021-12-03 08:54:13 +09:00
wiz
01da46daca Square -> Spiral 🌀 2021-12-03 07:30:24 +09:00
wiz
73f558db6e Merge pull request #963 from mempool/simon/liquid-handle-database-disabled 2021-11-30 10:50:19 +00:00
softsimon
feb8e35ec3 Handle database disabled config when running Liquid
fixes #962
2021-11-30 10:59:10 +04:00
softsimon
79e44479e9 Remodeling how historical fees are stored and presented.
fixes #908
2021-11-29 23:31:01 +04:00
wiz
9a39d3207f Merge pull request #959 from mempool/simon/lbtc-loading-spinner
Adding missing loading spinner to L-BTC peg graph
2021-11-28 12:13:23 +00:00
softsimon
7e55e836fd Adding missing loading spinner to L-BTC peg graph
fixes #955
2021-11-28 15:44:42 +04:00
softsimon
571bf3fa64 Merge pull request #957 from mempool/simon/merging-duplicate-i18n-strings
Merged block header and markets i18n strings
2021-11-28 14:57:43 +04:00
softsimon
0b1cf052a8 Merged block header, markets and genesis i18n strings 2021-11-28 14:55:17 +04:00
wiz
b301840bb8 Merge pull request #956 from mempool/simon/i18n-extract-nov28
Extracting i18n from templates
2021-11-28 09:31:56 +00:00
softsimon
a0e5a79ec4 Extracting i18n from templates 2021-11-28 13:23:27 +04:00
wiz
8da89230c9 Merge pull request #944 from mempool/simon/chart-loading-spinner
Moving chart loading spinner to chart component
2021-11-28 08:19:52 +00:00
wiz
2408e81537 Merge pull request #954 from mempool/simon/transaction-pages-and-loading
Fixing Bisq transactions page and skeleton loaders
2021-11-28 08:16:36 +00:00
softsimon
9377d80dbb Fixing Bisq transactions page and skeleton loaders
fixes #953
2021-11-27 13:06:57 +04:00
softsimon
8c200bc0e4 Merge pull request #950 from MiguelMedeiros/fix-time-span-styles
Fix time span menu styles.
2021-11-23 14:13:33 +04:00
Miguel Medeiros
35ca8c846b fix: time span menu media queries styles. 2021-11-22 20:29:10 -03:00
softsimon
4b1acfc77e Skip the skeleton loader tests 2021-11-20 00:34:59 +04:00
softsimon
8569523b89 Moving chart loading spinner to chart component
fixes #885
2021-11-19 00:10:12 +04:00
wiz
9bef7da210 Merge pull request #881 from mempool/simon/tx-push-endpoint
Post TX API for HTML forms
2021-11-18 22:40:55 +09:00
softsimon
6f6b2a4355 Post TX API for HTML forms 2021-11-18 17:25:48 +04:00
softsimon
783530b3de Merge pull request #943 from mempool/wiz/20211118-update-privacy-policy
Delete nginx logs after 10 days and explain this in our Privacy Policy
2021-11-18 16:37:58 +04:00
wiz
36777a8c5b Clarify webserver logging and analytics in our Privacy Policy 2021-11-18 17:05:34 +09:00
wiz
638d6d896a Update newsyslog-mempool-nginx.conf for all nginx log paths 2021-11-18 15:28:44 +09:00
wiz
2afb9d359f Merge pull request #942 from mempool/i18n/enable-thai
Enable i18n locale Thai (th)
2021-11-18 14:41:04 +09:00
wiz
60a8d0ce6e Update i18n translations for Thai (th) 2021-11-18 14:29:36 +09:00
wiz
e3aeb784ad Merge pull request #935 from MiguelMedeiros/fix-tooltip-opreturn
Fix: op_return tooltip position.
2021-11-17 22:58:29 +09:00
wiz
8124274880 Credit Gusb3ll as Thai translator 2021-11-17 22:18:38 +09:00
wiz
836f0f065d Enable i18n locale Thai (th) 2021-11-17 21:03:35 +09:00
wiz
062fdb3658 Don't change cursor when hovering over OP_RETURN 2021-11-17 20:06:24 +09:00
wiz
7cfbd2c70d Merge pull request #940 from mempool/simon/empty-mempool-block-position
Fix for empty mempool block position
2021-11-17 19:40:16 +09:00
wiz
5b9ae2eaf5 Merge pull request #941 from mempool/simon/hide-early-difficulty-adjustment
Handle recent difficulty adjustment estimate gracefully
2021-11-17 19:29:48 +09:00
softsimon
d534c42c47 Handle recent difficulty adjustment estimate gracefully
fixes #927
2021-11-17 13:46:48 +04:00
softsimon
15a0644bd1 Fix for empty mempool block position
fixes #938
2021-11-17 12:37:40 +04:00
wiz
6ad4e655ea Merge pull request #910 from mempool/simon/liquid-fee-ranges
Display lower <1 s/vB fee rate tiers for Liquid
2021-11-17 17:01:29 +09:00
softsimon
598920d6a9 Merge pull request #928 from knorrium/fix_local_dev_proxy
Fix local dev proxy
2021-11-17 09:38:10 +04:00
Miguel Medeiros
d816e67ce4 fix: op_return tooltip position. 2021-11-16 18:03:43 -03:00
wiz
662aafff57 Merge pull request #930 from mempool/simon/more-transaction-details
Adding version and locktime to transaction details
2021-11-16 06:18:01 +09:00
softsimon
cfec9345c8 Merge pull request #932 from MiguelMedeiros/fix-empty-mempool-blocks
Fix: mempool empty block.
2021-11-16 00:26:15 +04:00
Miguel Medeiros
9cb203f98a ref: remove function to better performance 2021-11-15 17:10:54 -03:00
Miguel Medeiros
3bab50a43b fix: blocksfull variable. 2021-11-15 16:38:28 -03:00
Miguel Medeiros
0639ce9b07 fix: mempool empty block. 2021-11-15 14:16:27 -03:00
softsimon
34c9ca4197 Adding version and locktime to transaction details
fixes #929
2021-11-15 18:05:28 +04:00
Felipe Knorr Kuhn
14d015a904 Set the local target to use the new local proxy config 2021-11-14 15:41:28 -08:00
Felipe Knorr Kuhn
38412753fe Add new local server proxy config 2021-11-14 15:40:45 -08:00
wiz
475f9344a0 Merge pull request #923 from mempool/simon/taproot-activation-countdown
Adding taproot countdown
2021-11-13 15:19:42 +09:00
softsimon
d9cf6a2604 Update frontend/src/app/app.constants.ts
Co-authored-by: Vojtěch Strnad <43024885+vostrnad@users.noreply.github.com>
2021-11-13 10:04:38 +04:00
softsimon
9eb159617f Adding taproot countdown 2021-11-12 21:07:57 +04:00
softsimon
2dc930fad2 Merge pull request #912 from MiguelMedeiros/taproot-activation-fireworks
Add special blocks animation: fireworks.
2021-11-12 13:30:54 +04:00
softsimon
c478478f86 Merge pull request #922 from knorrium/update_test_address
Update mainnet partial address tests
2021-11-12 10:23:35 +04:00
Felipe Knorr Kuhn
7a07f67be5 Update mainnet partial address tests 2021-11-11 21:56:19 -08:00
Miguel Medeiros
a3de75ebf4 Add mempool special block animation. 2021-11-11 16:04:00 -03:00
Miguel Medeiros
46a2854f67 Add taproot activation fireworks. 2021-11-11 16:04:00 -03:00
softsimon
033f066abf Merge pull request #898 from MiguelMedeiros/fix-translations-strings-tooltip-echarts
Localization: Add localize strings at echarts tooltip.
2021-11-11 15:28:49 +04:00
softsimon
97244c7b35 Merge pull request #921 from MiguelMedeiros/fix-button-menu-styles
Fix menu button styles.
2021-11-11 00:02:42 +04:00
Miguel Medeiros
3d92369ed6 fix: menu button styles. 2021-11-10 12:18:29 -03:00
wiz
2bee46951c Merge pull request #920 from mempool/simon/display-transaction-prevout-type
Display previous output types
2021-11-10 23:06:26 +09:00
wiz
61ffcd0065 Merge pull request #918 from mempool/simon/taproot-tag
Adding Taproot transaction tag
2021-11-10 22:58:02 +09:00
wiz
88e79c220f Merge pull request #902 from MiguelMedeiros/fix-nginx-docs
Doc: Fix nginx package name.
2021-11-10 22:33:34 +09:00
Miguel Medeiros
a2c21e9036 Add id to size string. 2021-11-10 10:26:26 -03:00
Miguel Medeiros
8a0316a562 Add localize strings at echarts tooltip. 2021-11-10 10:25:00 -03:00
softsimon
055c1f2aa5 Display previous output types
fixes #917
2021-11-10 16:17:03 +04:00
softsimon
88e48df8a9 Adding Taproot transaction tag
fixes #914
2021-11-10 15:05:45 +04:00
softsimon
b81d296635 Merge pull request #916 from mempool/wiz/enable-autocomplete-for-all-networks
Enable address autocomplete for all networks
2021-11-10 11:43:48 +04:00
wiz
9f68f57d8a Enable address autocomplete for all networks 2021-11-10 07:56:07 +01:00
softsimon
26a540a57c Display lower <1 s/vB fee rate tiers for Liquid
fixes #859
2021-11-10 00:04:58 +04:00
softsimon
ad8398e3d4 Merge pull request #897 from MiguelMedeiros/fix-rtl-menu-mobile
UI/UX: Fix rtl mobile header menu.
2021-11-06 01:50:51 +04:00
softsimon
0fabf8dbc3 Merge pull request #905 from MiguelMedeiros/add-2y-3y-graph-time-span
UI/UX: Add 2y and 3y statistics time span.
2021-11-05 23:09:35 +04:00
softsimon
cd63c6c0c1 Merge pull request #890 from MiguelMedeiros/fix-buttons-graph-page
UI/UX: Fix buttons positions at graphs page.
2021-11-04 13:21:00 +04:00
Miguel Medeiros
c95f75254b Add 2y and 3y statistics time span. 2021-11-01 22:06:10 -03:00
Miguel Medeiros
9e4ad51b79 Fix nginx docs. 2021-11-01 20:57:20 -03:00
Miguel Medeiros
6e35102b3a Fix rtl mobile header menu. 2021-11-01 11:11:50 -03:00
Miguel Medeiros
d1e72c0cc0 Fix loading icon position. 2021-10-29 10:46:16 -03:00
Miguel Medeiros
1925023eb2 fix: check buttons at graphs page 2021-10-29 10:04:30 -03:00
softsimon
377eb0cae5 Merge pull request #892 from MiguelMedeiros/fix-tooltip-echarts-liquid
UI/UX: Fix Liquid.network missing tooltip series name.
2021-10-29 13:28:21 +04:00
softsimon
e33e4b1d71 Merge pull request #873 from MiguelMedeiros/fix-height-title-components
UI/UX: Fix height inconsistencies between components.
2021-10-29 12:14:26 +04:00
softsimon
b8f3c1f124 Merge pull request #884 from mempool/simon/electrs-error-handling
Handle new type of Electrum Server error.
2021-10-29 11:29:49 +04:00
wiz
5333ec0b99 Merge pull request #893 from knorrium/e2e_base_module_cleanup
e2e BASE_MODULE cleanup
2021-10-28 14:30:06 +09:00
wiz
f761c5d966 Merge pull request #894 from knorrium/fe_dev_instructions 2021-10-28 14:13:58 +09:00
Felipe Knorr Kuhn
3b6d07cace Add instructions on how to contribute to the Frontend codebase 2021-10-27 21:50:51 -07:00
Felipe Knorr Kuhn
cbeeef3b2c Remove BASE_MODULE from the GHA env vars as we read from the config now 2021-10-27 20:52:50 -07:00
Felipe Knorr Kuhn
5dab44e6c4 Cleanup Cypress config and commands 2021-10-27 20:49:49 -07:00
Felipe Knorr Kuhn
5139ffb4df Update e2e tests BASE_MODULE resolution 2021-10-27 20:40:44 -07:00
Miguel Medeiros
06706be18f fix: Liquid missing tooltip serie name. 2021-10-27 01:58:54 -03:00
Miguel Medeiros
9264f3cf4f Fix title styles. 2021-10-26 21:47:28 -03:00
Miguel Medeiros
d6a9017267 Fix disable button font-size. 2021-10-26 21:47:27 -03:00
Miguel Medeiros
bad75cfd4e Fix address title styles.
Fix tx title margin right .
2021-10-26 21:47:27 -03:00
Miguel Medeiros
68240e4f5c Fix skeleton css styles. 2021-10-26 21:47:26 -03:00
Miguel Medeiros
9d9ff6ed91 Fix titles height inconsistencies. 2021-10-26 21:47:26 -03:00
softsimon
f19b84090a Merge pull request #887 from knorrium/fix_ws_api_docs
Fix ws api docs
2021-10-25 18:11:40 +04:00
Felipe Knorr Kuhn
85c4574cbd Update HTML template for the WS API examples 2021-10-24 22:47:50 -07:00
Felipe Knorr Kuhn
e2c4e42c81 Fix WS API examples 2021-10-24 22:47:02 -07:00
softsimon
dd6c26b079 Handle new type of Electrum Server error.
fixes #872
2021-10-23 11:46:38 +04:00
Felipe Knorr Kuhn
837992f7ea Route json assets based on the BASE_MODULE 2021-10-22 11:54:28 -07:00
Felipe Knorr Kuhn
40914236d4 Update references to the JS proxy config 2021-10-22 11:52:23 -07:00
Felipe Knorr Kuhn
f52c36093e Remove old json based proxy config 2021-10-22 11:51:52 -07:00
wiz
a9f4418e1a Merge pull request #880 from mempool/simon/transaction-output-id
Add output ID to transaction info
2021-10-20 22:32:31 +09:00
softsimon
1a37c8b116 Add output ID to transaction info
fixes #413
2021-10-20 15:44:43 +04:00
wiz
39d231bb3c Merge pull request #879 from mempool/simon/push-tx-form
Broadcast transaction form
2021-10-19 22:30:03 +09:00
softsimon
4046c3176f Broadcast transaction form
fixes #878
2021-10-19 17:10:30 +04:00
softsimon
c257fbfdcb Merge pull request #874 from MiguelMedeiros/fix-typo
Ref: Fix typo.
2021-10-18 16:26:07 +04:00
Miguel Medeiros
1659be0d9f Fix typo. 2021-10-12 10:54:14 -03:00
softsimon
6f9762d50b Merge pull request #868 from MiguelMedeiros/fix-tooltip-dashboard
UI/UX: Fix mempool chart tooltip at dashboard component.
2021-10-08 22:40:29 +04:00
Miguel Medeiros
9bf475bc97 Fix filter color. 2021-10-08 15:30:26 -03:00
Miguel Medeiros
e59a318cad Fix mempool chart tooltip at dashboard component. 2021-10-08 15:11:59 -03:00
softsimon
57b64f64ad Merge pull request #867 from MiguelMedeiros/fix-tooltip-charts
UI/UX: Fix fee rate tiers on graphs.
2021-10-08 21:54:36 +04:00
Miguel Medeiros
af3af5f099 Fix tooltip ranges. 2021-10-08 12:42:43 -03:00
softsimon
fec603d5c5 Merge pull request #866 from mempool/wiz/fix-ios-top-notch-color
Set the iOS status bar when viewing as progressive web app
2021-10-08 15:36:34 +04:00
softsimon
ed2ebb1c70 Merge pull request #862 from MiguelMedeiros/ui-tooltip-size
UI/UX: Make tooltip looks bigger on mempool fee chart.
2021-10-08 13:59:45 +04:00
wiz
14d2f8dd97 Set the iOS status bar when viewing as progressive web app 2021-10-08 18:23:21 +09:00
wiz
bf563cc195 Merge pull request #847 from MiguelMedeiros/add-filtering-mempool-charts
Add mempool chart filtering.
2021-10-08 09:54:28 +09:00
Miguel Medeiros
f66e0a2c12 Make tooltip style looks bigger 2021-10-07 16:19:57 -03:00
Miguel Medeiros
a43cd48795 Remove unecessary code to controle legends.
Fix order of active and inactive fee ranges.
2021-10-07 16:03:21 -03:00
Miguel Medeiros
44339daedf Add toggle button to dropdown menu.
Revert left margin from tv page.
Change text dropdown filter to icon.
Change dropdown inactive item color.
Revert 500 limit rate.
2021-10-07 14:20:06 -03:00
Miguel Medeiros
14b7b6427a Change dropdown button text. 2021-10-07 14:20:06 -03:00
Miguel Medeiros
a2e866d15a Change filters to dropdown selection menu. 2021-10-07 14:20:05 -03:00
Miguel Medeiros
c2f288a861 Add mempool chart filtering. 2021-10-07 14:20:05 -03:00
wiz
e1c943d0a7 Merge pull request #856 from mempool/simon/mempool-blocks-amount-display-fix
Display correct amount of mempool blocks on mobile
2021-10-07 08:03:42 +09:00
softsimon
fa2d2e60b5 Merge pull request #857 from mempool/wiz/fix-robots-txt
Remove sitemap.xml from robots.txt
2021-10-06 13:21:40 +04:00
wiz
c919980652 Remove sitemap.xml from robots.txt 2021-10-06 17:36:01 +09:00
softsimon
b48389ae7d Display correct amount of mempool blocks on mobile
fixes #854
2021-10-05 15:40:28 +04:00
wiz
2bac7f9987 Merge pull request #855 from mempool/simon/liquid-dashboard-update
Display mempool graph on the Liquid dashboard
2021-10-05 20:16:32 +09:00
softsimon
acf6fd9db5 Display mempool graph on the Liquid dashboard 2021-10-05 15:08:41 +04:00
wiz
74a9b65e81 Merge pull request #853 from mempool/simon/mempool-blocks-config-fix
Use MEMPOOL_BLOCKS_AMOUNT config in the frontend
2021-10-05 10:06:41 +09:00
softsimon
822c840e54 Use MEMPOOL_BLOCKS_AMOUNT config in the frontend
fixes #852
2021-10-05 04:37:24 +04:00
wiz
6e93ef68fe Merge pull request #848 from mempool/simon/update-preview-image
Update README preview image
2021-10-02 05:37:18 +09:00
wiz
3006deae6e Merge pull request #845 from MiguelMedeiros/add-dashed-line
Add mark line to mempool chart.
2021-10-02 05:36:09 +09:00
softsimon
740f5c2003 Update README.md 2021-10-01 21:45:20 +04:00
Miguel Medeiros
5c9d44e9eb Fix dotted line style at tx chart.
Remove dotted line from inverted mempool chart.
2021-10-01 00:35:08 -03:00
wiz
88527b41e7 Merge pull request #846 from MiguelMedeiros/fix-optimize-series-data
Remove vbytesPipe from series data.
2021-10-01 04:44:08 +09:00
Miguel Medeiros
83cce0c3a7 Remove vbytesPipe from series data. 2021-09-29 21:47:39 -03:00
Miguel Medeiros
e144d0c8e5 Add mark line to mempool chart. 2021-09-29 21:44:13 -03:00
wiz
d72dbc1415 Merge pull request #840 from MiguelMedeiros/fix-confirmation-button-position
Fix confirmations button positioning.
2021-09-30 05:46:08 +09:00
Miguel Medeiros
b857a7c37f Fix rtl transaction title. 2021-09-29 17:13:21 -03:00
Miguel Medeiros
c72c287b27 Fix confirmations button positioning. 2021-09-29 16:16:39 -03:00
wiz
18e0a17d26 Merge pull request #843 from MiguelMedeiros/fix-sum-bar-values
Fix total percentage bar value.
2021-09-30 03:59:44 +09:00
Miguel Medeiros
87eeef5d41 Fix total percentage bar value. 2021-09-29 15:12:54 -03:00
softsimon
76a2fdeea7 Merge pull request #839 from MiguelMedeiros/fix-shadowed-variable
Fix lint 'no-shadowed-variable'.
2021-09-29 17:20:39 +04:00
softsimon
792eb3727c Merge pull request #838 from MiguelMedeiros/fix-localized-numbers-mempool-charts
Fix parse numbers localized.
2021-09-29 17:16:48 +04:00
softsimon
2e0845847d Merge pull request #837 from MiguelMedeiros/fix-circle-dots-mempool-charts
Remove circle symbols when hovering the series.
2021-09-29 17:15:18 +04:00
Miguel Medeiros
8f774e55a8 Fix lint 'no-shadowed-variable'. 2021-09-28 21:04:48 -03:00
Miguel Medeiros
28418640bb Fix parse numbers localized. 2021-09-28 21:00:29 -03:00
Miguel Medeiros
8aae5c1c9c Remove circle symbols when hovering the series.
Fix selected index when hovering the series.
2021-09-28 20:13:08 -03:00
wiz
92048964d1 Merge pull request #831 from MiguelMedeiros/fix-sum-column-ui-mempool-chart
Change total sum column to fixed color.
2021-09-29 02:05:15 +09:00
Miguel Medeiros
b2140c2abe Change total sum column to fixed color. 2021-09-28 10:16:27 -03:00
wiz
d0a8509194 Merge pull request #826 from mempool/simon/bisq-transaciton-filter-fix
Fix for stuck Bisq transaction page when filtering
2021-09-27 19:20:28 +09:00
wiz
aa0c3e6fed Merge pull request #825 from MiguelMedeiros/fix-focus-effect-mempool-chart
Fix the focus effect on the mempool graph.
2021-09-27 19:12:49 +09:00
softsimon
f0462114f3 Fix for stuck Bisq transaction page when filtering
fixes #540
2021-09-27 02:37:57 +04:00
Miguel Medeiros
9e0f9840aa Fix the focus effect on the mempool graph. 2021-09-26 16:59:00 -03:00
wiz
d763c30f6a Merge pull request #824 from mempool/simon/lbtc-widget-minor-ux
L-BTC graph: Minor styling update
2021-09-27 04:07:23 +09:00
wiz
92b69657da Merge pull request #814 from mempool/simon/block-transactions-sorting-fix
Sort block transactions first by height and then time
2021-09-27 04:04:46 +09:00
wiz
d9ec0c1a36 Merge pull request #823 from MiguelMedeiros/fix-tooltip-inverted-chart
Fix tooltip mempool chart hover selection.
2021-09-27 04:03:34 +09:00
wiz
4bf9f8b062 Merge pull request #821 from mempool/simon/post-tx-api
Adding POST /tx API to bitcoind mode
2021-09-27 04:03:25 +09:00
softsimon
eefd8104bb L-BTC graph: Minor styling update 2021-09-26 22:57:37 +04:00
wiz
16e807c4b0 Fix API docs curl example for POST /api/tx 2021-09-27 03:49:20 +09:00
Miguel Medeiros
461296e002 Remove uncessary variable check. 2021-09-26 15:47:08 -03:00
softsimon
86c877c8e9 Adding POST /tx API to bitcoind mode
fixes #777
2021-09-26 22:46:23 +04:00
Miguel Medeiros
80fcceef73 Fix size column order when invert mempool chart. 2021-09-26 15:39:37 -03:00
Miguel Medeiros
b0e54818ae Fix mempool chart tooltip hover selection. 2021-09-26 15:24:29 -03:00
Miguel Medeiros
acbd7f0bde Fix inverted tooltip when invert chart. 2021-09-26 15:17:39 -03:00
wiz
9a6efceb34 Merge pull request #820 from MiguelMedeiros/add-inverted-button
UI/UX: Add inverted feature to mempool fee chart.
2021-09-27 01:36:06 +09:00
Miguel Medeiros
5ce7b55441 Add inverted chart feature. 2021-09-26 11:41:55 -03:00
wiz
a3edaf17cc Merge pull request #819 from mempool/simon/lpeg-liquid-test
Check for data to possibly fix Liquid test
2021-09-26 18:51:25 +09:00
softsimon
5695019216 Check for data to possibly fix Liquid test 2021-09-26 13:41:33 +04:00
wiz
7ab1ce8fc4 Merge pull request #813 from mempool/simon/significant-digits-fix
Fix for fee rounding not using locale
2021-09-26 05:25:21 +09:00
wiz
1f8ec2bd8e Merge pull request #812 from mempool/simon/liquid-block-hash-search-fix
Handle search for Liquid block hashes in search bar.
2021-09-26 05:15:06 +09:00
wiz
78b488466e Merge pull request #810 from mempool/simon/liquid-lbtc-dashboard-widget
L-BTC in circulation dashboard widgete
2021-09-26 05:10:47 +09:00
softsimon
66630743f6 L-BTC in circulation dashboard widget
refs #718
2021-09-25 23:45:10 +04:00
softsimon
ffa18bbe71 Sort block transactions first by height and then time
fixes #770
2021-09-25 16:28:11 +04:00
softsimon
8cb1c5c88c Fix for fee rounding not using locale
fixes #796
2021-09-25 15:50:31 +04:00
softsimon
bb07031362 Handle search for Liquid block hashes in search bar.
fixes #797
2021-09-25 14:37:54 +04:00
softsimon
31a0d44543 Merge pull request #809 from mempool/wiz/update-production-backend-configs
Update production backend configuration files
2021-09-24 22:00:12 +04:00
wiz
f90e19c767 Update production backend configuration files
* Set syslog priority to DEBUG since we're not Raspberry Pi
* Add 2nd core RPC configuration stubs for mainnet / liquid
2021-09-25 01:19:33 +09:00
wiz
800625d80e Merge pull request #799 from mempool/simon/liquid-lbtc-widget
Liquid L-BTC widgets (Backend)
2021-09-24 23:54:33 +09:00
wiz
552540f510 Merge pull request #806 from mempool/simon/angular-12-upgrade
Upgrading to Angular 12 and NgBootstrap 10
2021-09-23 05:10:52 +09:00
softsimon
bbee2dcb5b Upgrading to Angular 12 and NgBootstrap 10 2021-09-22 23:57:05 +04:00
softsimon
e4e338b05a Merge pull request #805 from mempool/wiz/update-unchained-url
Update the URL for Unchained Capital to unchained.com
2021-09-22 13:19:19 +04:00
wiz
061a55b236 Update the URL for Unchained Capital to unchained.com 2021-09-22 17:24:11 +09:00
softsimon
9f0f9230fb Merge pull request #804 from mempool/wiz/remove-warden-integration
Remove warden from list of Community Integrations
2021-09-22 11:13:07 +04:00
wiz
40956c0a23 Remove warden from list of Community Integrations 2021-09-22 02:19:48 +09:00
wiz
f29e35b325 Merge pull request #795 from MiguelMedeiros/bugfix-echarts-fixes
UI/UX: Fix charts css styling.
2021-09-22 02:07:43 +09:00
softsimon
d88efb8b0d Merge pull request #803 from mempool/wiz/add-zeus-integration
Add Zeus LN as Community Integration
2021-09-21 19:24:23 +04:00
Miguel Medeiros
b9489525c6 Revert charts margins. 2021-09-21 09:16:59 -03:00
Miguel Medeiros
8ddcd298b0 Fix axis labels css.
Change series smooth to false.
 Make charts margin smaller to match box container.
2021-09-21 09:16:59 -03:00
wiz
69df6e4dcb Add Zeus LN as Community Integration 2021-09-21 19:13:43 +09:00
softsimon
f3c8e2134b Handle errors gracefully. 2021-09-20 01:02:07 +04:00
wiz
0e25c52e67 Merge pull request #801 from mempool/simon/transifex-update 2021-09-20 02:02:12 +09:00
softsimon
60f41d3181 Transifex language fixes to Romanian, Makedonian and Hungarian. 2021-09-19 20:49:27 +04:00
wiz
50c5244abf Merge pull request #800 from mempool/simon/api-docs-hostname-fix
Always use local hostname for API examples.
2021-09-19 18:36:10 +09:00
softsimon
605c1a980c Always use local hostname for API examples. 2021-09-19 13:17:11 +04:00
softsimon
0d67bc36ee Refactoring the MINFEE node configuration into new configs. 2021-09-19 02:40:16 +04:00
softsimon
aa39bbd091 Elements blockchain parser. Save all peg in/out i the database. 2021-09-19 02:26:44 +04:00
softsimon
641d2ad028 Refactoring Bitcoin RPC client implementation 2021-09-18 13:18:47 +04:00
wiz
d602b20f56 Merge pull request #779 from mempool/simon/core-22-compatibility 2021-09-18 17:51:41 +09:00
softsimon
138f6e4e39 Update backend/src/api/bitcoin/bitcoin-api.interface.ts
Co-authored-by: Miguel Medeiros <miguel@miguelmedeiros.com.br>
2021-09-17 19:22:15 +04:00
softsimon
3e788ecbf9 Handle changes to address RPC api in bitcoin core 22
fixes #778
2021-09-17 19:22:15 +04:00
wiz
2236c6d9a6 Merge pull request #794 from mempool/simon/transifex-pull-20200917 2021-09-17 21:42:38 +09:00
softsimon
2a0a1b0213 Pulled from transifex 2021-09-17 16:27:24 +04:00
wiz
e6e49fd5d6 Merge pull request #793 from mempool/simon/credit-romanian-macedonian-translators 2021-09-17 20:49:14 +09:00
softsimon
f6d5f44469 Credit Romanian and Macedonian translators. 2021-09-17 14:19:53 +04:00
softsimon
51e09ff64f Merge pull request #775 from mempool/wiz/fix-canonical-name-for-three-sites
Set canonical URLs for new 3 site structure
2021-09-17 14:14:59 +04:00
softsimon
07ba2f6ecc Merge pull request #792 from mempool/i18n/add-macedonian
Add new locale: Macedonian (mk)
2021-09-17 13:54:03 +04:00
softsimon
bc42552bec Merge pull request #791 from mempool/i18n/add-romanian
Add new locale: Romanian (ro)
2021-09-17 13:53:35 +04:00
wiz
c6b44a3be9 Merge pull request #782 from TechMiX/rtlFixes
Fix RTL issues
2021-09-17 16:23:07 +09:00
wiz
e1f4de0de3 Set canonical URLs for new 3 site structure 2021-09-17 15:13:52 +09:00
wiz
d22dc0888a Add new locale: Macedonian (mk) 2021-09-17 15:03:52 +09:00
wiz
75fb27c690 Add new locale: Romanian (ro) 2021-09-17 15:02:15 +09:00
softsimon
401506a103 Merge pull request #789 from MiguelMedeiros/bugfix-echarts-mobile-mouseover
Disable mouseover legend for mobile users.
fixes #781
2021-09-17 03:24:10 +04:00
Miguel Medeiros
ab27ea28f0 Disable mouseover legend for mobile users. 2021-09-16 17:30:13 -03:00
softsimon
6e579ce0b6 Merge pull request #787 from mempool/wiz/disable-matomo-cookies
Disable matomo cookies - fixes #784
2021-09-16 17:45:37 +04:00
wiz
e7030cca32 Disable matomo cookies - fixes #784 2021-09-16 22:37:09 +09:00
TechMiX
2c496e9a50 add rtl hinting for new graph + move code rtl hints to style file 2021-09-15 12:06:55 +02:00
TechMiX
014d6dee66 fix various rtl issues 2021-09-15 11:02:04 +02:00
wiz
47ae306a75 Merge pull request #738 from MiguelMedeiros/feature-echarts
Feature: New charts library.
2021-09-15 11:08:11 +09:00
Miguel Medeiros
8b8b06e6ab Remove fee tier legends.
Fix tv page css.
2021-09-14 22:35:51 -03:00
Miguel Medeiros
fa7a45421e Fix linting and unclosed html tag.
Fix no shadowed variable tslint warning.
2021-09-14 22:35:51 -03:00
Miguel Medeiros
d376ba1c61 Move total MvB to the top.
Fix yAxis value.
Fix yAxis value.
Make disks smaller and transparent.
Change opacity on mouseover stack bars.
Add 4th column "sum of vsize" to tooltips table.
Add toggle show/hide tier fees.
Make progress active bar inline with text value.
Add a break line to the timestamp text.
Add colored progress bar with number.
2021-09-14 22:35:50 -03:00
Miguel Medeiros
388aa7fbe3 Fix y axis margin left. 2021-09-14 22:35:50 -03:00
Miguel Medeiros
34695146ee Change renderer to svg. 2021-09-14 22:35:50 -03:00
Miguel Medeiros
9020c618f0 Change renderer to svg.
Fix data structure of mempool graph.
Change tooltip total position (top).
Change tooltip visual of partial porcentage.
2021-09-14 22:35:49 -03:00
Miguel Medeiros
584d091d4e Fix indicator border-radius. 2021-09-14 22:35:49 -03:00
Miguel Medeiros
f434e50a2c Invert the tooltip legends order.
Fix default data to title tooltip MM/dd HH:mm.
Add symbol to tx chart tooltip .
Add accumulative total for tooltip information.
Add 3th column to tooltip with a progress bar.
Add and max span zoom span.
Add feeRate limit input to mempool graph component.
Add showZoom option to mempool graph component.
Remove start animation to match the layout for future SSR.
Remove mouse wheel zoom from small template.
Fix small template style.
2021-09-14 22:35:49 -03:00
Miguel Medeiros
1a7decb91d Add default data to title tooltip MM/dd HH:mm.
Add symbol to tx chart tooltip .
2021-09-14 22:35:48 -03:00
Miguel Medeiros
3574f8639e Add total sum to mempool chart.
Add zoom tools.
Add different theme for charts `big` and `small` (default).
Fix date format on mouseover.
Fix animations on graphs page.
Fix overflow tv page.
Remove `crosshair` on mouseover, changed to `line`.
Fix custom tooltip styles.
Remove inverted button (will add in a future PR).
Remove fee range labels (will add in a future PR).
Fix e2e testing.
2021-09-14 22:35:48 -03:00
Miguel Medeiros
9b956ff88d Add new component incoming-transactions-graph;
Refactor component mempool-graph;
Refactor component fee-distribution-graph;
Add incoming-transactions-graph to dashboard;
Add incoming-transactions-graph to statistics;
Add incoming-transactions-graph to television;
Add mempool-graph to dashboard;
Add mempool-graph to statistics;
Add mempool-graph to television;
Remove chartist.component;
2021-09-14 22:35:47 -03:00
Miguel Medeiros
1a98a14541 Add echart module. 2021-09-14 22:35:47 -03:00
wiz
0088e58c14 Merge pull request #776 from mempool/wiz/add-newsyslog-for-nginx 2021-09-11 19:20:30 +09:00
wiz
3fad765269 Add newsyslog.conf for nginx log rotation - delete logs after 90 days 2021-09-11 08:40:58 +09:00
softsimon
2e122a9be1 Merge pull request #771 from mempool/release/v2.2.2
Bump version number to v2.3.0-dev
2021-09-09 11:41:11 +04:00
wiz
2978d16148 Merge pull request #772 from mempool/wiz/fix-api-docs-for-raspberry-pi-users
Fix API docs examples for Raspberry Pi users using romanz/electrs
2021-09-09 14:44:10 +09:00
wiz
fc58bcb3bc Fix API docs examples for Raspberry Pi users using romanz/electrs 2021-09-09 11:11:01 +09:00
wiz
1696623e2f Bump version to v2.3.0-dev after shipping v2.2.2 2021-09-09 07:27:01 +09:00
wiz
251a1af442 Bump version number for v2.2.2 release 2021-09-09 07:23:36 +09:00
wiz
9bdf42530a Merge pull request #769 from mempool/wiz/fix-api-docs-fees-path
Fix api-docs incorrect API path for fees related methods
2021-09-08 07:29:36 +09:00
wiz
8525fbb177 Fix api-docs incorrect API path for fees related methods 2021-09-08 07:13:23 +09:00
wiz
63a3568481 Merge pull request #768 from mempool/simon/liquid-fetch-unconfidential
Liquid: Display unconfidential address and fix tracking
2021-09-08 06:37:24 +09:00
wiz
e4941740de Merge pull request #765 from mempool/simon/address-regex-fix
Updated address regex to handle all types of addresses.
2021-09-08 06:36:42 +09:00
softsimon
25bd33f7da validate-address API should be there both in esplora and bitcoind mode. 2021-09-07 13:13:29 +04:00
softsimon
2d007b9100 Liquid: Display unconfidential address and fix tracking
fixes #761
2021-09-06 10:20:31 +04:00
softsimon
b71330c606 Lowercase Segwit uppercase addresses for tracking matching. 2021-09-05 00:30:24 +04:00
softsimon
844b640c8c Merge pull request #760 from mempool/wiz/rename-keybase-channels
Update syslog.conf and upgrade/restart scripts for new keybase channels
2021-09-04 23:31:28 +04:00
softsimon
1277e58e68 Updated address regex to handle all types of addresses.
fixes #301
fixes #750
2021-09-04 23:21:15 +04:00
wiz
fde6fe324a Merge pull request #764 from mempool/simon/electrum-error-msg-fix
Handle string error messages.
2021-09-04 09:17:46 +09:00
wiz
4ed114a4d5 Merge pull request #762 from mempool/simon/npm-audit-fix-2021-09-03
Npm audit fix.
2021-09-04 09:16:56 +09:00
wiz
8c2dfea6a6 Merge pull request #716 from MiguelMedeiros/documentation-api
Improvements to API documentation and examples
2021-09-04 09:10:59 +09:00
Miguel Medeiros
a0624df06b Change websocket examples. 2021-09-03 20:13:31 -03:00
Miguel Medeiros
1eedcf900b Fix transaction post curl example. 2021-09-03 19:43:28 -03:00
softsimon
0b077d6fda Handle string error messages.
fixes #763
2021-09-04 01:32:36 +04:00
Miguel Medeiros
80047313e7 Remove unused variables. 2021-09-03 16:50:45 -03:00
Miguel Medeiros
71229b94c8 Set default active tab to liquid network. 2021-09-03 16:48:37 -03:00
Miguel Medeiros
c256daf8c8 Fix document location protocol for curl url. 2021-09-03 16:22:39 -03:00
Miguel Medeiros
ba0fb996d2 Fix curl placeholder url depending on base_module.
Fix currencies wrapper url variable name.
2021-09-03 16:02:05 -03:00
Miguel Medeiros
5977e96034 Fix typo variable name. 2021-09-03 14:35:06 -03:00
Miguel Medeiros
a151c5cddd Add template to documentation.
Add support for BASE_MODULE=[mempool, bisq, liquid].
 Add print results do CommonJS examples.
 Add support for custom domains.
 Remove basecurrency from /volume endpoint.
2021-09-03 07:04:19 -03:00
softsimon
0323fd966d Npm audit fix. 2021-09-03 00:44:23 +04:00
wiz
beb834bc30 Update syslog.conf and upgrade/restart scripts for new keybase channels 2021-09-02 19:30:54 +09:00
wiz
ad6503c7b3 Merge pull request #755 from knorrium/fix_dashboard_memory_leak
Add a potential fix for the memory leak on the Dashboard
2021-09-02 19:12:42 +09:00
softsimon
f8c11c8b6b Merge pull request #759 from knorrium/cypress_831
Update Cypress to v8.3.1
2021-09-02 13:45:12 +04:00
Felipe Knorr Kuhn
ba5421e77b Add some search tests (#758) 2021-09-02 13:42:18 +04:00
Felipe Knorr Kuhn
20fa803cee Add a potential fix for the memory leak on the Dashboard
Fix the broken experience after unsubscribing for network changes

Fix the broken experience after unsubscribing for network changes
2021-09-02 00:47:00 -07:00
Felipe Knorr Kuhn
393fa78a43 Increase waitForSkeletonGone timeout to 15s 2021-09-01 21:09:14 -07:00
Felipe Knorr Kuhn
3f290dae06 Upgrade Cypress to v8.3.1 2021-09-01 21:08:10 -07:00
wiz
24d18b9f2f Merge pull request #757 from mempool/wiz/revert-search-input-lowercase-conversion
Revert "Support uppercase addresses when searching."
2021-09-02 01:37:56 +09:00
wiz
79ef8ca371 Revert "Support uppercase addresses when searching."
This reverts commit fc28b06a0f.
2021-09-02 00:57:43 +09:00
softsimon
ec12f21113 Backend: Bumping Typescript version to 4.4.2 (#748)
* Backend: Bumping Typescript version to 4.4.2

* Replacing any types with instanceOf checks.
2021-08-31 15:09:33 +03:00
Priyansh
2e8ecc7277 Made Price feed update configurable (#751) 2021-08-29 22:30:11 +03:00
softsimon
fc28b06a0f Support uppercase addresses when searching.
fixes #301
2021-08-29 15:58:39 +03:00
softsimon
8fdbfdc04c Use block cache when searching or opening a recent block. (#749)
* Use block cache when searching or opening a recent block.

fixes #715

* Fixed linting errors.
2021-08-29 04:55:46 +03:00
Felipe Knorr Kuhn
bdfcfc96a8 Add script to pull digests from docker images (#705) 2021-08-27 19:04:51 +09:00
wiz
bb8649bc81 Merge pull request #747 from knorrium/be_dockerfile_fixes
Fix non-deterministic TypeScript version on Dockerfile
2021-08-27 17:08:04 +09:00
Felipe Knorr Kuhn
777e3d58b7 Fix non-deterministic TypeScript version on Dockerfile 2021-08-27 00:28:05 -07:00
wiz
c552f1aab6 Pull from transifex 2021-08-27 14:28:51 +09:00
softsimon
c0f2fa3042 Merge pull request #746 from MiguelMedeiros/bugfix-difficulty-adjustment-calc
Bugfix: difficulty adjustment calculation.
2021-08-26 03:27:59 +03:00
Miguel Medeiros
05936f82bd Refactor getDifficultyChange endpoint. 2021-08-25 21:14:01 -03:00
Miguel Medeiros
c7db81c97c Refactor difficulty adjustment calculation. 2021-08-25 17:18:30 -03:00
softsimon
bd1a37b8ef Correcting keypress arrow left test. 2021-08-25 18:41:35 +03:00
softsimon
efc4e6a8ed Fix for multiple arrow navigation bugs. (#741)
* Fix for multiple arrow navigation bugs.

fixes #731

* Updating test to handle left arrow navigation.

* Updating test to handle left arrow navigation.

* Arrow right click fix.

* Update frontend/cypress/integration/mainnet/mainnet.spec.ts

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>
2021-08-25 15:44:55 +03:00
Felipe Knorr Kuhn
dd5d87e91e Add a test for not showing unblinding errors on regular TXs (#737) 2021-08-22 00:34:40 +03:00
wiz
ca6df488c5 Fix missing fetch command in upgrade script 2021-08-21 21:56:42 +09:00
wiz
1e018a6aa5 Fix typo/bug in mempool-logger script 2021-08-21 15:39:15 +09:00
wiz
0a627f96be Tweak production syslog configuration 2021-08-21 15:19:29 +09:00
wiz
17a8e67d8a Modify restart script to log restart events, don't restart services 2021-08-21 15:06:50 +09:00
wiz
815c2c5ad5 Modify upgrade script for PR branch deployment, tweak logging 2021-08-21 14:51:19 +09:00
softsimon
4376de85ff Liquid unblinding: Don't throw error as default for regular liquid transactions. 2021-08-21 03:13:39 +03:00
wiz
7e89de4612 Send deployment notifications to mempool.dev keybase group 2021-08-20 21:52:54 +09:00
wiz
4b72a14706 Merge pull request #735 from mempool/simon/bisq-tx-redirect-fix
Redirect unconfirmed bisq transactions to main website for tracking.
2021-08-20 21:25:13 +09:00
softsimon
b34f6fedb6 Redirect unconfirmed bisq transactions to main website for tracking. 2021-08-20 14:56:12 +03:00
Miguel Medeiros
58af0d78af Bugfix: Fix bisq dashboard tables overflow. (#733)
* Fix bisq dashboard tables overflow.

* Fix nav-item mobile margin.
2021-08-19 17:51:08 +03:00
Priyansh
ca13d9109c Updated mobile view for dropdown (#717)
Dropdown menu with dynamic positioning
2021-08-18 19:18:12 +03:00
Priyansh
e103fb5876 Updated significant digits of transaction fee (#722) 2021-08-18 16:27:35 +03:00
softsimon
58178f4563 Arrow bugfix: Unsubscribe all the observables when leaving view. 2021-08-18 15:59:18 +03:00
wiz
04f1879fd1 Add Unchained Capital as Enterprise Sponsor (#711) 2021-08-18 15:15:31 +03:00
softsimon
f5bc9ced0a Liquid unblinding: Replacing async/await with observable. 2021-08-18 14:05:40 +03:00
softsimon
7fe9993f91 Optimize performance of next/previous block. (#729) 2021-08-18 12:49:42 +03:00
softsimon
7c95339324 Merge pull request #728 from mempool/simon/unblinding-refactor-fix
Unblinding refactor fix
2021-08-18 04:09:53 +03:00
softsimon
006442f9de Merge pull request #727 from knorrium/improve_multisite_testing
Improve multisite testing
2021-08-18 03:35:43 +03:00
softsimon
e20100e437 Unblinding refactor fix 2021-08-18 03:34:17 +03:00
Felipe Knorr Kuhn
d7cf2b37d5 Update Liquid test data 2021-08-17 16:49:34 -07:00
Felipe Knorr Kuhn
278c2b9aae Fix typo on liquid setup 2021-08-17 16:38:51 -07:00
Felipe Knorr Kuhn
944246fcf5 Allow test jobs to run regardless of previous failures 2021-08-17 16:26:19 -07:00
Felipe Knorr Kuhn
03d87f4993 Add the Cypress env vars to the new test configs 2021-08-17 16:14:19 -07:00
Felipe Knorr Kuhn
cf8cab5f77 Temporarily enable cypress debug logs on GHA 2021-08-17 16:08:47 -07:00
Felipe Knorr Kuhn
49d1376647 Update cypress test config 2021-08-17 15:55:00 -07:00
Felipe Knorr Kuhn
de5518d262 update test specs to handle the new multisite setup on CI 2021-08-17 15:53:57 -07:00
Felipe Knorr Kuhn
7e4c51f47f Add new config targets for the multisite setup 2021-08-17 15:49:58 -07:00
softsimon
fe1d153632 Merge pull request #710 from MiguelMedeiros/feature-next-previous-block-arrows
UI/UX: `Next` and `Previous` button arrows for block navigation.
2021-08-18 00:57:39 +03:00
softsimon
a98f9ab80e Updating from transifex. 2021-08-18 00:54:34 +03:00
softsimon
867afaf265 Updating package lock file. 2021-08-18 00:50:18 +03:00
Rishabh
3d2ec64b14 Only display "Load all" if there are at least 3 more items to load (#724)
* Only display Load more if there are at least 3 more items to load

* Load more only if at least 3 more inputs
2021-08-18 00:49:08 +03:00
softsimon
bb407c0b42 Merge pull request #725 from mempool/simon/liquid-unblinding-refactor
Refactored liquid unblinding code into a new file.
2021-08-17 23:52:33 +03:00
softsimon
83c3d901c7 Merge pull request #726 from knorrium/update_devproxy
Update test infra to add initial support for the new multi-site setup.
2021-08-17 23:52:21 +03:00
Felipe Knorr Kuhn
901cee903c Update bisq tests to use the menu navigation 2021-08-17 13:02:24 -07:00
Felipe Knorr Kuhn
250ea09c7e Run generate config before running e2e tests locally 2021-08-17 13:01:36 -07:00
Felipe Knorr Kuhn
648d59631b Update local-prod target to use the new JS dev proxy 2021-08-17 13:01:04 -07:00
Felipe Knorr Kuhn
ed06e3c491 Add a new JS-based dev proxy for the new split up sites 2021-08-17 13:00:46 -07:00
Felipe Knorr Kuhn
3e8d646edd Fix update-config script to parse string values 2021-08-17 12:03:03 -07:00
softsimon
9c2c698575 Refactored liquid unblinding code into a new file. 2021-08-17 20:20:25 +03:00
softsimon
e2b0a286a4 Adding v2.2.1 dashboard screen shot. 2021-08-16 00:31:14 +03:00
softsimon
154809f0f9 Fix navigate to sponsor when base module is not mempool 2021-08-15 20:05:49 +03:00
softsimon
8d9a51a7c4 Readding search field, and fixing search for non-mempool base module sites. 2021-08-14 14:58:58 +03:00
softsimon
b3294369d4 Restoring Bisq Dao nav bar on Bisq module. 2021-08-14 13:25:54 +03:00
softsimon
53730920e3 Bugfix: Mempool block sizes were mixing up vsize and weight. 2021-08-14 03:24:31 +03:00
softsimon
d73b814277 Merge pull request #703 from priyanshiiit/median_fee
Get Median Fee on page reload
2021-08-14 02:25:35 +03:00
softsimon
dd0050c066 Merge pull request #669 from mempool/simon/configurable-main-module
Make base module and index.html file configurable with BASE_MODULE. A…
2021-08-14 02:25:07 +03:00
softsimon
ae51ee3e26 Removing issuance id test and fixing asset id test. 2021-08-14 02:21:38 +03:00
wiz
4b16e5d65f Add some basic title/descriptions for bisq.markets and liquid.network 2021-08-14 07:44:22 +09:00
softsimon
4f73bba132 Hide Mempool project description from non-mempool base module sites. 2021-08-14 01:37:28 +03:00
softsimon
3c229602e4 Use local about page component instead of external link. 2021-08-14 00:42:52 +03:00
softsimon
c74c902ebc Adding new preview images for Liquid and Bisq 2021-08-14 00:36:46 +03:00
wiz
8bfd315ba3 Rewrite production upgrade script to handle all 3 sites 2021-08-14 06:03:30 +09:00
softsimon
9d75c47792 Merge branch 'master' into simon/configurable-main-module
# Conflicts:
#	frontend/src/app/components/api-docs/api-docs.component.ts
#	frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts
#	frontend/src/app/components/master-page/master-page.component.html
#	frontend/src/app/components/mempool-blocks/mempool-blocks.component.html
#	frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts
#	frontend/src/app/dashboard/dashboard.component.html
2021-08-13 17:16:14 +03:00
wiz
e183be1a5c Update GitHub sponsor link to mempool.space/sponsor 2021-08-13 08:41:35 +09:00
wiz
7e273ce63d Bump version tags to v2.2.2-dev 2021-08-13 07:56:14 +09:00
Miguel Medeiros
6d070e75b0 Add next and previous arrows to blocks. 2021-08-12 19:49:39 -03:00
wiz
af5e0d7cd6 Bump version to v2.2.1 2021-08-13 07:45:47 +09:00
wiz
a2f1003916 Pull from transifex 2021-08-13 06:22:11 +09:00
wiz
f4f96fd18e Fix typos in site.webmanifest for liquid.network 2021-08-12 20:57:33 +09:00
Miguel Medeiros
f3b470b63e Fix API docs example for POST /tx endpoint (#707)
* Fix post transactions example.
* Fix post tx endpoint.
2021-08-12 20:41:23 +09:00
wiz
398a72c1a6 Pull from transifex 2021-08-12 19:33:22 +09:00
softsimon
ddd6420d9b Updating Bisq markets logo and favicons. 2021-08-11 20:31:05 +03:00
Miguel Medeiros
d76f42296a Add new documentation for Liquid and Bisq. 2021-08-12 01:19:40 +09:00
wiz
45af88774f Pull from transifex 2021-08-12 00:49:33 +09:00
wiz
71c6b0e11d Remove typo'd extra line in nginx-mempool.conf - fixes #706 2021-08-12 00:47:42 +09:00
github2k20
47a6118ffb Get Median Fee on page reload 2021-08-11 00:17:25 +05:30
wiz
994eb378af Update production nginx-mempool.conf for donations API endpoint 2021-08-11 01:00:17 +09:00
wiz
34d46e8ca5 Pull from transifex 2021-08-11 00:29:46 +09:00
wiz
a940f7e3b4 Pull from transifex 2021-08-09 23:48:20 +09:00
softsimon
8c29395533 Resume tx tracking when network goes offline. (#702)
fixes #609
2021-08-09 13:01:29 +03:00
Miguel Medeiros
8208bbf0b7 UI/UX: Fix blockchain-blocks skeleton. (#697)
* Fix blockchain-blocks skeleton.

* Fix blockchain skeleton background.

* Fix mempool blockchain skeleton.

* Add e2e testing.
Add tsconfig.
Fix mempool fit to screen.

* Fix wrong return.
Fix e2e testing.

* Fix blockchainblocks connectionstate.
Add init action to websocket mock.
Add e2e testing for droping websock connection.

* Ref e2e code for websocket connection.
Fix blockchain blocks skeleton.

* Fix state connections.
Remove .only e2e tests.

* Fix mempool blocks skeleton.

* Add fit screen to empty blocks.
2021-08-09 03:43:03 +03:00
softsimon
dbd205b73f Fix: Block fee data wasn't visible unless at least 2 transactions. 2021-08-08 14:17:18 +03:00
softsimon
7ef4be26ed Use BLOCK_WEIGHT_UNITS instead of hard coded block size limit in all occations. 2021-08-08 04:19:54 +03:00
wiz
1223c58a98 Add missing --db-dir option in electrs-start-liquid script 2021-08-08 05:18:11 +09:00
wiz
7d3757676f Enable 'ca' locale for Catalan 2021-08-08 01:05:42 +09:00
wiz
073bd60ed8 Pull from transifex 2021-08-08 01:05:26 +09:00
wiz
18c38fc1c1 Pull strings from transifex 2021-08-08 00:58:58 +09:00
wiz
0eb95447bb Pull strings from transifex 2021-08-07 21:12:26 +09:00
softsimon
c6b1979391 Support Liquid 0.1 sat/vB fees on blocks. 2021-08-07 04:24:46 +03:00
softsimon
0f390e65a4 Assets page design improvements. 2021-08-07 03:25:35 +03:00
softsimon
5dc0f4e270 Use actual MEMPOOL_BLOCKS_AMOUNT value for amount of mempool blocks. 2021-08-07 03:07:32 +03:00
softsimon
223288cc52 Removing extra character. 2021-08-07 03:05:54 +03:00
softsimon
72a35200b3 Pulled from transifex. 2021-08-07 02:27:59 +03:00
softsimon
11817c04f7 Transaction and block header hex external URL should be relative to the network. 2021-08-06 23:45:54 +03:00
Miguel Medeiros
7a8b2db3fb UI/UX: Fix Blockchain skeleton preloader. (#696)
* Fix Blockchain skeleton preloader.

* Fix Mempool Blocks skeleton preloader.

* Add e2e test.

* Add shared command to cyrpress e2e test.
2021-08-06 14:09:47 +03:00
Priyansh
6d910a5e24 changed the order of columns in collapsed view (#695) 2021-08-06 14:08:44 +03:00
softsimon
e1f07884b9 Correcting favicon paths and color. 2021-08-05 19:25:13 +03:00
softsimon
e00e61edfa Updating liquid favicons. 2021-08-05 19:14:48 +03:00
softsimon
4f988e186a Updating liquid network logo. 2021-08-05 18:58:39 +03:00
wiz
1aa54faa35 Fix liquid.network and bisq.markets page titles in SEO services 2021-08-05 22:45:03 +09:00
softsimon
99adccf43c Pulled from transifex. 2021-08-05 14:15:37 +03:00
softsimon
0bb9247609 Handle 0.1 sat/vB base fee on the dashboard and backend. 2021-08-05 02:03:52 +03:00
softsimon
d841933b21 Sync blockstream asset registry when in liquid base module mode. 2021-08-05 01:31:22 +03:00
wiz
bc8b78a01b Update page titles in index.*.html and SEO service 2021-08-05 02:41:52 +09:00
softsimon
b0c708659b Merge pull request #690 from MiguelMedeiros/bugfix-titles-styles
UI: Fix Transaction h1 font-size.
2021-08-04 15:48:39 +03:00
Miguel Medeiros
e31b906084 Import scss from transaction component. 2021-08-04 09:09:28 -03:00
Miguel Medeiros
7249620471 Fix Bisq css page.
Refactor Bisq html page title classes.
2021-08-04 09:08:11 -03:00
Miguel Medeiros
dc9d5d0be3 Fix h1 fontsize. 2021-08-04 09:08:11 -03:00
softsimon
a9009d4de2 npm audit fix. 2021-08-04 14:34:28 +03:00
softsimon
a265787cd4 Bumping mempool.js. 2021-08-04 14:34:05 +03:00
softsimon
c6e72be483 Liquid proxy fix to work locally. 2021-08-04 14:21:15 +03:00
softsimon
4680519d2e Merge pull request #689 from knorrium/e2e_tweaks
e2e tweaks
2021-08-04 13:24:05 +03:00
Felipe Knorr Kuhn
5b17f88de2 disable video recording 2021-08-03 21:26:40 -07:00
Felipe Knorr Kuhn
a6d34ba4f1 remove firefox from test matrix 2021-08-03 21:20:05 -07:00
Felipe Knorr Kuhn
508c8b0be3 make serve:local-prod target not verbose 2021-08-03 21:19:25 -07:00
softsimon
ef7dd6c8fb Merge branch 'master' into simon/configurable-main-module 2021-08-03 18:41:43 +03:00
softsimon
f03249761b Updating i18n from transifex. 2021-08-03 18:38:34 +03:00
softsimon
cb5877ba0a Update i18n. 2021-08-03 18:37:31 +03:00
softsimon
96f14d2781 Flipping Merkle root and Bits location for more table alignment. 2021-08-03 18:35:49 +03:00
softsimon
8eb70416da Removing "raw block". 2021-08-03 18:15:33 +03:00
wiz
b9246a72f2 Add Foundry as Enterprise Sponsor (#685) 2021-08-03 18:00:18 +03:00
Priyansh
43e222b9df Raw Hex of Objects in Details Tab #616 (#682)
* Added Block Hex in Details

* Added Raw Tx in Transaction Details

* Backend Updates
2021-08-03 14:27:02 +03:00
wiz
5548d08a9e Remove debug env var for cypress testsuite runs 2021-08-03 12:20:55 +09:00
wiz
10fa39634e Update our Terms of Service, split Privacy Policy into its own page 2021-08-03 12:20:51 +09:00
wiz
e6b90385b2 Further tweak index.liquid.html metadata text 2021-08-02 21:42:02 +09:00
wiz
61181c6791 Set index.html metadata and SEO service title for liquid.network 2021-08-02 21:30:29 +09:00
wiz
d2cccd2422 Fix liquid favicons 2021-08-02 21:07:48 +09:00
wiz
b05ebe1598 Add missing route for /privacy-policy to liquid explorer routing 2021-08-02 20:59:31 +09:00
softsimon
d92827a411 Upgrade deprecated xi18n command to extract-i18n. 2021-08-02 14:49:02 +03:00
wiz
d061f7589c Update our Terms of Service, split Privacy Policy into its own page 2021-08-02 20:48:10 +09:00
softsimon
1c01094e07 Removing duplicate i18n string. 2021-08-02 14:48:08 +03:00
wiz
f28a85f91b Hush a noisy bisq error message down to info 2021-08-02 16:57:49 +09:00
softsimon
15903faf49 Merge branch 'master' into simon/configurable-main-module
# Conflicts:
#	frontend/src/app/components/blockchain/blockchain.component.ts
2021-08-02 00:24:09 +03:00
softsimon
4895343d4e Perform a blockchain sync check before updating initial difficulty ad… (#677)
* Perform a blockchain sync check before updating initial difficulty adjustment.

fixes #603

* Updating logger messages.
2021-08-01 15:49:26 +03:00
Miguel Medeiros
a0559cbb24 Fix time until component round for week interval. (#679)
* Fix time until component round for week interval.

* Add forceFloorOnTimeIntervals parameter.
2021-08-01 01:25:24 +03:00
Miguel Medeiros
0293ba4a52 Remove feeRange check. (#678) 2021-07-31 20:11:50 +03:00
Miguel Medeiros
8b0d1db776 Fix concurrent asynchronous calls. (#675)
* Fix concurrent asynchronous calls.

* Remove test without mempool info websocket.

* Remove isloading$ variable.
2021-07-31 19:40:15 +03:00
softsimon
1908b1a5a6 Adding configuration for blocks and mempool blocks amount. 2021-07-31 17:56:10 +03:00
softsimon
037f472f8c Make Block Weight Unit configurable in frontend+backend. 2021-07-31 17:30:35 +03:00
softsimon
a32c1f40b1 Restoring About page. Fix for KEEP_BLOCKS_AMOUNT setting. Show up to 2 mempool blocks. 2021-07-30 23:14:45 +03:00
Miguel Medeiros
837e714b1f Fix show blocks on small screen. (#674) 2021-07-30 02:28:43 +03:00
wiz
91a37d8fe8 Add [push, pull_request] to cypress GHA workflow 2021-07-29 23:58:25 +09:00
softsimon
a00aa27ae4 Fix API doc page for Bisq. 2021-07-29 16:14:36 +03:00
Miguel Medeiros
226e72451c Fix colorized unblinded transaction. (#671) 2021-07-29 13:37:17 +03:00
softsimon
544be77bdc Liquid asset search bug fix. 2021-07-29 13:10:06 +03:00
softsimon
b8a110a772 Liquid fixes for latest transactions and API Doc. 2021-07-29 13:06:08 +03:00
wiz
7788a2d6bd Add other domain names to Terms of Service header 2021-07-29 18:38:49 +09:00
softsimon
da17fd16fa Liquid blockchain container position. 2021-07-29 12:36:00 +03:00
softsimon
e670f80fed Liquid dashboard updates. About page link. 2021-07-29 12:32:54 +03:00
wiz
857a5ff6fc Add missing asset_registry_db repo path for liquid electrs backend
Fixes #649
2021-07-29 17:49:42 +09:00
softsimon
2de28b9926 Dynamic dropdown. 2021-07-28 22:32:13 +03:00
softsimon
e6f8cf6cc8 Updating from transifex. 2021-07-27 19:51:38 +03:00
softsimon
d7586af392 Make base module and index.html file configurable with BASE_MODULE. Adding bare Liquid module. 2021-07-27 17:10:38 +03:00
wiz
35881b2457 Add customized index.html for bisq.markets entrypoint 2021-07-27 21:38:13 +09:00
Felipe Knorr Kuhn
59cd80b6d1 remove windows from test matrix (#666) 2021-07-27 02:47:32 +03:00
Miguel Medeiros
735c2ba587 Bugfix: Dashboard preloading skeleton. (#668)
* Change green color.

* Fix dashboard preloading components.
2021-07-27 02:47:08 +03:00
softsimon
be1ef43cd1 Updating i18n messages. 2021-07-26 22:02:24 +03:00
Felipe Knorr Kuhn
34ad88d3d0 update indentation (#664) 2021-07-26 22:00:53 +03:00
Miguel Medeiros
751c7d6e69 Bugfix: Dashboard - Difficulty adjustment component. (#663)
* Add color to previous retarget.
Add absolute number pipe.
Change plus and minus signs to fa icons.
Change Fee Estimate title to Transactions Fees.
Set min and max difficulty adjustments.

* Add projectID to cypress conf.

* Change icon to fa-caret.

* Remove unecessary icons.
2021-07-26 22:00:40 +03:00
Felipe Knorr Kuhn
60d8697b09 Cypress browser matrix (#665)
* use cypress matrix

* fix workflow indentation

* fix workflow job name

* add dummy containers for parallelization
2021-07-27 03:23:35 +09:00
wiz
41aa1248be Pass GITHUB_TOKEN to Cypress workflows, revert back to on "push" 2021-07-27 01:48:53 +09:00
wiz
cedd94c654 Set GitHub Action for Cypress to pull_request instead of push 2021-07-26 15:47:13 +09:00
wiz
bf13994d28 Remove duplicate trademark notice in LICENSE 2021-07-26 15:24:12 +09:00
Felipe Knorr Kuhn
8a44ccc55d small formatting fix to trigger more tests (#660) 2021-07-26 01:49:40 +03:00
softsimon
81df40681f Updating translations. 2021-07-25 21:18:35 +03:00
Felipe Knorr Kuhn
9e46cde9b7 Updates to the e2e suite (#659)
* initial version of the update config script

* fix duplicated content

* update cypress ci settings

* add workflow to run e2e tests when pushing

* record cypress results to the dashboard

* pull the cypress record key and project id from the secrets

* add start-server-and-test to replace concurrently

* replace concurrently with start-server-and-test

* remove concurrently

* add new cypress target to record

* update cypress to 7.7.0

* add tests for signet

* add tests for testnet

* run tests on chrome and firefox

* update test matrix: add edge and run firefox on container

* fix copypasta

* update docker image for firefox

* fix task name again

* fix edge tests task name

* improve bisq tests

* update workflow config

* enable cypress debug logs

* add a manual trigger for the e2e tests

* add config:defaults target

* use more of the GHA options

* fix config command

* add cypress-fail-on-console-error

* upgrade cypress to v8.0.0

* add helper to wait for the loader skeleton to be gone

* use skeleton waiter on the tests

* remove manual test trigger

* fix tv test when only one mempool block is available

* add waiter for pagination

* add extra steps to debug firefox launch issue

* remove whoami step

* Revert "upgrade cypress to v8.0.0"

This reverts commit cb3ff7d906.

* remove userinfo debug step

* enable test retries in run mode

* update proxy config to reduce ECONNRESET errors

* add mock-socket dev dependency

* add helpers to mock websockets and detect page idleness

* stabilize mainnet tests

* fix tv mode test on Liquid

* add basic tests for the mainnet status page

* cleanup mainnet tests

* update bisq tests

* update signet tests

* update testnet tests

* add initial support for parameterized websocket mocks

* move testing dependencies to optionalDependencies

* comment out mempool size check until the live updates are fixed

* comment out tx regex test

* update fixture for the new difficulty adjustment component

* fix the assertions on the status page
2021-07-25 21:03:47 +03:00
softsimon
723034b3d3 Status page wasn't updated due to multiple want events.
fixes #658
2021-07-25 19:43:06 +03:00
wiz
59898f1269 Patch sysconf dep for blockstream/electrs build in start scripts 2021-07-25 15:20:35 +09:00
softsimon
195b9bf542 Bumping the mempool-js lib. 2021-07-25 02:32:31 +03:00
softsimon
0333d91b15 Updating from transfex. 2021-07-25 01:49:35 +03:00
softsimon
f0bd487ea9 Update i18n messages. 2021-07-25 01:35:12 +03:00
Miguel Medeiros
cd8e308870 Add previous adjustment retarget. (#655)
* Add previous adjustment retarget.

* Fix green color.
Add + symbol to difficulty change.

* Add previousRetarget to websocket.

* Add previous retarget.
2021-07-25 01:26:48 +03:00
Miguel Medeiros
f6a889298c Bugfix: Change mempool block time precision. (#650)
* Fix time precision.

* Fix rounding numbers only for minutes range.
Fix reflected avg time to ETA transactions.

* Fix now variable update.
2021-07-25 01:26:29 +03:00
Miguel Medeiros
11f5e99187 Doc: Add new endpoints to api documentation. (#654)
* Add difficulty adjustment api doc.
Change fee tab to general tab.

* Add block header examples.

* Change tab orders.
Add fees tabs.
Change CPFP instructions to Transactions tab.

* Reorder alphabetically.
Fix typo.
2021-07-24 23:00:11 +03:00
wiz
334f9358b0 Add new page for Trademark Policy and Guidelines (#647)
* Add new page for Trademark Policy and Guidelines

* Fix attribution footer at bottom of Trademark Policy

* Add our Trademark Notice and Trademark Policy URL to LICENSE

* Last minute fixes to Trademark Policy and Guidelines page
2021-07-24 22:40:11 +03:00
wiz
820561610a Merge pull request #642 from unruhschuh/patch-2
fixed rsync command for frontent
2021-07-25 04:08:25 +09:00
wiz
2c895e7b03 Merge pull request #643 from mempool/wiz/nginx-cache-lang-updates
Update nginx configuration for cache settings and new locales
2021-07-24 03:21:21 +09:00
wiz
f36f48b11c Add Marina Wallet as Community Integration on About page (#651)
* Add Marina Wallet as Community Integration on About page

* Shift logo for Marina wallet by a few pixels on About page
2021-07-23 21:12:48 +03:00
wiz
f12f1b4a4e Merge pull request #641 from unruhschuh/patch-1 2021-07-23 20:56:19 +09:00
softsimon
037d6a75ea Adding previous difficulty retarget to the difficulty adjustment api. (#652)
refs #640
2021-07-23 14:35:04 +03:00
softsimon
775323de3e Removing angular CLI analytics. 2021-07-22 15:37:40 +03:00
Miguel Medeiros
d91dfa2f41 Check if feeRange is undefined. (#636) 2021-07-21 18:35:27 +03:00
softsimon
3ac06bb983 Updating i18n from transifex. Moving hindi location. 2021-07-20 15:43:01 +03:00
Miguel Medeiros
1ba0075829 Feature: Reflect difficulty estimation into mempool blocks. (#637)
* Add time until to mempool blocks.
Reflect difficulty estimate time.

* Fix estimate calculation.
Turn off the auto refresh.

* Change Math.floor to Math.round.
2021-07-20 15:04:53 +03:00
Miguel Medeiros
95436d398d Fix undefined asset and colored coinbase tx. (#645) 2021-07-19 23:13:34 +03:00
wiz
f2f5749769 Update nginx configuration for cache settings and new locales
* Consolidates add_header statements into single top-level section
* Updates locales to match frontend/src/app/app.constants.ts
* Re-orders locales to match locale selector for easier checking
2021-07-19 18:36:13 +09:00
softsimon
cb90b09a0e Changing block header link to icon. Setting api response header to match electrs. 2021-07-19 02:34:01 +03:00
Rishabh
2e54f4ca94 Added missing block header API (#630)
* header API frontend

* Block Header API endpoint added to Node.js backend

* updated package-lock.json

Co-authored-by: Rishabh <rishabh@Rajeshs-MacBook-Pro.local>
2021-07-19 02:26:16 +03:00
softsimon
853e2fcb8f Minor fixes to difficulty adjustment api. 2021-07-19 00:50:09 +03:00
Priyansh
9e0a5300b0 Expose the difficulty adjustment information in an API #622 (#628)
* Added difficulty adjustment information API

* Added Difficulty API in API docs frontend

* Added link to API

* Updated the API implementation of difficulty-adjustment

* Updated API End Point in frontend

* Updated sample API response in frontend
2021-07-19 00:45:45 +03:00
Thomas Leitz
1b5930887c fixed rsync command for frontent
nginx-mempool.conf has "root /var/www/mempool/browser;"
2021-07-18 23:20:28 +02:00
Thomas Leitz
5b39c018db Fixed 'cp' command for nginx.conf and nginx-mempool.conf
The destination path was a file, should be a directory.
2021-07-18 22:54:47 +02:00
Miguel Medeiros
ad08c3a907 Add min-height to mempool-info-data. (#639) 2021-07-18 16:42:02 +03:00
Miguel Medeiros
08328cbf0f Bugfix: Overflow in difficulty adjustment component. (#638)
* Remove green progress bar.

* Fix itens overflow.
2021-07-18 15:47:47 +03:00
Miguel Medeiros
03ce592ab0 Fix time-span calculation. (#635) 2021-07-18 15:42:59 +03:00
softsimon
21db5a4102 Removing shortened date i18n strings. 2021-07-18 01:02:02 +03:00
softsimon
7234734056 Updated "mins per block" i18n string. 2021-07-17 18:23:50 +03:00
softsimon
7bf9d604b9 Reusing hard coded In~1 min with base date minute i18n string. 2021-07-17 16:36:21 +03:00
softsimon
08fd4a4835 Updating from transifex. 2021-07-17 15:37:34 +03:00
softsimon
9a715871c5 Updating i18n strings. 2021-07-17 14:59:10 +03:00
Miguel Medeiros
d405334109 UI/UX - New component for difficult adjustment. (#602)
* Add next difficulty blocks.
Add next difficulty target date.
Add next difficulty total progress.
Add ajustment difficulty avg min per block.

* Fix typo.

* Trigger difficulty calculation every 5 seconds.

* Add rxjs timer to difficultyEpoch.

* Fix pipe.

* Fix small bar position.

* Change i18n strings.

* Fix typo.

* Add time-until component.

* Speed up difficultyEpoch timer to 1000 ms.

* Fix values to 2 decimal places.

* Add title to fee and difficulty adjustment cards.

* Add title outside the card.

* Fix title to center position.

* Add other titles.

* Add new transalations strings.
Refactor time span component.

* Fix difficulty adjustment i18n string.
Fix duplicated i18n strings.
2021-07-17 14:58:16 +03:00
Miguel Medeiros
38aee1a897 UI/UX - Scroll by clicking on the pagination button. (#613)
* Add scrollIntoView when click on pagination.

* Add padding top.

* Fix access DOM from ViewChild.

* Fix scrolling position.

* Fix chrome and firefox compatibility.
2021-07-16 15:33:22 +03:00
Miguel Medeiros
52aea12f22 UI/UX - Fix arrow position. (#627)
* Fix arrow position.

* Add arrows from font-awesome.

* Add icons to bisq transfers.

* Fix icon size in mobile view.
2021-07-15 23:23:37 +03:00
softsimon
ecbd18087b Effective fee could go below 0 due to rounding error. (#623)
fixes #606
2021-07-14 22:42:48 +03:00
softsimon
d13e18a72a Fix for liquid network redirect in staging proxy. 2021-07-14 14:40:31 +03:00
softsimon
8749b8b0fa Updating @mempool/node-bitcoin to support new methods 2021-07-13 18:43:10 +03:00
softsimon
f2e0a71b01 Only display Trade Mark sign on english language. (#608) 2021-07-13 12:00:05 +03:00
softsimon
b4eea3dc72 Updating from transifex. 2021-07-13 11:49:46 +03:00
softsimon
cdfc03f352 Adding Hindi 2021-07-13 11:49:04 +03:00
Miguel Medeiros
2c5ccab77c UI/UX - Blocks not visible on the TV page. (#626)
* Fix blocks not visible on the TV page.

* Add e2e testing for tv screen.
2021-07-12 17:19:58 +03:00
softsimon
80d76ad1f4 Updating from transifex. 2021-07-11 22:06:14 +03:00
softsimon
9a2428ad79 Update i18n. 2021-07-10 18:20:15 +03:00
Miguel Medeiros
71cf41362f UI/UX - Add skeleton for blocks preload. (#615)
* Add skeleton for blocks preload.

* Add e2e testing for skeleton blocks preloader.

* Fix reduce mempool blocks to fit the screen.

* Fix variable naming.
2021-07-10 16:04:15 +03:00
Miguel Medeiros
652f88770e Fix mouse over tooltip width. (#614) 2021-07-07 22:20:17 +03:00
Miguel Medeiros
7de2cf89f4 Fix table overflow. (#612)
fixes #303
2021-07-07 15:22:25 +03:00
softsimon
d7a827ba7f Update from transifex. 2021-07-06 20:05:59 +03:00
Miguel Medeiros
9dae7020c8 Liquid support for unblinding transactions. (#588)
* Add docker file to generate wallycore wasm js lib.

* Add unblinded liquid transactions.

* Add background to unblided transactions.

* Check liquid network to try to unblind tx.

Ww don't want to try to unblind transactions in other networks.

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>

* Delete libwally-core dockerfile.

* Delete wallycore.html.

* Fix validation unblind tx.
Fix lint.
Add errorUnblinded.
Add vin.prevout unblinded tx.

* Add e2e testing to liquids unblinded tx.

* Load libwally.js dynamically.

* Fix table size.

* Add Blockstream License to libwally and wallycore.

Co-authored-by: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>
2021-07-06 19:56:32 +03:00
softsimon
3ae3df6722 Revert "Parse TXID, hash or address strings from search bar and allow searching for TXID:OUTPUT. (#578)" (#610)
This reverts commit 2e2e6aa01f.
2021-07-06 19:55:01 +03:00
softsimon
2e2e6aa01f Parse TXID, hash or address strings from search bar and allow searching for TXID:OUTPUT. (#578)
fixes #450
fixes #415
2021-07-06 19:43:18 +03:00
Miguel Medeiros
1e9f131a2a Fix pagination responsive layout. (#590)
* Fix pagination responsive css.

* Fix css title block transaction alignment.

* Add pagination responsive layout to bisq tx page.

* Add pagination responsive  to bisq blocks page.

* Fix pagination css - bisq txs page.

* Add e2e tests for bisq and mainnet pagination.
2021-07-05 22:28:56 +03:00
wiz
5197a15e31 Merge pull request #596 from knorrium/skip_cypress_on_docker
skip downloading the Cypress binary on Docker
2021-07-04 07:02:05 +09:00
wiz
1d29fad986 Bump version to v2.2.1-dev 2021-07-03 14:49:59 -07:00
wiz
eb6db6caf3 Bump version for v2.2.0 release 2021-07-03 14:36:10 -07:00
wiz
78c44eedbc Update from transifex 2021-07-03 14:34:47 -07:00
softsimon
b48a48a6be Updating from transifex. 2021-06-29 13:12:47 -04:00
softsimon
8e1aae1bbf Updating i18n messages. 2021-06-29 13:11:39 -04:00
Miguel Medeiros
807d4b0327 Fix tv only (#598)
* Remove TV Only container.
2021-06-29 13:10:15 -04:00
Miguel Medeiros
df588695ec Fix iinverse mempool graph also affect the TV view (#580) 2021-06-29 13:08:11 -04:00
softsimon
da13349b14 Reduce titles in Russian language to prevent overflows. 2021-06-27 12:16:59 -04:00
Felipe Knorr Kuhn
f6e4907128 skip downloading the Cypress binary on Docker 2021-06-26 16:48:57 -07:00
softsimon
6be733490f npm audit fix 2021-06-26 15:28:45 -04:00
wiz
fdf15c39a6 Merge pull request #595 from knorrium/fix_docker_builds
Improvements to local and Docker builds
2021-06-27 04:20:09 +09:00
softsimon
3b020046b7 Update i18n from transifex. 2021-06-26 14:45:05 -04:00
Felipe Knorr Kuhn
8574ee6edd push both tag and latest images at the same time 2021-06-26 10:29:08 -07:00
Felipe Knorr Kuhn
f937ea5745 fix missing backslash 2021-06-26 00:38:18 -07:00
Felipe Knorr Kuhn
741a020579 add missing semicolon 2021-06-26 00:29:45 -07:00
Felipe Knorr Kuhn
33d37a9b5b update generate-config to read the short sha from docker 2021-06-25 23:47:40 -07:00
Felipe Knorr Kuhn
446bdfebea update FE Dockerfile to read short sha 2021-06-25 23:47:19 -07:00
Felipe Knorr Kuhn
ca91afe45b update GHA workflow to expose the short sha to docker 2021-06-25 23:46:56 -07:00
softsimon
33a5be5a7d Lower scroll threshold to fix load more not triggering. (#576)
* Lower scroll threshold to fix load more not triggering.

fixes #575
2021-06-24 18:20:20 -04:00
softsimon
6a4eee3711 Updated from transifex. 2021-06-22 13:56:46 -04:00
softsimon
13931ceec6 Updated from transifex. 2021-06-22 10:57:44 -04:00
softsimon
0c418a9e33 Updated from transifex. 2021-06-22 10:57:26 -04:00
softsimon
6f8b95a17f Updating i18n. 2021-06-17 11:59:11 -05:00
softsimon
389c1d794c Updated from transifex. 2021-06-17 11:09:52 -05:00
softsimon
fca66f1b9f Updating i18n. 2021-06-17 11:09:07 -05:00
Felipe Knorr Kuhn
4c7d0cd2e5 Generate config on serve and updated git revision method (#587)
* run generate-config on serve

* write the config file only if settings have changed

* read the git commit hash from the current branch, not master

* git sha is now short by default, no need to trim on the about component
2021-06-16 13:47:05 -05:00
Felipe Knorr Kuhn
1016586992 fix the block viewer for liquid (#584) 2021-06-16 11:48:46 -05:00
wiz
38c8f3acb4 More tweaking of project description on About page 2021-06-16 00:19:56 -05:00
wiz
962023fbc4 Update project description on About page 2021-06-15 23:56:49 -05:00
wiz
b4f8bb2f48 Add trademark symbols and trademark notice to About page 2021-06-15 23:23:26 -05:00
Felipe Knorr Kuhn
c26461fada Route json assets to prod (#585)
* update proxy settings to route json assets to prod
2021-06-15 17:32:36 -05:00
softsimon
1a996e1640 Adding missing space. 2021-06-13 17:56:24 -05:00
softsimon
c80532b420 Bumping mempool.js lib. 2021-06-13 15:39:40 -05:00
wiz
74c49b9ae7 Enable i18n locale for Russian (ru) 2021-06-13 15:05:21 -05:00
softsimon
3f03c9c2b6 Swap location of API doc tabs. 2021-06-12 17:18:59 -05:00
softsimon
f00e727e68 Updating i18n from transifex. 2021-06-11 23:27:29 -05:00
Miguel Medeiros
4338dd6c3f Fix transaction title breaks row on some languages (#570) 2021-06-11 23:16:45 -05:00
Felipe Knorr Kuhn
8385c50605 Update test dependencies (#572)
* move Cypress to the optionalDependencies section

* remove protractor

* remove dead protractor test files
2021-06-11 23:06:55 -05:00
softsimon
93c4b1caf1 Fix for missing overpaid fees tag on confirmed txs
fixes #483
2021-06-11 19:30:33 -05:00
softsimon
49810b6a47 Added new i18n strings 2021-06-11 14:54:57 -05:00
softsimon
28d685a661 Updated i18n from transifex 2021-06-11 10:58:54 -05:00
softsimon
95d3d0feaf Bisq transactions was listed in the wrong order.
fixes #566
2021-06-11 10:55:13 -05:00
softsimon
cbc5d67f62 Update README.md 2021-06-10 16:18:26 -05:00
softsimon
87575bc0a2 Add v2.2.0 screen shot 2021-06-10 16:18:09 -05:00
softsimon
8f74ef58f8 i18n fixes. 2021-06-10 15:38:15 -05:00
softsimon
2475c67d5b Use default proxy config for local proxy conf. 2021-06-10 09:55:19 -05:00
softsimon
bf45bf7b39 Update i18n from transifex 2021-06-10 09:52:13 -05:00
Miguel Medeiros
a1f0417997 Sponsor page (#560)
* Refactor sponsors page layout.
Remove add to t-shirts.

* Remove tshirt promo.

* Refactor sponsors page layout.
Remove add to t-shirts.

* Remove bootstrap classes and inline styles.
Add new classes to thanks page.

Co-authored-by: softsimon <softsimon@protonmail.com>
2021-06-09 18:36:34 -05:00
Miguel Medeiros
237f265aab Refactor about page layout. (#559)
* Refactor about page layout.

* Fix loading sponsors layout.
Fix container margins.
Fix sponsor image src.
2021-06-09 18:35:54 -05:00
softsimon
0087700aa5 Adding missing i18n strings on Bisq. 2021-06-09 14:09:25 -05:00
softsimon
861344ed6d Update i18n from transifex. 2021-06-09 13:35:07 -05:00
softsimon
9e343b346a Update i18n. 2021-06-08 22:44:52 -05:00
softsimon
e857dbc874 I18n space fix. 2021-06-08 22:38:48 -05:00
softsimon
a10cd09ba8 I18n space fix. 2021-06-08 22:37:23 -05:00
softsimon
f30777934f Remove tshirt promo. 2021-06-08 21:42:48 -05:00
Miguel Medeiros
4f6bf297bf Fix loading icon position at graph page. (#558) 2021-06-08 00:29:25 -04:00
Miguel Medeiros
0121052f0b Fix lint errors. (#556) 2021-06-07 15:48:27 -04:00
Felipe Knorr Kuhn
1bd0c40c15 New e2e test suite (#555)
* add @cypress/schematic as a dev dependency

* replace protractor with cypress

* remove the boilerplate test

* add the cypress-wait-until helper library

* add cypress-wait-until to all tests

* add signet to stg proxy config

* add proxy config for production

* add environment configs to angular.json

* update e2e target to use the production proxy

* update serve and start scripts to use the new environment config

* add the concurrently lib to the dev dependencies

* fix missing import

* ignore videos and screenshots saved by the e2e suite

* add fixtures for the tests

* update cypress npm scripts to use concurrently

* add some e2e tests
2021-06-07 10:36:41 -04:00
softsimon
2ee96cae44 Remove duplicate i18n string sponsor 2021-06-06 17:16:39 -04:00
softsimon
28c8d7dba0 Updated i18n 2021-06-06 16:56:08 -04:00
softsimon
9b05ecedc6 Address page: Display load more button on load error. (#542)
fixes #440
2021-06-06 16:07:45 -04:00
softsimon
8fbd273733 Empty Bisq blocks was missing. (#541)
fixes #539
2021-06-06 16:07:26 -04:00
Miguel Medeiros
dec8ae2930 Dashboard layout reviewed. (#550)
* Fix mempool-info-data item margin-bottom.

* Remove unecessary bootstrap classes.

* Fix lint errors.

* Fix and remove css classes.

* Add css class to Terms of Service.
2021-06-06 16:07:04 -04:00
Miguel Medeiros
353b0e8729 New API docummentation. (#544)
* Install hljs package.

* Add highlight.js stylesheet and js to index.html.

* Add new instructions for API documentation.

* Add network value to code-template component.

* Add curl examples.

* Fix tab order of bisq api page.

* Add esmodules instalation instructions.
Add external links to repositories.

* Add self-hosted hljs styles.

* Add response code examples.
Add dynamic networks to curl examples.
Remove reponse code box if not needed.

* Self hosted highlight.min.js.

* Bumping "ws" dependency to fix vulnerability.

* npm audit fix

* npm audit fix

* Remove Hightlight.js dependency.
Add new style to code-template-component.

* Remove hljs css.

* Change NgbModule and NgbAccordionModule  to shared

* Fix NgbAccordionModule import.
2021-06-06 16:06:56 -04:00
softsimon
71bfcea8a6 npm audit fix 2021-05-31 19:03:10 -04:00
softsimon
c54c30209e npm audit fix 2021-05-31 19:02:39 -04:00
softsimon
abc6b1519e Bumping "ws" dependency to fix vulnerability. 2021-05-31 18:49:19 -04:00
Miguel Medeiros
4dcda2cf47 Invert graph legends order. (#532)
* Invert graph legends order.

* Reorder graph legends if inverted-graph is true.
2021-05-23 13:51:29 +04:00
Miguel Medeiros
d055fabfeb Fix innerHTML element of status view component. (#537) 2021-05-23 02:16:23 +04:00
Miguel Medeiros
dbb365f5e3 Align loading component in the center. (#535)
* Align loading component in the center.

* Change height of loading component.
2021-05-22 18:57:15 +04:00
Miguel Medeiros
efb5deda43 Fix missing whitespace linting. (#534) 2021-05-21 19:03:18 +04:00
softsimon
a4cd6450e3 Fix for race condition causing cpfp fetching not working. (#533)
fixes #505
2021-05-21 17:06:53 +04:00
softsimon
edad15da0d Upgrading mempool.js 2021-05-21 03:30:39 +04:00
Miguel Medeiros
e70fd0045d Fix tx-list load is being constantly triggered. (#531) 2021-05-20 02:03:59 +04:00
Miguel Medeiros
794bc99cb6 Change chart-holder width. (#530) 2021-05-20 00:44:21 +04:00
Miguel Medeiros
cd1ec53af0 Align scriptmessage text to the left. (#529)
* Align scriptmessage text to the left.
* Script message box only fills the text width.
2021-05-19 01:16:47 +04:00
Miguel Medeiros
3e435d1394 Fix vertical align Graph. (#528)
* Fix graph component vertical css query.

* Fix chart-holder padding-top.
2021-05-19 01:06:51 +04:00
Miguel Medeiros
50b94f8b72 Fix TV View graph height. (#527)
* Fix graph alignment.
Only show the graph on desktop resolutions.

* Fix mempool-info-chart chart alignment.
2021-05-18 23:59:48 +04:00
softsimon
f6f5b69487 Sponsor t-shirts. 2021-05-18 23:00:07 +04:00
wiz
66b27b9dd0 Merge pull request #524 from mempool/simon/sponsor-page
New separate sponsorship page
2021-05-19 00:50:14 +09:00
Miguel Medeiros
71fa2d67cb Fix rbf alert css. (#525) 2021-05-18 18:56:42 +04:00
Miguel Medeiros
5cd2cfa097 FIX unify the units css. (#499)
* FIX unify the units css.
* Fix units css font-size.
2021-05-18 18:20:17 +04:00
softsimon
cfd13b3655 New separate sponsorship page. 2021-05-18 13:23:39 +04:00
wiz
3ffa60db1f Merge pull request #517 from mempool/simon/bisq-address-prefix-search
Handle the 'B' prefix in the search bar autocomplete on /bisq
2021-05-14 03:42:15 +09:00
softsimon
4442964124 Updated regex to accept bisq-addresses. 2021-05-13 21:56:57 +04:00
wiz
cb034020ef Merge pull request #521 from mempool/simon/bisq-price-coloring
Bisq dashboard: Change color between red/green when price changes
2021-05-14 00:53:15 +09:00
softsimon
5aa57d6df9 Bisq dashboard: Change color between red/green when price changes 2021-05-13 19:23:43 +04:00
softsimon
c1a79e3a33 Handle the 'B' prefix in the search bar autocomplete on /bisq
refs #510
2021-05-13 03:01:47 +04:00
wiz
bbd21c9401 Merge pull request #511 from knorrium/improve_scrolling_between_routes
Improve scrolling between routes
2021-05-13 02:03:14 +09:00
wiz
ad22f9cb46 Merge pull request #515 from mempool/simon/round-up-fee-estimates
Round up fee estimations
2021-05-13 01:42:37 +09:00
softsimon
939955fb84 Round up fee estimations 2021-05-12 20:13:55 +04:00
softsimon
63e67dba38 Bisq markets: Add terms of service 2021-05-12 16:07:25 +04:00
softsimon
8a1230623e Adding missing icon import. 2021-05-12 15:57:46 +04:00
softsimon
f20c73af7b Update fiat price every minute instead of every hour. 2021-05-12 15:09:48 +04:00
softsimon
12c99b86b7 Bisq markets: Display terms of service and language selector (except on official markets).
refs #510
2021-05-12 14:51:55 +04:00
softsimon
934dd67384 Updated i18n from transifex. 2021-05-11 15:31:42 +04:00
softsimon
870bd54b38 Updated i18n. 2021-05-11 15:29:03 +04:00
softsimon
89300dae98 Bisq markets: Fix for graph not updating when changing window
refs #510
2021-05-11 14:55:45 +04:00
softsimon
482a891cec Bisq markets: Swapping price locations 2021-05-11 14:37:25 +04:00
softsimon
098ab7d3a7 Bisq market symlinks fix. 2021-05-11 13:25:16 +04:00
softsimon
147d44d14b npm audit fix 2021-05-11 12:43:19 +04:00
Felipe Knorr Kuhn
8ccdf3973c set toggleShowDetails() to scroll into the viewport using anchors 2021-05-10 22:18:30 -07:00
wiz
c09eb651ef Add production/nginx-bisq.conf for bisq.markets usage 2021-05-11 14:18:25 +09:00
Felipe Knorr Kuhn
ac91d814d6 add anchors to the block component 2021-05-10 22:16:42 -07:00
Felipe Knorr Kuhn
be2f024da1 enable scroll position restoration and anchor scrolling 2021-05-10 22:15:54 -07:00
wiz
f137f45cef Merge pull request #508 from mempool/simon/bisq-new-dashboard
New Bisq Markets Dashboard Design
2021-05-11 13:40:32 +09:00
softsimon
90784deacc New Bisq Markets Dashboard Design
fixes #476
2021-05-11 04:15:11 +04:00
softsimon
8ed664e3a9 Update translations from transifex. 2021-05-08 01:12:57 +04:00
softsimon
17b6916f31 Update i18n messages. 2021-05-08 01:11:05 +04:00
Miguel Medeiros
b778d96910 Fix OP_RETURN truncated text. (#502)
* Fix OP_RETURN truncated text.

* Fix scriptmessage width on desktop media queries
2021-05-08 00:36:35 +04:00
wiz
5b2eb16d1c Merge pull request #498 from MiguelMedeiros/op_return
Fix Coinbase and OP_RETURN truncated text.
2021-05-07 00:00:12 +09:00
wiz
af61357ced Merge pull request #478 from mempool/simon/address-page-error-localization
Localize electrum limit error.
2021-05-06 23:04:01 +09:00
wiz
f281e84396 Disable caching of electrs endpoints in production/nginx.conf 2021-05-06 21:20:13 +09:00
Miguel Medeiros
0dc255edf9 Fix OP_RETURN css width. 2021-05-06 09:00:33 -03:00
Miguel Medeiros
2f8f3ca2e9 New concept for dashboard layout components. (#469)
* New concept for dashboard layout components.

* Align dashboard componentes.

* Add divider to fee box component.

* Remove TV icon from mobile and tablet queries.

* Fix form input overflow.

* Add responsive css to statistic component.

* Add responsive css to about page.

* Add global padding bottom.

* Fix graph page styles.

* Add responsive chart and scrollable table.

* Fix mobile css query for navbar menus.

* Fix pagination responsive css.

* Add CSS animated logo.

* Revert "Add CSS animated logo."

This reverts commit 92af38294c0d4fe815a801b37635cde7f8ee1ced.

* Add extra skeleton to fee-box-component.

* Fix latest-blocks and latest-transactions table css.

* Adapt Bisq pages to responsive layout.

* Remove parenthesis from fiat amout.
Fiat prive break not break on desktop.
Transaction ID align left.
Fee box skeleton width resize.

* Fix mobile table text-size.

* Fix dashboard mempool info mobile alignment.
2021-05-03 17:11:30 +04:00
softsimon
39bb93970b Lower height where taproot signaling cal be visible. 2021-05-01 21:46:49 +04:00
softsimon
72d01a0b67 Improve taproot detection. Only display when detected. 2021-05-01 21:03:01 +04:00
softsimon
0b4da88802 Hide taproot signalling until signalling starts. 2021-05-01 04:06:45 +04:00
softsimon
d2fe000ad0 Display block details and taproot signaling. 2021-05-01 03:55:02 +04:00
softsimon
dcedc8a5ff Localize electrum limit error.
fixes #442
2021-04-27 14:21:33 +04:00
wiz
0d03a9e6cc Send HTTP header Vary: Cookie to prevent localization cache bug
Fixes #477
2021-04-27 19:00:33 +09:00
wiz
24b7acdc60 Merge pull request #475 from mempool/simon/difficulty-adjustment-calc-fix
Fixing incorrect difficulty adjustment call
2021-04-27 17:50:43 +09:00
wiz
1000f4dd4d Merge pull request #474 from mempool/simon/bitcoind-tx-push-break-fix
Fix crash issues related to new unconfirmed transactions in bitcoind …
2021-04-27 17:44:19 +09:00
softsimon
d5dba9128e Fixing incorrect difficulty adjustment call
fixes #471
2021-04-27 12:20:11 +04:00
softsimon
84b0375c0c Fix crash issues related to new unconfirmed transactions in bitcoind mode.
fixes #391
2021-04-27 02:13:48 +04:00
softsimon
bf23a6649c Updating from transifex. 2021-04-26 04:05:55 +04:00
softsimon
aea35d4c86 i18n update 2021-04-26 04:03:33 +04:00
softsimon
52b7efdd53 Updated transifex. 2021-04-26 03:45:14 +04:00
wiz
492abad7a6 Fix a few Bisq strings, update transifex source strings 2021-04-26 07:59:15 +09:00
softsimon
f566eae471 Fixed api docs typo. 2021-04-26 02:40:30 +04:00
wiz
2f2be5c64b Capitalize some strings in Bisq components, update i18n 2021-04-26 07:30:34 +09:00
wiz
5d1af0a86e Merge pull request #381 from mempool/simon/bisq-dashboard
Bisq dashboard
2021-04-26 07:17:03 +09:00
softsimon
5cd5280b21 Updated i18n 2021-04-26 01:49:58 +04:00
softsimon
3a957ece05 Merge branch 'master' into simon/bisq-dashboard
# Conflicts:
#	frontend/src/locale/messages.xlf
2021-04-26 01:41:07 +04:00
wiz
3ead05fa51 Add missing i18n tags for various strings, fixes #473 2021-04-26 06:35:56 +09:00
wiz
8a838cd4dc Credit @maciejsoltysiak as translator for Polish 2021-04-26 06:27:51 +09:00
wiz
b05f731332 Update translated strings from Transifex 2021-04-26 06:17:59 +09:00
wiz
06fd821bf8 Update translated strings from Transifex 2021-04-26 05:44:00 +09:00
wiz
6dbfcc9d1a Enable i18n for Polish language 2021-04-26 05:43:47 +09:00
softsimon
001bddd529 Bisq Markets i18n 2021-04-25 22:52:11 +04:00
softsimon
56518b9655 Updated titles 2021-04-25 19:40:43 +04:00
softsimon
da050ee3dc Swap BTC/Fiat columns. 2021-04-25 19:02:26 +04:00
softsimon
5878a2e631 Unified Bisq config 2021-04-25 02:38:46 +04:00
softsimon
c1fc08196b Add whitespaces to missing data points. 2021-04-25 02:07:29 +04:00
softsimon
95a80157a7 Hide latest altcoin trades when not using official bisq markets. 2021-04-24 20:33:56 +04:00
softsimon
165aa6eee2 Don't hide API docs on mobile. 2021-04-23 15:44:01 +04:00
softsimon
b8fe7b621c Merge branch 'master' into simon/bisq-dashboard
# Conflicts:
#	frontend/package-lock.json
#	frontend/src/app/components/master-page/master-page.component.html
2021-04-23 15:35:35 +04:00
softsimon
04ec5e9564 Sort table by number of trades as default sort option, make other columns sortable 2021-04-23 15:09:51 +04:00
softsimon
2d4dff6de8 Display 100 latest trades. 2021-04-23 03:49:55 +04:00
softsimon
5cb98b9813 Make unique URLs for graph timespans 2021-04-21 22:12:35 +04:00
softsimon
d4508bd876 Add loading spinners. 2021-04-21 20:22:34 +04:00
wiz
6ccac1df79 Merge pull request #467 from knorrium/fix_infinite_scrolling
fix infinite scrolling by not using body as the container
2021-04-20 16:47:50 +09:00
Felipe Knorr Kuhn
b38fc824e6 fix infinite scrolling by not using body as the container 2021-04-19 23:48:33 -07:00
softsimon
cdbe90c182 Only enable statistics service from node master process.
fixes #460
2021-04-19 21:39:30 +04:00
softsimon
6b5b80f866 Update chart colors. 2021-04-19 17:39:47 +04:00
Miguel Medeiros
d74677628b New UI for responsive navbar. (#458)
New UI for responsive navbar.
fixes #458
2021-04-19 17:01:04 +04:00
softsimon
f0d46d6ed8 Don't reload after setting graph preference setting.
refs #365
2021-04-19 10:50:24 +04:00
Felipe Knorr Kuhn
220d9afd97 persist graph window preference between reloads (#456)
Persist graph window preference between reloads
fixes #365
2021-04-19 10:17:16 +04:00
wiz
dfd88a7ff9 Merge pull request #454 from knorrium/fix_ios_native_scrolling
fix native scrolling on iOS devices
2021-04-18 19:26:27 +09:00
wiz
eec36ae4e6 Merge pull request #453 from knorrium/bind_server_address 2021-04-18 08:16:56 +09:00
Felipe Knorr Kuhn
0a07a16650 fix native scrolling on iOS devices 2021-04-17 16:11:34 -07:00
Felipe Knorr Kuhn
e62ee72149 bind the server to 0.0.0.0 to allow it to be reachable by other devices 2021-04-17 15:53:22 -07:00
softsimon
117f5410d7 Merge pull request #452 from knorrium/stg_frontend_config
add new configuration and targets to point the frontend to staging
2021-04-18 02:10:09 +04:00
Felipe Knorr Kuhn
f6ea45b61f add new configuration and targets to point the frontend to staging 2021-04-17 14:52:16 -07:00
wiz
90b06833ba Rename frontend npm dep @mempool/mempool-js to @mempool/mempool.js 2021-04-17 12:58:27 +09:00
wiz
221fccf3bc Merge pull request #449 from mempool/simon/syslog-config
Syslog is now configurable with minimum priority and facility option.
2021-04-16 02:54:22 +09:00
wiz
3740980007 Update Exodus logo with new SVG 2021-04-16 02:29:06 +09:00
softsimon
d1b53f4c3a Syslog priority comparison fix. 2021-04-15 21:16:56 +04:00
wiz
d51ea54ab9 Add production FreeBSD tuning parameters to increase network buffers 2021-04-16 00:12:29 +09:00
wiz
3300f0e8d3 Set production backend config "CLEAR_PROTECTION_MINUTES": 5 2021-04-15 21:44:38 +09:00
softsimon
cd1273981d Syslog is now configurable with minimum priority and facility option.
fixes #135
2021-04-15 16:04:09 +04:00
softsimon
fd0ffd2a39 Upgrading mempool-js to v2.3. 2021-04-15 00:57:10 +04:00
wiz
d60bc10941 Update Square Crypto logo with SVG image 2021-04-14 05:04:02 +09:00
wiz
5085e0c420 Add Exodus as Enterprise Sponsor on About page 2021-04-14 04:55:58 +09:00
softsimon
3dbddedf91 Remove 'v' from version. 2021-04-13 18:12:32 +04:00
softsimon
e255bec7ad Updating versions to v2.2.0-dev 2021-04-13 16:53:42 +04:00
softsimon
cbe79d7051 Show backend info at the bottom. Removing frontend hostname. Re-adding frontend version and commit on top. JS error fix. 2021-04-13 11:51:55 +04:00
softsimon
344d1247bd Updated package.json. 2021-04-13 11:30:53 +04:00
wiz
089bb38e6a Change log priority for 'The mempool is now in sync!' message to NOTICE 2021-04-13 14:03:36 +09:00
wiz
2077126064 Merge pull request #447 from mempool/simon/frontend-commit-hash-hostname
Backend and frontend commit, version and hostname displayed on the about page
2021-04-13 13:58:59 +09:00
softsimon
fcf7955d63 Merge branch 'master' into simon/bisq-dashboard
# Conflicts:
#	frontend/package-lock.json
#	frontend/package.json
2021-04-12 22:22:50 +04:00
softsimon
7a4ad0ee2f Including gitCommit and version in frontend build. Backend now sending a backendInfo object containing commit, version and hostname. All printed on About page. 2021-04-12 22:17:13 +04:00
wiz
4bb68d0163 Update mempool.space og/twitter preview image with 5 block style logo 2021-04-13 00:13:58 +09:00
wiz
f80a11d1f4 Increase section spacing on About page 2021-04-13 00:10:15 +09:00
wiz
f61e3d8cec Merge pull request #445 from mempool/simon/disk-cache-save-error
Only allow one disk cache saving simultaneously, and allow for partia…
2021-04-12 18:40:32 +09:00
softsimon
7fab42baa5 Only allow one disk cache saving simultaneously, and allow for partially written cache files.
fixes #444
2021-04-12 13:21:49 +04:00
softsimon
4ab4581393 Fix for effective fee rate calculation bug. 2021-04-12 13:02:31 +04:00
wiz
4c8d261da0 Merge pull request #441 from knorrium/fix_address_explorer_typo 2021-04-11 13:34:28 +09:00
Felipe Knorr Kuhn
88c9fd0c7b fix typo on 413/405 error message on the address explorer 2021-04-10 21:04:30 -07:00
softsimon
f1c5f83412 Don't round variables in code, only in templates. 2021-04-10 23:23:05 +04:00
softsimon
2d9b9b5c5d When filtering out lower fee parents, compare with effective fee instead of base fee to include a CPFP chain of transactions. 2021-04-10 21:26:05 +04:00
softsimon
c7c4895eab fixes #438 2021-04-10 20:59:27 +04:00
softsimon
979b870c9c Bump mempool-js version to 2.2.1 2021-04-10 18:58:20 +04:00
softsimon
041aa2a163 Build mempool-js as standalone. 2021-04-10 18:51:13 +04:00
wiz
1bb990b796 Merge pull request #436 from MiguelMedeiros/bugfix/project-contributor-alignment
FIX: align project contributor handle text.
2021-04-10 19:44:26 +09:00
wiz
a6e7e1966e Merge pull request #437 from mempool/simon/contributors-proxy
Proxy contributor requests.
2021-04-10 19:39:26 +09:00
softsimon
db263b8db4 Proxy contributor requests. 2021-04-10 11:33:01 +04:00
Miguel Medeiros
0289620262 FIX: align project contributor handle text. 2021-04-09 17:07:11 -03:00
wiz
d8ef0cd3ac Add BlueWallet as Community Integration on About page
Also try to fix sort order of integrations:
* P2P Exchange Networks
* Raspberry Pi distros
* Onchain wallets
* Lightning wallets
* Watch-only wallets
2021-04-10 02:32:27 +09:00
wiz
68be897379 Fix typo in API documentation for /api/block/:hash/raw method 2021-04-09 21:59:21 +09:00
wiz
2016d4bca6 Merge pull request #433 from mempool/simon/build-mempool-js
Build mempool-js to root www folder.
2021-04-09 12:01:30 +09:00
wiz
0c2d88960c Publish mempool-js output as mempool.js instead of .min.js 2021-04-09 12:01:21 +09:00
softsimon
e3e1cddd2f Build mempool-js to root www folder. 2021-04-09 01:22:24 +04:00
wiz
00b564149d Add Square as Enterprise Sponsor on About page 2021-04-08 00:05:11 +09:00
wiz
dee614f6ac Merge pull request #432 from mempool/simon/angular-11-upgrade
Upgrading all front and backend dependencies, including Angular 11.
2021-04-07 23:31:30 +09:00
wiz
896a4cbcfc Set frontend tsconfig to target es2020 2021-04-07 22:40:13 +09:00
softsimon
e731077077 extractCss is deprecated and always defaults to true. 2021-04-07 17:36:20 +04:00
softsimon
4a907f9dc6 Upgrading all front and backend dependencies, including Angular 11.
fixes #429
2021-04-07 16:18:55 +04:00
wiz
b0baf6aa0d Merge pull request #422 from mempool/simon/corerpcminfee-catcher
Catch getMempoolInfo errors gracefully to not break general main loop
2021-04-06 16:08:20 +09:00
softsimon
8dddfe38a9 Updating getMempoolInfo defaults. 2021-04-06 11:07:38 +04:00
wiz
0f9f905fd1 Merge pull request #419 from mempool/simon/cpfp-duplicate-fix
Fix for duplicate cpfp ancestors.
2021-04-06 15:58:58 +09:00
wiz
bc8e3109fa Merge pull request #427 from mempool/simon/cpfp-ancestors-fee-bug
Bugfix: Ancestors are not able to increase fee of descendants
2021-04-06 15:52:46 +09:00
softsimon
56b0eab9b4 Bugfix: Ancestors are not able to increase fee of descendants
fixes #426
2021-04-06 10:41:13 +04:00
softsimon
5914d99283 Bugfix: Ancestors are not able to increase fee of descendants
fixes #426
2021-04-05 23:45:47 +04:00
softsimon
d942cb48a5 Catch getMempoolInfo errors gracefully to not break general main loop
fixes #411
2021-04-02 11:47:13 +04:00
softsimon
4d0429b786 Fix for duplicate cpfp ancestors.
fixes #414
2021-04-02 00:30:51 +04:00
wiz
2b1c511611 Merge pull request #410 from mempool/wiz/dual-license-under-agplv3-and-gplv3
Dual-license mempool under both the GNU AGPLv3 and GPLv3 licenses
2021-04-02 00:15:59 +09:00
wiz
8a86b63693 Tweak margins and layout spacing on About page 2021-04-01 16:42:37 +09:00
softsimon
2a2c1a6291 Increase space between logos and titles. 2021-03-31 22:49:55 +09:00
wiz
ce1860b7d1 Add Gemini as an Enterprise Sponsor on About page 2021-03-31 22:49:51 +09:00
softsimon
37e01c5e91 Always display one decimal on fee rate for consistency. 2021-03-31 15:43:23 +04:00
wiz
0ff05d5551 Update legal notices for dual-licensed AGPLv3 and GPLv3 on About page 2021-03-28 00:07:03 +09:00
wiz
9b428821f6 Dual-license mempool under both the GNU AGPLv3 and GNU GPLv3 licenses
A few weeks ago in #388, we changed the license for the mempool project
from MIT+CC to AGPLv3. This was generally met with very positive
feedback from the Bitcoin community. However, a few very large
enterprise organizations that love the mempool project are now no longer
able to use our code, since apparently some enterprise organizations
have an internal policy of not using AGPL licensed software.

Since the AGPLv3 license is compatible with the GPLv3 license in various
ways, adding the GPLv3 as an alternative second license for the project
seems like a reasonable way to retain most of the copyleft properties of
our current AGPLv3 license, while also keeping the community happy and
allowing them GPLv3 as another choice if they are prohibited from using
the AGPL internally.

Therefore, I propose to add GPLv3 as an alternative license for the
mempool open source project in this PR. If you are okay with this,
please ACK with "I hereby re-license my contributions to the mempool
open source project under both the GNU AGPLv3 and GPLv3 licenses"

- [ ] @softsimon
- [ ] @wiz
- [ ] @bguillaumat
- [ ] @TechMiX
- [ ] @rbrooklyn
- [ ] @junderw
- [ ] @andrerfneves
- [ ] @andrewtoth
- [ ] @6102bitcoin
- [ ] @Czino
- [ ] @devinbileck
- [ ] @knorrium
- [ ] @jambolo
- [ ] @lucasmoten
- [ ] @fiatjaf
- [ ] @pox
- [ ] @RandyMcMillan
- [ ] @timlucmiptev
2021-03-27 20:02:53 +09:00
wiz
21bb879fc1 Add link to Muun Wallet on About page 2021-03-27 13:12:47 +09:00
wiz
8a97880cdb Merge pull request #408 from knorrium/fix_electrum_dockerfile
fixes to the electrum Dockerfile
2021-03-25 12:45:56 +09:00
Felipe Knorr Kuhn
ca267744a6 fixes to the electrum Dockerfile 2021-03-24 16:24:04 -07:00
wiz
a4253301dc Merge pull request #403 from bitcoincore-dev/makefile
docker: add Makefiles for easier docker deploy
2021-03-24 22:37:18 +09:00
randymcmillan
402c5e3444 deploy: add Makefile for easier docker deploy 2021-03-23 19:57:04 -04:00
softsimon
f12eb333d2 Reuse same i18n string for fee warning tooltip. 2021-03-23 05:18:08 +07:00
wiz
a0b50d7735 Merge pull request #404 from mempool/simon/cpfp-frontend
Visualize the CPFP transactions.
2021-03-22 21:30:00 +09:00
softsimon
3967ce0854 Fix: Compare with tx.feePerVsize to determine if modified fee is the same.
refs #401
2021-03-22 18:24:51 +07:00
softsimon
ed55e86a9d Visualize the CPFP transactions.
fixes #401
2021-03-22 18:04:50 +07:00
softsimon
c93adba276 Merge pull request #402 from mempool/simon/mempool-lazy-delete
Flag transactions for lazy deletion.
2021-03-21 14:58:22 +07:00
softsimon
1ae002385d Merge branch 'simon/cpfp-frontend' into simon/bisq-dashboard
* simon/cpfp-frontend: (46 commits)
  Bugfix: Don't extend already extended transactions to not override the firstSeen property. fixes #390
  Shuffle mempool transactions before saving disk cache. (#398)
  Adding missing return after expressjs response.
  CPFP support (#395)
  Round sat/vB in fee rating tooltip. fixes #364
  Add the GNU AGPLv3 logo to About page
  Update package.json license tags
  Add recommended fee percentile config (#394)
  Fix typo in README (#392)
  Fix icon for Specter Wallet on About page
  Add link to Specter Wallet on our About page
  Add link to WARden Portfolio app as Community Integration on About page
  Delete MIT+CC license from Terms of Service, add AGPLv3 to About page
  Change mempool project license to GNU Affero General Public License v3
  Lower volume for sound effects (#385)
  Improve grammar, layout, and formatting of Terms of Service page
  Display all Project Contributors on About page using GitHub API (#382)
  Modify nginx.conf to cache HTML for 10m and static resources for 1h
  Proxy /api/v1/contributors from mempool.space, also fix HTTP headers
  Add link to Bisq's GitHub repo on About page
  ...
2021-03-21 06:12:41 +07:00
softsimon
e05ca7d691 Flag transactions for lazy deletion.
fixes #400
2021-03-21 06:06:03 +07:00
softsimon
dc36bfcfe4 Adding Bisq markets logo. 2021-03-21 02:40:37 +07:00
softsimon
e688948e42 Bugfix: Don't extend already extended transactions to not override the firstSeen property.
fixes #390
2021-03-19 19:10:11 +07:00
softsimon
5148de8f17 Shuffle mempool transactions before saving disk cache. (#398)
fixes #397
2021-03-19 13:47:37 +07:00
softsimon
6f1cdd0c8b Adding missing return after expressjs response. 2021-03-18 23:53:39 +07:00
softsimon
d3c53c7406 CPFP support (#395)
* CPFP support.

fixes #5
fixes #353
fixes #360

* Use effectiveFeePerVsize for mempool statistics.

* Renaming endpoint cpfp-info to just cpfp.

* Renaming decended to BestDescendant.

* Updating language file with new strings.
2021-03-18 23:47:40 +07:00
softsimon
b2d08d69cf Round sat/vB in fee rating tooltip.
fixes #364
2021-03-18 19:18:59 +07:00
wiz
b85c2a6e0f Merge pull request #396 from mempool/wiz/add-agpl-logo-to-about-page
Add the GNU AGPLv3 logo to About page
2021-03-18 17:48:32 +09:00
wiz
f1f847a9f8 Add the GNU AGPLv3 logo to About page 2021-03-18 17:44:25 +09:00
wiz
8b5d3dabe7 Update package.json license tags 2021-03-18 16:30:10 +09:00
andrewtoth
ac4588cdab Add recommended fee percentile config (#394) 2021-03-18 12:52:46 +07:00
andrewtoth
baa75b77a7 Fix typo in README (#392) 2021-03-18 12:46:16 +07:00
wiz
f2a08444fe Fix icon for Specter Wallet on About page 2021-03-18 01:14:25 +09:00
wiz
c866fbf6df Add link to Specter Wallet on our About page 2021-03-17 22:23:29 +09:00
softsimon
da77dbece1 Bisq markets: General trading volume graph. 2021-03-16 01:17:40 +07:00
wiz
6a07eb0d91 Add link to WARden Portfolio app as Community Integration on About page 2021-03-16 01:56:19 +09:00
wiz
057a96001d Merge pull request #388 from mempool/wiz/change-license-to-agplv3
Change mempool project license to GNU Affero General Public License v3
2021-03-15 06:26:09 +09:00
wiz
f173b17b90 Delete MIT+CC license from Terms of Service, add AGPLv3 to About page 2021-03-15 05:45:53 +09:00
softsimon
8e29a4cefd Bisq markets: Titles 2021-03-14 23:24:06 +07:00
wiz
6b47895aec Change mempool project license to GNU Affero General Public License v3
The files contained in this source code repository are currently
released as "open source" under the terms of the [MIT license](https://opensource.org/licenses/MIT),
with the additional protections of the [Commons Clause License Condition v1](https://commonsclause.com/),
in order to restrict monetization of the mempool app, with the
intended result of mempool remaining free software (as in free
beer) for the Bitcoin community.

However, because of the Commons Clause being added to our license terms,
The Mempool Open Source Project cannot formally be considered as [Free
and open-source software (FOSS)](https://en.wikipedia.org/wiki/Free_and_open-source_software),
according to the generally accepted definition of ["What is free
software?"](https://www.gnu.org/philosophy/free-sw.en.html), and this
has drawn some criticism from the Bitcoin open source community.

Therefore, in order to make The Mempool Open Source Project truly FOSS,
I hereby propose to change our project's license to the [GNU Affero
General Public License v3](https://www.gnu.org/licenses/agpl-3.0.html),
which seems most suitable for a web application. While this won't keep
the mempool free as in free beer, it will keep mempool free as in free
speech, which is what actually matters.

Here is [the TL;DR of AGPLv3](https://tldrlegal.com/license/gnu-affero-general-public-license-v3-(agpl-3.0)):
> The AGPL license differs from the other GNU licenses in that it was
> built for network software. You can distribute modified versions if
> you keep track of the changes and the date you made them. As per usual
> with GNU licenses, you must license derivatives under AGPL. It
> provides the same restrictions and freedoms as the GPLv3 but with an
> additional clause which makes it so that source code must be
> distributed along with web publication. Since web sites and services
> are never distributed in the traditional sense, the AGPL is the GPL of
> the web.

Could all contributors to The Mempool Open Source Project please ACK
this PR?  @softsimon @wiz @bguillaumat @TechMiX @junderw @andrerfneves
@pox @jambolo @6102bitcoin @devinbileck @fiatjaf @timlucmiptev @Czino
@lucasmoten
2021-03-15 00:59:31 +09:00
softsimon
146fcfc16d Bisq markets: Hide altcoins when not in official bisq markets mode 2021-03-14 02:42:14 +07:00
softsimon
308dd2c7ad Bisq markets: Recent trades. Separate Bisq master page. 2021-03-13 18:24:50 +07:00
Jonathan Underwood
4cbf2e0eb4 Lower volume for sound effects (#385)
* Turn down that racket *shakes cane*

* Maybe a little lower

* Maybe 80%?

* 70?

* 30 ok?

* 65 sounds best
2021-03-12 13:20:40 +07:00
softsimon
1d4ed85d50 Bisq markets: Volume and other fixes. 2021-03-10 23:02:55 +07:00
wiz
a530d8b17f Improve grammar, layout, and formatting of Terms of Service page 2021-03-09 14:22:14 +09:00
wiz
e32066affd Display all Project Contributors on About page using GitHub API (#382) 2021-03-09 01:56:41 +07:00
wiz
d5cc558670 Modify nginx.conf to cache HTML for 10m and static resources for 1h
Fixes #61
2021-03-08 18:50:57 +09:00
wiz
a52f98c39d Proxy /api/v1/contributors from mempool.space, also fix HTTP headers
Fixes #366
2021-03-08 18:34:04 +09:00
wiz
7beb832007 Merge pull request #380 from junderw/fixCacheUpdate
Fix bug where legend state is reverted when clicking 1-2 after a 1-minute auto-update.
2021-03-08 16:10:10 +09:00
wiz
3e1c4a7e59 Add link to Bisq's GitHub repo on About page 2021-03-08 12:58:00 +09:00
softsimon
3b8d3221cf Adding enterprise sponsors i18n string. 2021-03-07 21:48:33 +07:00
junderw
b594a9d249 Fix? 2021-03-07 23:45:43 +09:00
softsimon
d20cec4e59 Updating translations from transifex. 2021-03-07 20:13:39 +07:00
softsimon
e5972aa181 Updating transifex. 2021-03-07 20:05:20 +07:00
wiz
b0912064cc Minor tweak of ToS formatting, clarify Bitcoin Only, add 3rd party licenses 2021-03-07 09:37:49 +09:00
wiz
84737bca6e Merge pull request #376 from jambolo/master
Fix mempool-graph legend off-by-one
2021-03-07 03:44:15 +09:00
wiz
14db7e4c8b Update ToS for copyright, mempool.space operator, external link policy (#377)
Update ToS for copyright, mempool.space operator, external link policy
2021-03-05 19:07:31 +07:00
softsimon
d99fd5d59a Bisq markets dashboard: Market backend tracking. WIP. 2021-03-05 15:38:46 +07:00
wiz
9624801716 Add a bit more margin to alliances on About page 2021-03-05 16:33:05 +09:00
John Bolton
904cf62c78 Fixes mempool-graph legend off-by-one
Resolves issue #283.
2021-03-04 23:31:09 -08:00
wiz
92e2df4627 Move the Bisq logo on About page from Integrations to Alliances (#375) 2021-03-05 14:30:08 +07:00
wiz
f157a50952 Update hostname in index.html for stats.mempool.space 2021-03-05 15:19:56 +09:00
wiz
c3927c9f0a Fix community integration links on About page to point to GitHub repos 2021-03-05 13:32:52 +09:00
wiz
45505c86d9 Merge pull request #374 from junderw/showFeeTiles
Show fee tiles on mobile
2021-03-05 11:51:07 +09:00
Jonathan Underwood
4fbab41cc8 Show fee tiles on mobile 2021-03-05 11:28:59 +09:00
softsimon
b2769d2af3 Adding Sparrow wallet to about page. 2021-03-05 02:46:23 +07:00
softsimon
2fca34faaa Bisq markets dashboard: Offers list. WIP. 2021-03-05 02:02:21 +07:00
wiz
8fa672e312 Merge pull request #373 from junderw/betterGraph
Graph hides all fee rates below clicked value
2021-03-04 19:34:30 +09:00
Jonathan Underwood
2c5cf94982 Graph hides all fee rates below clicked value 2021-03-04 19:07:20 +09:00
wiz
72ded16543 Tweak padding/margins on About page logos 2021-03-04 16:27:36 +09:00
wiz
7d67c8ea6e Merge pull request #371 from mempool/wiz/add-stuff-to-about-page
Add community integrations / alliances to About page
2021-03-04 16:12:15 +09:00
wiz
1051919a8a Add BLW and Satpile to About page integrations 2021-03-04 16:07:59 +09:00
wiz
8ca6f06650 Fix i18n tags on new About page titles 2021-03-04 15:47:59 +09:00
wiz
906189c43a Add community integrations / alliances to About page, move us to bottom 2021-03-04 12:46:57 +09:00
wiz
0ba6d651c0 Merge pull request #369 from junderw/hex2utf8
Decode hex into utf8 instead of ascii
2021-03-03 21:37:46 +09:00
Jonathan Underwood
2a7b4f9aed Decode hex into utf8 instead of ascii 2021-03-03 21:29:22 +09:00
wiz
892cebd8f4 Enable sending CORS headers from electrs backend in startup script
Fixes #367
2021-03-03 21:29:18 +09:00
wiz
2e8bd7f32e Put the project title back on the About page 2021-03-03 15:48:55 +09:00
wiz
275895bedd Update index.html <head> metadata, OG tags, twitter tags 2021-03-03 11:55:53 +09:00
wiz
ec699f28fb Update link on About page for mempool Twitter account 2021-03-03 11:21:05 +09:00
softsimon
38e866995f Bisq markets dashboard: 24H Volume. WIP. 2021-02-28 17:18:29 +07:00
wiz
85ad0aaa27 Merge pull request #362 from bguillaumat/update-docker
Update docker part
2021-02-27 14:44:52 +09:00
softsimon
eeb7447988 Bisq markets dashboard. Base views. WIP. 2021-02-27 04:19:56 +07:00
bguillaumat
9e2581d734 Update var from ELECTRS to ELECTRUM for more compatibility 2021-02-26 09:04:14 +01:00
softsimon
be0fd7c582 Credit Hebrew translator 2021-02-25 17:34:21 +07:00
softsimon
26b4bd899b Adding Hebrew language 2021-02-25 17:22:03 +07:00
softsimon
a3d9e87f0e Adding Hebrew language 2021-02-25 17:16:22 +07:00
bguillaumat
4a24a173d3 Update docker README 2021-02-25 10:40:14 +01:00
bguillaumat
05098b1141 Update docker mempool-config 2021-02-25 10:33:04 +01:00
wiz
6a7d5fbe6a Don't start production instances if backend folder doesn't exist 2021-02-25 02:38:38 +09:00
wiz
75b8ec855b Update logo for Liquid network (#359) 2021-02-24 15:16:06 +07:00
wiz
b89630953c Merge pull request #358 from mempool/simon/fee-api-minfee
Send mempoolminfee in fee api.
2021-02-24 16:47:32 +09:00
softsimon
04c42b82f4 Renaming feeApi minimumFee and display as rounded satoshis. 2021-02-24 14:39:34 +07:00
softsimon
6ec07e5315 Re-fixing bug where high priority fee could display as lower than the medium and low fee.
fixes #278
2021-02-24 12:30:40 +07:00
softsimon
ea5dc8738c Send mempoolminfee in fee api.
fixes #357
2021-02-24 12:26:55 +07:00
wiz
619eee9492 Improve production high availability using structured failover and cache 2021-02-23 13:33:52 +09:00
wiz
c9f2bd4029 Update nginx and mempool backend configuration for active failover HA 2021-02-22 20:22:38 +09:00
softsimon
795fb9342a Fix: Double BTC is displayed. 2021-02-21 19:12:50 +07:00
wiz
0b04dbbca2 Merge pull request #352 from mempool/simon/signet-frontend
Signet support in the frontend.
2021-02-21 03:56:46 +09:00
softsimon
55df5dbd35 Signet network color. 2021-02-21 01:45:52 +07:00
wiz
0b79aaaf2f Don't use rust from rustup, use OS package rust instead 2021-02-21 03:44:54 +09:00
wiz
7d858a8abd Modify production startup scripts to support signet 2021-02-21 03:44:33 +09:00
wiz
32af9420dc Update production frontend/backend config to support signet 2021-02-21 03:41:52 +09:00
wiz
7195d6ea31 Update nginx.conf for signet, services, and disable SSR for now 2021-02-21 03:39:19 +09:00
softsimon
a111dc044f Signet should use sBTC not tBTC. 2021-02-21 00:40:47 +07:00
softsimon
563ae8540b Signet support in the frontend. 2021-02-20 23:12:22 +07:00
wiz
279cba5d79 More tweaking of project description on About page 2021-02-18 21:46:16 +09:00
wiz
32c740e572 More tweaking of project description on About page 2021-02-18 21:36:05 +09:00
wiz
28bc08c5a8 Change all usage of <h2> to <h3> on About page 2021-02-18 21:29:15 +09:00
wiz
a0e3468c51 Change 'SNAPSHOT' tag to 'dev' in semver on About page 2021-02-18 21:07:00 +09:00
softsimon
d50e25bed7 Create README.md 2021-02-18 15:40:59 +07:00
wiz
7f8329aa4d Update project name and description on About page (#350) 2021-02-18 15:33:59 +07:00
wiz
6619f92502 Merge pull request #349 from mempool/simon/mempool-space-logo
Updating mempool logo and adding new mempool space logo.
2021-02-18 16:33:00 +09:00
softsimon
edce0d118a Updating mempool logo and adding new mempool space logo. New frontend config OFFICIAL_MEMPOOL_SPACE to enable the latter.
fixes #336
2021-02-18 13:34:05 +07:00
pox
26ba41cb91 a bit of formatting for the docker readme (#348) 2021-02-18 11:11:31 +07:00
Czino
475baf5634 Fix style on block hover (#347)
* Fix style on block hover

* Fix style on block hover

Co-authored-by: Eric Lehmann <eric@machinas.com>
2021-02-18 03:05:39 +07:00
wiz
6866b12e84 Update hard-coded LN node URI for sponsors on About page 2021-02-17 17:16:32 +09:00
softsimon
2743b35ea2 Update from transifex. 2021-02-15 00:15:04 +07:00
softsimon
d39207e097 Adding Telegram group link on about page. 2021-02-14 23:23:03 +07:00
wiz
033d1451d0 Merge pull request #343 from mempool/simon/clear-protection-config
Make clear protection timeout configurable.
2021-02-15 00:26:47 +09:00
wiz
befb192651 Reduce backend heap size setting to 2G since cache memory usage was optimized (#345)
On powerful servers, nodejs automatically sets the limit at 4GB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 4144 Mb
```

On a Raspberry Pi with 8GB RAM, nodejs automatically sets the limit at 1GB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 1048 Mb
```

On a Raspberry Pi with 4GB RAM, nodejs automatically sets the limit at 740MB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 739.4694900512695 Mb
```

After testing with manually setting the limit to 768MB, mempool starts
up fine, but crashes when saving the cache when the mempool is quite
large (over 400MB with custom bitcoin.conf setting).

So it's probably safe to reduce the 4GB limit setting to 2GB for
all devices and and just use the automatically set values, now that the
backend's disk cache memory usage was recently optimized.

However, a new npm script for `npm run start-production` will be added
so we can keep our production mempool.space servers running with a very
large bitcoin.conf mempool
2021-02-14 22:25:29 +07:00
softsimon
7489d3360a Make clear protection timeout configurable.
fixes #335
2021-02-14 20:32:00 +07:00
wiz
2641ae0c8e Merge pull request #342 from mempool/simon/optimize-disk-cache
Optimized cache chunks. Default cache files to cache/ directory.
2021-02-14 22:11:33 +09:00
softsimon
32290d1e0d Apply suggestions from code review
Co-authored-by: wiz <j@wiz.biz>
2021-02-14 20:03:45 +07:00
softsimon
584ef87fc8 Optimized cache chunks. Default cache files to /cache directory.
fixes #341
2021-02-14 19:50:31 +07:00
softsimon
63b52b9d9b Use mempool clear protection feature also when in bitcoind mode.
fixes #335
2021-02-14 01:04:44 +07:00
wiz
5f6b7d94b1 Update URL for RoninRojo repo to their self-hosted GitLab 2021-02-12 16:20:57 +09:00
wiz
95a1c002eb Update README with instructions for various installation methods 2021-02-11 14:57:43 +09:00
wiz
2085833720 Fix docker/README example docker-compose.xml to use latest tag 2021-02-10 22:56:42 +09:00
Bastien Guillaumat
20ff62779d Re-implement Docker workflow using GitHub Actions (#326)
* Recreate a docker dir with all docker files inside and add init.sh
* Add docker/README.md with example docker-compose.xml
* Add mysql vars for mempool-config.json
* Port can be set from env var in docker-compose.xml
* Update docker-compose.xml example to use latest tag
* Remove armv7 architecture from build workflow
* Remove master git-hash file
* Remove useless ':' in sed
2021-02-10 22:51:01 +09:00
softsimon
181cb8e03f Removing lightning htlc matching since it has false positives.
refs #324
2021-02-10 19:55:11 +07:00
wiz
cef6bc8345 Enable our GitHub Sponsors program "Sponsor" button 2021-02-10 21:30:16 +09:00
Devin Bileck
a67d82ea94 Fix BSQ token market cap calculation (#332)
Fixes #331
2021-02-10 19:05:16 +07:00
softsimon
89efd410fb Fix for hard coded sponsor url.
refs #319
2021-02-07 03:00:02 +07:00
softsimon
eb0c20dd92 Removing sponsors code.
Support new sponsor confirmation polling.
fixes #319
2021-02-07 02:20:07 +07:00
softsimon
c733497e52 Adding v2.1 screen shot. 2021-02-04 17:58:23 +07:00
wiz
378a56b2c7 Set production electrs scripts to store db in /electrs 2021-02-04 15:53:08 +09:00
wiz
8e42d573ee Modify production electrs scripts to use relative paths from homedir 2021-02-04 12:17:28 +09:00
wiz
a7adf3a345 Bump version number to v2.2-SNAPSHOT 2021-02-04 12:16:47 +09:00
softsimon
ccdf41c5b6 Don't display multisig tag on lightning/liquid contracts.
refs #324
2021-02-03 19:03:59 +07:00
softsimon
0c979e9440 Only lowercase bech32 addresses in address prefix search.
fixes #327
2021-02-03 17:13:29 +07:00
wiz
de035dc1b5 Merge pull request #325 from bguillaumat/docker-error-backend
Fix missing mempool-config due to gitignore
2021-02-03 18:07:25 +09:00
softsimon
18d08ce4bf Updating from transifex. 2021-02-03 15:57:51 +07:00
Bastien
35f5efaa2e Fix missing mempool-config due to gitignore 2021-02-03 09:52:04 +01:00
softsimon
96b3ca6a0b Updating from transifex. 2021-02-03 15:30:38 +07:00
wiz
4e4f655be4 Rename repos on DockerHub to mempool/frontend and mempool/backend 2021-02-03 17:07:12 +09:00
wiz
985df53af6 Remove mempool-mysql Dockerfile target 2021-02-03 16:41:28 +09:00
wiz
ace480e3c7 Fix name and target tag of GitHub Actions workflow 2021-02-03 16:37:11 +09:00
wiz
e670172979 Disable building mempool-mysql Dockerfile from GitHub Action workflow 2021-02-03 16:30:42 +09:00
wiz
7ddbf5d3df Disable using docker buildkit in GitHub Action workflow 2021-02-03 16:28:37 +09:00
wiz
264bca9c56 Fix space indentation in .github/workflows/on-tag.yml 2021-02-03 16:18:00 +09:00
wiz
b53d364877 Add new GitHub action workflow on-tag to build and push to DockerHub 2021-02-03 16:08:59 +09:00
softsimon
ed17203a5f bitcoind: Parse witness scripts from P2SH transactions.
fixes #323
2021-02-03 13:11:14 +07:00
softsimon
999163d7ad Type fix for contract parsing.
refs #324
2021-02-03 12:51:30 +07:00
fiatjaf
276117fba9 better identification of lightning outputs. (#320)
* better identification of lightning outputs.
* identify liquid pegouts and emergency pegouts.
fixes #324
2021-02-03 12:40:31 +07:00
wiz
448cb8e264 Merge pull request #322 from bguillaumat/update-dockerization
Update dockerization
2021-02-03 13:03:44 +09:00
Bastien
6782229a3d Move docker files in subdir 2021-02-03 02:12:15 +01:00
Bastien
543fe8c735 Set all dir to be dockerized 2021-02-02 23:45:54 +01:00
Bastien
f3e97e2e2d Default dir should be the same than config-mempool.json 2021-02-02 19:25:33 +01:00
wiz
03179e34fb Merge pull request #317 from bguillaumat/add-cache-dir
Add Dockerization of Mempool v2 for Umbrel App Store
2021-02-03 03:21:22 +09:00
Bastien
a36b5c660d Fix ENV_VAR issues 2021-02-02 19:20:05 +01:00
Bastien
2d872bda47 Update package.json && Fix start.sh script 2021-02-02 18:01:23 +01:00
Bastien
91d4017aa6 Update ENV_VARIABLES in scripts && Fix some errors 2021-02-02 17:54:01 +01:00
Bastien Guillaumat
6efe055003 Apply Wiz suggestions
Co-authored-by: wiz <j@wiz.biz>
2021-02-02 16:34:21 +01:00
softsimon
f39d90547e Display P2PK inputs as "P2PK" instead of empty string.
fixes #290
2021-02-02 01:32:15 +07:00
Bastien
c26737ffd6 Update build.sh 2021-02-01 18:17:50 +01:00
softsimon
09f5f552bf Don't display fee rating when block medianFee is empty to fix "overpaid by infinity".
fixes #288
2021-02-02 00:10:57 +07:00
Bastien
feb5e96323 Add docker dir to build mempool containers 2021-02-01 17:25:08 +01:00
Bastien
f7ff6336f2 Add CACHE_DIR var 2021-02-01 15:54:27 +01:00
softsimon
2a5a4ddac0 Hide address received/sent from address page when using electrum API.
fixes #294
2021-02-01 04:52:24 +07:00
softsimon
fd869c732d Detect network from url also when languages are being used.
fixes #287
2021-02-01 04:17:34 +07:00
wiz
d3646aa45e Fix production nginx.conf and backend config to always use unique ports 2021-01-31 01:16:32 +09:00
softsimon
f3c18b152a Moved sponsors cache creation until after diskcache is done.
refs #315
2021-01-30 22:12:22 +07:00
wiz
6a9c4d82ec Rename production syslog notifications channel 2021-01-30 23:40:46 +09:00
softsimon
35521f4871 Refactored when statistics cache from database is created.
refs #315
2021-01-30 21:40:04 +07:00
softsimon
9b9c605cbe Upgrading mysql client lib. 2021-01-30 21:39:23 +07:00
softsimon
21d32dec41 Wait for database connection established before continuing startup.
refs #315
2021-01-30 21:09:30 +07:00
wiz
54a276439d Increase Bisq block height divergence warning to 10 blocks for Tor issues 2021-01-30 23:02:20 +09:00
wiz
42ad068dd2 Configure production backends and nginx for high availability electrs 2021-01-30 23:01:01 +09:00
softsimon
c5c2222b8c Increased database query timeouts
fixes #315
2021-01-30 19:20:52 +07:00
softsimon
9d317082e1 Replacing localhost with 127.0.0.1 2021-01-30 18:43:58 +07:00
wiz
edf8f1fc8a Update production upgrade script notification command 2021-01-30 20:31:47 +09:00
wiz
ad52e7fe7e Update production syslog scripts 2021-01-30 20:09:47 +09:00
softsimon
c94f004425 Adding missing default timeout on all axios requests.
fixes #314
2021-01-30 16:25:22 +07:00
softsimon
371433b2da Fix for fee estimate not being correct when block is almost full with more projected blocks in queue.
fixes #278
2021-01-30 01:34:40 +07:00
softsimon
3256198ab0 Credit Italian translator. 2021-01-29 16:58:04 +07:00
softsimon
da533097d9 Replacing weight with vsize in transactions api to match esplora. 2021-01-28 18:24:02 +07:00
softsimon
47dd1f2d0b Adding Italian language. Updating nginx conf with some missing languages. 2021-01-27 20:24:32 +07:00
softsimon
5f1f06fecf Don't save disk cache on exit. Handle corrupted mempool disk cache.
fixes #304
2021-01-27 01:49:11 +07:00
softsimon
b08225dab5 Readding deleted blocks api endpoint. 2021-01-27 00:33:16 +07:00
softsimon
9d02ab1eb5 Center align offline/reconnection badge on the logo.
fixes #302
2021-01-25 01:29:58 +07:00
softsimon
e86b7c7258 Adding missing basic API endpoints when in bitcoind/electrum mode.
fixes #291
2021-01-25 01:09:42 +07:00
softsimon
c9e175a0cc Always fetch at least the coinbase transaction of blocks, and throw error if failed. 2021-01-24 23:56:51 +07:00
softsimon
cca95bbd66 Increasing clear protection period to 10 minutes. 2021-01-24 19:33:05 +07:00
softsimon
86902d6f33 Updated from transifex. 2021-01-24 18:32:46 +07:00
softsimon
e214eedf23 Center aligning fee box text. 2021-01-24 17:26:14 +07:00
softsimon
39613cc2a2 Updated from transifex. 2021-01-24 14:08:06 +07:00
softsimon
dad122625f Adjusting h5 header font-size. 2021-01-24 13:59:39 +07:00
softsimon
f049e3abc4 Reducing size of dashboard header titles to reduce overflow depending on language. 2021-01-24 11:53:42 +07:00
softsimon
bf28dc1eea Credit hungarian translator. 2021-01-24 11:43:20 +07:00
softsimon
4d47388e25 Updating translations from transifex. 2021-01-24 04:21:07 +07:00
softsimon
6507b5e003 Adding hungarian language. 2021-01-24 04:19:50 +07:00
softsimon
47a449e1d9 Disable support for Electrum TX lookups (require -txindex). 2021-01-24 04:15:06 +07:00
softsimon
5b268794af Correctly error handle getTransaction and set 404 status when not found. 2021-01-24 02:51:22 +07:00
softsimon
fb41f58f7c Corrected Bisq stats calculation.
fixes #280
2021-01-23 19:26:05 +07:00
softsimon
e82c89a985 Only save cache on new block when in sync. 2021-01-22 23:20:39 +07:00
wiz
494119d119 Update translated strings from Transifex 2021-01-21 12:39:53 +09:00
softsimon
9900f4da80 Set backend to out of sync after connection retry interval has exceeded. 2021-01-20 17:16:43 +07:00
softsimon
a158794e2c Bitcoind: Lookup block transactions as long as in sync.
refs #288
2021-01-20 17:15:11 +07:00
softsimon
1a04b088fb Fix: Load mempool cache before checking DB connectivity. 2021-01-20 01:34:21 +07:00
softsimon
17b1325b3f Fix for case-insensitive address prefix search.
fixes #301
2021-01-19 13:01:47 +07:00
wiz
0336c6256a Don't create empty cache.json on startup anymore 2021-01-18 12:20:55 +09:00
softsimon
642e54b057 Adding missing space. 2021-01-16 17:34:58 +07:00
softsimon
23323be24a Updated i18n 2021-01-16 14:56:19 +07:00
softsimon
011f35ec94 Display a red RBF button when RBF is not enabled.
fixes #279
2021-01-16 00:24:23 +07:00
softsimon
9751af096d Adding common styling for dropdown select.
fixes #293
2021-01-16 00:10:23 +07:00
softsimon
1e81355e7d Increased disk cache chunks amount to 10 to fix json string length error. 2021-01-15 23:26:32 +07:00
softsimon
eff4d2c8cd Optionally support second CoreRPC instance as source for the minimum fee. 2021-01-15 22:23:32 +07:00
softsimon
d49c347413 Minimum fee / Purging UX updates. 2021-01-15 21:21:53 +07:00
softsimon
8aa3379ba5 Reduce displayed address length on mobile. 2021-01-13 02:10:04 +07:00
softsimon
ec845a6ac2 Renaming minimum fee to rejecting.
Adding progressbar to mempool size.
refs #171
2021-01-12 20:45:41 +07:00
wiz
46b7e6961e Merge pull request #289 from timlucmiptev/patch-1
README: update mariadb instructions
2021-01-12 20:49:35 +09:00
wiz
fc709058c1 Fix mariadb SQL command to GRANT ALL PRIVILEGES 2021-01-12 20:49:18 +09:00
wiz
627e8e5e9a Possible fix for occasional inability to change language to English
Fixes #275
2021-01-12 18:55:57 +09:00
softsimon
2b55ee1e07 Adding CoreRPC "Minimum fee" to the dashboard
fixes #171
2021-01-12 16:42:07 +07:00
wiz
695da602b8 Bump version string on about page to 2.1-SNAPSHOT 2021-01-12 18:10:48 +09:00
~timluc-miptev
3e09755c47 Update README.md 2021-01-11 20:44:45 +02:00
softsimon
4694a31f55 Fix memory leak by not stacking data in the scan accumulator.
Also handle going from zero to initial graph data on dashboard.
fixes #273
2021-01-12 00:15:52 +07:00
wiz
ab8cb033e6 Update backend/package-lock.json for axios security vulnerability 2021-01-11 23:27:27 +09:00
wiz
beb99bcfc6 Update README instructions and nginx.conf for v2.0 release 2021-01-11 23:14:10 +09:00
wiz
a05af48059 Add missing production/mempool-frontend-config.json 2021-01-11 23:14:08 +09:00
softsimon
f462cb27c6 Removing the term ELECTRS from ELECTRS_ITEMS_PER_PAGE setting. 2021-01-11 21:11:09 +07:00
softsimon
103740ec45 Setting default frontend config ELECTRS_ITEMS_PER_PAGE to 10 to adapt to CORE_RPC backends. 2021-01-11 21:06:47 +07:00
wiz
cc166cab75 Fix resource download path in frontend/sync-assets.js 2021-01-11 22:11:29 +09:00
wiz
29e0c337fe Fix pathname of frontend build output folder in npm run sync-assets 2021-01-11 22:05:39 +09:00
wiz
217666f455 Copy /en-US/resources files into top-level /resources/ after frontend build 2021-01-11 21:46:16 +09:00
softsimon
579ccaf21d Adding missing progressbar styling. 2021-01-11 17:20:52 +07:00
softsimon
4f1049bace npm audit fix 2021-01-11 16:04:16 +07:00
wiz
c31d4e35f6 Merge pull request #281 from mempool/simon/bitcoind
Bitcoind and Electrum Server backend support
2021-01-11 17:46:25 +09:00
wiz
3e2a49c08e Update production/mempool-config.*.json files for new backend config 2021-01-11 17:42:35 +09:00
softsimon
0a0e7fad3a Update backend/package.json
Co-authored-by: wiz <j@wiz.biz>
2021-01-11 15:23:59 +07:00
softsimon
e76ee93bbb Config updates. Renamed BITCOIND to CORE_RPC. 2021-01-11 14:53:18 +07:00
softsimon
27d2f5bd5a Merge branch 'master' into simon/bitcoind
* master:
  Update translated strings from Transifex
2021-01-11 14:42:38 +07:00
softsimon
20406fa522 Moved method $validateAddress 2021-01-11 14:30:58 +07:00
softsimon
905ddbb363 Bitcoind: Use mempool as address index when doing address prefix search. 2021-01-11 01:51:57 +07:00
softsimon
38d534caee Return not implemented error instead of empty array. 2021-01-11 00:26:36 +07:00
softsimon
e36646ac7c Adding missing error output on /blocks page. 2021-01-10 22:41:52 +07:00
softsimon
9689ccf2ac Bitcoind: Display the suggestion message on address page when address lookups is not implemented. 2021-01-10 22:24:36 +07:00
softsimon
c4d1fad853 Cache electrum address history fetch a couple of seconds to prevent double requests on address page load. 2021-01-10 19:58:55 +07:00
softsimon
9a23d2c6b0 Electrum: Sort address transactions correctly by confirmed and unconfirmed. 2021-01-10 17:40:05 +07:00
softsimon
065c21da1f Bitcoind: Push full transactions to address page and RBF mode. 2021-01-10 17:38:59 +07:00
softsimon
6a58717694 Loading progressbar for loading address, block transactions and blocks 2021-01-08 21:44:36 +07:00
wiz
b4e61634bc Update translated strings from Transifex 2021-01-08 00:23:53 +09:00
softsimon
b91516a1c1 Push new conversion rate updates to the clients. 2021-01-06 23:31:33 +07:00
softsimon
dc63fd9428 Config file updates. electrs -> esplora 2021-01-06 22:49:28 +07:00
softsimon
29dd6e5d8d Never run statistics when mempool not in sync. 2021-01-06 03:09:31 +07:00
softsimon
9e1ef1b747 Adding bitcoinJS-lib and parse P2SH and P2WSH scripts. 2021-01-06 01:36:28 +07:00
softsimon
632c243b34 Loading indicator service indicating mempool sync status. 2021-01-05 18:57:06 +07:00
softsimon
f46728080d Inform client when Electrum server limit exceeded 2021-01-05 17:30:53 +07:00
softsimon
1a6c2e79e6 Electrum protocol and tx lookup setting. 2021-01-05 03:06:57 +07:00
softsimon
7729ad8b79 Convert sighash to match esplora. 2021-01-03 22:02:10 +07:00
softsimon
a25125091d Hack to make it possible to load the Coinbase transaction from Bitcoin Core. 2021-01-02 04:40:10 +07:00
softsimon
89b4de2484 Fixed addressTransactions with pagination in electrum API. 2020-12-30 02:27:34 +07:00
softsimon
5390629e41 Improved block fetching performance. 2020-12-30 01:47:07 +07:00
softsimon
62c78f5b08 Adding getBlocks support. 2020-12-29 20:41:16 +07:00
softsimon
ae87694bc3 Use @mempool/electrum-client lib as Electrum Client lib. 2020-12-29 14:14:34 +07:00
softsimon
a3644e23a7 Switching Electrum Client lib supporting auto reconnect. 2020-12-29 00:41:02 +07:00
softsimon
3c0fa71a10 Updates for general transaction and block fetching. 2020-12-28 20:17:32 +07:00
softsimon
bb28a56622 Big refactor of multiple backends handling. 2020-12-28 04:47:22 +07:00
softsimon
8d0db12abe Merge branch 'master' into simon/bitcoind
* master: (22 commits)
  Update translated strings from Transifex
  Rewrite server.ts again to properly add i18n support into SSR mode
  Rewrite server.ts to fix i18n and implement proper HTTP 404 responses
  Update mempool-frontend-config.sample.json for NGINX_HOSTNAME vars
  Fixes after merging master into AU branch, add nginx.conf for SSR
  Adjust build scripts for new AU frontend build output in /browser/
  Always set a value for the locale selector, for /liquid/ etc.
  Correcting merge conflict.
  Route all Angular Universal requests to nginx, remove simon's hacks
  Hack to fix the urls.
  Fix for non matching request URLs.
  Adding ServerTransferStateModule for AU with custom http interceptor for cache transfer.
  removing /api again
  New frontend config for webserver url to fix static asset httpGet. Removed "absolute" from config names.
  Remove ssr prepended url from asset service.
  Don't append /api to electrs backend path for SSR
  Update absolute url config variables.
  Frontend config support for AU. New absolute server url settings. refs #104
  Transaction, address and block page now works.
  Update `og:title` meta tag when changing page title
  ...
2020-12-24 10:38:14 +07:00
wiz
8b1768f745 Update translated strings from Transifex 2020-12-24 04:16:00 +09:00
wiz
8f3db3690c Merge pull request #187 from mempool/simon/angular-universal
Angular Universal Milestone 1
2020-12-24 04:13:17 +09:00
wiz
87fbdc063b Rewrite server.ts again to properly add i18n support into SSR mode 2020-12-23 18:04:30 +09:00
wiz
b261243f85 Rewrite server.ts to fix i18n and implement proper HTTP 404 responses 2020-12-23 13:26:11 +09:00
wiz
2385ec7cde Update mempool-frontend-config.sample.json for NGINX_HOSTNAME vars 2020-12-22 13:11:31 +09:00
wiz
6491d4576a Fixes after merging master into AU branch, add nginx.conf for SSR 2020-12-22 11:31:49 +09:00
softsimon
f84b9e6582 Address page mostly working. 2020-12-22 06:04:31 +07:00
wiz
51ed2a1f31 Merge remote-tracking branch 'origin/master' into simon/angular-universal 2020-12-22 07:17:40 +09:00
wiz
0d50bbdc0a Adjust build scripts for new AU frontend build output in /browser/ 2020-12-22 07:09:45 +09:00
softsimon
df63117088 Merge pull request #274 from mempool/wiz/fix-locale-selector-default-value
Always set a value for the locale selector, for /liquid/ etc.
2020-12-22 05:06:24 +07:00
wiz
de50816990 Always set a value for the locale selector, for /liquid/ etc. 2020-12-22 06:41:56 +09:00
wiz
ff0d1a7589 Merge remote-tracking branch 'origin/master' into simon/angular-universal 2020-12-22 06:14:12 +09:00
softsimon
ecc0f316cc Refactored transaction handling. 2020-12-21 23:08:34 +07:00
softsimon
5dbf6789a7 Basic bitcoind/romanz-electrum support to sync the mempool and blocks. 2020-12-20 22:36:36 +07:00
wiz
5a4a976d55 Update translated strings from Transifex 2020-12-17 12:41:18 +09:00
wiz
1f5af33f14 Add missing websocket subscription for 'blocks' in status-view component 2020-12-15 03:48:07 +09:00
wiz
8f3901b6d4 Update translation strings from Transifex 2020-12-15 00:15:14 +09:00
wiz
6dc10f438a Update translation strings from Transifex 2020-12-14 04:36:05 +09:00
wiz
006e942109 Update translation strings from Transifex 2020-12-13 17:59:54 +09:00
wiz
71c405d8bc Update from Transifex 2020-12-13 01:33:42 +09:00
wiz
73bb712311 Fix formatting of frontend/README.md 2020-12-11 03:13:47 +09:00
wiz
e04c4cfa38 Add list of translators to frontend/README.md 2020-12-11 03:02:58 +09:00
softsimon
cd9f8cbf93 Updating from transifex. 2020-12-10 23:38:50 +07:00
wiz
4b1ac88a5c Remove duplicate locale for 'ka' in app.constants.ts 2020-12-10 23:14:29 +09:00
softsimon
1309bfc56e Merge pull request #268 from TechMiX/fixRTLproblems
add rtl-layout class to base component
2020-12-10 12:16:01 +07:00
softsimon
ecf49c4365 Updated from transifex. 2020-12-10 11:53:16 +07:00
softsimon
d0e0ab7c24 i18n: Enabling Vietnamese 2020-12-10 11:51:27 +07:00
TechMiX
95c9b21149 add left-to-right mark character to blockchain and mempool block components size 2020-12-09 21:47:27 +01:00
TechMiX
306197c6e9 fix blockchain scrolling on mobile mode when RTL layout 2020-12-09 21:46:13 +01:00
softsimon
56556b6c52 Updated strings from transifex. 2020-12-09 23:55:17 +07:00
softsimon
d8e1023848 i18n: Enabling Finnish 2020-12-09 23:20:37 +07:00
softsimon
c9f485a775 i18n: Disabling vietnamese again 2020-12-09 23:20:10 +07:00
TechMiX
e6be450aaa add left-to-right mark character to amount component 2020-12-09 02:33:20 +01:00
TechMiX
c1bcf49f37 reverse all text-aligns in rtl-layout 2020-12-09 02:23:53 +01:00
TechMiX
c4734357c4 add text-align for Details title + swap text-left class with style so that it always remains aligned to left 2020-12-09 02:22:16 +01:00
TechMiX
e0adc505db add rtl-layout class to base component 2020-12-09 01:57:18 +01:00
softsimon
260735665b Status view live data now works again... 2020-12-09 01:37:14 +07:00
softsimon
5b8bcd5b7d i18n: Fixed stacked mempool block issue and enabled vietnamese. 2020-12-09 01:31:49 +07:00
softsimon
0a6f6a14b6 Pulled new strings from transifex. 2020-12-09 01:17:22 +07:00
softsimon
8e5efc47cd i18n: reuse vB/s string 2020-12-08 18:40:00 +07:00
softsimon
eb9aaac0aa i18n: Fixed translations for the footer component. Merged some duplicates. 2020-12-08 18:24:02 +07:00
softsimon
2c1514b6cf Merge pull request #266 from mempool/wiz/enable-korean-locale
Enable 'ko' locale for Korean
2020-12-08 14:00:53 +07:00
wiz
06a0abdb79 Enable 'ko' locale for Korean in app.constants.ts 2020-12-08 15:59:00 +09:00
wiz
29b9fec3b9 Enable 'ko' locale for Korean in angular.json 2020-12-08 15:57:46 +09:00
softsimon
40ac83ee88 Update strings from transifex. 2020-12-08 11:58:43 +07:00
softsimon
5659a8c086 Correcting merge conflict. 2020-12-08 11:57:03 +07:00
softsimon
f9e8dfb079 Merge branch 'master' into simon/angular-universal
* master: (42 commits)
  i18n: Added missing Bisq translations. Minor missing space and character fixes.
  add missing 'sat/vb' string for i18n
  i18n: Removed CR from "In X minutes" translation
  i18n: Updated strings for "x confirmations", "x transactions", "x blocks" and "block ETA". Peg-out, and bisq headers.
  Update translation strings from Transifex
  Enable 'ka' locale for Georgian
  Update translation strings from Transifex
  Disable Vietnamese locale 'vi' until translations are completed
  Update translation strings from Transifex
  add 'sat' string for i18n
  Update translation strings from Transifex
  Update translation strings from Transifex
  i18n update
  Remove extra garbage characters from OP_RETURN tooltip. fixes #254
  Fix for changing locale on other networks than mainnet. fixes #253
  i18n: Asset search box
  Update translation strings from Transifex
  i18n: Added X of X transaction. Flipped collapse/expand
  i18n: Added "miner identification" and updated "navigate to sponsor"
  Update translations from Transifex
  ...

# Conflicts:
#	frontend/src/app/components/app/app.component.ts
#	frontend/src/app/components/mempool-block/mempool-block.component.ts
2020-12-08 00:11:38 +07:00
softsimon
ae886e14b8 i18n: Added missing Bisq translations. Minor missing space and character fixes. 2020-12-07 17:35:05 +07:00
wiz
8d5ccf94f3 Merge pull request #264 from TechMiX/addMissingTranslatableString
add missing 'sat/vB' string for i18n
2020-12-07 10:21:48 +09:00
TechMiX
91cb2adb95 add missing 'sat/vb' string for i18n 2020-12-07 00:07:16 +01:00
softsimon
f70f94fede i18n: Removed CR from "In X minutes" translation 2020-12-07 00:23:13 +07:00
wiz
1006adabce Merge pull request #263 from mempool/simon/i18n-shared
i18n: Updated strings for "x confirmations", "x transactions", "x blo…
2020-12-07 02:04:14 +09:00
softsimon
e2d19a174e i18n: Updated strings for "x confirmations", "x transactions", "x blocks" and "block ETA". Peg-out, and bisq headers. 2020-12-06 23:44:08 +07:00
wiz
c19e21449d Merge pull request #262 from TechMiX/addMissingTranslatableString
add 'sat' string for i18n
2020-12-07 01:07:05 +09:00
wiz
c819ddc64a Update translation strings from Transifex 2020-12-07 00:20:22 +09:00
wiz
a2740aaa02 Enable 'ka' locale for Georgian 2020-12-07 00:20:05 +09:00
wiz
8d565f5c62 Update translation strings from Transifex 2020-12-06 03:44:29 +09:00
wiz
f93e1c460a Disable Vietnamese locale 'vi' until translations are completed 2020-12-06 03:40:04 +09:00
wiz
0247c7137e Update translation strings from Transifex 2020-12-06 01:12:33 +09:00
TechMiX
159d9c71a1 add 'sat' string for i18n 2020-12-05 14:59:08 +01:00
wiz
805636229a Update translation strings from Transifex 2020-12-05 22:42:48 +09:00
wiz
c5cd80ac48 Update translation strings from Transifex 2020-12-05 21:57:51 +09:00
softsimon
94a5e8edae i18n update 2020-12-05 11:58:22 +07:00
softsimon
1af1f7211e Remove extra garbage characters from OP_RETURN tooltip.
fixes #254
2020-12-05 02:32:16 +07:00
softsimon
4d54723472 Fix for changing locale on other networks than mainnet.
fixes #253
2020-12-05 02:08:54 +07:00
softsimon
1fc1b4b86e i18n: Asset search box 2020-12-05 02:01:31 +07:00
wiz
5774b395a7 Update translation strings from Transifex 2020-12-05 02:39:50 +09:00
softsimon
f4c27e4c26 i18n: Added X of X transaction. Flipped collapse/expand 2020-12-05 00:16:23 +07:00
softsimon
336e45a7b1 i18n: Added "miner identification" and updated "navigate to sponsor" 2020-12-04 23:07:53 +07:00
wiz
6acacc7792 Update translations from Transifex 2020-12-05 00:36:00 +09:00
softsimon
10b9778b3c Adding missing Asset page strings. Fixed block title translations. 2020-12-04 22:30:09 +07:00
wiz
9ebb9a5d65 Use --force when running tx pull for Transifex strings 2020-12-05 00:12:08 +09:00
wiz
6476d1e77c Update translations from Transifex 2020-12-05 00:11:40 +09:00
softsimon
67df21fe50 Fixing about-link title translation. 2020-12-04 21:49:03 +07:00
wiz
1e8167212f Merge pull request #251 from mempool/simon/i18n-everything
i18n all the remaining strings.
2020-12-04 23:40:35 +09:00
softsimon
ea496915c4 Updated messages.xlf 2020-12-04 21:38:14 +07:00
softsimon
035f9a4d67 Merge commit '768fbdfbfa8e0064b86e168c59762909f4c1763b' into simon/i18n-everything
* commit '768fbdfbfa8e0064b86e168c59762909f4c1763b':
  Update translated strings from Transifex
  More fixes for RTL
  Always render app-mempool-graph using LTR
  Implement auto RTL support for i18n locales like Arabic, Persian, etc.
  Update extracted i18n strings from source
  Enable 'ar' locale for Arabic
  Update translated strings from Transifex
  Fix incorrectly used 'nn' locale, rename it to 'nb' instead
  Update transifex-client configuration to use master branch

# Conflicts:
#	frontend/src/locale/messages.xlf
2020-12-04 21:30:51 +07:00
softsimon
232fc65af2 i18n correcctions based on feedback. Added even more missing i18n strings. 2020-12-04 21:29:31 +07:00
wiz
768fbdfbfa Update translated strings from Transifex 2020-12-04 23:03:52 +09:00
softsimon
974d89e40b Merge pull request #257 from mempool/wiz/implement-rtl-support-for-i18n
Implement auto RTL support for i18n locales like Arabic, Persian, etc.
2020-12-04 21:00:39 +07:00
wiz
92d163f495 More fixes for RTL 2020-12-04 22:54:09 +09:00
wiz
62363802be Always render app-mempool-graph using LTR 2020-12-04 22:41:58 +09:00
wiz
e49ecd9368 Implement auto RTL support for i18n locales like Arabic, Persian, etc.
Fixes #255
2020-12-04 05:56:40 +09:00
wiz
ea521651fd Update extracted i18n strings from source 2020-12-04 04:11:35 +09:00
wiz
73db9c5023 Enable 'ar' locale for Arabic 2020-12-04 04:11:14 +09:00
wiz
cc451d29ab Update translated strings from Transifex 2020-12-04 04:07:01 +09:00
wiz
a831d04694 Fix incorrectly used 'nn' locale, rename it to 'nb' instead 2020-12-03 22:37:06 +09:00
softsimon
fb11d73751 i18n all the remaining strings. 2020-12-03 18:34:19 +07:00
wiz
9509891abc Update transifex-client configuration to use master branch 2020-12-03 20:09:08 +09:00
wiz
129f122993 Replace nginx.conf try_files for /$lang/index.html with rewrite (fixes #250) 2020-12-03 18:52:03 +09:00
wiz
8875579c08 Update strings from Transifex 2020-12-03 10:16:21 +09:00
wiz
83501cfdbe Enable locale 'vi' for Vietnamese 2020-12-03 10:16:02 +09:00
wiz
2b2bc2fc41 Change nginx.conf Tor HS port from 81 to 80 to fix i18n bug 2020-12-03 09:56:29 +09:00
wiz
6b498b9601 Exempt localhost from nginx rate limits for Tor and AU usage 2020-12-03 09:47:39 +09:00
softsimon
e35eb5aad2 Adding virtual size to transaction details.
fixes #248
2020-12-02 22:22:14 +07:00
softsimon
2bba51e6c1 Merge branch 'master' into simon/angular-universal
* master:
  Update list of supported locales
  Add one more fix to nginx.conf for i18n
  Remove unused i18n tags in frontend/src/index.html
  Update translations from Transifex
  Enable 'fr' locale for French
  Corrected some missing spaces on transactions page and a blank render bug when confirmation time is below 1 minute.
  Implement i18n support in frontend using Angular + Transifex + NGINX

# Conflicts:
#	frontend/src/app/app.constants.ts
#	frontend/sync-assets.js
2020-12-02 20:05:49 +07:00
wiz
d3cb1d607b Update list of supported locales 2020-12-02 21:33:53 +09:00
wiz
352afbc029 Add one more fix to nginx.conf for i18n 2020-12-02 21:21:44 +09:00
softsimon
2ef87603fd Merge pull request #191 from mempool/wiz/i18n
Implement i18n support in frontend using Angular + Transifex + NGINX
2020-12-02 19:07:28 +07:00
wiz
88b702d6d8 Remove unused i18n tags in frontend/src/index.html 2020-12-02 20:35:52 +09:00
wiz
0d2e4000e1 Update translations from Transifex 2020-12-02 20:35:50 +09:00
wiz
9148d30fcc Enable 'fr' locale for French 2020-12-02 20:35:46 +09:00
softsimon
3f990ff706 Corrected some missing spaces on transactions page and a blank render bug when confirmation time is below 1 minute. 2020-12-02 17:03:04 +07:00
wiz
4658b47007 Implement i18n support in frontend using Angular + Transifex + NGINX
This PR adds basic i18n support into the mempool frontend, together with
a smooth workflow for developers and translators to collaborate:

* Using the existing @angular/localize module, developers add i18n
metadata to any frontend strings their new features or changes modify

* Using the new npm script `i18n-extract-from-source`, developers
extract the i18n data from source code into `src/locale/messages.xlf`

* After pushing the updated `src/locale/messages.xlf` to GitHub, the
Transifex service will update its database from the new source data

* Using the Transifex website UI, translators can work together to
translate all the mempool frontend strings into their native languages

* Using the new npm script `i18n-pull-from-transifex`, developers can
pull in completed translations from Transifex, and commit them into git.

This flow requires an API key from Transifex, which can be obtained at
https://www.transifex.com/user/settings/api/ to be used with the python
script installed by `pip install transifex-client` - after preparing
these, run the npm script which will ask you for the API key the first
time. When downloading is complete, you can test building the frontend,
and if successful, commit the new strings files into git.

This PR implements a new locale selector in the footer of the homepage
dashboard, and includes WIP translations for the following languages:

* Czech (cs)
* German (de)
* Japanese (ja)
* Norwegian (nn)
* Spanish (es)
* Swedish (sv)
* Ukrainian (uk)
* Persian (fa)
* Portugese (pt)
* Turkish (tr)
* Dutch (nl)
* French (fr)
* Chinese (zh)
* Slovenian (sl)
* Korean (ko)
* Polish (pl)

The user-agent's `Accept-Language` header is used to automatically
detect their preferred language, which can be manually overriden by the
pull-down selector, which saves their preference to a cookie, which is
used by nginx to serve the correct HTML bundle to the user.

Remaining tasks include adding i18n metadata for strings in the Bisq and
Liquid frontend code, mouseover hover tooltip strings, hard-coded og
metadata inside HTML templates, and many other places. This will be done
in a separate PR.

When upgrading to add i18n support, mempool instance operators must take
care to install the new nginx.conf and nginx-mempool.conf files, and
tweak for their specific site configuration.

Fixes #81
2020-12-02 04:19:33 +09:00
softsimon
f9c2bc1fb5 Merge commit 'f151eb81c812a62d1d5c57ee91620a3dd9ae5068' into simon/angular-universal
* commit 'f151eb81c812a62d1d5c57ee91620a3dd9ae5068':
  Upgrade angular from 10.0.4 to 10.2.3, typescript from 3.9.7 to 4.0.5
  Modify /bisq/api/v1/markets/markets to only return active markets
  Remove unnecessary @types/axios dependency.
  Same npm fix for running `tsc` from `./node_modules` for backend
  Set npm to run `ng` and `tsc` binaries from `./node_modules/` path

# Conflicts:
#	frontend/package-lock.json
#	frontend/package.json
2020-11-28 02:21:12 +07:00
softsimon
f151eb81c8 Merge pull request #195 from mempool/wiz/angular-10.2.3
Upgrade angular from 10.0.4 to 10.2.3, typescript from 3.9.7 to 4.0.5
2020-11-28 02:09:52 +07:00
wiz
9b89d9977f Upgrade angular from 10.0.4 to 10.2.3, typescript from 3.9.7 to 4.0.5 2020-11-28 04:04:45 +09:00
wiz
b6150a3237 Route all Angular Universal requests to nginx, remove simon's hacks 2020-11-27 23:03:48 +09:00
softsimon
dee9fa2d9a Hack to fix the urls. 2020-11-27 20:11:15 +07:00
softsimon
42d1fcbdee Fix for non matching request URLs. 2020-11-27 20:01:25 +07:00
softsimon
d0da875e69 Adding ServerTransferStateModule for AU with custom http interceptor for cache transfer. 2020-11-27 18:41:57 +07:00
softsimon
c7abb7a08a Merge pull request #189 from mempool/only-return-active-bisq-markets
Modify /bisq/api/v1/markets/markets to only return active markets
2020-11-23 22:02:13 +07:00
softsimon
5248fadcea removing /api again 2020-11-23 21:59:30 +07:00
wiz
d613aec395 Modify /bisq/api/v1/markets/markets to only return active markets
As per https://github.com/bisq-network/bisq/issues/4826 and https://github.com/bisq-network/bisq/pull/4831
2020-11-23 22:46:14 +09:00
softsimon
9e716aa913 Remove unnecessary @types/axios dependency. 2020-11-23 18:36:55 +07:00
softsimon
2cbf1474c3 New frontend config for webserver url to fix static asset httpGet.
Removed "absolute" from config names.
2020-11-23 18:22:21 +07:00
wiz
824bc21035 Same npm fix for running tsc from ./node_modules for backend 2020-11-23 17:26:22 +09:00
wiz
e51a4ce028 Set npm to run ng and tsc binaries from ./node_modules/ path 2020-11-23 17:19:16 +09:00
softsimon
2054c951ae Remove ssr prepended url from asset service. 2020-11-23 15:04:41 +07:00
wiz
5a70234370 Don't append /api to electrs backend path for SSR 2020-11-23 16:53:44 +09:00
softsimon
e5959f14bc Update absolute url config variables. 2020-11-23 14:50:28 +07:00
softsimon
aaf9d9be9f Merge branch 'master' into simon/angular-universal
* master:
  correcting merge
  Remove extra space in price server URL
  Modify upgrade script to append repo before tag name
  Merge "getInitData" method from simon/angular-universal.
  Replace opennode usd price source with wiz api. fixes #166
  Display confidential instead of nothing for confidential assets. fixes #110
  Detect confidential assets and display properly. fixes #109
  Allow searching for and viewing assets not in the asset registry. fixes #111

# Conflicts:
#	backend/src/api/websocket-handler.ts
2020-11-23 14:08:50 +07:00
wiz
fdf9cf7977 Merge pull request #186 from mempool/simon/update-pricefeed
Replace opennode usd price source with wiz api.
2020-11-23 16:06:15 +09:00
softsimon
bd67eec777 correcting merge 2020-11-23 11:46:04 +07:00
wiz
2fd559a7e1 Merge pull request #185 from mempool/simon/liquid-fixes
Liquid asset display bug fixes
2020-11-23 10:11:43 +09:00
wiz
9059c0c7e4 Merge remote-tracking branch 'origin/master' into simon/update-pricefeed 2020-11-23 09:56:23 +09:00
wiz
8fab153fb0 Remove extra space in price server URL 2020-11-23 09:48:06 +09:00
wiz
827c5d12a3 Modify upgrade script to append repo before tag name 2020-11-23 09:46:50 +09:00
softsimon
c0d2430a84 Merge "getInitData" method from simon/angular-universal. 2020-11-23 02:38:56 +07:00
softsimon
c36addd8c1 Frontend config support for AU. New absolute server url settings.
refs #104
2020-11-23 02:30:46 +07:00
softsimon
83126b83f1 Transaction, address and block page now works. 2020-11-22 23:47:27 +07:00
softsimon
75726df275 Merge branch 'master' into simon/angular-universal
* master:
  Tweak ASM opcode styling colors
  Add some color and styling to the Bitcoin ASM opcodes
  Correcting title text on graph invert button.
  Modify upgrade script to include "tag @ hash" in notification msg
  Adding a button to invert the graph globally.
  Display P2PK instead of OP_RETURN fixes #161
  Improved utxo script design. fixes #46
  Adding prevout script. Fixed padding. refs #46
  Correcting details button padding on mobile.
  Fix nginx.conf reverse proxy cache URL path for sponsor images
  Add missing "engines" metadata into package-lock.json
  Upgrade backend/package-lock.json to version 2
  Toggle display UTXO details and scripts for transactions fixes #46
  Axios error handle sponsor proxy requests.
  Replacing request.js with axios fixes #153
  Add basic websocket error handler as emergency fix for site crashing

# Conflicts:
#	frontend/src/app/services/storage.service.ts
2020-11-22 20:53:12 +07:00
softsimon
1521d47cc7 Replace opennode usd price source with wiz api.
fixes #166
2020-11-22 16:48:55 +07:00
softsimon
6bc6966019 Display confidential instead of nothing for confidential assets.
fixes #110
2020-11-22 16:30:36 +07:00
softsimon
01689c8433 Detect confidential assets and display properly.
fixes #109
2020-11-22 16:19:57 +07:00
softsimon
11d67cf756 Allow searching for and viewing assets not in the asset registry.
fixes #111
2020-11-22 16:03:23 +07:00
wiz
30fb0bad78 Tweak ASM opcode styling colors 2020-11-21 18:17:29 +09:00
softsimon
742ce7c429 Merge pull request #184 from mempool/wiz/style-asm-opcodes
Add some color and styling to the Bitcoin ASM opcodes
2020-11-21 03:33:54 +07:00
wiz
9e83fdc9f2 Add some color and styling to the Bitcoin ASM opcodes
Fixes #164
2020-11-21 05:29:50 +09:00
softsimon
36022680cb Merge pull request #183 from mempool/wiz/angular-universal
Update `og:title` meta tag when changing page title
2020-11-20 00:46:04 +07:00
wiz
a19ff7d3a7 Update og:title meta tag when changing page title 2020-11-20 00:59:10 +09:00
softsimon
9f9c0b1114 Correcting title text on graph invert button. 2020-11-16 21:58:16 +07:00
wiz
ab6ed227e3 Modify upgrade script to include "tag @ hash" in notification msg 2020-11-16 23:44:32 +09:00
wiz
e029f91d4c Merge pull request #162 from mempool/simon/graph-inverter
Adding a button to invert the graph globally.
2020-11-16 21:37:57 +09:00
softsimon
ca540d902a Adding a button to invert the graph globally. 2020-11-16 19:27:06 +07:00
softsimon
76238f5943 Display P2PK instead of OP_RETURN
fixes #161
2020-11-16 16:21:37 +07:00
softsimon
d9803e3f3d Improved utxo script design.
fixes #46
2020-11-16 02:25:10 +07:00
softsimon
c9e63a723a Adding prevout script. Fixed padding.
refs #46
2020-11-16 02:02:16 +07:00
softsimon
4136e8d332 Correcting details button padding on mobile. 2020-11-16 01:10:07 +07:00
wiz
ffb08e5e01 Fix nginx.conf reverse proxy cache URL path for sponsor images 2020-11-16 00:43:10 +09:00
wiz
c24e44f6fa Merge pull request #158 from mempool/simon/axios
Replacing request.js with axios
2020-11-16 00:37:43 +09:00
wiz
1676a78c13 Merge remote-tracking branch 'origin/master' into simon/axios 2020-11-15 22:17:11 +09:00
wiz
379db7b211 Merge pull request #159 from mempool/simon/utxo-details
Toggle display UTXO details and scripts for transactions
2020-11-15 22:11:44 +09:00
softsimon
e01718db22 Merge pull request #160 from mempool/wiz/upgrade-package-lock-json
Upgrade backend/package-lock.json to version 2
2020-11-15 19:26:18 +07:00
wiz
df81035ebc Add missing "engines" metadata into package-lock.json 2020-11-15 21:17:24 +09:00
wiz
0b35f784c4 Upgrade backend/package-lock.json to version 2 2020-11-15 20:47:36 +09:00
softsimon
ddea10b160 Toggle display UTXO details and scripts for transactions
fixes #46
2020-11-15 17:58:38 +07:00
softsimon
0616b3c3b0 Axios error handle sponsor proxy requests. 2020-11-15 14:31:34 +07:00
softsimon
e7ddedaeb6 Replacing request.js with axios
fixes #153
2020-11-15 14:22:47 +07:00
wiz
12b3ecd078 Add basic websocket error handler as emergency fix for site crashing 2020-11-15 11:44:16 +09:00
softsimon
f8ffd6ec6b Merge branch 'master' into simon/angular-universal
* master:
  Add the Commons Clause License Condition v1.0 to our MIT License
  fix legend bug on resize
  Correcting new chartist import path.
  Flip mempool chart by using patched chartist package by @techmix

# Conflicts:
#	frontend/package-lock.json
2020-11-15 02:51:00 +07:00
softsimon
1e39daafb3 Merge pull request #154 from TechMiX/fixGraphLegendBug
Fix graph legend bug on resize
2020-11-15 00:39:22 +07:00
wiz
c03f5d8393 Merge pull request #155 from mempool/add-commons-clause-license-condition
Add the Commons Clause License Condition v1.0 to our MIT License
2020-11-15 00:15:16 +09:00
wiz
65c29ddff2 Add the Commons Clause License Condition v1.0 to our MIT License 2020-11-14 22:39:03 +09:00
TechMiX
640a77e846 fix legend bug on resize 2020-11-13 01:23:19 +01:00
softsimon
5aa17e001c Correcting new chartist import path. 2020-11-10 21:09:50 +07:00
softsimon
ff8f2fafe8 Flip mempool chart by using patched chartist package by @techmix 2020-11-10 21:05:54 +07:00
softsimon
ea04dfa62f Merge pull request #151 from mempool/wiz/angular-universal
Various fixes (lol)
2020-11-08 00:39:44 +07:00
wiz
0361044352 Various fixes (lol) 2020-11-08 01:16:09 +09:00
softsimon
b39d12f64e Merge branch 'master' into simon/angular-universal
* master:
  Enable nginx reverse proxy cache for sponsor profile images + misc tweaks
  Update Bisq price API: markets.bisq.network -> bisq.markets
2020-11-07 14:03:03 +07:00
softsimon
14c9d0c409 angular universal WIP
refs #104
2020-11-07 04:30:52 +07:00
wiz
b89a549a75 Enable nginx reverse proxy cache for sponsor profile images + misc tweaks 2020-11-06 14:09:04 +09:00
wiz
203374bce2 Update Bisq price API: markets.bisq.network -> bisq.markets 2020-11-05 13:59:58 +09:00
softsimon
d8c4f5a6ac Adding some padding and correcting a bad pixel line. 2020-11-03 18:03:25 +07:00
softsimon
1877b40413 Use actual mempool size instead of mempool vsize.
fixes #150
2020-11-03 16:11:32 +07:00
wiz
6f6d7bc4d2 ❤️ 2020-11-03 17:03:41 +09:00
wiz
f1463b914d Modify index.html metadata to have timestamp for mempool-preview.png URL 2020-11-03 16:44:25 +09:00
softsimon
c03073bddd FIx: Write cache sync on exit. 2020-11-02 22:06:51 +07:00
softsimon
ce582eefc6 Fix for kept block amount when cache already contains more. 2020-11-02 21:28:40 +07:00
softsimon
d46ff35dfb Fix: Split mempool disk cache into 50K txs per file 2020-11-02 19:11:04 +07:00
softsimon
6865e00738 Fix: Reduce red difficulty adjustment progress when nearing end of cycle. 2020-11-02 14:48:48 +07:00
softsimon
73acec23ae Mute websocket parse error. 2020-11-02 01:14:42 +07:00
softsimon
72325b683e Merge pull request #147 from TechMiX/master
Save the legends status in cache
fixes #70
2020-11-01 20:26:38 +07:00
softsimon
8dd257aebd Upgrading social media preview image to new design. 2020-11-01 17:40:45 +07:00
softsimon
b21016efef Removing unnused config MINED_BLOCKS_CACHE. 2020-10-31 18:58:34 +07:00
softsimon
200e68f15a Fix: Wrong variable used to display mempool size. 2020-10-29 07:06:54 +07:00
TechMiX
411b75471c Merge branch 'master' of https://github.com/mempool/mempool 2020-10-28 22:25:33 +01:00
TechMiX
5d7a39a8f2 save the legends active status on a cache 2020-10-28 22:22:07 +01:00
softsimon
fcb51fef20 Calculate tx fees based on segwit tx sizes. 2020-10-28 20:26:48 +07:00
softsimon
5feaff130f Adding missing error cause messages. 2020-10-28 11:00:48 +07:00
softsimon
29ff029b07 Updating lightning node name.
Fixing dashboard button alignment.
2020-10-27 19:27:48 +07:00
softsimon
6494d6daf8 Removing hxpress http compression 2020-10-27 17:42:10 +07:00
softsimon
396ff6a375 Change collapsing dashboard into 3 levels. 2020-10-27 16:34:27 +07:00
softsimon
e61574c630 Add L-BTC sponsor support. 2020-10-27 15:26:37 +07:00
softsimon
edf2d4205d Feature: Add a collapse/show advanced view feature on the Dashboard
fixes #134
2020-10-27 02:58:29 +07:00
softsimon
645772c01a Fix: Segwit-tag is inconsistent when transaction contains segwit and non segwit
fixes #130
2020-10-27 02:07:39 +07:00
softsimon
d260a1ed73 Write cache.json on startup if it doesn't exist.
Write mempool and block data to cache on every new block
fixes #146
2020-10-27 00:05:06 +07:00
softsimon
6a8deff706 Adding form validators for donation form. 2020-10-26 23:23:08 +07:00
softsimon
018e95e648 Fixing missing dashboard graph labels in Firefox. 2020-10-26 23:12:32 +07:00
softsimon
1fc4e9530d Handle weird response body when fetching Bisq price.
fixes #145
2020-10-26 19:33:20 +07:00
wiz
9a94fccf40 Revert "Lock NPM versions."
This reverts commit b544af14e4.
2020-10-26 20:56:55 +09:00
softsimon
99162f5ec9 Sponsor Lightning support. 2020-10-26 18:29:25 +07:00
softsimon
b544af14e4 Lock NPM versions. 2020-10-26 15:59:28 +07:00
wiz
75ce300332 Don't call npm install with --only=prod 2020-10-26 04:24:05 +09:00
softsimon
fb47f5606a npm audit fix 2020-10-26 01:13:36 +07:00
softsimon
9d7b52a104 Removing AVG() from mysql query reducing execution time. Increasing graph data span.
fixes #106
2020-10-26 01:00:21 +07:00
wiz
c5c2d67fce Don't rebuild backend on every restart 2020-10-25 22:22:34 +09:00
softsimon
53bc7725ab Merge pull request #143 from TechMiX/master
update legend state after chart update
2020-10-24 00:27:09 +07:00
TechMiX
0fe32835c9 update legend state after chart update 2020-10-23 19:03:15 +02:00
wiz
aa8d3798ea API Docs: move Fee Estimate APIs to their own tab 2020-10-23 22:15:17 +09:00
softsimon
b4a17693af Only log warning if main update loop has failed more than once. 2020-10-23 16:27:02 +07:00
wiz
c6d0571be8 Merge pull request #138 from lucasmoten/patch-1
Update README with repository checkout guidance
2020-10-20 11:54:32 +09:00
wiz
56b551ea8e Update README to get latest release tag using portable parser 2020-10-20 11:54:04 +09:00
softsimon
bdeac55c97 Fix for statistics enabled config. 2020-10-19 20:24:22 +07:00
wiz
53f7839131 Don't append btc_mainnet/db/ to BISQ_MARKETS.DATA_PATH 2020-10-19 20:58:25 +09:00
wiz
32095cd6b3 Don't rate limit /api/v1/donations URL prefix for sponsor photos 2020-10-19 20:56:46 +09:00
wiz
d8521a9e21 Update production backend configuration files for all 4 instances 2020-10-19 20:40:56 +09:00
softsimon
962c024ecb Use default configs.
refs #141
2020-10-19 18:36:29 +07:00
wiz
4c82e292be Fix typo in previous commit 2020-10-19 19:49:02 +09:00
wiz
eb00b92996 Modify upgrade script to allow reverting to a specific git hash or tag 2020-10-19 19:43:30 +09:00
softsimon
cbef2ae6d0 Limit mempool clear protection to >20K TX mempool
fixes #140
2020-10-19 17:30:47 +07:00
softsimon
45efb604c1 Revamping configuration file.
fixes #141
2020-10-19 11:57:02 +07:00
softsimon
0abe62128e Reducing retry time to max 60 seconds 2020-10-18 22:48:15 +07:00
softsimon
49f70ca28a Slow down retries on Electrs errors in the main mempool loop. 2020-10-18 21:47:47 +07:00
softsimon
2ba7cd9ebd Proxy image requests. 2020-10-18 21:37:27 +07:00
wiz
70da8248cc Remove last paragraph on about page 2020-10-18 20:02:48 +09:00
wiz
716b1235ee Fix typo on about page text 2020-10-18 19:54:48 +09:00
wiz
e732f0f1dc Tweak about page text for project description 2020-10-18 19:28:11 +09:00
softsimon
fff8120daa Backend API to load sponsor profile photos. 2020-10-18 17:14:35 +07:00
wiz
9d4659c3ba Add Terms of Service links with minor tweaks to text formatting 2020-10-18 16:03:03 +09:00
wiz
95bb0fc265 Fix Bisq API docs page from not expanding on load 2020-10-18 13:53:45 +09:00
wiz
2c3f425797 Route /api and /<network/api URLs to HTML for API documentation 2020-10-18 13:11:02 +09:00
wiz
fb9b3202ca Add basic API documentation for all electrs endpoints 2020-10-18 12:56:08 +09:00
softsimon
7bf9810c48 Run Bisq block parse in separate Worker Thread. 2020-10-17 18:13:09 +07:00
softsimon
2715d02cf9 Fix exception handling. Don't save < 0.01 donations to DB.
refs #133
2020-10-17 15:01:58 +07:00
wiz
0fca6f3a3b Tweak about page spacing and text 2020-10-17 16:13:57 +09:00
wiz
2d3ed5f8cb Tag sponsored links with rel=sponsored, don't tag our social media links 2020-10-17 13:31:41 +09:00
wiz
988ed7e8af Add some brief text to our about page, state Bitcoin Only policy 2020-10-17 12:25:44 +09:00
wiz
c22d6e741a Change DB structure for donations: int -> varchar, blob -> mediumblob 2020-10-17 11:32:42 +09:00
softsimon
15fdb69b96 Use Twitter API to fetch profile photos.
fixes #133
2020-10-16 16:29:54 +07:00
softsimon
e7a7b45ad0 Readding "BISQ_ENABLED". Display 'bisq' in logs. 2020-10-15 11:54:21 +07:00
softsimon
d8857f1073 Replacing BISQ_ENABLED with NETWORK === "bisq" 2020-10-15 11:37:25 +07:00
softsimon
b767a0a33e Allow bisq network to be "bisq". 2020-10-15 11:15:04 +07:00
softsimon
472b1d35c2 Improve some logger error messages. 2020-10-15 11:12:33 +07:00
softsimon
86c654f22f New backend config "NETWORK".
Only activate mempool protection.
Log network to
fixes #140
2020-10-15 11:07:53 +07:00
softsimon
372c116283 Input sanitation. Minimum amount fix. Debug log updated. 2020-10-13 19:54:47 +07:00
softsimon
94e06a3a6b Add notice for BTCpay invoices and requests.
refs #135
2020-10-13 18:26:10 +07:00
wiz
3fd5277912 Update mempool-logger and syslog.conf to separate info and notice msgs 2020-10-13 19:58:11 +09:00
wiz
056fe5712d Add newsyslog.conf to rotate mempool logfiles regularly 2020-10-13 19:56:10 +09:00
softsimon
4399c5e8e9 Changing more loggings levels.
refs #135
2020-10-13 17:48:43 +07:00
wiz
cbcfbe5b36 Add mempool-logger script and syslog.conf configuration to log to it 2020-10-13 19:16:09 +09:00
softsimon
b98b979dc8 Changing more loggings levels.
refs #135
2020-10-13 16:58:48 +07:00
softsimon
3d374fd9d9 Changing more loggings levels.
refs #135
2020-10-13 16:43:09 +07:00
softsimon
4a14085908 Use persistent dgram socket client.
refs #135
2020-10-13 16:03:03 +07:00
softsimon
04ac820ed7 Changing common output messages to Debug.
refs #135
2020-10-13 16:00:58 +07:00
softsimon
4dacf292c2 Adding logger wrapper.
Log backend messages to syslog.
fixes #135
2020-10-13 15:27:52 +07:00
softsimon
4c203631db Making order_id (BTCPay invoice id) unique in the database. 2020-10-13 10:10:46 +07:00
Lucas Moten
ed3811bf2c Update README with repository checkout guidance
- Changed repository to clone based on updated organization
- Determine latest release from github api call.  An alternative form being `latestrelease=$(git describe --exact-match --abbrev=0)` to yield the most recent tag name.
2020-10-12 22:51:39 +00:00
softsimon
55646b5732 Handle and don't crash for adress-prefix search error.
fixes #121
2020-10-12 12:57:19 +07:00
wiz
f5e270c770 Use https:// instead of http:// to query mempool.space API 2020-10-12 14:26:01 +09:00
softsimon
e37a9de71d Proxy donation requests to mempool.space when BTCPay Sponsors is disabled. 2020-10-12 10:50:10 +07:00
wiz
7673bf13b9 Update terms of service, add Sponsor Policy for inappropriate profiles 2020-10-12 08:37:56 +09:00
wiz
88cb0d020d Merge pull request #132 from mempool/wiz/terms-of-service
Add new Terms of Service page with links and tweak About page layout for it
2020-10-11 20:58:40 +09:00
wiz
db16dbbc9d Apply suggestions from code review
Co-authored-by: softsimon <softsimon@users.noreply.github.com>
2020-10-11 20:57:52 +09:00
wiz
1d8d39db6b Only show first 8 characters of git commit hash on about page 2020-10-11 20:20:48 +09:00
wiz
024b2d58f7 Move social media icons to bottom, add terms of service links 2020-10-11 20:15:56 +09:00
wiz
bb3842fc10 Add basic Terms of Service page 2020-10-11 19:23:52 +09:00
wiz
8cd98b42fe Fix matomo URL filename 2020-10-10 11:55:27 +09:00
wiz
c8d22dc536 Load self-hosted matomo analytics stats on mempool.space domain 2020-10-10 11:42:32 +09:00
softsimon
a8a1f4e976 About page updates.
refs  #128
2020-10-09 13:56:43 +07:00
wiz
ba315648be Update top-level README screenshot and v2 guide 2020-10-09 06:10:23 +09:00
wiz
761eff62c5 Merge pull request #129 from mempool/donations-fixes
Enhancements to the sponsorship GUI
2020-10-09 04:20:35 +09:00
wiz
0e5f2dd1a4 Use higher resolution profile photos and other minor tweaks 2020-10-09 04:19:32 +09:00
softsimon
dfda0d1890 Bugfix: JS error in transactions.component
fixes #126
2020-10-08 17:53:02 +07:00
softsimon
784f00b725 Enhancements to the sponsorship GUI
fixes  #128
2020-10-08 17:51:10 +07:00
wiz
ad144a34ac Handle btcpay "paid" invoice status for sponsorship donations 2020-10-08 04:46:11 +09:00
wiz
9255f1c007 Merge pull request #125 from mempool/donations
Custom BTCPay donation integration
2020-10-08 02:57:48 +09:00
softsimon
87dc1e5db4 Check and accept both 'complete' and 'confirmed' invoices.
refs #122
2020-10-08 00:51:11 +07:00
softsimon
1f7483687f Don't allow invoices lower than 0.001 and require 0.01 for sponsorship.
refs #122
2020-10-08 00:20:42 +07:00
softsimon
0cbc7e2ab6 Make BTCPay webhook configurable.
refs #122
2020-10-08 00:15:26 +07:00
wiz
c48a151e21 Tweak upgrade script to take PR branch name as argument 2020-10-08 01:35:54 +09:00
softsimon
5b8dbfca74 Addig fronend flag (SPONSORS_ENABLED) to enable Sponsors in the gui.
refs #122
2020-10-07 23:30:45 +07:00
softsimon
b6738dd9e8 Moving API docs to separate /api page. 2020-10-07 23:24:01 +07:00
softsimon
0ee2753100 Only display About page on main Bitcoin network. 2020-10-07 20:27:22 +07:00
softsimon
17dd03682b Set 0.01 BTC as minimum donation limit
refs #122
2020-10-07 20:19:22 +07:00
softsimon
a07a4de255 Custom BTCPay donation integration
fixes #122
2020-10-07 20:15:42 +07:00
softsimon
774893f2fc Bugfix: Incoming transactions not parsed properly. 2020-10-06 13:31:33 +07:00
softsimon
98c398272c Fix for incorrect division in fee estimation.
refs #65
2020-10-05 16:26:39 +07:00
softsimon
beee916658 Updating package lock to fix potential vulns. 2020-10-05 12:31:56 +07:00
softsimon
15bb5a966b Improved empty mempool as well as medium and low fee estimations.
refs #65
2020-10-05 11:42:54 +07:00
softsimon
766bd0d1e0 Adding missing 'irregular' Bisq transaction type.
fixes  #118
2020-10-04 17:51:21 +07:00
wiz
a438ba9fcb Add btcpay donation iframe widget on about page for testing 2020-09-30 22:27:13 +09:00
wiz
5332e4765f Add .github/FUNDING.yml for sponsor button link URL configuration 2020-09-30 22:14:27 +09:00
softsimon
c0ad643d42 DiskCache fix when using clustering. 2020-09-30 00:25:43 +07:00
softsimon
140fc0c5e1 Bugfix: Mempool and blocks disk cache not saved on exit when using cluster. 2020-09-29 23:13:22 +07:00
softsimon
7c6c330b02 Bugfix: Websocket data push stopped working on disconnect, bug caused by 3dedf1e3 2020-09-29 20:52:32 +07:00
softsimon
e8de73cfbc Correct timer to get actual time to update bisq market data. 2020-09-29 19:38:01 +07:00
softsimon
d0b3b240e6 Bugfix for js error on transaction page.
Increase ping-pong timeout.
2020-09-29 18:27:44 +07:00
softsimon
05bea21cc8 Fix: Weight per second should be vBytes per second. 2020-09-29 15:07:04 +07:00
softsimon
0f72030d5e Enhancement: "Load more" is now "Load all"
fixes #117
2020-09-29 15:05:52 +07:00
softsimon
dfaa73803e Bugfix: Liquid asset issuance / circulating / burned amounts are missing decimal point
fixes #112
2020-09-29 03:54:56 +07:00
softsimon
64244228ea Dashboard ux fixes. 2020-09-28 23:05:42 +07:00
softsimon
da5556e3dc Liquid assets display fix. 2020-09-28 16:44:35 +07:00
softsimon
b95efca29d Various bugfixes. 2020-09-28 16:32:48 +07:00
wiz
e9d3b44e97 Set "LIQUID":true in production liquid backend config 2020-09-28 05:00:21 +09:00
softsimon
7848481d8f Dashboard ux fixes. 2020-09-28 02:51:01 +07:00
softsimon
3e3dd83243 Fix: Show fee box on Testnet and Liquid.
Use 0.1 sat/vB as minimum liquid fee.
2020-09-27 18:12:36 +07:00
softsimon
3450de774f Fix for Bisq blocks data watchers stopps working randomly. Restaring watcher when block height has diverged. 2020-09-27 17:21:18 +07:00
softsimon
f4a78a0e78 Fix for double subscribing to stats data. 2020-09-27 13:39:38 +07:00
softsimon
5536e5e77d Minor ux updates to dashboard. 2020-09-27 02:24:50 +07:00
softsimon
dbc2f9e2dd Rearranged dashboard graphs. 2020-09-27 01:31:20 +07:00
softsimon
677cea329c Fixing titles and margins for dashboard. 2020-09-27 00:39:29 +07:00
softsimon
209865d23f Minor dashboard mobile view fixes.
Offline indicator position fix.
2020-09-27 00:18:44 +07:00
softsimon
fe2c9bf49d Revering comment. 2020-09-26 23:48:18 +07:00
softsimon
21ef5054bf Moving fee box into a regular box. 2020-09-26 23:40:26 +07:00
softsimon
3dedf1e3e1 Adding mini-graphs on dashboard. 2020-09-26 22:46:26 +07:00
softsimon
43314c2283 Correct dashboard for mobile. 2020-09-26 11:56:37 +07:00
softsimon
dd31cbfd70 Dashboard design updates based on pedro feedback. 2020-09-26 03:50:32 +07:00
softsimon
f9bbc425d8 Switching order of latest transactions and blocks. 2020-09-26 02:42:39 +07:00
softsimon
d4f768e3b6 Adding latest blocks and transactions to dashboard. 2020-09-26 02:11:30 +07:00
wiz
aa3559e634 Add production script to update local copy of assets registry JSON 2020-09-24 18:42:13 +09:00
wiz
8dddd6e25e Use mempool's fork of Blockstream's Liquid asset registry db repo 2020-09-24 17:12:53 +09:00
wiz
3aff874479 Update production nginx.conf and mempool-config.json for Bisq Markets API 2020-09-23 19:39:46 +09:00
wiz
fa75c1b08d Move backend restart command from upgrade command into its own command 2020-09-23 19:05:28 +09:00
softsimon
ea0edc41e2 Minor ux updates. 2020-09-23 16:48:10 +07:00
softsimon
89533cf76f Improved graph visibility on mobile. 2020-09-23 15:49:07 +07:00
softsimon
007bb30826 Bisq transactions dropdown menu position fix. 2020-09-23 01:43:56 +07:00
softsimon
9e71f1a683 Improved dashboard loading indicators. 2020-09-22 12:50:12 +07:00
softsimon
0464ad4bcf Hide Difficulty Epoch on Liquid. Updated difficulty change calc. 2020-09-22 12:26:54 +07:00
softsimon
bcf68aa074 Menu design updates. 2020-09-22 12:07:08 +07:00
softsimon
b2e0edb919 Menu design updates. 2020-09-22 06:55:45 +07:00
softsimon
ffee91939e Justify menu items center on mobile. 2020-09-22 06:19:14 +07:00
softsimon
9e3fad610c Removing hamburger menu on mobile. Adjusted icon sizes. 2020-09-22 06:13:27 +07:00
softsimon
b67b025dc2 Replacing menu button texts with icons.
Latest blocks is now a separate page.
2020-09-22 05:51:34 +07:00
softsimon
2c3b02a682 NodeJS cluster: Delay child process auto restart 10 seconds on exit.
refs #108
2020-09-22 04:27:08 +07:00
softsimon
6d67fbde84 NodeJS cluster fix: Only save disk cache to disk when master.
fixes #108
2020-09-22 04:07:47 +07:00
softsimon
347ab1e220 NodeJS cluster support. 2020-09-22 03:52:54 +07:00
softsimon
21e985202d Add difficulty percent change indicator. 2020-09-22 03:31:19 +07:00
softsimon
6c1d28a9ac Replacing footer and latest blocks with a stats dashboard. 2020-09-21 19:41:12 +07:00
wiz
8146939f0f Remove unnecessary options from production README's bitcoin.conf 2020-09-20 05:45:29 +09:00
softsimon
508b5c0f4e Markets API: Adding cache for general /ticker requests 2020-09-19 23:02:02 +07:00
softsimon
84f0ebaba6 Market api: /volume api fix. 2020-09-19 15:59:09 +07:00
wiz
04cc1338c0 Set npm dep locutus to dev 2020-09-19 02:25:51 +09:00
wiz
630e3fa863 Update production scripts to only install production npm deps 2020-09-19 02:19:47 +09:00
softsimon
5d2c0d2e0a Markets API: Use file mtime to only parse files that has updated. 2020-09-18 23:43:45 +07:00
wiz
55852bcf62 Update production bisq instance backend config for Bisq Markets data 2020-09-18 22:02:23 +09:00
wiz
91815072d5 Update production scripts to install/load NodeJS/npm using nvm 2020-09-18 21:53:58 +09:00
wiz
07cfdd73aa Fix upgrade script not restarting node due to new command line args 2020-09-18 18:08:59 +09:00
softsimon
059e4d079a Markets api: Add missing "timestamp" parameter for /hloc and /volumes 2020-09-17 15:38:25 +07:00
softsimon
14697a01cc Corrected Offers response data. 2020-09-17 02:45:14 +07:00
softsimon
4d4eaecb87 Market api: Fix memory leak 2020-09-15 23:12:42 +07:00
wiz
344413568d Increase NodeJS max heap to 4GB RAM for backend instance 2020-09-16 00:46:34 +09:00
softsimon
77cbb302ce Bisq market: Fix for missing prices from /trades 2020-09-15 12:37:54 +07:00
wiz
c1c0521ab4 Merge pull request #107 from mempool/bisq-markets
Bisq markets API
2020-09-15 05:28:28 +09:00
softsimon
a11135f358 * /volumes API
* /ticker API
2020-09-15 03:11:52 +07:00
softsimon
bafe2db094 HLOC markets api. 2020-09-13 17:51:53 +07:00
softsimon
98cc81c53d Corrections to parameters handling and sorting. 2020-09-12 01:26:51 +07:00
softsimon
60b1dd15f4 Fix pluralization for "transactions".
Display "genesis block" on block 0
2020-09-10 14:55:49 +07:00
softsimon
88e5b03430 Bisq Markets API. WIP 2020-09-10 14:46:23 +07:00
wiz
9234d23da2 Update production nginx.conf with performance tuning and rate limiting 2020-09-10 14:39:04 +09:00
softsimon
04351e843d Correcting robots.txt 2020-08-26 17:31:59 +07:00
softsimon
0041500e08 Correcting robots.txt 2020-08-26 17:24:40 +07:00
softsimon
4e8908925c Adding robots.txt 2020-08-26 17:05:29 +07:00
softsimon
80fc3df76d bugfix: vbytespersecond display was limited to 1667 2020-08-19 11:33:18 +07:00
softsimon
147de195a9 deleting yarn lock since we rely on NPM package-lock.json 2020-08-19 11:31:50 +07:00
softsimon
5300fb1265 Revert "Display whole fee span on mined blocks."
This reverts commit cb51b71128.
2020-08-13 02:53:52 +07:00
softsimon
71c44d725a Pagination fixes. 2020-08-13 02:35:10 +07:00
softsimon
097e2ba0ea Assets page pagination. 2020-08-13 00:46:44 +07:00
softsimon
b1c8166936 Update title to - "<network> Explorer" 2020-08-12 14:04:04 +07:00
softsimon
2d02ec7092 Return HTTP 503 from Fee Api when mempool is still syncing.
Fix for displaying git commit on About page.
2020-08-12 13:33:58 +07:00
softsimon
dd0b67716f Optimization for bisq transaction table rendering 2020-08-11 00:43:24 +07:00
softsimon
95bab64424 Fixes for bisq pagination and tx type select history 2020-08-11 00:01:22 +07:00
softsimon
b00a9ee938 Bisq Pagination and tx type select history. Increased transactions per page. 2020-08-10 23:47:44 +07:00
softsimon
d2a14e9cb7 Default to 1 sat/vB when mempool is empty. 2020-08-10 22:04:51 +07:00
softsimon
09b1a0d430 Hide "included in block" if block is clearly visible. 2020-08-10 17:48:07 +07:00
softsimon
1b9900ccf8 Add commit hash to the bottom of the about page
fixes #102
2020-08-10 14:59:29 +07:00
softsimon
cb51b71128 Display whole fee span on mined blocks.
fixes #101
2020-08-10 14:48:09 +07:00
softsimon
5411feee36 Default mempool backend to local electrs mock server. 2020-08-10 14:32:16 +07:00
softsimon
912a5dab27 Add proper timestamp to transaction pages. 2020-08-09 10:44:01 +07:00
softsimon
63fb733dc2 Adding OnPush to more components 2020-08-09 10:39:27 +07:00
softsimon
648be481d7 Upgrading bisq transaction type filter with a multiselect dropdown 2020-08-08 22:48:18 +07:00
softsimon
fea79f2ff4 Add pagination history to bisq transactions and blocks page. 2020-08-07 13:11:55 +07:00
softsimon
01b3407a9c Updated fee texts 2020-08-04 00:56:01 +07:00
softsimon
58ec9444a5 Change detection refactoring. 2020-08-02 19:20:38 +07:00
softsimon
bf1101ff66 Add testnet and bisq to local development proxy config. 2020-08-02 18:31:47 +07:00
softsimon
e6fa274aca Changedetection performance improvements. 2020-08-02 16:00:08 +07:00
softsimon
fa2a995de6 Fix for text overflow in footer 2020-08-02 15:30:28 +07:00
softsimon
7443522ed8 Merge pull request #100 from mempool/dependabot/npm_and_yarn/frontend/elliptic-6.5.3
Bump elliptic from 6.5.2 to 6.5.3 in /frontend
2020-08-01 12:35:37 +07:00
dependabot[bot]
dbe5f3bf06 Bump elliptic from 6.5.2 to 6.5.3 in /frontend
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-01 03:52:27 +00:00
softsimon
1f22819e0c Fixed margins. 2020-07-30 21:55:46 +07:00
softsimon
58a6bbd88b Subscription refactoring to increase performance. 2020-07-30 17:01:13 +07:00
softsimon
bb6272469d Refactor to use OnPush 2020-07-30 15:38:55 +07:00
softsimon
c1caaa37aa Refactor footer component to using OnPush. 2020-07-30 13:50:21 +07:00
softsimon
d1c786e2f6 Fee box: Only display on mainnet 2020-07-30 13:24:03 +07:00
softsimon
67dbea3faf Fee box fixes. 2020-07-30 13:13:22 +07:00
softsimon
bc92fb669b Display only the mempool blocks on mobile devices. 2020-07-30 12:43:22 +07:00
softsimon
51bed8e852 Merge pull request #99 from mempool/fees-box
Adding fee estimation component to front page
2020-07-29 21:54:46 +07:00
softsimon
81d7072a95 Fee box: Mobile view 2020-07-29 17:30:30 +07:00
softsimon
36d952b503 Fee block: Fees order fix. 2020-07-29 16:54:08 +07:00
softsimon
266c347292 Fee box: Handle empty mempool. 2020-07-29 15:20:23 +07:00
softsimon
9e0097e7b6 Adding fee estimation component to front page
fixes #98
2020-07-29 15:16:09 +07:00
softsimon
599159ecf0 Fix: Don't build statistics cache when DB is disabled. 2020-07-29 13:57:49 +07:00
softsimon
4c5ff7714e Adding eof new line 2020-07-28 14:27:38 +07:00
softsimon
010aef1e90 Bisq: burntFee should be displayed on asset listing fee tx types 2020-07-28 13:31:25 +07:00
wiz
d7a5ecc4aa Add bisq websocket proxy in production nginx.conf 2020-07-26 00:03:30 +09:00
softsimon
2b4b0d22ab Fix for electrs requests on /bisq 2020-07-25 21:59:52 +07:00
softsimon
24e40b25fd New config that lets frontend connect to a separate Bisq mempool backend. 2020-07-25 21:21:53 +07:00
softsimon
0ded140c72 Address suggestion fixes: Added ellipsis on long addresses. Search on item select. 2020-07-25 17:52:41 +07:00
wiz
7f7c6ef6f8 Minor tweaks to production, use git pull --rebase, only build 1 frontend 2020-07-25 01:46:51 +09:00
softsimon
81d05e23b8 Add typeahead address prefix. 2020-07-24 22:37:35 +07:00
wiz
d2673281f9 Fix .gitattributes for line endings again 2020-07-24 22:42:08 +09:00
softsimon
807b335534 Adding package-lock.json. 2020-07-24 20:16:56 +07:00
wiz
6ded0f54c4 Add production 4th instance for bisq backend 2020-07-24 21:53:57 +09:00
wiz
067540980e Add filesystem notes to production README doc 2020-07-24 21:53:55 +09:00
softsimon
fa88bd7057 Upgraded typescript and tslint version and fixed query type error. 2020-07-24 19:38:39 +07:00
softsimon
adcec33fb9 Remove non existing import. 2020-07-24 18:59:49 +07:00
softsimon
6a4184a413 Bisq types list order. 2020-07-24 18:52:55 +07:00
softsimon
7f71781916 Bisq: Feature to filter transaction types. 2020-07-24 18:41:15 +07:00
softsimon
24182a6fb3 Fixes. 2020-07-24 14:11:49 +07:00
softsimon
959e2b55cb Show prettier empty mempool blocks. 2020-07-24 12:23:49 +07:00
softsimon
0f11642418 Fix for creating empty blocks. 2020-07-24 12:11:05 +07:00
softsimon
c7a09ffbfc Display correct BTC unit depending on network. 2020-07-24 11:49:36 +07:00
softsimon
9980414969 Handle coinbase transactions no longer has undefined fee. 2020-07-24 00:20:59 +07:00
softsimon
9d8c1184ab Re-adding design credits. 2020-07-23 22:21:46 +07:00
softsimon
490223b40a Correced Liquid asset amouts. 2020-07-23 17:55:59 +07:00
softsimon
73d0900343 Display fee correctly on Liquid blocks. 2020-07-23 16:01:28 +07:00
softsimon
23f5e229c9 Fixes to block reward display on Liquid. 2020-07-23 12:10:22 +07:00
softsimon
b6b9001406 Display empty mempool instead of no mempool blocks at all. 2020-07-23 10:53:42 +07:00
softsimon
86c0a5ec7b Add setting to disable database use. 2020-07-23 00:04:29 +07:00
softsimon
251b8cdd8d Fix for block transition when switching networks. 2020-07-22 20:09:02 +07:00
softsimon
0f611ecf8a Adding a global websocket loader observable.
fixes #95
2020-07-22 19:21:40 +07:00
softsimon
6b3e84255a Display transaction fees even if they are zero. 2020-07-22 13:41:50 +07:00
softsimon
a4c49d42af Display "stack of X blocks" instead of "8th block" on the mempool block stack. 2020-07-21 13:20:17 +07:00
softsimon
942e1a7d68 Fix for weird block animation when navigating back to main page. 2020-07-21 12:47:51 +07:00
softsimon
a1b931851a Block text corrections. 2020-07-21 10:26:43 +07:00
softsimon
62d2fc8113 Using two watchers to monitor Bisq data top and sub directory, and added more error handling. 2020-07-21 10:23:21 +07:00
wiz
85d0deb239 Fix .gitattributes for CRLF issue 2020-07-20 18:47:16 +09:00
softsimon
e5c4642af4 Delay restarting of sub watcher to let Bisq recreate the directories. 2020-07-20 16:36:08 +07:00
softsimon
6a2d6d6291 Shorten 'minutes' and 'seconds' on mobile. 2020-07-20 12:21:30 +07:00
softsimon
362a3554f9 Block design corrections 2020-07-20 12:21:08 +07:00
softsimon
7bbfbdb188 Restoring "fee span" on blocks. 2020-07-20 11:03:53 +07:00
softsimon
9fa95ccbe8 Improv: On new block push, simultaneously send new mempool stats. 2020-07-20 10:44:05 +07:00
softsimon
5e16c592cb Bufix: Miner started reloading when switching transaction page 2020-07-20 10:29:38 +07:00
softsimon
eac605f181 Canonical url is now in index.html as default. 2020-07-19 23:55:56 +07:00
softsimon
caf5ae944a Add x-close button to block. 2020-07-19 22:54:31 +07:00
softsimon
b34648389c Restoring dynamic canonical URL. 2020-07-19 22:49:06 +07:00
softsimon
3b380fa4cc Adding X-button to close mempool blocks. 2020-07-19 19:49:27 +07:00
softsimon
8695bb9bb1 Upgrade libs. 2020-07-19 19:34:09 +07:00
wiz
222b7b9dd6 Merge pull request #92 from mempool/bisq
Bisq support
2020-07-19 20:33:16 +09:00
softsimon
621ff8fed5 Fix for responsive bug in medium screen size mode. 2020-07-19 17:55:33 +07:00
softsimon
83d821d80d bisq transaction link fix 2020-07-19 15:36:58 +07:00
softsimon
ee6108ccec Display tx data on bisq transaction page. 2020-07-19 15:28:27 +07:00
softsimon
cca69556d0 Refactored "features" and "fee rating" from transaction into components. 2020-07-19 14:54:42 +07:00
softsimon
c893608a41 Updated api docs. 2020-07-19 13:48:05 +07:00
softsimon
fbb8185c82 Responsiveness fixes. 2020-07-19 13:46:30 +07:00
softsimon
cfb60c0bad Update Bisq API paths to /api/bisq 2020-07-19 12:57:41 +07:00
wiz
4e6ba18f19 Add proxy_pass with rewrite for /bisq/api into nginx.conf 2020-07-18 21:07:36 +09:00
softsimon
5198c3a5af Send correct content-types. 2020-07-18 18:46:33 +07:00
softsimon
66c565a3d7 Adding multiple fs.watch-ers to handle Bisq restarts. 2020-07-18 18:17:24 +07:00
softsimon
3df36cd3b8 Watch for bisq dump recursively. 2020-07-18 13:41:40 +07:00
softsimon
425f4152b6 Handle confirm transactions not present in the bisq database. 2020-07-18 13:09:57 +07:00
softsimon
d22e4a03e6 Adding Bisq API to About page.
Watching partent bisq dump folder.
2020-07-18 12:59:12 +07:00
softsimon
3ff1957f0c Table design and responsiveness updates. 2020-07-18 11:04:04 +07:00
softsimon
74e9eca0d9 Fixed bisq transaction id. 2020-07-16 17:56:40 +07:00
softsimon
ad3c295fd6 Handle errors in block component. 2020-07-16 16:46:10 +07:00
softsimon
d3d3fd0db1 If bisq tx not found, check for regular tx and redirect to /tx/ 2020-07-16 16:18:35 +07:00
softsimon
c5759be3ee Fix responsiveness. 2020-07-16 14:36:02 +07:00
softsimon
87e56e2975 Network menu design updates. 2020-07-16 14:30:27 +07:00
softsimon
40afa7a420 Remove filename check for fs.watch 2020-07-16 00:55:41 +07:00
softsimon
40f7eaf7ba Watch dir instead of json file.
Adding divider to network dropdown.
2020-07-16 00:33:53 +07:00
softsimon
e4a65bd19a Corrected Liquid logo. 2020-07-15 16:19:08 +07:00
softsimon
3333b76c98 Rearange network dropdown.
API for Bisq block height tip.
Loading indicators on transactions/blocks view.
Total sent now correctly display burnt on Pay trade fee txs.
2020-07-15 13:10:13 +07:00
softsimon
3008f99668 Show fiat value of totalRecieved for addresses.
Rename fee to fee burnt.
2020-07-14 23:49:57 +07:00
softsimon
ca0cf23d66 Bisq stats page.
BSQ prices.
2020-07-14 21:26:02 +07:00
softsimon
b7376fbd8d Bisq statistics page. 2020-07-14 14:38:52 +07:00
softsimon
87abfc38cb Display network logo in the top bar.
Allow search for block height.
Hide empty bisq blocks.
2020-07-13 23:22:24 +07:00
softsimon
432fb9cd66 Address index and api.
Address view.
2020-07-13 21:46:25 +07:00
softsimon
db2e293ce5 Bisq module separation.
Transaction view.
Block view.
Blocks list.
2020-07-13 15:16:12 +07:00
softsimon
60e1b9a41e Bisq explorer is now a separate module. 2020-07-11 00:17:13 +07:00
softsimon
8c23eae5fe Auto reload bisq dump file. 2020-07-10 14:13:07 +07:00
softsimon
4ff9663812 merge from master 2020-07-05 23:24:06 +07:00
softsimon
c9c892b4fe Merge pull request #90 from mempool/rename-api-endpoints
Rename API endpoints in frontend and nginx.conf to match blockstream
2020-07-05 22:42:00 +07:00
wiz
4aca806b70 Rename API endpoints in frontend and nginx.conf to match blockstream 2020-07-06 00:15:16 +09:00
wiz
50ccdc424d Add HTTP Link: header for canonical URL reference to mempool.space 2020-07-05 16:34:26 +09:00
wiz
926842d949 Fix HTTP content-security-policy header typo 2020-07-04 18:00:41 +09:00
wiz
ae4eb22db9 Add HTTP security headers to production nginx.conf 2020-07-04 17:57:26 +09:00
softsimon
c21dad88bf WIP: Bisq DAO support. Transactions list and details. 2020-07-03 23:45:19 +07:00
softsimon
2ebdb27dcb Fixing routes to /tv and /status 2020-07-02 22:34:16 +07:00
softsimon
f5260b72e5 enable status view for liquid and testnet 2020-07-02 20:51:55 +07:00
softsimon
2aca447f9e Adding /status-view 2020-07-02 17:56:15 +07:00
wiz
f1a1039dea Merge pull request #89 from 6102bitcoin/master
Remove shadow on Block-Height value
2020-07-01 02:21:18 +09:00
6102bitcoin
953eea7321 Remove shadown on Block-Height value 2020-06-30 18:19:09 +01:00
wiz
c4d4d931f1 Add <noscript> tag in index.html for Tor browser or NoJS users 2020-06-28 22:14:16 +09:00
softsimon
c20ba429b1 Increased frontend auto reload timeout.
Increased time limit on new transaction processing.
2020-06-23 14:49:06 +07:00
softsimon
0a264a7078 Adding support for optional frontend config.
Dropdown network selector is hidden by default, and enabled using config.
fixes #79
2020-06-22 22:10:49 +07:00
softsimon
7e9ba6b983 Bugfix: Latestblock height didn't propagate in the template
Renaming Contributors to About
2020-06-21 14:55:16 +07:00
wiz
c9cc660e54 Update production upgrade script to update main repo, announce hostname 2020-06-21 01:53:24 +09:00
wiz
0609ce91d0 Update production README dependency packages for FreeBSD 2020-06-21 01:53:07 +09:00
softsimon
57029405a7 Removing "blockchain" tab to make medium size display not overlap. 2020-06-20 21:54:42 +07:00
softsimon
ae9f57322b Liquid fee amount fix, network was read to early 2020-06-19 23:57:57 +07:00
softsimon
22813a09e8 Display fees correctly for Liquid blocks. 2020-06-19 23:32:17 +07:00
softsimon
279b79b9b1 Reducing mempool detection sensitivity to 25%
refs #76
2020-06-18 17:10:07 +07:00
softsimon
b92eef8198 Set in sync to false when mempool clear protection is active.
refs #76
2020-06-18 14:34:56 +07:00
softsimon
6688421e39 Prevent mempool from being flushed when restarting bitcoind.
fixes #76
2020-06-18 13:54:54 +07:00
wiz
21e2ce6a85 Remove old unused favicons for apple homescreen 2020-06-17 18:40:16 +09:00
wiz
91c40da8c9 Remove old unused favicons for android homescreen 2020-06-17 18:30:01 +09:00
wiz
d513bd7ea8 Update favicons with transparent icon - fixes #87 2020-06-17 18:28:15 +09:00
softsimon
cc48e0be2c Fix: Don't calculate block fee for Liquid.
Completing interfaces.
2020-06-17 15:01:58 +07:00
softsimon
6eca311147 Display input/output asset transfers
fixes #85
2020-06-12 16:17:52 +07:00
softsimon
56c6612e2e Don't fully animate when tab is deactivated.
refs #47
2020-06-11 01:38:59 +07:00
softsimon
07b543d6bf Disabling new block sound until we have a setting for this.
refs #84
2020-06-11 00:41:39 +07:00
softsimon
43dac03ec0 Bigfix: Don't chime when switching networks.
fixes #84
2020-06-11 00:11:15 +07:00
softsimon
36e46249b5 Transition new blocks from the mempool onto the blockchain.
Chime on new blocks.
fixes #47
fixes #84
2020-06-10 23:52:14 +07:00
softsimon
ea708de9fb Speed up mempool loop. 2020-06-09 02:32:24 +07:00
softsimon
0177224eba Adding types to callback functions. 2020-06-09 02:08:46 +07:00
softsimon
912d45165b Don't call mempoolChanged after disk cache dump. 2020-06-08 19:19:31 +07:00
softsimon
8b6a681614 Detect RBF-transactions and offer to track them.
fixes #78
2020-06-08 18:55:53 +07:00
softsimon
f0b0fc3f4b Push new block and mempool synchronized.
Measure projected block accuracy.
refs #47
2020-06-08 02:08:51 +07:00
softsimon
9bf38da470 Merge pull request #83 from mempool/dependabot/npm_and_yarn/frontend/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4 in /frontend
2020-06-07 20:39:02 +07:00
dependabot[bot]
cec6bf59f2 Bump websocket-extensions from 0.1.3 to 0.1.4 in /frontend
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-07 12:14:55 +00:00
softsimon
7ade4c114b Code cleanup. 2020-06-07 17:30:32 +07:00
softsimon
4bef9f9b79 Display coinbase and op return messages all the time. 2020-06-06 23:50:08 +07:00
softsimon
6662bc4646 Display at least one standalone mempool block.
Upgrade some packages to ng 9.
2020-06-04 15:08:24 +07:00
softsimon
e917d40909 Dynamic itemsPerPage on assets list. 2020-06-01 15:56:32 +07:00
softsimon
3cf839e1da Icons to network dropdown. 2020-06-01 15:08:27 +07:00
softsimon
55835b3741 Spread gradient correctly on unfilled blocks. 2020-05-31 18:34:03 +07:00
softsimon
da4ce0855c Block transactions list now use pagination instead of infinite scroll. 2020-05-30 21:18:53 +07:00
softsimon
5e5f048071 Hide horizontal scrollbar. 2020-05-30 18:04:06 +07:00
softsimon
969367c8bb Improved Liquid Assets page with pagination and search filter. 2020-05-30 16:26:39 +07:00
softsimon
235c9b0bdd Mempool gradient update, again. 2020-05-30 10:20:29 +07:00
softsimon
2c24c2de83 Corrected that horrible green color. 2020-05-30 09:56:38 +07:00
softsimon
9ef5c420d9 Change mempool gradient to green-yellow-red 2020-05-29 22:16:20 +07:00
softsimon
3deedada07 Display Segwit and RBF information 2020-05-28 18:39:45 +07:00
softsimon
84e15b133a Mobile responsive fixes. 2020-05-28 15:50:19 +07:00
softsimon
16603e4fc1 Throw error when failing to download json assets. 2020-05-28 01:56:32 +07:00
softsimon
3b546b234f Handle missing assets in search. 2020-05-28 01:01:35 +07:00
softsimon
559a6dd19a Slightly increased gradient span and contrast on mempool blocks 2020-05-27 17:14:02 +07:00
softsimon
8167debbe9 Expose git commit hash to backend info api. 2020-05-27 15:18:04 +07:00
wiz
4d4b6f4831 Add GitHub issue template with info about support requests 2020-05-26 23:15:39 +09:00
wiz
ca9ee0e6ae Add torrc in production README 2020-05-26 23:13:57 +09:00
wiz
b9d9875e98 Remove duplicate npm install and build steps in production scripts 2020-05-26 21:52:50 +09:00
wiz
9af0015c22 Remove uacomment from bitcoin.conf 2020-05-26 21:34:47 +09:00
wiz
c732f2d423 Always run "npm install" when upgrading, only build mainnet frontend 2020-05-26 21:34:45 +09:00
softsimon
68664968da Add backendInfo api endpoint. 2020-05-26 18:06:14 +07:00
softsimon
5b80b43e2a Add hostname to initial websocket data. 2020-05-26 16:34:55 +07:00
wiz
4ece586709 Add missing MySQL grant statements in production README 2020-05-26 13:23:57 +09:00
wiz
01ac06b096 Fix start/upgrade scripts to properly restart the backend processes 2020-05-26 13:23:55 +09:00
wiz
73fb18b929 Ignore line endings for package.json files 2020-05-26 13:23:52 +09:00
softsimon
5cbbf5a186 Crash fix. 2020-05-26 11:02:12 +07:00
softsimon
0b74e6cba8 Bootstrap version update and progressbar fix.
Yellow fee text is now white.
2020-05-25 22:36:50 +07:00
wiz
ecbc3e7580 Add production site setup guide and related install scripts 2020-05-25 20:58:46 +09:00
wiz
003361befb Update misc files used for mempool.space production website 2020-05-25 18:42:00 +09:00
softsimon
2c345426cb Strip attached coinbase transactions to save data. 2020-05-24 22:45:45 +07:00
softsimon
ba007a4b17 Use dynamic gradient based on fee levels on mempool blocks.
fixes #64
2020-05-24 22:23:56 +07:00
softsimon
4d2fcf96c6 Duplicate code fix. 2020-05-24 16:29:30 +07:00
softsimon
f4117df63d Display "in several hours" for transactions over 7 blocks away. 2020-05-24 00:25:04 +07:00
softsimon
b32afac98c Remove arrow when switching to old block. 2020-05-22 14:03:06 +07:00
softsimon
5e3c71e11c Allow blockchain horizontal scrolling. 2020-05-22 13:22:23 +07:00
softsimon
565aa499e5 Reveal coinbase scriptsig and op_return scriptpubkey ascii on hover. 2020-05-22 00:35:45 +07:00
softsimon
58942ec88a Display fees in transaction list 2020-05-21 01:55:46 +07:00
softsimon
7e07e2cd8a Fix address tracking issues. 2020-05-20 17:00:50 +07:00
softsimon
30d2c5de27 Liquid Graph fix.
Key navigation fix.
Addresses overflow fix.
Firefox float fix.
2020-05-17 17:06:09 +07:00
softsimon
afb4f6e70b Fixed keyboard navigation bugs. 2020-05-13 13:03:57 +07:00
softsimon
910696e41c Removing halving event code. 2020-05-12 14:49:29 +07:00
softsimon
422055046e Blink projected halving block. 2020-05-12 01:12:38 +07:00
softsimon
ba3aba918a Network based block progressbar colors. 2020-05-10 21:50:32 +07:00
softsimon
4d53e897b4 Network based blockchain colors. 2020-05-10 21:34:25 +07:00
softsimon
50f98807a3 Graph x-axis date fix. 2020-05-10 17:44:19 +07:00
softsimon
db64abec4e Dropdown color update. 2020-05-10 16:22:35 +07:00
softsimon
91a45aae30 Search box text updated.
BTC ticker fix.
Dropdown color fix.
Miner button tooltip.
2020-05-10 16:03:22 +07:00
softsimon
9b4e5194c1 Allow search and navigate by block height.
fixes #41
2020-05-10 14:32:27 +07:00
softsimon
756caf2c53 Improved network switching. 2020-05-10 12:31:57 +07:00
wiz
e4d54ebb14 Add missing lines at top of nginx.conf for user and pid files 2020-05-10 03:56:48 +09:00
wiz
d92492eba6 Update production nginx.conf to run all 3 sites on same hostname 2020-05-10 03:48:16 +09:00
softsimon
1d542c15e4 Arrow navigation fix.
Liquid native asset notification fix.
2020-05-10 01:34:28 +07:00
softsimon
c08a4c8424 Instant mining pool identification from recent blocks.
refs #59
2020-05-10 00:54:07 +07:00
softsimon
0753b11840 Identify and display mining pool.
fixes #59
2020-05-10 00:35:21 +07:00
softsimon
1feb985bec Liquid and Testnet now accessable from the main site
fixes #35
2020-05-09 20:37:50 +07:00
softsimon
20c7ee98e7 Asset tracking.
Asset caching.
refs #37
2020-05-05 15:26:23 +07:00
softsimon
d662292afb Fixed asset infinite scroll. 2020-05-03 00:56:48 +07:00
softsimon
0d435c9e1a Hide assets on mainnet. 2020-05-02 17:52:26 +07:00
softsimon
6a51162f99 Renaming file assets folder to resources to not confuse with Liquid assets. 2020-05-02 16:59:14 +07:00
softsimon
44d19550e8 Assets list. Native asset updates.
refs #37
2020-05-02 16:29:34 +07:00
softsimon
ac9e718ef1 Sync asset registry on build.
refs #37
2020-05-02 14:04:33 +07:00
softsimon
11b1d9bbd3 Assets support WIP
refs #37
2020-05-02 12:36:35 +07:00
softsimon
b2d2fd225c Basic Liquid Asset support. 2020-04-28 17:10:31 +07:00
softsimon
7e7b536acb Renaming angular project to 'mempool' from 'mempoolspace' 2020-04-28 00:14:29 +07:00
softsimon
9025d4dd54 - Switched the arrow colors for spent/unspent utxos
- Collapse dropdown on search (mobile)
2020-04-14 15:35:20 +07:00
softsimon
e02924e8dd Another bugfix related to the mempool transaction subscription. 2020-04-13 02:43:43 +07:00
softsimon
590f1d2b04 Improvments to the mempool transaction subscription. 2020-04-13 02:06:10 +07:00
softsimon
e2671df4be Wait for an push transactions that hasn't yet appeared in the mempool 2020-04-13 01:26:53 +07:00
softsimon
c5796a8062 Improved websocket tx/address tracking handling when disconnecting . 2020-04-12 03:03:51 +07:00
softsimon
52e2d364dd Changing sats to sat. 2020-04-11 23:23:39 +07:00
softsimon
7c58195d10 Adding countdown timer
refs #50
2020-04-10 01:14:18 +07:00
softsimon
fc7a5c2e28 Adding countdown timer
refs #50
2020-04-10 01:05:21 +07:00
softsimon
38d424f793 Special halvening block and fireworks.
fixes #50
2020-04-09 17:46:30 +07:00
softsimon
53999dbea5 Round medianFee instead of ceil
Minor ui fixes.
2020-04-09 15:23:46 +07:00
softsimon
498df53f25 Format transaction count numbers. 2020-04-07 00:44:22 +07:00
softsimon
eaaf7bedc2 upgrading tslint to v6 2020-04-05 00:00:17 +07:00
softsimon
01c1b22419 Upgrading frontend to angular 9.1 2020-04-04 23:50:10 +07:00
softsimon
d7a7095b8d Prepend network name to title when on testnet or liquid. 2020-04-04 21:47:05 +07:00
softsimon
b082763438 Send empty mempoolInfo responsive instead of undefined on server restart. 2020-04-04 01:11:46 +07:00
softsimon
c6df78815b Added mempool inSync property to backend. Display on frontend when not in sync and on't create statistics when not in sync.
fixes #29
2020-04-01 20:06:44 +07:00
softsimon
03316f99d1 Handle empty and invalid addresses 2020-03-30 14:54:48 +07:00
wiz
0b23e5bcd3 Add instructions for Docker Hub to README 2020-03-30 03:59:03 +09:00
softsimon
8d903c42b9 Corrected canonical url. 2020-03-30 01:53:39 +07:00
softsimon
0bcfdc8028 Set dynamic canonical url 2020-03-30 01:44:22 +07:00
softsimon
9814927849 Merging duplicate mempool graph code. 2020-03-29 23:59:04 +07:00
softsimon
24c23f1ee8 Only display 0-1sat/vB on Liquid. 2020-03-28 19:24:13 +07:00
softsimon
2f83da7ce9 Various bugfixes and removing unfairly cheap joke. 2020-03-28 16:38:28 +07:00
softsimon
3f35671fb5 Color fix for 0-1 sat/vb fees in tv graph 2020-03-28 16:02:21 +07:00
softsimon
18989cf1e4 Display 0-1 sat/vb fees in graph 2020-03-28 13:55:52 +07:00
wiz
630967680f Move sitemap XML files into their own folder, add to .gitignore 2020-03-27 23:04:46 +09:00
wiz
f7381a88e5 Change metadata descriptions to Bitcoin Only 2020-03-27 22:58:21 +09:00
softsimon
f21585782f Adding unfairly cheap for very low fee transactions. 2020-03-27 17:56:42 +07:00
wiz
fccfa202e1 Add production nginx.conf for mempool.space and mempool.ninja hosts 2020-03-27 15:16:17 +09:00
wiz
f78c35bdcf Fix xml header on sitemap, don't gzip every sitemap file 2020-03-27 09:26:54 +09:00
wiz
1823212899 Fix sitemap bugs, reduce blocks per sitemap to 100 2020-03-27 09:00:42 +09:00
wiz
a0d6365c61 Fix sitemap generation lastmod timestamp 2020-03-27 08:33:08 +09:00
wiz
a266ed30b2 Tweak sitemap generation to have 1000 blocks per file 2020-03-27 08:11:07 +09:00
wiz
028bcbf53e Add script to generate sitemap links for each block hash 2020-03-27 07:49:37 +09:00
softsimon
1d0dc5c418 Merge pull request #66 from mempool/dependabot/npm_and_yarn/frontend/acorn-6.4.1
Bump acorn from 6.4.0 to 6.4.1 in /frontend
2020-03-27 03:55:15 +07:00
softsimon
e3bf8d0039 Repointing meta tags to correct domain. 2020-03-27 03:50:10 +07:00
dependabot[bot]
cd0573e0d1 Bump acorn from 6.4.0 to 6.4.1 in /frontend
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-26 20:20:15 +00:00
softsimon
294e6d1667 Adding "load more" for large input/output sets. 2020-03-27 02:34:09 +07:00
softsimon
af86956836 Set outspend fetch limit on transaction level. 2020-03-27 01:33:39 +07:00
softsimon
550a096749 Bugfixes. 2020-03-27 01:29:55 +07:00
softsimon
12546e1096 Liquid: Display BTC as L-BTC. 2020-03-25 21:55:18 +07:00
softsimon
6b96dce478 Liquid: Display block times and amounts correctly. 2020-03-25 21:29:40 +07:00
softsimon
9a8740cbe0 Small fixes. 2020-03-25 18:41:16 +07:00
softsimon
05d4eb7696 Renaming Mempool blocks to "next block" + ux fixes 2020-03-25 03:59:30 +07:00
softsimon
628df1a972 Mobile view design updates. 2020-03-25 02:55:26 +07:00
softsimon
fe216b12d9 Mobile padding improvements. 2020-03-25 00:41:46 +07:00
softsimon
9c532499e8 Refactor address reactive flow. 2020-03-24 21:38:11 +07:00
softsimon
ffa97fedf3 Bugfix: Refetch unconfirmed transaction when returning back online. 2020-03-24 21:01:29 +07:00
softsimon
a244458928 Removing bad code 2020-03-24 01:00:39 +07:00
softsimon
2628dc1271 Update page Title for SEO. 2020-03-24 00:52:08 +07:00
softsimon
93c5f0bd84 Adding ETA, confirmed time, and other ui improvements to transaction page. 2020-03-23 04:07:31 +07:00
softsimon
245af5fa8f Improved how mempool blocks handle updates 2020-03-23 01:43:03 +07:00
softsimon
bd641271a9 Bugfix and inprovments for arrow navigation. 2020-03-22 23:45:16 +07:00
softsimon
78e41fc3d3 Refactord blockchain is rendering, block arrow location propagation and keynavigation. 2020-03-22 17:44:36 +07:00
softsimon
69827843c9 Navigate between blocks using keyboard arrows. 2020-03-21 03:38:18 +07:00
softsimon
4ae5576452 Update fee distribution graph and fix arrow. 2020-03-20 02:11:40 +07:00
softsimon
e84ec7dd86 Fixed sorting issue that caused the median calculation bug. 2020-03-20 02:07:12 +07:00
softsimon
72658c19f6 Adding "mempool block" details. Work in progress! 2020-03-17 21:53:20 +07:00
softsimon
3e6f382c4d Adding mouse over title to fee rate badge. 2020-03-16 02:41:13 +07:00
softsimon
8a5887e890 Only return "initial block amount" on init, and treat high fees in empty blocks as overpaid. 2020-03-16 02:25:14 +07:00
softsimon
abf74c1aaf Adding fee rating to confirmed transactions. 2020-03-16 02:01:03 +07:00
softsimon
dbf8d025e9 Adding median fee to block. 2020-03-15 17:12:09 +07:00
softsimon
9b33baa4c1 TV view didn't request mempool blocks. 2020-03-14 13:48:01 +07:00
softsimon
7c2849b331 Adjusting font-sizes. Logo size. 2020-03-13 22:05:44 +07:00
wiz
5b41ecf6e5 Remove more instances of # before block height number 2020-03-13 23:03:46 +09:00
wiz
79f85ebf47 Tweak projected blocks to match blockchain blocks, tweak font size 2020-03-13 22:22:15 +09:00
wiz
fd4d0123d1 Remove ".space" from mempool logo, fixes #55 2020-03-13 22:01:30 +09:00
wiz
70445ddfa2 Tweak to the block layout, move block height down, only show median fee 2020-03-13 21:33:45 +09:00
wiz
95d15bde2f Remove "#" from block-height number for cleaner look 2020-03-13 20:56:05 +09:00
wiz
e8ba7b7f0c Increase block height font-size from 12px to 18px 2020-03-13 20:29:00 +09:00
softsimon
6c05a25303 Merge branch 'master' of https://github.com/mempool/mempool
* 'master' of https://github.com/mempool/mempool:
  Add new package.json for top-level mempool project
  Update package.json for mempool-frontend
2020-03-13 18:00:44 +07:00
softsimon
e351bcea73 Fix for the websocket DOS bug. 2020-03-13 18:00:34 +07:00
wiz
6af45c86f8 Add new package.json for top-level mempool project 2020-03-13 19:51:25 +09:00
wiz
c8da732771 Update package.json for mempool-frontend 2020-03-13 19:48:10 +09:00
wiz
0bf337b7a6 Update package.json for mempool-backend 2020-03-13 19:44:56 +09:00
softsimon
2f94200a45 Responsive mempool blocks. 2020-03-12 21:56:07 +07:00
softsimon
82ac10af93 Preload latest blocks until it fills the screen on inital load.
closes #42
2020-03-11 18:04:57 +07:00
softsimon
f94007979b Removing latest transactions component. 2020-03-11 16:31:37 +07:00
softsimon
4d5580eabb Replace some spinners with skeleton loaders. 2020-03-11 16:06:11 +07:00
softsimon
c0aa9ff925 Don't lookup transaction times for confirmed transactions 2020-03-10 15:33:58 +07:00
softsimon
3c38aaaf33 Fixes to responsive design. 2020-03-10 15:25:49 +07:00
softsimon
0f41b0d933 Making block, transaction, and address view responsive.
closes #43
2020-03-10 14:46:12 +07:00
wiz
71cd4e1279 Capitalize the B in Bitcoin in metadata 2020-03-10 04:10:31 +09:00
wiz
4096d44688 Tweak that metadata 2020-03-10 04:05:29 +09:00
wiz
7e1b99f726 Moar tweaks to opengraph metadata and twitter card metadata 2020-03-10 03:30:27 +09:00
softsimon
701b8610e5 Reducing size of twitter card image. 2020-03-10 01:29:11 +07:00
wiz
1c883cf150 Shorten opengraph description and twitter card description to fit 2020-03-10 03:19:50 +09:00
wiz
33ffabcd28 Fix page title (accidentally deleted in previous commit) 2020-03-10 03:16:54 +09:00
wiz
7aeb4ef692 Add opengraph metadata + twitter card preview (fixes #38) 2020-03-10 03:11:29 +09:00
softsimon
2296ad69b9 Adding a third connection state and preventing offline indicator from pushing the menu. 2020-03-09 17:53:54 +07:00
softsimon
994c42440d Adding more websocket connection reconnect fail safe.
fixes #44
2020-03-09 01:41:43 +07:00
softsimon
677f99d03b Bugfix for null error when using transaction tracking 2020-03-09 00:23:45 +07:00
softsimon
4574d18ce3 Improved websocket disconnections. 2020-03-06 13:47:04 +07:00
softsimon
a6809e99f1 Adding console log messages to websocket error handling. 2020-03-06 02:27:22 +07:00
softsimon
5d4ce44627 Introduce a websocket ping check that closes the socket if no response. 2020-03-06 02:05:26 +07:00
softsimon
b60d9cdfbc General responsive improvments. 2020-03-05 16:13:46 +07:00
softsimon
9851ae7169 Made decimals more nice and clear. 2020-03-04 15:55:54 +07:00
softsimon
7186426441 Block reward calculation fix. 2020-03-04 15:30:35 +07:00
softsimon
73e24195da Adding miner block reward and fee to block info. 2020-03-04 15:10:30 +07:00
softsimon
f71ac67d24 Responsive latest blocks and transactions tables. 2020-03-04 02:53:31 +07:00
softsimon
c1a8863861 Improvments to responsiveness 2020-03-03 17:47:01 +07:00
softsimon
2fe7af0c22 Handle some cases of api not returning full data. 2020-03-03 16:44:32 +07:00
softsimon
2b9be35afa Fast forward the block fetching if backend has been offline for a while. 2020-03-03 15:11:14 +07:00
softsimon
4ae6b982e0 Template fix. 2020-03-02 17:31:33 +07:00
softsimon
669a5e429d Added fiat balance to address and made fiat balance into a component. 2020-03-02 17:29:00 +07:00
softsimon
d28730787a Removed comment. 2020-03-02 15:07:52 +07:00
softsimon
02373f366c Moving strings to template. 2020-03-01 23:18:03 +07:00
softsimon
2382aa44e1 Write cache to disk on SIGTERM as with SIGINT. 2020-03-01 23:09:33 +07:00
softsimon
4d2ebcede9 Updating to new github url. 2020-03-01 22:56:14 +07:00
softsimon
15e25b447f Address loadmore bugfix. 2020-03-01 18:09:42 +07:00
softsimon
dc775b7ee5 Infinite scroll fixes. 2020-03-01 16:33:18 +07:00
softsimon
90c05ccb51 Infinite scroll replaces "load more" buttons. 2020-03-01 03:32:12 +07:00
softsimon
c9b161423d Send git-commit hash to client on reconnect to force client reload on backend update 2020-03-01 00:42:41 +07:00
softsimon
943d96ee8c Latest block design updates. 2020-02-29 23:42:50 +07:00
softsimon
39394e1178 Also save and load blocks to cache.json for speedy restarts. 2020-02-29 21:52:04 +07:00
softsimon
50b4e1523e Minor UX fixes. 2020-02-28 05:28:23 +07:00
softsimon
ef862e2442 Additional fixes for address transaction fetching. 2020-02-28 04:16:15 +07:00
softsimon
3d3cec2582 Optimized address transaction fetching. 2020-02-28 03:51:59 +07:00
softsimon
4879036216 Added first seen on mempool transactions. 2020-02-28 01:09:07 +07:00
softsimon
23a61a37fd Confirmed address transactions fix. QR Code fix. (take 2) 2020-02-26 23:21:16 +07:00
softsimon
37166e230d Confirmed address transactions fix. QR Code fix. 2020-02-26 21:11:43 +07:00
wiz
f9c03f2a98 Disable nginx cache for electrs reverse proxy 2020-02-26 23:07:48 +09:00
softsimon
7fbc6f1461 Moved websocket handling to its own file and cleaned up index.ts 2020-02-26 17:49:53 +07:00
wiz
ff92ae43a5 Add missing blocks table to SQL schema 2020-02-26 13:59:48 +09:00
softsimon
a122432c24 Address tracking and notification sounds. 2020-02-26 04:29:57 +07:00
wiz
3709b652ae Merge pull request #30 from mempool-space/v2
mempool v2 repo merge
2020-02-26 03:46:02 +09:00
wiz
aa58e62440 Update README with release tag checkout instructions 2020-02-26 03:42:59 +09:00
Simon Lindh
8e52a2ba06 Design updates. 2020-02-26 03:39:22 +09:00
wiz
f744d83b65 Simplify contributor roles on team page 2020-02-26 03:38:30 +09:00
wiz
c8666d4079 Add nginx proxy_pass for /electrs -> localhost port 3000 2020-02-26 03:37:51 +09:00
Simon Lindh
057bff69fc Various fixes and design updates. 2020-02-26 03:37:00 +09:00
Simon Lindh
c5c068a8d4 Empty block fix. 2020-02-26 03:35:46 +09:00
Simon Lindh
32fdb32792 Connection config and proxy updates. 2020-02-26 03:35:08 +09:00
Simon Lindh
d690511a08 Footer and header design updates. 2020-02-26 03:34:20 +09:00
Simon Lindh
c8c1be594b Adding production and deployment files. 2020-02-26 03:33:17 +09:00
Simon Lindh
3453e84889 Basic address tracking. 2020-02-26 03:31:45 +09:00
Simon Lindh
5186f81d56 Track transaction among mempool blocks. 2020-02-26 03:30:51 +09:00
Simon Lindh
f3cfa038d3 Transaction tracking revamped.
Blockchain block arrow.
2020-02-26 03:28:57 +09:00
Simon Lindh
34645908e9 Refactor. API explanations. UX revamp. 2020-02-26 03:26:16 +09:00
Simon Lindh
acd658a0e7 Optimize statistics. 2020-02-26 03:21:21 +09:00
Simon Lindh
ac95c09ea6 New base code for mempool blockchain explorerer 2020-02-26 03:19:26 +09:00
wiz
ca40fc7045 Update README with release tag checkout instructions 2020-02-26 02:34:37 +09:00
767 changed files with 237835 additions and 20561 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
# ignore all differences in line endings
package.json eol=crlf -crlf
*/package.json eol=crlf -crlf

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: ['mempool'] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://mempool.space/sponsor'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

43
.github/ISSUE_TEMPLATE/00-bug-issue.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: 🐛 Bug Report
about: Report bugs (no support requests, please)
---
<!--
SUPPORT REQUESTS:
This is for reporting bugs in Mempool, not for support requests.
If you have a support request, please reach out on Matrix:
https://matrix.to/#/#mempool.support:bitcoin.kyoto
-->
### Description
<!-- brief description of the bug -->
#### Version
<!-- commit id or version number -->
### Steps to reproduce
<!-- if you can reliably reproduce the bug, list the steps here -->
### Expected behaviour
<!-- description of the expected behavior -->
### Actual behaviour
<!-- explain what happened instead of the expected behaviour -->
### Screenshots
<!-- Screenshots if gui related, drag and drop to add to the issue -->
#### Device or machine
<!-- device/machine used, operating system -->
#### Additional info
<!-- Additional information useful for debugging (e.g. logs) -->

View File

@@ -0,0 +1,27 @@
---
name: ✨ Feature Request
about: Request a feature or suggest other enhancements
---
<!--
SUPPORT REQUESTS:
This is for requesting features in Mempool, not for support requests.
If you have a support request, please reach out on Matrix:
https://matrix.to/#/#mempool.support:bitcoin.kyoto
-->
### Description
<!-- brief description of the feature request -->
### Problem to be solved
<!-- description of the the problem you're having -->
### Proposed solution
<!-- explain how you think we should solve the problem -->
#### Additional info
<!-- Additional information useful for implementing (e.g. docs, links, etc.) -->

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 🙋 Need help? Chat with us on Matrix
url: https://matrix.to/#/#mempool.support:bitcoin.kyoto
about: For support requests or general questions
- name: 🌐 Want to help with translations? Use Transifex
url: https://www.transifex.com/mempool/mempool
about: All translations work is done on Transifex

20
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/backend"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: "/frontend"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/docker/backend"
schedule:
interval: weekly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

6
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,6 @@
<!--
Please do not open pull requests for translations.
All translations work is done on Transifex:
https://www.transifex.com/mempool/mempool
-->

91
.github/workflows/cypress.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Cypress Tests
on: [push, pull_request]
jobs:
cypress:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5]
os: ["ubuntu-latest"]
browser: [chrome]
name: E2E tests on ${{ matrix.browser }} - ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.15.0
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: ${{ matrix.browser }} browser tests (Mempool)
uses: cypress-io/github-action@v4
with:
tag: ${{ github.event_name }}
working-directory: frontend
build: npm run config:defaults:mempool
start: npm run start:local-staging
wait-on: 'http://localhost:4200'
wait-on-timeout: 120
record: true
parallel: true
spec: |
cypress/e2e/mainnet/*.spec.ts
cypress/e2e/signet/*.spec.ts
cypress/e2e/testnet/*.spec.ts
group: Tests on ${{ matrix.browser }} (Mempool)
browser: ${{ matrix.browser }}
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'
env:
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
- name: ${{ matrix.browser }} browser tests (Liquid)
uses: cypress-io/github-action@v4
if: always()
with:
tag: ${{ github.event_name }}
working-directory: frontend
build: npm run config:defaults:liquid
start: npm run start:local-staging
wait-on: 'http://localhost:4200'
wait-on-timeout: 120
record: true
parallel: true
spec: |
cypress/e2e/liquid/liquid.spec.ts
cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
group: Tests on ${{ matrix.browser }} (Liquid)
browser: ${{ matrix.browser }}
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'
env:
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
- name: ${{ matrix.browser }} browser tests (Bisq)
uses: cypress-io/github-action@v4
if: always()
with:
tag: ${{ github.event_name }}
working-directory: frontend
build: npm run config:defaults:bisq
start: npm run start:local-staging
wait-on: 'http://localhost:4200'
wait-on-timeout: 120
record: true
parallel: true
spec: cypress/e2e/bisq/bisq.spec.ts
group: Tests on ${{ matrix.browser }} (Bisq)
browser: ${{ matrix.browser }}
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'
env:
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}

75
.github/workflows/on-tag.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
name: Docker build on tag
env:
DOCKER_CLI_EXPERIMENTAL: enabled
TAG_FMT: '^refs/tags/(((.?[0-9]+){3,4}))$'
DOCKER_BUILDKIT: 0
COMPOSE_DOCKER_CLI_BUILD: 0
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-*
permissions:
contents: read
jobs:
build:
strategy:
matrix:
service:
- frontend
- backend
runs-on: ubuntu-18.04
name: Build and push to DockerHub
steps:
- name: Set env variables
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Show set environment variables
run: |
printf " TAG: %s\n" "$TAG"
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Login to Docker for building
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Checkout project
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- name: Init repo for Dockerization
run: docker/init.sh "$TAG"
- name: Set up QEMU
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
id: qemu
- name: Setup Docker buildx action
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
id: buildx
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Cache Docker layers
uses: actions/cache@661fd3eb7f2f20d8c7c84bc2b0509efd7a826628 # v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Run Docker buildx for ${{ matrix.service }} against tag
run: |
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \
--output "type=registry" ./${{ matrix.service }}/ \
--build-arg commitHash=$SHORT_SHA

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
sitemap
data
docker-compose.yml
backend/mempool-config.json

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v16.15.0

4
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"editor.tabSize": 2,
"typescript.tsdk": "./backend/node_modules/typescript/lib"
}

49
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,49 @@
# Contributing to The Mempool Open Source Project
Thank you for contributing to The Mempool Open Source Project managed by Mempool Space K.K. (“Mempool”).
In order to clarify the intellectual property license granted with Contributions from any person or entity, Mempool must have a statement on file from each Contributor indicating their agreement to the Contributor License Agreement (“Agreement”). This license is for your protection as a Contributor as well as the protection of Mempool and its other contributors and users; it does not change your rights to use your own Contributions for any other purpose.
When submitting a pull request for the first time, please create a file with a name like `/contributors/{github_username}.txt`, and in the content of that file indicate your agreement to the Contributor License Agreement terms below. An example of what that file should contain can be seen in wiz's agreement file. (This method of CLA "signing" is borrowed from Medium's open source project.)
# Contributor License Agreement
Last Updated: January 25, 2022
By accepting this Agreement, You agree to the following terms and conditions for Your present and future Contributions submitted to Mempool. Except for the license granted herein to Mempool and recipients of software distributed by Mempool, You reserve all right, title, and interest in and to Your Contributions.
### 1. Definitions
“You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Mempool. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
“Contribution” shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Mempool for inclusion in, or documentation of, any of the products owned or managed by Mempool (“Work”). For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to Mempool or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Mempool for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as “Not a Contribution.”
### 2. Grant of Copyright License
Subject to the terms and conditions of this Agreement, You hereby grant to Mempool and to recipients of software distributed by Mempool a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
### 3. Grant of Patent License
Subject to the terms and conditions of this Agreement, You hereby grant to Mempool and to recipients of software distributed by Mempool a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
### 4. Authority
You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Mempool, or that your employer has executed a separate Corporate Contributor License Agreement with Mempool.
### 5. Originality
You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware, and which are associated with any part of Your Contributions.
### 6. Support
You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
### 7. Third Party Contributions
Should You wish to submit work that is not Your original creation, You may submit it to Mempool separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as “Submitted on behalf of a third-party: [named here]”.
### 8. Notifications
You agree to notify Mempool of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
EOF

View File

@@ -1,57 +0,0 @@
FROM alpine:latest
RUN mkdir /mempool.space/
COPY ./backend /mempool.space/backend/
COPY ./frontend /mempool.space/frontend/
COPY ./mariadb-structure.sql /mempool.space/mariadb-structure.sql
RUN apk add mariadb mariadb-client git nginx npm rsync bash
RUN mysql_install_db --user=mysql --datadir=/var/lib/mysql/
RUN /usr/bin/mysqld_safe --datadir='/var/lib/mysql/'& \
sleep 60 && \
mysql -e "create database mempool" && \
mysql -e "grant all privileges on mempool.* to 'mempool'@'localhost' identified by 'mempool'" && \
mysql mempool < /mempool.space/mariadb-structure.sql
RUN sed -i "/^skip-networking/ c#skip-networking" /etc/my.cnf.d/mariadb-server.cnf
RUN export NG_CLI_ANALYTICS=ci && \
npm install -g typescript && \
cd /mempool.space/frontend && \
npm install && \
cd /mempool.space/backend && \
npm install && \
tsc
COPY ./nginx-nossl-docker.conf /etc/nginx/nginx.conf
ENV ENV dev
ENV DB_HOST localhost
ENV DB_PORT 3306
ENV DB_USER mempool
ENV DB_PASSWORD mempool
ENV DB_DATABASE mempool
ENV API_ENDPOINT /api/v1/
ENV CHAT_SSL_ENABLED false
ENV MEMPOOL_REFRESH_RATE_MS 500
ENV INITIAL_BLOCK_AMOUNT 8
ENV DEFAULT_PROJECTED_BLOCKS_AMOUNT 3
ENV KEEP_BLOCK_AMOUNT 24
ENV BITCOIN_NODE_HOST bitcoinhost
ENV BITCOIN_NODE_PORT 8332
ENV BITCOIN_NODE_USER bitcoinuser
ENV BITCOIN_NODE_PASS bitcoinpass
ENV TX_PER_SECOND_SPAN_SECONDS 150
ENV BACKEND_API bitcoind
ENV ELECTRS_API_URL https://mempool.space/api
RUN cd /mempool.space/frontend/ && \
npm run build && \
rsync -av --delete dist/mempool/ /var/www/html/
EXPOSE 80
COPY ./entrypoint.sh /mempool.space/entrypoint.sh
RUN chmod +x /mempool.space/entrypoint.sh
WORKDIR /mempool.space
CMD ["/mempool.space/entrypoint.sh"]

47
GNUmakefile Executable file
View File

@@ -0,0 +1,47 @@
# If you see pwd_unknown showing up check permissions
PWD ?= pwd_unknown
# DATABASE DEPLOY FOLDER CONFIG - default ./data
ifeq ($(data),)
DATA := data
export DATA
else
DATA := $(data)
export DATA
endif
.PHONY: help
help:
@echo ''
@echo ''
@echo ' Usage: make [COMMAND]'
@echo ''
@echo ' make all # build init mempool and electrs'
@echo ' make init # setup some useful configs'
@echo ' make mempool # build q dockerized mempool.space'
@echo ' make electrs # build a docker electrs image'
@echo ''
.PHONY: init
init:
@echo ''
mkdir -p $(DATA) $(DATA)/mysql $(DATA)/mysql/data
#REF: https://github.com/mempool/mempool/blob/master/docker/README.md
cat docker/docker-compose.yml > docker-compose.yml
cat backend/mempool-config.sample.json > backend/mempool-config.json
.PHONY: mempool
mempool: init
@echo ''
docker-compose up --force-recreate --always-recreate-deps
@echo ''
.PHONY: electrs
electrum:
#REF: https://hub.docker.com/r/beli/electrum
@echo ''
docker build -f docker/electrum/Dockerfile .
@echo ''
.PHONY: all
all: init
make mempool
#######################
-include Makefile

42
LICENSE
View File

@@ -1,21 +1,29 @@
MIT License
The Mempool Open Source Project
Copyright (c) 2019-2022 The Mempool Open Source Project Developers
Copyright (c) 2019 Simon Lindh
This program is free software; you can redistribute it and/or modify it under
the terms of (at your option) either:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1) the GNU Affero General Public License as published by the Free Software
Foundation, either version 3 of the License or any later version approved by a
proxy statement published on <https://mempool.space/about>; or
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
2) the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License or any later version approved by a
proxy statement published on <https://mempool.space/about>.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
However, this copyright license does not include an implied right or license to
use our trademarks: The Mempool Open Source Project™, mempool.space™, the
mempool Logo™, the mempool.space Vertical Logo™, the mempool.space Horizontal
Logo™, the mempool Square Logo™, and the mempool Blocks logo™ are registered
trademarks or trademarks of Mempool Space K.K in Japan, the United States,
and/or other countries. See our full Trademark Policy and Guidelines for more
details, published on <https://mempool.space/trademark-policy>.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the full license terms for more details.
You should have received a copy of both the GNU Affero General Public License
and the GNU General Public License along with this program. If not, see
<http://www.gnu.org/licenses/>.

660
LICENSE.AGPL-3.md Normal file
View File

@@ -0,0 +1,660 @@
### GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
### Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains
free software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing
under this license.
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS
#### 0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public
License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays "Appropriate Legal Notices" to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
#### 1. Source Code.
The "source code" for a work means the preferred form of the work for
making modifications to it. "Object code" means any non-source form of
a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
#### 2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
#### 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
- a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
- b) The work must carry prominent notices stating that it is
released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4
to "keep intact all notices".
- c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
#### 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
- a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
#### 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your
version supports such interaction) an opportunity to receive the
Corresponding Source of your version by providing access to the
Corresponding Source from a network server at no charge, through some
standard or customary means of facilitating copying of software. This
Corresponding Source shall include the Corresponding Source for any
work covered by version 3 of the GNU General Public License that is
incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Affero General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever
published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
#### 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
#### 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#### 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper
mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for
the specific requirements.
You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow
the GNU AGPL, see <https://www.gnu.org/licenses/>.

675
LICENSE.GPL-3.md Normal file
View File

@@ -0,0 +1,675 @@
### GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
### Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom
to share and change all versions of a program--to make sure it remains
free software for all its users. We, the Free Software Foundation, use
the GNU General Public License for most of our software; it applies
also to any other work released this way by its authors. You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so. This is fundamentally incompatible with the
aim of protecting users' freedom to change the software. The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish
to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS
#### 0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays "Appropriate Legal Notices" to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
#### 1. Source Code.
The "source code" for a work means the preferred form of the work for
making modifications to it. "Object code" means any non-source form of
a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
#### 2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
#### 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
- a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
- b) The work must carry prominent notices stating that it is
released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4
to "keep intact all notices".
- c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
#### 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
- a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
#### 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU General Public
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that numbered version or
of any later version published by the Free Software Foundation. If the
Program does not specify a version number of the GNU General Public
License, you may choose any version ever published by the Free
Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy's public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
#### 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
#### 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#### 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper
mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands \`show w' and \`show c' should show the
appropriate parts of the General Public License. Of course, your
program's commands might be different; for a GUI interface, you would
use an "about box".
You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow
the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the
GNU Lesser General Public License instead of this License. But first,
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

1
Makefile Normal file
View File

@@ -0,0 +1 @@
# For additional configs/scripting

217
README.md
View File

@@ -1,208 +1,33 @@
# mempool
## a mempool visualizer and explorer for Bitcoin
# The Mempool Open Source Project™ [![mempool](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/ry4br7/master&style=flat-square)](https://dashboard.cypress.io/projects/ry4br7/runs)
![mempool](https://pbs.twimg.com/media/EAETXWCU4AAv2v-?format=jpg&name=4096x4096)
![blockchain](https://pbs.twimg.com/media/EAETXWAU8AAj4IP?format=jpg&name=4096x4096)
Mempool is the fully-featured mempool visualizer, explorer, and API service running at [mempool.space](https://mempool.space/).
## Pick the right version for your use case
It is an open-source project developed and operated for the benefit of the Bitcoin community, with a focus on the emerging transaction fee market that is evolving Bitcoin into a multi-layer ecosystem.
Mempool V1 has basic explorer functionality and can run from a Bitcoin Core full node on a Raspberry Pi (no pruning, txindex=1).
![mempool](https://mempool.space/resources/screenshots/v2.4.0-dashboard.png)
Mempool V2 is what runs on https://mempool.space and has advanced explorer functionality, but requires a fully synced electrs backend running on powerful server hardware.
# Installation Methods
# Mempool V1 using Docker (easy)
Mempool can be self-hosted on a wide variety of your own hardware, ranging from a simple one-click installation on a Raspberry Pi full-node distro all the way to a robust production instance on a powerful FreeBSD server.
Install from Docker Hub, passing your Bitcoin Core RPC credentials as environment variables:
**Most people should use a one-click install method.** Other install methods are meant for developers and others with experience managing servers.
```bash
docker pull mempool/mempool:v1.0
docker create -p 80:80 -e BITCOIN_NODE_HOST=192.168.1.102 -e BITCOIN_NODE_USER=foo -e BITCOIN_NODE_PASS=bar --name mempool mempool/mempool:v1.0
docker start mempool
docker logs mempool
```
<a id="one-click-installation"></a>
## One-Click Installation
You should see mempool starting up, which takes over an hour (needs 8 blocks). When it's ready, visit http://127.0.0.1/ to see your mempool.
Mempool can be conveniently installed on the following full-node distros:
- [Umbrel](https://github.com/getumbrel/umbrel)
- [RaspiBlitz](https://github.com/rootzoll/raspiblitz)
- [RoninDojo](https://code.samourai.io/ronindojo/RoninDojo)
- [myNode](https://github.com/mynodebtc/mynode)
- [Start9](https://github.com/Start9Labs/embassy-os)
# Mempool V1 not using Docker (advanced)
**We highly recommend you deploy your own Mempool instance this way.** No matter which option you pick, you'll be able to get your own fully-sovereign instance of Mempool up quickly without needing to fiddle with any settings.
## Dependencies
## Advanced Installation Methods
* Bitcoin (full node required, no pruning, txindex=1)
* NodeJS (official stable LTS)
* MySQL or MariaDB (default config)
* Nginx (use supplied nginx.conf)
Mempool can be installed in other ways too, but we only recommend doing so if you're a developer, have experience managing servers, or otherwise know what you're doing.
## Checking out release tag
```bash
git clone https://github.com/mempool-space/mempool.space
cd mempool.space
git checkout v1.0.0 # put latest release tag here
```
## Bitcoin Core (bitcoind)
Enable RPC and txindex in bitcoin.conf
```bash
rpcuser=mempool
rpcpassword=71b61986da5b03a5694d7c7d5165ece5
txindex=1
```
## NodeJS
Install dependencies and build code:
```bash
# Install TypeScript Globally
npm install -g typescript
# Frontend
cd frontend
npm install
npm run build
# Backend
cd ../backend/
npm install
npm run build
```
## Mempool Configuration
In the `backend` folder, make a copy of the sample config and modify it to fit your settings.
```bash
cp mempool-config.sample.json mempool-config.json
```
Edit `mempool-config.json` to add your Bitcoin Core node RPC credentials:
```bash
"BITCOIN_NODE_HOST": "192.168.1.5",
"BITCOIN_NODE_PORT": 8332,
"BITCOIN_NODE_USER": "mempool",
"BITCOIN_NODE_PASS": "71b61986da5b03a5694d7c7d5165ece5",
```
## MySQL
Install MariaDB:
```bash
# Linux
apt-get install mariadb-server mariadb-client
# macOS
brew install mariadb
brew services start mariadb
```
Create database and grant privileges:
```bash
MariaDB [(none)]> drop database mempool;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create database mempool;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on mempool.* to 'mempool' identified by 'mempool';
Query OK, 0 rows affected (0.00 sec)
```
From the root folder, initialize database structure:
```bash
mysql -u mempool -p mempool < mariadb-structure.sql
```
## Running (Backend)
Create an initial empty cache and start the app:
```bash
touch cache.json
npm run start # node dist/index.js
```
After starting you should see:
```bash
Server started on port 8999 :)
New block found (#586498)! 0 of 1986 found in mempool. 1985 not found.
New block found (#586499)! 0 of 1094 found in mempool. 1093 not found.
New block found (#586500)! 0 of 2735 found in mempool. 2734 not found.
New block found (#586501)! 0 of 2675 found in mempool. 2674 not found.
New block found (#586502)! 0 of 975 found in mempool. 974 not found.
New block found (#586503)! 0 of 2130 found in mempool. 2129 not found.
New block found (#586504)! 0 of 2770 found in mempool. 2769 not found.
New block found (#586505)! 0 of 2759 found in mempool. 2758 not found.
Updating mempool
Calculated fee for transaction 1 / 3257
Calculated fee for transaction 2 / 3257
Calculated fee for transaction 3 / 3257
Calculated fee for transaction 4 / 3257
Calculated fee for transaction 5 / 3257
Calculated fee for transaction 6 / 3257
Calculated fee for transaction 7 / 3257
Calculated fee for transaction 8 / 3257
Calculated fee for transaction 9 / 3257
```
You need to wait for at least *8 blocks to be mined*, so please wait ~80 minutes.
The backend also needs to index transactions, calculate fees, etc.
When it's ready you will see output like this:
```bash
Mempool updated in 0.189 seconds
Updating mempool
Mempool updated in 0.096 seconds
Updating mempool
Mempool updated in 0.099 seconds
Updating mempool
Calculated fee for transaction 1 / 10
Calculated fee for transaction 2 / 10
Calculated fee for transaction 3 / 10
Calculated fee for transaction 4 / 10
Calculated fee for transaction 5 / 10
Calculated fee for transaction 6 / 10
Calculated fee for transaction 7 / 10
Calculated fee for transaction 8 / 10
Calculated fee for transaction 9 / 10
Calculated fee for transaction 10 / 10
Mempool updated in 0.243 seconds
Updating mempool
```
## nginx + CertBot (LetsEncrypt)
Setup nginx using the supplied nginx.conf
```bash
# install nginx and certbot
apt-get install -y nginx python-certbot-nginx
# replace example.com with your domain name
certbot --nginx -d example.com
# install the mempool configuration for nginx
cp nginx.conf /etc/nginx/nginx.conf
# edit the installed nginx.conf, and replace all
# instances of example.com with your domain name
```
Make sure you can access https://<your-domain-name>/ in browser before proceeding
## Running (Frontend)
Build the frontend static HTML/CSS/JS, rsync the output into nginx folder:
```bash
cd frontend/
npm run build
sudo rsync -av --delete dist/mempool/ /var/www/html/
```
## Try It Out
If everything went okay you should see the beautiful mempool :grin:
If you get stuck on "loading blocks", this means the websocket can't connect.
Check your nginx proxy setup, firewalls, etc. and open an issue if you need help.
- See the [`docker/`](./docker/) directory for instructions on deploying Mempool with Docker.
- See the [`backend/`](./backend/) and [`frontend/`](./frontend/) directories for manual install instructions oriented for developers and small-scale deployments.
- See the [`production/`](./production/) directory for guidance on setting up a more serious Mempool instance designed for high performance at scale.

9
backend/.gitignore vendored
View File

@@ -1,7 +1,10 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# production config
mempool-config.json
# production config and external assets
*.json
!mempool-config.sample.json
icons.json
# compiled output
/dist
@@ -41,5 +44,3 @@ testem.log
#System Files
.DS_Store
Thumbs.db
cache.json

4
backend/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"editor.tabSize": 2,
"typescript.tsdk": "../backend/node_modules/typescript/lib"
}

161
backend/README.md Normal file
View File

@@ -0,0 +1,161 @@
# Mempool Backend
These instructions are mostly intended for developers, but can be used as a basis for personal or small-scale production setups.
If you choose to use these instructions for a production setup, be aware that you will still probably need to do additional configuration for your specific OS, environment, use-case, etc. We do our best here to provide a good starting point, but only proceed if you know what you're doing. Mempool does not provide support for custom setups.
See other ways to set up Mempool on [the main README](/../../#installation-methods).
Jump to a section in this doc:
- [Set Up the Backend](#setup)
- [Development Tips](#development-tips)
## Setup
### 1. Clone Mempool Repository
Get the latest Mempool code:
```
git clone https://github.com/mempool/mempool
cd mempool
```
Check out the latest release:
```
latestrelease=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
git checkout $latestrelease
```
### 2. Configure Bitcoin Core
Turn on `txindex`, enable RPC, and set RPC credentials in `bitcoin.conf`:
```
txindex=1
server=1
rpcuser=mempool
rpcpassword=mempool
```
### 3. Configure Electrum Server
[Pick an Electrum Server implementation](https://mempool.space/docs/faq#address-lookup-issues), configure it, and make sure it's synced.
**This step is optional.** You can run Mempool without configuring an Electrum Server for it, but address lookups will be disabled.
### 4. Configure MariaDB
_Mempool needs MariaDB v10.5 or later. If you already have MySQL installed, make sure to migrate any existing databases **before** installing MariaDB._
Get MariaDB from your operating system's package manager:
```
# Debian, Ubuntu, etc.
apt-get install mariadb-server mariadb-client
# macOS
brew install mariadb
mysql.server start
```
Create a database and grant privileges:
```
MariaDB [(none)]> drop database mempool;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create database mempool;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on mempool.* to 'mempool'@'%' identified by 'mempool';
Query OK, 0 rows affected (0.00 sec)
```
### 5. Prepare Mempool Backend
#### Build
_Make sure to use Node.js 16.15 and npm 7._
Install dependencies with `npm` and build the backend:
```
cd backend
npm install # add --prod for production
npm run build
```
#### Configure
In the backend folder, make a copy of the sample config file:
```
cp mempool-config.sample.json mempool-config.json
```
Edit `mempool-config.json` as needed.
In particular, make sure:
- the correct Bitcoin Core RPC credentials are specified in `CORE_RPC`
- the correct `BACKEND` is specified in `MEMPOOL`:
- "electrum" if you're using [romanz/electrs](https://github.com/romanz/electrs) or [cculianu/Fulcrum](https://github.com/cculianu/Fulcrum)
- "esplora" if you're using [Blockstream/electrs](https://github.com/Blockstream/electrs)
- "none" if you're not using any Electrum Server
### 6. Run Mempool Backend
Run the Mempool backend:
```
npm run start
```
When it's running, you should see output like this:
```
Mempool updated in 0.189 seconds
Updating mempool
Mempool updated in 0.096 seconds
Updating mempool
Mempool updated in 0.099 seconds
Updating mempool
Calculated fee for transaction 1 / 10
Calculated fee for transaction 2 / 10
Calculated fee for transaction 3 / 10
Calculated fee for transaction 4 / 10
Calculated fee for transaction 5 / 10
Calculated fee for transaction 6 / 10
Calculated fee for transaction 7 / 10
Calculated fee for transaction 8 / 10
Calculated fee for transaction 9 / 10
Calculated fee for transaction 10 / 10
Mempool updated in 0.243 seconds
Updating mempool
```
### 7. Set Up Mempool Frontend
With the backend configured and running, proceed to set up the [Mempool frontend](../frontend#manual-setup).
## Development Tips
### Set Up Backend Watchers
The Mempool backend is static. TypeScript scripts are compiled into the `dist` folder and served through a Node.js web server.
As a result, for development purposes, you may find it helpful to set up backend watchers to avoid the manual shutdown/recompile/restart command-line cycle.
First, install `nodemon` and `ts-node`:
```
npm install -g ts-node nodemon
```
Then, run the watcher:
```
nodemon src/index.ts --ignore cache/ --ignore pools.json
```
`nodemon` should be in npm's global binary folder. If needed, you can determine where that is with `npm -g bin`.

1
backend/cache/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.json

View File

@@ -1,25 +1,88 @@
{
"ENV": "dev",
"DB_HOST": "localhost",
"DB_PORT": 3306,
"DB_USER": "mempool",
"DB_PASSWORD": "mempool",
"DB_DATABASE": "mempool",
"HTTP_PORT": 3000,
"API_ENDPOINT": "/api/v1/",
"CHAT_SSL_ENABLED": false,
"CHAT_SSL_PRIVKEY": "",
"CHAT_SSL_CERT": "",
"CHAT_SSL_CHAIN": "",
"MEMPOOL_REFRESH_RATE_MS": 500,
"INITIAL_BLOCK_AMOUNT": 8,
"DEFAULT_PROJECTED_BLOCKS_AMOUNT": 3,
"KEEP_BLOCK_AMOUNT": 24,
"BITCOIN_NODE_HOST": "localhost",
"BITCOIN_NODE_PORT": 8332,
"BITCOIN_NODE_USER": "",
"BITCOIN_NODE_PASS": "",
"BACKEND_API": "bitcoind",
"ELECTRS_API_URL": "https://mempool.space/api",
"TX_PER_SECOND_SPAN_SECONDS": 150
"MEMPOOL": {
"NETWORK": "mainnet",
"BACKEND": "electrum",
"HTTP_PORT": 8999,
"SPAWN_CLUSTER_PROCS": 0,
"API_URL_PREFIX": "/api/v1/",
"POLL_RATE_MS": 2000,
"CACHE_DIR": "./cache",
"CLEAR_PROTECTION_MINUTES": 20,
"RECOMMENDED_FEE_PERCENTILE": 50,
"BLOCK_WEIGHT_UNITS": 4000000,
"INITIAL_BLOCKS_AMOUNT": 8,
"MEMPOOL_BLOCKS_AMOUNT": 8,
"INDEXING_BLOCKS_AMOUNT": 11000,
"PRICE_FEED_UPDATE_INTERVAL": 600,
"USE_SECOND_NODE_FOR_MINFEE": false,
"EXTERNAL_ASSETS": [],
"EXTERNAL_MAX_RETRY": 1,
"EXTERNAL_RETRY_INTERVAL": 0,
"USER_AGENT": "mempool",
"STDOUT_LOG_MIN_PRIORITY": "debug"
},
"CORE_RPC": {
"HOST": "127.0.0.1",
"PORT": 8332,
"USERNAME": "mempool",
"PASSWORD": "mempool"
},
"ELECTRUM": {
"HOST": "127.0.0.1",
"PORT": 50002,
"TLS_ENABLED": true
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:3000"
},
"SECOND_CORE_RPC": {
"HOST": "127.0.0.1",
"PORT": 8332,
"USERNAME": "mempool",
"PASSWORD": "mempool"
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"DATABASE": "mempool",
"USERNAME": "mempool",
"PASSWORD": "mempool"
},
"SYSLOG": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 514,
"MIN_PRIORITY": "info",
"FACILITY": "local7"
},
"STATISTICS": {
"ENABLED": true,
"TX_PER_SECOND_SAMPLE_PERIOD": 150
},
"BISQ": {
"ENABLED": false,
"DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db"
},
"SOCKS5PROXY": {
"ENABLED": false,
"USE_ONION": true,
"HOST": "127.0.0.1",
"PORT": 9050,
"USERNAME": "",
"PASSWORD": ""
},
"PRICE_DATA_SERVER": {
"TOR_URL": "http://wizpriceje6q5tdrxkyiazsgu7irquiqjy2dptezqhrtu7l2qelqktid.onion/getAllMarketPrices",
"CLEARNET_URL": "https://price.bisq.wiz.biz/getAllMarketPrices"
},
"EXTERNAL_DATA_SERVER": {
"MEMPOOL_API": "https://mempool.space/api/v1",
"MEMPOOL_ONION": "http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/api/v1",
"LIQUID_API": "https://liquid.network/api/v1",
"LIQUID_ONION": "http://liquidmom47f6s3m53ebfxn47p76a6tlnxib3wp6deux7wuzotdr6cyd.onion/api/v1",
"BISQ_URL": "https://bisq.markets/api",
"BISQ_ONION": "http://bisqmktse2cabavbr2xjq7xw3h6g5ottemo5rolfcwt6aly6tp5fdryd.onion/api"
}
}

2769
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,48 @@
{
"name": "mempool-backend",
"version": "1.0.0",
"description": "Bitcoin Mempool Visualizer",
"version": "2.4.0-dev",
"description": "Bitcoin mempool visualizer and blockchain explorer backend",
"license": "GNU Affero General Public License v3.0",
"homepage": "https://mempool.space",
"repository": {
"type": "git",
"url": "git+https://github.com/mempool/mempool"
},
"bugs": {
"url": "https://github.com/mempool/mempool/issues"
},
"keywords": [
"bitcoin",
"mempool",
"blockchain",
"explorer",
"liquid"
],
"main": "index.ts",
"scripts": {
"build": "tsc",
"start": "npm run build && node dist/index.js"
"ng": "./node_modules/@angular/cli/bin/ng",
"tsc": "./node_modules/typescript/bin/tsc",
"build": "npm run tsc",
"start": "node --max-old-space-size=2048 dist/index.js",
"start-production": "node --max-old-space-size=4096 dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": {
"name": "Simon Lindh",
"url": "https://github.com/mempool-space/mempool.space"
},
"license": "MIT",
"dependencies": {
"bitcoin": "^3.0.1",
"compression": "^1.7.3",
"express": "^4.16.3",
"mysql2": "^1.6.1",
"request": "^2.88.0",
"ws": "^6.0.0"
"@mempool/electrum-client": "^1.1.7",
"axios": "~0.27.2",
"bitcoinjs-lib": "6.0.1",
"crypto-js": "^4.0.0",
"express": "^4.18.0",
"mysql2": "2.3.3",
"node-worker-threads-pool": "^1.5.1",
"socks-proxy-agent": "^6.2.0",
"typescript": "~4.7.2",
"ws": "~8.7.0"
},
"devDependencies": {
"@types/express": "^4.16.0",
"@types/mysql2": "github:types/mysql2",
"@types/request": "^2.48.2",
"@types/ws": "^6.0.1",
"tslint": "^5.11.0",
"typescript": "^3.1.1"
"@types/compression": "^1.7.2",
"@types/ws": "~8.5.3",
"@types/express": "^4.17.13",
"tslint": "^6.1.0"
}
}

View File

@@ -0,0 +1,61 @@
import * as fs from 'fs';
import * as os from 'os';
import logger from '../logger';
import { IBackendInfo } from '../mempool.interfaces';
const { spawnSync } = require('child_process');
class BackendInfo {
private gitCommitHash = '';
private hostname = '';
private version = '';
constructor() {
this.setLatestCommitHash();
this.setVersion();
this.hostname = os.hostname();
}
public getBackendInfo(): IBackendInfo {
return {
hostname: this.hostname,
gitCommit: this.gitCommitHash,
version: this.version,
};
}
public getShortCommitHash() {
return this.gitCommitHash.slice(0, 7);
}
private setLatestCommitHash(): void {
//TODO: share this logic with `generate-config.js`
if (process.env.DOCKER_COMMIT_HASH) {
this.gitCommitHash = process.env.DOCKER_COMMIT_HASH;
} else {
try {
const gitRevParse = spawnSync('git', ['rev-parse', '--short', 'HEAD']);
if (!gitRevParse.error) {
const output = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
this.gitCommitHash = output ? output : '?';
} else if (gitRevParse.error.code === 'ENOENT') {
console.log('git not found, cannot parse git hash');
this.gitCommitHash = '?';
}
} catch (e: any) {
console.log('Could not load git commit info: ' + e.message);
this.gitCommitHash = '?';
}
}
}
private setVersion(): void {
try {
const packageJson = fs.readFileSync('package.json').toString();
this.version = JSON.parse(packageJson).version;
} catch (e) {
throw new Error(e instanceof Error ? e.message : 'Error');
}
}
}
export default new BackendInfo();

View File

@@ -0,0 +1,364 @@
import config from '../../config';
import * as fs from 'fs';
import axios, { AxiosResponse } from 'axios';
import * as http from 'http';
import * as https from 'https';
import { SocksProxyAgent } from 'socks-proxy-agent';
import { BisqBlocks, BisqBlock, BisqTransaction, BisqStats, BisqTrade } from './interfaces';
import { Common } from '../common';
import { BlockExtended } from '../../mempool.interfaces';
import { StaticPool } from 'node-worker-threads-pool';
import backendInfo from '../backend-info';
import logger from '../../logger';
class Bisq {
private static BLOCKS_JSON_FILE_PATH = config.BISQ.DATA_PATH + '/json/all/blocks.json';
private latestBlockHeight = 0;
private blocks: BisqBlock[] = [];
private allBlocks: BisqBlock[] = [];
private transactions: BisqTransaction[] = [];
private transactionIndex: { [txId: string]: BisqTransaction } = {};
private blockIndex: { [hash: string]: BisqBlock } = {};
private addressIndex: { [address: string]: BisqTransaction[] } = {};
private stats: BisqStats = {
minted: 0,
burnt: 0,
addresses: 0,
unspent_txos: 0,
spent_txos: 0,
};
private price: number = 0;
private priceUpdateCallbackFunction: ((price: number) => void) | undefined;
private topDirectoryWatcher: fs.FSWatcher | undefined;
private subdirectoryWatcher: fs.FSWatcher | undefined;
private jsonParsePool = new StaticPool({
size: 4,
task: (blob: string) => JSON.parse(blob),
});
constructor() {}
startBisqService(): void {
try {
this.checkForBisqDataFolder();
} catch (e) {
logger.info('Retrying to start bisq service in 3 minutes');
setTimeout(this.startBisqService.bind(this), 180000);
return;
}
this.loadBisqDumpFile();
setInterval(this.updatePrice.bind(this), 1000 * 60 * 60);
this.updatePrice();
this.startTopDirectoryWatcher();
this.startSubDirectoryWatcher();
}
handleNewBitcoinBlock(block: BlockExtended): void {
if (block.height - 10 > this.latestBlockHeight && this.latestBlockHeight !== 0) {
logger.warn(`Bitcoin block height (#${block.height}) has diverged from the latest Bisq block height (#${this.latestBlockHeight}). Restarting watchers...`);
this.startTopDirectoryWatcher();
this.startSubDirectoryWatcher();
}
}
getTransaction(txId: string): BisqTransaction | undefined {
return this.transactionIndex[txId];
}
getTransactions(start: number, length: number, types: string[]): [BisqTransaction[], number] {
let transactions = this.transactions;
if (types.length) {
transactions = transactions.filter((tx) => types.indexOf(tx.txType) > -1);
}
return [transactions.slice(start, length + start), transactions.length];
}
getBlock(hash: string): BisqBlock | undefined {
return this.blockIndex[hash];
}
getAddress(hash: string): BisqTransaction[] {
return this.addressIndex[hash];
}
getBlocks(start: number, length: number): [BisqBlock[], number] {
return [this.blocks.slice(start, length + start), this.blocks.length];
}
getStats(): BisqStats {
return this.stats;
}
setPriceCallbackFunction(fn: (price: number) => void) {
this.priceUpdateCallbackFunction = fn;
}
getLatestBlockHeight(): number {
return this.latestBlockHeight;
}
private checkForBisqDataFolder() {
if (!fs.existsSync(Bisq.BLOCKS_JSON_FILE_PATH)) {
logger.warn(Bisq.BLOCKS_JSON_FILE_PATH + ` doesn't exist. Make sure Bisq is running and the config is correct before starting the server.`);
throw new Error(`Cannot load BISQ ${Bisq.BLOCKS_JSON_FILE_PATH} file`);
}
}
private startTopDirectoryWatcher() {
if (this.topDirectoryWatcher) {
this.topDirectoryWatcher.close();
}
let fsWait: NodeJS.Timeout | null = null;
this.topDirectoryWatcher = fs.watch(config.BISQ.DATA_PATH + '/json', () => {
if (fsWait) {
clearTimeout(fsWait);
}
if (this.subdirectoryWatcher) {
this.subdirectoryWatcher.close();
}
fsWait = setTimeout(() => {
logger.debug(`Bisq restart detected. Resetting both watchers in 3 minutes.`);
setTimeout(() => {
this.startTopDirectoryWatcher();
this.startSubDirectoryWatcher();
this.loadBisqDumpFile();
}, 180000);
}, 15000);
});
}
private startSubDirectoryWatcher() {
if (this.subdirectoryWatcher) {
this.subdirectoryWatcher.close();
}
if (!fs.existsSync(Bisq.BLOCKS_JSON_FILE_PATH)) {
logger.warn(Bisq.BLOCKS_JSON_FILE_PATH + ` doesn't exist. Trying to restart sub directory watcher again in 3 minutes.`);
setTimeout(() => this.startSubDirectoryWatcher(), 180000);
return;
}
let fsWait: NodeJS.Timeout | null = null;
this.subdirectoryWatcher = fs.watch(config.BISQ.DATA_PATH + '/json/all', () => {
if (fsWait) {
clearTimeout(fsWait);
}
fsWait = setTimeout(() => {
logger.debug(`Change detected in the Bisq data folder.`);
this.loadBisqDumpFile();
}, 2000);
});
}
private async updatePrice() {
type axiosOptions = {
headers: {
'User-Agent': string
};
timeout: number;
httpAgent?: http.Agent;
httpsAgent?: https.Agent;
}
const setDelay = (secs: number = 1): Promise<void> => new Promise(resolve => setTimeout(() => resolve(), secs * 1000));
const BISQ_URL = (config.SOCKS5PROXY.ENABLED === true) && (config.SOCKS5PROXY.USE_ONION === true) ? config.EXTERNAL_DATA_SERVER.BISQ_ONION : config.EXTERNAL_DATA_SERVER.BISQ_URL;
const isHTTP = (new URL(BISQ_URL).protocol.split(':')[0] === 'http') ? true : false;
const axiosOptions: axiosOptions = {
headers: {
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
timeout: config.SOCKS5PROXY.ENABLED ? 30000 : 10000
};
let retry = 0;
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
try {
if (config.SOCKS5PROXY.ENABLED) {
const socksOptions: any = {
agentOptions: {
keepAlive: true,
},
hostname: config.SOCKS5PROXY.HOST,
port: config.SOCKS5PROXY.PORT
};
if (config.SOCKS5PROXY.USERNAME && config.SOCKS5PROXY.PASSWORD) {
socksOptions.username = config.SOCKS5PROXY.USERNAME;
socksOptions.password = config.SOCKS5PROXY.PASSWORD;
} else {
// Retry with different tor circuits https://stackoverflow.com/a/64960234
socksOptions.username = `circuit${retry}`;
}
// Handle proxy agent for onion addresses
if (isHTTP) {
axiosOptions.httpAgent = new SocksProxyAgent(socksOptions);
} else {
axiosOptions.httpsAgent = new SocksProxyAgent(socksOptions);
}
}
const data: AxiosResponse = await axios.get(`${BISQ_URL}/trades/?market=bsq_btc`, axiosOptions);
if (data.statusText === 'error' || !data.data) {
throw new Error(`Could not fetch data from Bisq market, Error: ${data.status}`);
}
const prices: number[] = [];
data.data.forEach((trade) => {
prices.push(parseFloat(trade.price) * 100000000);
});
prices.sort((a, b) => a - b);
this.price = Common.median(prices);
if (this.priceUpdateCallbackFunction) {
this.priceUpdateCallbackFunction(this.price);
}
logger.debug('Successfully updated Bisq market price');
break;
} catch (e) {
logger.err('Error updating Bisq market price: ' + (e instanceof Error ? e.message : e));
await setDelay(config.MEMPOOL.EXTERNAL_RETRY_INTERVAL);
retry++;
}
}
}
private async loadBisqDumpFile(): Promise<void> {
this.allBlocks = [];
try {
await this.loadData();
this.buildIndex();
this.calculateStats();
} catch (e) {
logger.info('Cannot load bisq dump file because: ' + (e instanceof Error ? e.message : e));
}
}
private buildIndex() {
const start = new Date().getTime();
this.transactions = [];
this.transactionIndex = {};
this.addressIndex = {};
this.allBlocks.forEach((block) => {
/* Build block index */
if (!this.blockIndex[block.hash]) {
this.blockIndex[block.hash] = block;
}
/* Build transactions index */
block.txs.forEach((tx) => {
this.transactions.push(tx);
this.transactionIndex[tx.id] = tx;
});
});
/* Build address index */
this.transactions.forEach((tx) => {
tx.inputs.forEach((input) => {
if (!this.addressIndex[input.address]) {
this.addressIndex[input.address] = [];
}
if (this.addressIndex[input.address].indexOf(tx) === -1) {
this.addressIndex[input.address].push(tx);
}
});
tx.outputs.forEach((output) => {
if (!this.addressIndex[output.address]) {
this.addressIndex[output.address] = [];
}
if (this.addressIndex[output.address].indexOf(tx) === -1) {
this.addressIndex[output.address].push(tx);
}
});
});
const time = new Date().getTime() - start;
logger.debug('Bisq data index rebuilt in ' + time + ' ms');
}
private calculateStats() {
let minted = 0;
let burned = 0;
let unspent = 0;
let spent = 0;
this.transactions.forEach((tx) => {
tx.outputs.forEach((output) => {
if (output.opReturn) {
return;
}
if (output.txOutputType === 'GENESIS_OUTPUT' || output.txOutputType === 'ISSUANCE_CANDIDATE_OUTPUT' && output.isVerified) {
minted += output.bsqAmount;
}
if (output.isUnspent) {
unspent++;
} else {
spent++;
}
});
burned += tx['burntFee'];
});
this.stats = {
addresses: Object.keys(this.addressIndex).length,
minted: minted / 100,
burnt: burned / 100,
spent_txos: spent,
unspent_txos: unspent,
};
}
private async loadData(): Promise<any> {
if (!fs.existsSync(Bisq.BLOCKS_JSON_FILE_PATH)) {
throw new Error(Bisq.BLOCKS_JSON_FILE_PATH + ` doesn't exist`);
}
const readline = require('readline');
const events = require('events');
const rl = readline.createInterface({
input: fs.createReadStream(Bisq.BLOCKS_JSON_FILE_PATH),
crlfDelay: Infinity
});
let blockBuffer = '';
let readingBlock = false;
let lineCount = 1;
const start = new Date().getTime();
logger.debug('Processing Bisq data dump...');
rl.on('line', (line) => {
if (lineCount === 2) {
line = line.replace(' "chainHeight": ', '');
this.latestBlockHeight = parseInt(line, 10);
}
if (line === ' {') {
readingBlock = true;
} else if (line === ' },') {
blockBuffer += '}';
try {
const block: BisqBlock = JSON.parse(blockBuffer);
this.allBlocks.push(block);
readingBlock = false;
blockBuffer = '';
} catch (e) {
logger.debug(blockBuffer);
throw Error(`Unable to parse Bisq data dump at line ${lineCount}` + (e instanceof Error ? e.message : e));
}
}
if (readingBlock === true) {
blockBuffer += line;
}
++lineCount;
});
await events.once(rl, 'close');
this.allBlocks.reverse();
this.blocks = this.allBlocks.filter((block) => block.txs.length > 0);
const time = new Date().getTime() - start;
logger.debug('Bisq dump processed in ' + time + ' ms');
}
}
export default new Bisq();

View File

@@ -0,0 +1,258 @@
export interface BisqBlocks {
chainHeight: number;
blocks: BisqBlock[];
}
export interface BisqBlock {
height: number;
time: number;
hash: string;
previousBlockHash: string;
txs: BisqTransaction[];
}
export interface BisqTransaction {
txVersion: string;
id: string;
blockHeight: number;
blockHash: string;
time: number;
inputs: BisqInput[];
outputs: BisqOutput[];
txType: string;
txTypeDisplayString: string;
burntFee: number;
invalidatedBsq: number;
unlockBlockHeight: number;
}
export interface BisqStats {
minted: number;
burnt: number;
addresses: number;
unspent_txos: number;
spent_txos: number;
}
interface BisqInput {
spendingTxOutputIndex: number;
spendingTxId: string;
bsqAmount: number;
isVerified: boolean;
address: string;
time: number;
}
interface BisqOutput {
txVersion: string;
txId: string;
index: number;
bsqAmount: number;
btcAmount: number;
height: number;
isVerified: boolean;
burntFee: number;
invalidatedBsq: number;
address: string;
scriptPubKey: BisqScriptPubKey;
time: any;
txType: string;
txTypeDisplayString: string;
txOutputType: string;
txOutputTypeDisplayString: string;
lockTime: number;
isUnspent: boolean;
spentInfo: SpentInfo;
opReturn?: string;
}
interface BisqScriptPubKey {
addresses: string[];
asm: string;
hex: string;
reqSigs?: number;
type: string;
}
interface SpentInfo {
height: number;
inputIndex: number;
txId: string;
}
export interface BisqTrade {
direction: string;
price: string;
amount: string;
volume: string;
payment_method: string;
trade_id: string;
trade_date: number;
market?: string;
}
export interface Currencies { [txid: string]: Currency; }
export interface Currency {
code: string;
name: string;
precision: number;
_type: string;
}
export interface Depth { [market: string]: Market; }
interface Market {
'buys': string[];
'sells': string[];
}
export interface HighLowOpenClose {
period_start: number | string;
open: string;
high: string;
low: string;
close: string;
volume_left: string;
volume_right: string;
avg: string;
}
export interface Markets { [txid: string]: Pair; }
interface Pair {
pair: string;
lname: string;
rname: string;
lsymbol: string;
rsymbol: string;
lprecision: number;
rprecision: number;
ltype: string;
rtype: string;
name: string;
}
export interface Offers { [market: string]: OffersMarket; }
interface OffersMarket {
buys: Offer[] | null;
sells: Offer[] | null;
}
export interface OffersData {
direction: string;
currencyCode: string;
minAmount: number;
amount: number;
price: number;
date: number;
useMarketBasedPrice: boolean;
marketPriceMargin: number;
paymentMethod: string;
id: string;
currencyPair: string;
primaryMarketDirection: string;
priceDisplayString: string;
primaryMarketAmountDisplayString: string;
primaryMarketMinAmountDisplayString: string;
primaryMarketVolumeDisplayString: string;
primaryMarketMinVolumeDisplayString: string;
primaryMarketPrice: number;
primaryMarketAmount: number;
primaryMarketMinAmount: number;
primaryMarketVolume: number;
primaryMarketMinVolume: number;
}
export interface Offer {
offer_id: string;
offer_date: number;
direction: string;
min_amount: string;
amount: string;
price: string;
volume: string;
payment_method: string;
offer_fee_txid: any;
}
export interface Tickers { [market: string]: Ticker | null; }
export interface Ticker {
last: string;
high: string;
low: string;
volume_left: string;
volume_right: string;
buy: string | null;
sell: string | null;
}
export interface Trade {
direction: string;
price: string;
amount: string;
volume: string;
payment_method: string;
trade_id: string;
trade_date: number;
}
export interface TradesData {
currency: string;
direction: string;
tradePrice: number;
tradeAmount: number;
tradeDate: number;
paymentMethod: string;
offerDate: number;
useMarketBasedPrice: boolean;
marketPriceMargin: number;
offerAmount: number;
offerMinAmount: number;
offerId: string;
depositTxId?: string;
currencyPair: string;
primaryMarketDirection: string;
primaryMarketTradePrice: number;
primaryMarketTradeAmount: number;
primaryMarketTradeVolume: number;
_market: string;
_tradePriceStr: string;
_tradeAmountStr: string;
_tradeVolumeStr: string;
_offerAmountStr: string;
_tradePrice: number;
_tradeAmount: number;
_tradeVolume: number;
_offerAmount: number;
}
export interface MarketVolume {
period_start: number;
num_trades: number;
volume: string;
}
export interface MarketsApiError {
success: number;
error: string;
}
export type Interval = 'minute' | 'half_hour' | 'hour' | 'half_day' | 'day' | 'week' | 'month' | 'year' | 'auto';
export interface SummarizedIntervals { [market: string]: SummarizedInterval; }
export interface SummarizedInterval {
'period_start': number;
'open': number;
'close': number;
'high': number;
'low': number;
'avg': number;
'volume_right': number;
'volume_left': number;
}

View File

@@ -0,0 +1,679 @@
import { Currencies, OffersData, TradesData, Depth, Currency, Interval, HighLowOpenClose,
Markets, Offers, Offer, BisqTrade, MarketVolume, Tickers, Ticker, SummarizedIntervals, SummarizedInterval } from './interfaces';
const strtotime = require('./strtotime');
class BisqMarketsApi {
private cryptoCurrencyData: Currency[] = [];
private fiatCurrencyData: Currency[] = [];
private activeCryptoCurrencyData: Currency[] = [];
private activeFiatCurrencyData: Currency[] = [];
private offersData: OffersData[] = [];
private tradesData: TradesData[] = [];
private fiatCurrenciesIndexed: { [code: string]: true } = {};
private allCurrenciesIndexed: { [code: string]: Currency } = {};
private tradeDataByMarket: { [market: string]: TradesData[] } = {};
private tickersCache: Ticker | Tickers | null = null;
constructor() { }
setOffersData(offers: OffersData[]) {
this.offersData = offers;
}
setTradesData(trades: TradesData[]) {
this.tradesData = trades;
this.tradeDataByMarket = {};
this.tradesData.forEach((trade) => {
trade._market = trade.currencyPair.toLowerCase().replace('/', '_');
if (!this.tradeDataByMarket[trade._market]) {
this.tradeDataByMarket[trade._market] = [];
}
this.tradeDataByMarket[trade._market].push(trade);
});
}
setCurrencyData(cryptoCurrency: Currency[], fiatCurrency: Currency[], activeCryptoCurrency: Currency[], activeFiatCurrency: Currency[]) {
this.cryptoCurrencyData = cryptoCurrency,
this.fiatCurrencyData = fiatCurrency,
this.activeCryptoCurrencyData = activeCryptoCurrency,
this.activeFiatCurrencyData = activeFiatCurrency;
this.fiatCurrenciesIndexed = {};
this.allCurrenciesIndexed = {};
this.fiatCurrencyData.forEach((currency) => {
currency._type = 'fiat';
this.fiatCurrenciesIndexed[currency.code] = true;
this.allCurrenciesIndexed[currency.code] = currency;
});
this.cryptoCurrencyData.forEach((currency) => {
currency._type = 'crypto';
this.allCurrenciesIndexed[currency.code] = currency;
});
}
updateCache() {
this.tickersCache = null;
this.tickersCache = this.getTicker();
}
getCurrencies(
type: 'crypto' | 'fiat' | 'active' | 'all' = 'all',
): Currencies {
let currencies: Currency[];
switch (type) {
case 'fiat':
currencies = this.fiatCurrencyData;
break;
case 'crypto':
currencies = this.cryptoCurrencyData;
break;
case 'active':
currencies = this.activeCryptoCurrencyData.concat(this.activeFiatCurrencyData);
break;
case 'all':
default:
currencies = this.cryptoCurrencyData.concat(this.fiatCurrencyData);
}
const result = {};
currencies.forEach((currency) => {
result[currency.code] = currency;
});
return result;
}
getDepth(
market: string,
): Depth {
const currencyPair = market.replace('_', '/').toUpperCase();
const buys = this.offersData
.filter((offer) => offer.currencyPair === currencyPair && offer.primaryMarketDirection === 'BUY')
.map((offer) => offer.price)
.sort((a, b) => b - a)
.map((price) => this.intToBtc(price));
const sells = this.offersData
.filter((offer) => offer.currencyPair === currencyPair && offer.primaryMarketDirection === 'SELL')
.map((offer) => offer.price)
.sort((a, b) => a - b)
.map((price) => this.intToBtc(price));
const result = {};
result[market] = {
'buys': buys,
'sells': sells,
};
return result;
}
getOffers(
market: string,
direction?: 'buy' | 'sell',
): Offers {
const currencyPair = market.replace('_', '/').toUpperCase();
let buys: Offer[] | null = null;
let sells: Offer[] | null = null;
if (!direction || direction === 'buy') {
buys = this.offersData
.filter((offer) => offer.currencyPair === currencyPair && offer.primaryMarketDirection === 'BUY')
.sort((a, b) => b.price - a.price)
.map((offer) => this.offerDataToOffer(offer, market));
}
if (!direction || direction === 'sell') {
sells = this.offersData
.filter((offer) => offer.currencyPair === currencyPair && offer.primaryMarketDirection === 'SELL')
.sort((a, b) => a.price - b.price)
.map((offer) => this.offerDataToOffer(offer, market));
}
const result: Offers = {};
result[market] = {
'buys': buys,
'sells': sells,
};
return result;
}
getMarkets(): Markets {
const allCurrencies = this.getCurrencies();
const activeCurrencies = this.getCurrencies('active');
const markets = {};
for (const currency of Object.keys(activeCurrencies)) {
if (allCurrencies[currency].code === 'BTC') {
continue;
}
const isFiat = allCurrencies[currency]._type === 'fiat';
const pmarketname = allCurrencies['BTC']['name'];
const lsymbol = isFiat ? 'BTC' : currency;
const rsymbol = isFiat ? currency : 'BTC';
const lname = isFiat ? pmarketname : allCurrencies[currency].name;
const rname = isFiat ? allCurrencies[currency].name : pmarketname;
const ltype = isFiat ? 'crypto' : allCurrencies[currency]._type;
const rtype = isFiat ? 'fiat' : 'crypto';
const lprecision = 8;
const rprecision = isFiat ? 2 : 8;
const pair = lsymbol.toLowerCase() + '_' + rsymbol.toLowerCase();
markets[pair] = {
'pair': pair,
'lname': lname,
'rname': rname,
'lsymbol': lsymbol,
'rsymbol': rsymbol,
'lprecision': lprecision,
'rprecision': rprecision,
'ltype': ltype,
'rtype': rtype,
'name': lname + '/' + rname,
};
}
return markets;
}
getTrades(
market: string,
timestamp_from?: number,
timestamp_to?: number,
trade_id_from?: string,
trade_id_to?: string,
direction?: 'buy' | 'sell',
limit: number = 100,
sort: 'asc' | 'desc' = 'desc',
): BisqTrade[] {
limit = Math.min(limit, 2000);
const _market = market === 'all' ? undefined : market;
if (!timestamp_from) {
timestamp_from = new Date('2016-01-01').getTime() / 1000;
}
if (!timestamp_to) {
timestamp_to = new Date().getTime() / 1000;
}
const matches = this.getTradesByCriteria(_market, timestamp_to, timestamp_from,
trade_id_to, trade_id_from, direction, sort, limit, false);
if (sort === 'asc') {
matches.sort((a, b) => a.tradeDate - b.tradeDate);
} else {
matches.sort((a, b) => b.tradeDate - a.tradeDate);
}
return matches.map((trade) => {
const bsqTrade: BisqTrade = {
direction: trade.primaryMarketDirection,
price: trade._tradePriceStr,
amount: trade._tradeAmountStr,
volume: trade._tradeVolumeStr,
payment_method: trade.paymentMethod,
trade_id: trade.offerId,
trade_date: trade.tradeDate,
};
if (market === 'all') {
bsqTrade.market = trade._market;
}
return bsqTrade;
});
}
getVolumes(
market?: string,
timestamp_from?: number,
timestamp_to?: number,
interval: Interval = 'auto',
milliseconds?: boolean,
timestamp: 'no' | 'yes' = 'yes',
): MarketVolume[] {
if (milliseconds) {
timestamp_from = timestamp_from ? timestamp_from / 1000 : timestamp_from;
timestamp_to = timestamp_to ? timestamp_to / 1000 : timestamp_to;
}
if (!timestamp_from) {
timestamp_from = new Date('2016-01-01').getTime() / 1000;
}
if (!timestamp_to) {
timestamp_to = new Date().getTime() / 1000;
}
const trades = this.getTradesByCriteria(market, timestamp_to, timestamp_from,
undefined, undefined, undefined, 'asc', Number.MAX_SAFE_INTEGER);
if (interval === 'auto') {
const range = timestamp_to - timestamp_from;
interval = this.getIntervalFromRange(range);
}
const intervals: any = {};
const marketVolumes: MarketVolume[] = [];
for (const trade of trades) {
const traded_at = trade['tradeDate'] / 1000;
const interval_start = this.intervalStart(traded_at, interval);
if (!intervals[interval_start]) {
intervals[interval_start] = {
'volume': 0,
'num_trades': 0,
};
}
const period = intervals[interval_start];
period['period_start'] = interval_start;
period['volume'] += this.fiatCurrenciesIndexed[trade.currency] ? trade._tradeAmount : trade._tradeVolume;
period['num_trades']++;
}
for (const p in intervals) {
if (intervals.hasOwnProperty(p)) {
const period = intervals[p];
marketVolumes.push({
period_start: timestamp === 'no' ? new Date(period['period_start'] * 1000).toISOString() : period['period_start'],
num_trades: period['num_trades'],
volume: this.intToBtc(period['volume']),
});
}
}
return marketVolumes;
}
getTicker(
market?: string,
): Tickers | Ticker | null {
if (market) {
return this.getTickerFromMarket(market);
}
if (this.tickersCache) {
return this.tickersCache;
}
const allMarkets = this.getMarkets();
const tickers = {};
for (const m in allMarkets) {
if (allMarkets.hasOwnProperty(m)) {
tickers[allMarkets[m].pair] = this.getTickerFromMarket(allMarkets[m].pair);
}
}
return tickers;
}
getTickerFromMarket(market: string): Ticker | null {
let ticker: Ticker;
const timestamp_from = strtotime('-24 hour');
const timestamp_to = new Date().getTime() / 1000;
const trades = this.getTradesByCriteria(market, timestamp_to, timestamp_from,
undefined, undefined, undefined, 'asc', Number.MAX_SAFE_INTEGER);
const periods: SummarizedInterval[] = Object.values(this.getTradesSummarized(trades, timestamp_from));
const allCurrencies = this.getCurrencies();
const currencyRight = allCurrencies[market.split('_')[1].toUpperCase()];
if (periods[0]) {
ticker = {
'last': this.intToBtc(periods[0].close),
'high': this.intToBtc(periods[0].high),
'low': this.intToBtc(periods[0].low),
'volume_left': this.intToBtc(periods[0].volume_left),
'volume_right': this.intToBtc(periods[0].volume_right),
'buy': null,
'sell': null,
};
} else {
const lastTrade = this.tradeDataByMarket[market];
if (!lastTrade) {
return null;
}
const tradePrice = lastTrade[0].primaryMarketTradePrice * Math.pow(10, 8 - currencyRight.precision);
const lastTradePrice = this.intToBtc(tradePrice);
ticker = {
'last': lastTradePrice,
'high': lastTradePrice,
'low': lastTradePrice,
'volume_left': '0',
'volume_right': '0',
'buy': null,
'sell': null,
};
}
const timestampFromMilli = timestamp_from * 1000;
const timestampToMilli = timestamp_to * 1000;
const currencyPair = market.replace('_', '/').toUpperCase();
const offersData = this.offersData.slice().sort((a, b) => a.price - b.price);
const buy = offersData.find((offer) => offer.currencyPair === currencyPair
&& offer.primaryMarketDirection === 'BUY'
&& offer.date >= timestampFromMilli
&& offer.date <= timestampToMilli
);
const sell = offersData.find((offer) => offer.currencyPair === currencyPair
&& offer.primaryMarketDirection === 'SELL'
&& offer.date >= timestampFromMilli
&& offer.date <= timestampToMilli
);
if (buy) {
ticker.buy = this.intToBtc(buy.primaryMarketPrice * Math.pow(10, 8 - currencyRight.precision));
}
if (sell) {
ticker.sell = this.intToBtc(sell.primaryMarketPrice * Math.pow(10, 8 - currencyRight.precision));
}
return ticker;
}
getHloc(
market: string,
interval: Interval = 'auto',
timestamp_from?: number,
timestamp_to?: number,
milliseconds?: boolean,
timestamp: 'no' | 'yes' = 'yes',
): HighLowOpenClose[] {
if (milliseconds) {
timestamp_from = timestamp_from ? timestamp_from / 1000 : timestamp_from;
timestamp_to = timestamp_to ? timestamp_to / 1000 : timestamp_to;
}
if (!timestamp_from) {
timestamp_from = new Date('2016-01-01').getTime() / 1000;
}
if (!timestamp_to) {
timestamp_to = new Date().getTime() / 1000;
}
const trades = this.getTradesByCriteria(market, timestamp_to, timestamp_from,
undefined, undefined, undefined, 'asc', Number.MAX_SAFE_INTEGER);
if (interval === 'auto') {
const range = timestamp_to - timestamp_from;
interval = this.getIntervalFromRange(range);
}
const intervals = this.getTradesSummarized(trades, timestamp_from, interval);
const hloc: HighLowOpenClose[] = [];
for (const p in intervals) {
if (intervals.hasOwnProperty(p)) {
const period = intervals[p];
hloc.push({
period_start: timestamp === 'no' ? new Date(period['period_start'] * 1000).toISOString() : period['period_start'],
open: this.intToBtc(period['open']),
close: this.intToBtc(period['close']),
high: this.intToBtc(period['high']),
low: this.intToBtc(period['low']),
avg: this.intToBtc(period['avg']),
volume_right: this.intToBtc(period['volume_right']),
volume_left: this.intToBtc(period['volume_left']),
});
}
}
return hloc;
}
private getIntervalFromRange(range: number): Interval {
// two days range loads minute data
if (range <= 3600) {
// up to one hour range loads minutely data
return 'minute';
} else if (range <= 1 * 24 * 3600) {
// up to one day range loads half-hourly data
return 'half_hour';
} else if (range <= 3 * 24 * 3600) {
// up to 3 day range loads hourly data
return 'hour';
} else if (range <= 7 * 24 * 3600) {
// up to 7 day range loads half-daily data
return 'half_day';
} else if (range <= 60 * 24 * 3600) {
// up to 2 month range loads daily data
return 'day';
} else if (range <= 12 * 31 * 24 * 3600) {
// up to one year range loads weekly data
return 'week';
} else if (range <= 12 * 31 * 24 * 3600) {
// up to 5 year range loads monthly data
return 'month';
} else {
// greater range loads yearly data
return 'year';
}
}
getVolumesByTime(time: number): MarketVolume[] {
const timestamp_from = new Date().getTime() / 1000 - time;
const timestamp_to = new Date().getTime() / 1000;
const trades = this.getTradesByCriteria(undefined, timestamp_to, timestamp_from,
undefined, undefined, undefined, 'asc', Number.MAX_SAFE_INTEGER);
const markets: any = {};
for (const trade of trades) {
if (!markets[trade._market]) {
markets[trade._market] = {
'volume': 0,
'num_trades': 0,
};
}
markets[trade._market]['volume'] += this.fiatCurrenciesIndexed[trade.currency] ? trade._tradeAmount : trade._tradeVolume;
markets[trade._market]['num_trades']++;
}
return markets;
}
private getTradesSummarized(trades: TradesData[], timestamp_from: number, interval?: string): SummarizedIntervals {
const intervals: any = {};
const intervals_prices: any = {};
for (const trade of trades) {
const traded_at = trade.tradeDate / 1000;
const interval_start = !interval ? timestamp_from : this.intervalStart(traded_at, interval);
if (!intervals[interval_start]) {
intervals[interval_start] = {
'open': 0,
'close': 0,
'high': 0,
'low': 0,
'avg': 0,
'volume_right': 0,
'volume_left': 0,
};
intervals_prices[interval_start] = [];
}
const period = intervals[interval_start];
const price = trade._tradePrice;
if (!intervals_prices[interval_start]['leftvol']) {
intervals_prices[interval_start]['leftvol'] = [];
}
if (!intervals_prices[interval_start]['rightvol']) {
intervals_prices[interval_start]['rightvol'] = [];
}
intervals_prices[interval_start]['leftvol'].push(trade._tradeAmount);
intervals_prices[interval_start]['rightvol'].push(trade._tradeVolume);
if (price) {
const plow = period['low'];
period['period_start'] = interval_start;
period['open'] = period['open'] || price;
period['close'] = price;
period['high'] = price > period['high'] ? price : period['high'];
period['low'] = (plow && price > plow) ? period['low'] : price;
period['avg'] = intervals_prices[interval_start]['rightvol'].reduce((p: number, c: number) => c + p, 0)
/ intervals_prices[interval_start]['leftvol'].reduce((c: number, p: number) => c + p, 0) * 100000000;
period['volume_left'] += trade._tradeAmount;
period['volume_right'] += trade._tradeVolume;
}
}
return intervals;
}
private getTradesByCriteria(
market: string | undefined,
timestamp_to: number,
timestamp_from: number,
trade_id_to: string | undefined,
trade_id_from: string | undefined,
direction: 'buy' | 'sell' | undefined,
sort: string,
limit: number,
integerAmounts: boolean = true,
): TradesData[] {
let trade_id_from_ts: number | null = null;
let trade_id_to_ts: number | null = null;
const allCurrencies = this.getCurrencies();
const timestampFromMilli = timestamp_from * 1000;
const timestampToMilli = timestamp_to * 1000;
// note: the offer_id_from/to depends on iterating over trades in
// descending chronological order.
const tradesDataSorted = this.tradesData.slice();
if (sort === 'asc') {
tradesDataSorted.reverse();
}
let matches: TradesData[] = [];
for (const trade of tradesDataSorted) {
if (trade_id_from === trade.offerId) {
trade_id_from_ts = trade.tradeDate;
}
if (trade_id_to === trade.offerId) {
trade_id_to_ts = trade.tradeDate;
}
if (trade_id_to && trade_id_to_ts === null) {
continue;
}
if (trade_id_from && trade_id_from_ts != null && trade_id_from_ts !== trade.tradeDate) {
continue;
}
if (market && market !== trade._market) {
continue;
}
if (timestampFromMilli && timestampFromMilli > trade.tradeDate) {
continue;
}
if (timestampToMilli && timestampToMilli < trade.tradeDate) {
continue;
}
if (direction && direction !== trade.direction.toLowerCase()) {
continue;
}
// Filter out bogus trades with BTC/BTC or XXX/XXX market.
// See github issue: https://github.com/bitsquare/bitsquare/issues/883
const currencyPairs = trade.currencyPair.split('/');
if (currencyPairs[0] === currencyPairs[1]) {
continue;
}
const currencyLeft = allCurrencies[currencyPairs[0]];
const currencyRight = allCurrencies[currencyPairs[1]];
if (!currencyLeft || !currencyRight) {
continue;
}
const tradePrice = trade.primaryMarketTradePrice * Math.pow(10, 8 - currencyRight.precision);
const tradeAmount = trade.primaryMarketTradeAmount * Math.pow(10, 8 - currencyLeft.precision);
const tradeVolume = trade.primaryMarketTradeVolume * Math.pow(10, 8 - currencyRight.precision);
if (integerAmounts) {
trade._tradePrice = tradePrice;
trade._tradeAmount = tradeAmount;
trade._tradeVolume = tradeVolume;
trade._offerAmount = trade.offerAmount;
} else {
trade._tradePriceStr = this.intToBtc(tradePrice);
trade._tradeAmountStr = this.intToBtc(tradeAmount);
trade._tradeVolumeStr = this.intToBtc(tradeVolume);
trade._offerAmountStr = this.intToBtc(trade.offerAmount);
}
matches.push(trade);
if (matches.length >= limit) {
break;
}
}
if ((trade_id_from && !trade_id_from_ts) || (trade_id_to && !trade_id_to_ts)) {
matches = [];
}
return matches;
}
private intervalStart(ts: number, interval: string): number {
switch (interval) {
case 'minute':
return (ts - (ts % 60));
case '10_minute':
return (ts - (ts % 600));
case 'half_hour':
return (ts - (ts % 1800));
case 'hour':
return (ts - (ts % 3600));
case 'half_day':
return (ts - (ts % (3600 * 12)));
case 'day':
return strtotime('midnight today', ts);
case 'week':
return strtotime('midnight sunday last week', ts);
case 'month':
return strtotime('midnight first day of this month', ts);
case 'year':
return strtotime('midnight first day of january', ts);
default:
throw new Error('Unsupported interval: ' + interval);
}
}
private offerDataToOffer(offer: OffersData, market: string): Offer {
const currencyPairs = market.split('_');
const currencyRight = this.allCurrenciesIndexed[currencyPairs[1].toUpperCase()];
const currencyLeft = this.allCurrenciesIndexed[currencyPairs[0].toUpperCase()];
const price = offer['primaryMarketPrice'] * Math.pow( 10, 8 - currencyRight['precision']);
const amount = offer['primaryMarketAmount'] * Math.pow( 10, 8 - currencyLeft['precision']);
const volume = offer['primaryMarketVolume'] * Math.pow( 10, 8 - currencyRight['precision']);
return {
offer_id: offer.id,
offer_date: offer.date,
direction: offer.primaryMarketDirection,
min_amount: this.intToBtc(offer.minAmount),
amount: this.intToBtc(amount),
price: this.intToBtc(price),
volume: this.intToBtc(volume),
payment_method: offer.paymentMethod,
offer_fee_txid: null,
};
}
private intToBtc(val: number): string {
return (val / 100000000).toFixed(8);
}
}
export default new BisqMarketsApi();

View File

@@ -0,0 +1,137 @@
import config from '../../config';
import * as fs from 'fs';
import { OffersData as OffersData, TradesData, Currency } from './interfaces';
import bisqMarket from './markets-api';
import logger from '../../logger';
class Bisq {
private static FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE = 4000;
private static MARKET_JSON_PATH = config.BISQ.DATA_PATH;
private static MARKET_JSON_FILE_PATHS = {
activeCryptoCurrency: '/active_crypto_currency_list.json',
activeFiatCurrency: '/active_fiat_currency_list.json',
cryptoCurrency: '/crypto_currency_list.json',
fiatCurrency: '/fiat_currency_list.json',
offers: '/offers_statistics.json',
trades: '/trade_statistics.json',
};
private cryptoCurrencyLastMtime = new Date('2016-01-01');
private fiatCurrencyLastMtime = new Date('2016-01-01');
private offersLastMtime = new Date('2016-01-01');
private tradesLastMtime = new Date('2016-01-01');
private subdirectoryWatcher: fs.FSWatcher | undefined;
constructor() {}
startBisqService(): void {
try {
this.checkForBisqDataFolder();
} catch (e) {
logger.info('Retrying to start bisq service (markets) in 3 minutes');
setTimeout(this.startBisqService.bind(this), 180000);
return;
}
this.loadBisqDumpFile();
this.startBisqDirectoryWatcher();
}
private checkForBisqDataFolder() {
if (!fs.existsSync(Bisq.MARKET_JSON_PATH + Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency)) {
logger.err(Bisq.MARKET_JSON_PATH + Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency + ` doesn't exist. Make sure Bisq is running and the config is correct before starting the server.`);
throw new Error(`Cannot load BISQ ${Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency} file`);
}
}
private startBisqDirectoryWatcher() {
if (this.subdirectoryWatcher) {
this.subdirectoryWatcher.close();
}
if (!fs.existsSync(Bisq.MARKET_JSON_PATH + Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency)) {
logger.warn(Bisq.MARKET_JSON_PATH + Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency + ` doesn't exist. Trying to restart sub directory watcher again in 3 minutes.`);
setTimeout(() => this.startBisqDirectoryWatcher(), 180000);
return;
}
let fsWait: NodeJS.Timeout | null = null;
this.subdirectoryWatcher = fs.watch(Bisq.MARKET_JSON_PATH, () => {
if (fsWait) {
clearTimeout(fsWait);
}
fsWait = setTimeout(() => {
logger.debug(`Change detected in the Bisq market data folder.`);
this.loadBisqDumpFile();
}, Bisq.FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE);
});
}
private async loadBisqDumpFile(): Promise<void> {
const start = new Date().getTime();
try {
let marketsDataUpdated = false;
const cryptoMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency);
const fiatMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.fiatCurrency);
if (cryptoMtime > this.cryptoCurrencyLastMtime || fiatMtime > this.fiatCurrencyLastMtime) {
const cryptoCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency);
const fiatCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.fiatCurrency);
const activeCryptoCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.activeCryptoCurrency);
const activeFiatCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.activeFiatCurrency);
logger.debug('Updating Bisq Market Currency Data');
bisqMarket.setCurrencyData(cryptoCurrencyData, fiatCurrencyData, activeCryptoCurrencyData, activeFiatCurrencyData);
if (cryptoMtime > this.cryptoCurrencyLastMtime) {
this.cryptoCurrencyLastMtime = cryptoMtime;
}
if (fiatMtime > this.fiatCurrencyLastMtime) {
this.fiatCurrencyLastMtime = fiatMtime;
}
marketsDataUpdated = true;
}
const offersMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.offers);
if (offersMtime > this.offersLastMtime) {
const offersData = await this.loadData<OffersData[]>(Bisq.MARKET_JSON_FILE_PATHS.offers);
logger.debug('Updating Bisq Market Offers Data');
bisqMarket.setOffersData(offersData);
this.offersLastMtime = offersMtime;
marketsDataUpdated = true;
}
const tradesMtime = this.getFileMtime(Bisq.MARKET_JSON_FILE_PATHS.trades);
if (tradesMtime > this.tradesLastMtime) {
const tradesData = await this.loadData<TradesData[]>(Bisq.MARKET_JSON_FILE_PATHS.trades);
logger.debug('Updating Bisq Market Trades Data');
bisqMarket.setTradesData(tradesData);
this.tradesLastMtime = tradesMtime;
marketsDataUpdated = true;
}
if (marketsDataUpdated) {
bisqMarket.updateCache();
const time = new Date().getTime() - start;
logger.debug('Bisq market data updated in ' + time + ' ms');
}
} catch (e) {
logger.err('loadBisqMarketDataDumpFile() error.' + (e instanceof Error ? e.message : e));
}
}
private getFileMtime(path: string): Date {
const stats = fs.statSync(Bisq.MARKET_JSON_PATH + path);
return stats.mtime;
}
private loadData<T>(path: string): Promise<T> {
return new Promise((resolve, reject) => {
fs.readFile(Bisq.MARKET_JSON_PATH + path, 'utf8', (err, data) => {
if (err) {
reject(err);
}
try {
const parsedData = JSON.parse(data);
resolve(parsedData);
} catch (e) {
reject('JSON parse error (' + path + ')');
}
});
});
}
}
export default new Bisq();

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,23 @@
import { IMempoolInfo, ITransaction, IBlock } from '../../interfaces';
import { IEsploraApi } from './esplora-api.interface';
export interface AbstractBitcoinApi {
getMempoolInfo(): Promise<IMempoolInfo>;
getRawMempool(): Promise<ITransaction['txid'][]>;
getRawTransaction(txId: string): Promise<ITransaction>;
getBlockCount(): Promise<number>;
getBlockAndTransactions(hash: string): Promise<IBlock>;
getBlockHash(height: number): Promise<string>;
getBlock(hash: string): Promise<IBlock>;
getBlockTransactions(hash: string): Promise<IBlock>;
getBlockTransactionsFromIndex(hash: string, index: number): Promise<IBlock>;
getBlocks(): Promise<string>;
getBlocksFromHeight(height: number): Promise<string>;
getAddress(address: string): Promise<IBlock>;
getAddressTransactions(address: string): Promise<IBlock>;
getAddressTransactionsFromLastSeenTxid(address: string, lastSeenTxid: string): Promise<IBlock>;
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]>;
$getRawTransaction(txId: string, skipConversion?: boolean, addPrevout?: boolean, lazyPrevouts?: boolean): Promise<IEsploraApi.Transaction>;
$getBlockHeightTip(): Promise<number>;
$getTxIdsForBlock(hash: string): Promise<string[]>;
$getBlockHash(height: number): Promise<string>;
$getBlockHeader(hash: string): Promise<string>;
$getBlock(hash: string): Promise<IEsploraApi.Block>;
$getAddress(address: string): Promise<IEsploraApi.Address>;
$getAddressTransactions(address: string, lastSeenTxId: string): Promise<IEsploraApi.Transaction[]>;
$getAddressPrefix(prefix: string): string[];
$sendRawTransaction(rawTransaction: string): Promise<string>;
$getOutspends(txId: string): Promise<IEsploraApi.Outspend[]>;
}
export interface BitcoinRpcCredentials {
host: string;
port: number;
user: string;
pass: string;
timeout: number;
}

View File

@@ -1,16 +1,20 @@
const config = require('../../../mempool-config.json');
import config from '../../config';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
import BitcoindApi from './bitcoind-api';
import ElectrsApi from './electrs-api';
import EsploraApi from './esplora-api';
import BitcoinApi from './bitcoin-api';
import ElectrumApi from './electrum-api';
import bitcoinClient from './bitcoin-client';
function factory(): AbstractBitcoinApi {
switch (config.BACKEND_API) {
case 'electrs':
return new ElectrsApi();
case 'bitcoind':
function bitcoinApiFactory(): AbstractBitcoinApi {
switch (config.MEMPOOL.BACKEND) {
case 'esplora':
return new EsploraApi();
case 'electrum':
return new ElectrumApi(bitcoinClient);
case 'none':
default:
return new BitcoindApi();
return new BitcoinApi(bitcoinClient);
}
}
export default factory();
export default bitcoinApiFactory();

View File

@@ -0,0 +1,167 @@
export namespace IBitcoinApi {
export interface MempoolInfo {
loaded: boolean; // (boolean) True if the mempool is fully loaded
size: number; // (numeric) Current tx count
bytes: number; // (numeric) Sum of all virtual transaction sizes as defined in BIP 141.
usage: number; // (numeric) Total memory usage for the mempool
total_fee: number; // (numeric) Total fees of transactions in the mempool
maxmempool: number; // (numeric) Maximum memory usage for the mempool
mempoolminfee: number; // (numeric) Minimum fee rate in BTC/kB for tx to be accepted.
minrelaytxfee: number; // (numeric) Current minimum relay fee for transactions
}
export interface RawMempool { [txId: string]: MempoolEntry; }
export interface MempoolEntry {
vsize: number; // (numeric) virtual transaction size as defined in BIP 141.
weight: number; // (numeric) transaction weight as defined in BIP 141.
time: number; // (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
height: number; // (numeric) block height when transaction entered pool
descendantcount: number; // (numeric) number of in-mempool descendant transactions (including this one)
descendantsize: number; // (numeric) virtual transaction size of in-mempool descendants (including this one)
ancestorcount: number; // (numeric) number of in-mempool ancestor transactions (including this one)
ancestorsize: number; // (numeric) virtual transaction size of in-mempool ancestors (including this one)
wtxid: string; // (string) hash of serialized transactionumber; including witness data
fees: {
base: number; // (numeric) transaction fee in BTC
modified: number; // (numeric) transaction fee with fee deltas used for mining priority in BTC
ancestor: number; // (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC
descendant: number; // (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC
};
depends: string[]; // (string) parent transaction id
spentby: string[]; // (array) unconfirmed transactions spending outputs from this transaction
'bip125-replaceable': boolean; // (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)
}
export interface Block {
hash: string; // (string) the block hash (same as provided)
confirmations: number; // (numeric) The number of confirmations, or -1 if the block is not on the main chain
size: number; // (numeric) The block size
strippedsize: number; // (numeric) The block size excluding witness data
weight: number; // (numeric) The block weight as defined in BIP 141
height: number; // (numeric) The block height or index
version: number; // (numeric) The block version
versionHex: string; // (string) The block version formatted in hexadecimal
merkleroot: string; // (string) The merkle root
tx: Transaction[];
time: number; // (numeric) The block time expressed in UNIX epoch time
mediantime: number; // (numeric) The median block time expressed in UNIX epoch time
nonce: number; // (numeric) The nonce
bits: string; // (string) The bits
difficulty: number; // (numeric) The difficulty
chainwork: string; // (string) Expected number of hashes required to produce the chain up to this block (in hex)
nTx: number; // (numeric) The number of transactions in the block
previousblockhash: string; // (string) The hash of the previous block
nextblockhash: string; // (string) The hash of the next block
}
export interface Transaction {
in_active_chain: boolean; // (boolean) Whether specified block is in the active chain or not
hex: string; // (string) The serialized, hex-encoded data for 'txid'
txid: string; // (string) The transaction id (same as provided)
hash: string; // (string) The transaction hash (differs from txid for witness transactions)
size: number; // (numeric) The serialized transaction size
vsize: number; // (numeric) The virtual transaction size (differs from size for witness transactions)
weight: number; // (numeric) The transaction's weight (between vsize*4-3 and vsize*4)
version: number; // (numeric) The version
locktime: number; // (numeric) The lock time
vin: Vin[];
vout: Vout[];
blockhash: string; // (string) the block hash
confirmations: number; // (numeric) The confirmations
blocktime: number; // (numeric) The block time expressed in UNIX epoch time
time: number; // (numeric) Same as blocktime
}
export interface Vin {
txid?: string; // (string) The transaction id
vout?: number; // (string)
scriptSig?: { // (json object) The script
asm: string; // (string) asm
hex: string; // (string) hex
};
sequence: number; // (numeric) The script sequence number
txinwitness?: string[]; // (string) hex-encoded witness data
coinbase?: string;
is_pegin?: boolean; // (boolean) Elements peg-in
}
export interface Vout {
value: number; // (numeric) The value in BTC
n: number; // (numeric) index
asset?: string; // (string) Elements asset id
scriptPubKey: { // (json object)
asm: string; // (string) the asm
hex: string; // (string) the hex
reqSigs?: number; // (numeric) The required sigs
type: string; // (string) The type, eg 'pubkeyhash'
address?: string; // (string) bitcoin address
addresses?: string[]; // (string) bitcoin addresses
pegout_chain?: string; // (string) Elements peg-out chain
pegout_addresses?: string[]; // (string) Elements peg-out addresses
};
}
export interface AddressInformation {
isvalid: boolean; // (boolean) If the address is valid or not. If not, this is the only property returned.
isvalid_parent?: boolean; // (boolean) Elements only
address: string; // (string) The bitcoin address validated
scriptPubKey: string; // (string) The hex-encoded scriptPubKey generated by the address
isscript: boolean; // (boolean) If the key is a script
iswitness: boolean; // (boolean) If the address is a witness
witness_version?: number; // (numeric, optional) The version number of the witness program
witness_program: string; // (string, optional) The hex value of the witness program
confidential_key?: string; // (string) Elements only
unconfidential?: string; // (string) Elements only
}
export interface ChainTips {
height: number; // (numeric) height of the chain tip
hash: string; // (string) block hash of the tip
branchlen: number; // (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain
status: 'invalid' | 'headers-only' | 'valid-headers' | 'valid-fork' | 'active';
}
export interface BlockchainInfo {
chain: number; // (string) current network name as defined in BIP70 (main, test, regtest)
blocks: number; // (numeric) the current number of blocks processed in the server
headers: number; // (numeric) the current number of headers we have validated
bestblockhash: string, // (string) the hash of the currently best block
difficulty: number; // (numeric) the current difficulty
mediantime: number; // (numeric) median time for the current best block
verificationprogress: number; // (numeric) estimate of verification progress [0..1]
initialblockdownload: boolean; // (bool) (debug information) estimate of whether this node is in Initial Block Download mode.
chainwork: string // (string) total amount of work in active chain, in hexadecimal
size_on_disk: number; // (numeric) the estimated size of the block and undo files on disk
pruned: number; // (boolean) if the blocks are subject to pruning
pruneheight: number; // (numeric) lowest-height complete block stored (only present if pruning is enabled)
automatic_pruning: number; // (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
prune_target_size: number; // (numeric) the target size used by pruning (only present if automatic pruning is enabled)
softforks: SoftFork[]; // (array) status of softforks in progress
bip9_softforks: { [name: string]: Bip9SoftForks[] } // (object) status of BIP9 softforks in progress
warnings: string; // (string) any network and blockchain warnings.
}
interface SoftFork {
id: string; // (string) name of softfork
version: number; // (numeric) block version
reject: { // (object) progress toward rejecting pre-softfork blocks
status: boolean; // (boolean) true if threshold reached
},
}
interface Bip9SoftForks {
status: number; // (string) one of defined, started, locked_in, active, failed
bit: number; // (numeric) the bit (0-28) in the block version field used to signal this softfork (only for started status)
startTime: number; // (numeric) the minimum median time past of a block at which the bit gains its meaning
timeout: number; // (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
since: number; // (numeric) height of the first block to which the status applies
statistics: { // (object) numeric statistics about BIP9 signalling for a softfork (only for started status)
period: number; // (numeric) the length in blocks of the BIP9 signalling period
threshold: number; // (numeric) the number of blocks with the version bit set required to activate the feature
elapsed: number; // (numeric) the number of blocks elapsed since the beginning of the current period
count: number; // (numeric) the number of blocks with the version bit set in the current period
possible: boolean; // (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
}
}
}

View File

@@ -0,0 +1,391 @@
import * as bitcoinjs from 'bitcoinjs-lib';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
import { IBitcoinApi } from './bitcoin-api.interface';
import { IEsploraApi } from './esplora-api.interface';
import blocks from '../blocks';
import mempool from '../mempool';
import { TransactionExtended } from '../../mempool.interfaces';
class BitcoinApi implements AbstractBitcoinApi {
private rawMempoolCache: IBitcoinApi.RawMempool | null = null;
protected bitcoindClient: any;
constructor(bitcoinClient: any) {
this.bitcoindClient = bitcoinClient;
}
static convertBlock(block: IBitcoinApi.Block): IEsploraApi.Block {
return {
id: block.hash,
height: block.height,
version: block.version,
timestamp: block.time,
bits: parseInt(block.bits, 16),
nonce: block.nonce,
difficulty: block.difficulty,
merkle_root: block.merkleroot,
tx_count: block.nTx,
size: block.size,
weight: block.weight,
previousblockhash: block.previousblockhash,
};
}
$getRawTransaction(txId: string, skipConversion = false, addPrevout = false, lazyPrevouts = false): Promise<IEsploraApi.Transaction> {
// If the transaction is in the mempool we already converted and fetched the fee. Only prevouts are missing
const txInMempool = mempool.getMempool()[txId];
if (txInMempool && addPrevout) {
return this.$addPrevouts(txInMempool);
}
return this.bitcoindClient.getRawTransaction(txId, true)
.then((transaction: IBitcoinApi.Transaction) => {
if (skipConversion) {
transaction.vout.forEach((vout) => {
vout.value = Math.round(vout.value * 100000000);
});
return transaction;
}
return this.$convertTransaction(transaction, addPrevout, lazyPrevouts);
})
.catch((e: Error) => {
if (e.message.startsWith('The genesis block coinbase')) {
return this.$returnCoinbaseTransaction();
}
throw e;
});
}
$getBlockHeightTip(): Promise<number> {
return this.bitcoindClient.getChainTips()
.then((result: IBitcoinApi.ChainTips[]) => {
return result.find(tip => tip.status === 'active')!.height;
});
}
$getTxIdsForBlock(hash: string): Promise<string[]> {
return this.bitcoindClient.getBlock(hash, 1)
.then((rpcBlock: IBitcoinApi.Block) => rpcBlock.tx);
}
$getRawBlock(hash: string): Promise<string> {
return this.bitcoindClient.getBlock(hash, 0);
}
$getBlockHash(height: number): Promise<string> {
return this.bitcoindClient.getBlockHash(height);
}
$getBlockHeader(hash: string): Promise<string> {
return this.bitcoindClient.getBlockHeader(hash, false);
}
async $getBlock(hash: string): Promise<IEsploraApi.Block> {
const foundBlock = blocks.getBlocks().find((block) => block.id === hash);
if (foundBlock) {
return foundBlock;
}
return this.bitcoindClient.getBlock(hash)
.then((block: IBitcoinApi.Block) => BitcoinApi.convertBlock(block));
}
$getAddress(address: string): Promise<IEsploraApi.Address> {
throw new Error('Method getAddress not supported by the Bitcoin RPC API.');
}
$getAddressTransactions(address: string, lastSeenTxId: string): Promise<IEsploraApi.Transaction[]> {
throw new Error('Method getAddressTransactions not supported by the Bitcoin RPC API.');
}
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]> {
return this.bitcoindClient.getRawMemPool();
}
$getAddressPrefix(prefix: string): string[] {
const found: { [address: string]: string } = {};
const mp = mempool.getMempool();
for (const tx in mp) {
for (const vout of mp[tx].vout) {
if (vout.scriptpubkey_address.indexOf(prefix) === 0) {
found[vout.scriptpubkey_address] = '';
if (Object.keys(found).length >= 10) {
return Object.keys(found);
}
}
}
}
return Object.keys(found);
}
$sendRawTransaction(rawTransaction: string): Promise<string> {
return this.bitcoindClient.sendRawTransaction(rawTransaction);
}
async $getOutspends(txId: string): Promise<IEsploraApi.Outspend[]> {
const outSpends: IEsploraApi.Outspend[] = [];
const tx = await this.$getRawTransaction(txId, true, false);
for (let i = 0; i < tx.vout.length; i++) {
if (tx.status && tx.status.block_height === 0) {
outSpends.push({
spent: false
});
} else {
const txOut = await this.bitcoindClient.getTxOut(txId, i);
outSpends.push({
spent: txOut === null,
});
}
}
return outSpends;
}
$getEstimatedHashrate(blockHeight: number): Promise<number> {
// 120 is the default block span in Core
return this.bitcoindClient.getNetworkHashPs(120, blockHeight);
}
protected async $convertTransaction(transaction: IBitcoinApi.Transaction, addPrevout: boolean, lazyPrevouts = false): Promise<IEsploraApi.Transaction> {
let esploraTransaction: IEsploraApi.Transaction = {
txid: transaction.txid,
version: transaction.version,
locktime: transaction.locktime,
size: transaction.size,
weight: transaction.weight,
fee: 0,
vin: [],
vout: [],
status: { confirmed: false },
};
esploraTransaction.vout = transaction.vout.map((vout) => {
return {
value: Math.round(vout.value * 100000000),
scriptpubkey: vout.scriptPubKey.hex,
scriptpubkey_address: vout.scriptPubKey && vout.scriptPubKey.address ? vout.scriptPubKey.address
: vout.scriptPubKey.addresses ? vout.scriptPubKey.addresses[0] : '',
scriptpubkey_asm: vout.scriptPubKey.asm ? this.convertScriptSigAsm(vout.scriptPubKey.hex) : '',
scriptpubkey_type: this.translateScriptPubKeyType(vout.scriptPubKey.type),
};
});
esploraTransaction.vin = transaction.vin.map((vin) => {
return {
is_coinbase: !!vin.coinbase,
prevout: null,
scriptsig: vin.scriptSig && vin.scriptSig.hex || vin.coinbase || '',
scriptsig_asm: vin.scriptSig && this.convertScriptSigAsm(vin.scriptSig.hex) || '',
sequence: vin.sequence,
txid: vin.txid || '',
vout: vin.vout || 0,
witness: vin.txinwitness,
};
});
if (transaction.confirmations) {
esploraTransaction.status = {
confirmed: true,
block_height: blocks.getCurrentBlockHeight() - transaction.confirmations + 1,
block_hash: transaction.blockhash,
block_time: transaction.blocktime,
};
}
if (addPrevout) {
esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction, false, lazyPrevouts);
} else if (!transaction.confirmations) {
esploraTransaction = await this.$appendMempoolFeeData(esploraTransaction);
}
return esploraTransaction;
}
private translateScriptPubKeyType(outputType: string): string {
const map = {
'pubkey': 'p2pk',
'pubkeyhash': 'p2pkh',
'scripthash': 'p2sh',
'witness_v0_keyhash': 'v0_p2wpkh',
'witness_v0_scripthash': 'v0_p2wsh',
'witness_v1_taproot': 'v1_p2tr',
'nonstandard': 'nonstandard',
'multisig': 'multisig',
'nulldata': 'op_return'
};
if (map[outputType]) {
return map[outputType];
} else {
return 'unknown';
}
}
private async $appendMempoolFeeData(transaction: IEsploraApi.Transaction): Promise<IEsploraApi.Transaction> {
if (transaction.fee) {
return transaction;
}
let mempoolEntry: IBitcoinApi.MempoolEntry;
if (!mempool.isInSync() && !this.rawMempoolCache) {
this.rawMempoolCache = await this.$getRawMempoolVerbose();
}
if (this.rawMempoolCache && this.rawMempoolCache[transaction.txid]) {
mempoolEntry = this.rawMempoolCache[transaction.txid];
} else {
mempoolEntry = await this.$getMempoolEntry(transaction.txid);
}
transaction.fee = Math.round(mempoolEntry.fees.base * 100000000);
return transaction;
}
protected async $addPrevouts(transaction: TransactionExtended): Promise<TransactionExtended> {
for (const vin of transaction.vin) {
if (vin.prevout) {
continue;
}
const innerTx = await this.$getRawTransaction(vin.txid, false, false);
vin.prevout = innerTx.vout[vin.vout];
this.addInnerScriptsToVin(vin);
}
return transaction;
}
protected $returnCoinbaseTransaction(): Promise<IEsploraApi.Transaction> {
return this.bitcoindClient.getBlockHash(0).then((hash: string) =>
this.bitcoindClient.getBlock(hash, 2)
.then((block: IBitcoinApi.Block) => {
return this.$convertTransaction(Object.assign(block.tx[0], {
confirmations: blocks.getCurrentBlockHeight() + 1,
blocktime: block.time }), false);
})
);
}
private $getMempoolEntry(txid: string): Promise<IBitcoinApi.MempoolEntry> {
return this.bitcoindClient.getMempoolEntry(txid);
}
private $getRawMempoolVerbose(): Promise<IBitcoinApi.RawMempool> {
return this.bitcoindClient.getRawMemPool(true);
}
private async $calculateFeeFromInputs(transaction: IEsploraApi.Transaction, addPrevout: boolean, lazyPrevouts: boolean): Promise<IEsploraApi.Transaction> {
if (transaction.vin[0].is_coinbase) {
transaction.fee = 0;
return transaction;
}
let totalIn = 0;
for (let i = 0; i < transaction.vin.length; i++) {
if (lazyPrevouts && i > 12) {
transaction.vin[i].lazy = true;
continue;
}
const innerTx = await this.$getRawTransaction(transaction.vin[i].txid, false, false);
transaction.vin[i].prevout = innerTx.vout[transaction.vin[i].vout];
this.addInnerScriptsToVin(transaction.vin[i]);
totalIn += innerTx.vout[transaction.vin[i].vout].value;
}
if (lazyPrevouts && transaction.vin.length > 12) {
transaction.fee = -1;
} else {
const totalOut = transaction.vout.reduce((p, output) => p + output.value, 0);
transaction.fee = parseFloat((totalIn - totalOut).toFixed(8));
}
return transaction;
}
private convertScriptSigAsm(hex: string): string {
const buf = Buffer.from(hex, 'hex');
const b: string[] = [];
let i = 0;
while (i < buf.length) {
const op = buf[i];
if (op >= 0x01 && op <= 0x4e) {
i++;
let push: number;
if (op === 0x4c) {
push = buf.readUInt8(i);
b.push('OP_PUSHDATA1');
i += 1;
} else if (op === 0x4d) {
push = buf.readUInt16LE(i);
b.push('OP_PUSHDATA2');
i += 2;
} else if (op === 0x4e) {
push = buf.readUInt32LE(i);
b.push('OP_PUSHDATA4');
i += 4;
} else {
push = op;
b.push('OP_PUSHBYTES_' + push);
}
const data = buf.slice(i, i + push);
if (data.length !== push) {
break;
}
b.push(data.toString('hex'));
i += data.length;
} else {
if (op === 0x00) {
b.push('OP_0');
} else if (op === 0x4f) {
b.push('OP_PUSHNUM_NEG1');
} else if (op === 0xb1) {
b.push('OP_CLTV');
} else if (op === 0xb2) {
b.push('OP_CSV');
} else if (op === 0xba) {
b.push('OP_CHECKSIGADD');
} else {
const opcode = bitcoinjs.script.toASM([ op ]);
if (opcode && op < 0xfd) {
if (/^OP_(\d+)$/.test(opcode)) {
b.push(opcode.replace(/^OP_(\d+)$/, 'OP_PUSHNUM_$1'));
} else {
b.push(opcode);
}
} else {
b.push('OP_RETURN_' + op);
}
}
i += 1;
}
}
return b.join(' ');
}
private addInnerScriptsToVin(vin: IEsploraApi.Vin): void {
if (!vin.prevout) {
return;
}
if (vin.prevout.scriptpubkey_type === 'p2sh') {
const redeemScript = vin.scriptsig_asm.split(' ').reverse()[0];
vin.inner_redeemscript_asm = this.convertScriptSigAsm(redeemScript);
if (vin.witness && vin.witness.length > 2) {
const witnessScript = vin.witness[vin.witness.length - 1];
vin.inner_witnessscript_asm = this.convertScriptSigAsm(witnessScript);
}
}
if (vin.prevout.scriptpubkey_type === 'v0_p2wsh' && vin.witness) {
const witnessScript = vin.witness[vin.witness.length - 1];
vin.inner_witnessscript_asm = this.convertScriptSigAsm(witnessScript);
}
if (vin.prevout.scriptpubkey_type === 'v1_p2tr' && vin.witness && vin.witness.length > 1) {
const witnessScript = vin.witness[vin.witness.length - 2];
vin.inner_witnessscript_asm = this.convertScriptSigAsm(witnessScript);
}
}
}
export default BitcoinApi;

View File

@@ -0,0 +1,13 @@
import config from '../../config';
const bitcoin = require('../../rpc-api/index');
import { BitcoinRpcCredentials } from './bitcoin-api-abstract-factory';
const nodeRpcCredentials: BitcoinRpcCredentials = {
host: config.CORE_RPC.HOST,
port: config.CORE_RPC.PORT,
user: config.CORE_RPC.USERNAME,
pass: config.CORE_RPC.PASSWORD,
timeout: 60000,
};
export default new bitcoin.Client(nodeRpcCredentials);

View File

@@ -0,0 +1,13 @@
import config from '../../config';
const bitcoin = require('../../rpc-api/index');
import { BitcoinRpcCredentials } from './bitcoin-api-abstract-factory';
const nodeRpcCredentials: BitcoinRpcCredentials = {
host: config.SECOND_CORE_RPC.HOST,
port: config.SECOND_CORE_RPC.PORT,
user: config.SECOND_CORE_RPC.USERNAME,
pass: config.SECOND_CORE_RPC.PASSWORD,
timeout: 60000,
};
export default new bitcoin.Client(nodeRpcCredentials);

View File

@@ -1,110 +0,0 @@
const config = require('../../../mempool-config.json');
import * as bitcoin from 'bitcoin';
import { ITransaction, IMempoolInfo, IBlock } from '../../interfaces';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
class BitcoindApi implements AbstractBitcoinApi {
client: any;
constructor() {
this.client = new bitcoin.Client({
host: config.BITCOIN_NODE_HOST,
port: config.BITCOIN_NODE_PORT,
user: config.BITCOIN_NODE_USER,
pass: config.BITCOIN_NODE_PASS,
});
}
getMempoolInfo(): Promise<IMempoolInfo> {
return new Promise((resolve, reject) => {
this.client.getMempoolInfo((err: Error, mempoolInfo: any) => {
if (err) {
return reject(err);
}
resolve(mempoolInfo);
});
});
}
getRawMempool(): Promise<ITransaction['txid'][]> {
return new Promise((resolve, reject) => {
this.client.getRawMemPool((err: Error, transactions: ITransaction['txid'][]) => {
if (err) {
return reject(err);
}
resolve(transactions);
});
});
}
getRawTransaction(txId: string): Promise<ITransaction> {
return new Promise((resolve, reject) => {
this.client.getRawTransaction(txId, true, (err: Error, txData: ITransaction) => {
if (err) {
return reject(err);
}
resolve(txData);
});
});
}
getBlockCount(): Promise<number> {
return new Promise((resolve, reject) => {
this.client.getBlockCount((err: Error, response: number) => {
if (err) {
return reject(err);
}
resolve(response);
});
});
}
getBlockAndTransactions(hash: string, verbosity: 1 | 2 = 1): Promise<IBlock> {
return new Promise((resolve, reject) => {
this.client.getBlock(hash, verbosity, (err: Error, block: IBlock) => {
if (err) {
return reject(err);
}
resolve(block);
});
});
}
getBlockHash(height: number): Promise<string> {
return new Promise((resolve, reject) => {
this.client.getBlockHash(height, (err: Error, response: string) => {
if (err) {
return reject(err);
}
resolve(response);
});
});
}
getBlock(hash: string): Promise<IBlock> {
throw new Error('Method not implemented.');
}
getBlocks(): Promise<string> {
throw new Error('Method not implemented.');
}
getBlocksFromHeight(height: number): Promise<string> {
throw new Error('Method not implemented.');
}
getBlockTransactions(hash: string): Promise<IBlock> {
throw new Error('Method not implemented.');
}
getBlockTransactionsFromIndex(hash: string, index: number): Promise<IBlock> {
throw new Error('Method not implemented.');
}
getAddress(address: string): Promise<IBlock> {
throw new Error('Method not implemented.');
}
getAddressTransactions(address: string): Promise<IBlock> {
throw new Error('Method not implemented.');
}
getAddressTransactionsFromLastSeenTxid(address: string, lastSeenTxid: string): Promise<IBlock> {
throw new Error('Method not implemented.');
}
}
export default BitcoindApi;

View File

@@ -1,229 +0,0 @@
const config = require('../../../mempool-config.json');
import { ITransaction, IMempoolInfo, IBlock } from '../../interfaces';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
import * as request from 'request';
class ElectrsApi implements AbstractBitcoinApi {
constructor() {
}
getMempoolInfo(): Promise<IMempoolInfo> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/mempool', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve({
size: response.count,
bytes: response.vsize,
});
}
});
});
}
getRawMempool(): Promise<ITransaction['txid'][]> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/mempool/txids', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getRawTransaction(txId: string): Promise<ITransaction> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/tx/' + txId, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
response.vsize = Math.round(response.weight / 4);
response.fee = response.fee / 100000000;
response.blockhash = response.status.block_hash;
resolve(response);
}
});
});
}
getBlockCount(): Promise<number> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/blocks/tip/height', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlockAndTransactions(hash: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/block/' + hash, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
request(config.ELECTRS_API_URL + '/block/' + hash + '/txids', { json: true, timeout: 10000 }, (err2, res2, response2) => {
if (err2) {
reject(err2);
} else if (res.statusCode !== 200) {
reject(response);
} else {
const block = response;
block.hash = hash;
block.nTx = block.tx_count;
block.time = block.timestamp;
block.tx = response2;
resolve(block);
}
});
}
});
});
}
getBlockHash(height: number): Promise<string> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/block-height/' + height, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlocks(): Promise<string> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/blocks', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlocksFromHeight(height: number): Promise<string> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/blocks/' + height, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlock(hash: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/block/' + hash, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlockTransactions(hash: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/block/' + hash + '/txs', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getBlockTransactionsFromIndex(hash: string, index: number): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/block/' + hash + '/txs/' + index, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getAddress(address: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/address/' + address, { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getAddressTransactions(address: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/address/' + address + '/txs', { json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
getAddressTransactionsFromLastSeenTxid(address: string, lastSeenTxid: string): Promise<IBlock> {
return new Promise((resolve, reject) => {
request(config.ELECTRS_API_URL + '/address/' + address + '/txs/chain/' + lastSeenTxid,
{ json: true, timeout: 10000 }, (err, res, response) => {
if (err) {
reject(err);
} else if (res.statusCode !== 200) {
reject(response);
} else {
resolve(response);
}
});
});
}
}
export default ElectrsApi;

View File

@@ -0,0 +1,12 @@
export namespace IElectrumApi {
export interface ScriptHashBalance {
confirmed: number;
unconfirmed: number;
}
export interface ScriptHashHistory {
height: number;
tx_hash: string;
fee?: number;
}
}

View File

@@ -0,0 +1,153 @@
import config from '../../config';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
import { IEsploraApi } from './esplora-api.interface';
import { IElectrumApi } from './electrum-api.interface';
import BitcoinApi from './bitcoin-api';
import logger from '../../logger';
import * as ElectrumClient from '@mempool/electrum-client';
import * as sha256 from 'crypto-js/sha256';
import * as hexEnc from 'crypto-js/enc-hex';
import loadingIndicators from '../loading-indicators';
import memoryCache from '../memory-cache';
class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
private electrumClient: any;
constructor(bitcoinClient: any) {
super(bitcoinClient);
const electrumConfig = { client: 'mempool-v2', version: '1.4' };
const electrumPersistencePolicy = { retryPeriod: 10000, maxRetry: 1000, callback: null };
const electrumCallbacks = {
onConnect: (client, versionInfo) => { logger.info(`Connected to Electrum Server at ${config.ELECTRUM.HOST}:${config.ELECTRUM.PORT} (${JSON.stringify(versionInfo)})`); },
onClose: (client) => { logger.info(`Disconnected from Electrum Server at ${config.ELECTRUM.HOST}:${config.ELECTRUM.PORT}`); },
onError: (err) => { logger.err(`Electrum error: ${JSON.stringify(err)}`); },
onLog: (str) => { logger.debug(str); },
};
this.electrumClient = new ElectrumClient(
config.ELECTRUM.PORT,
config.ELECTRUM.HOST,
config.ELECTRUM.TLS_ENABLED ? 'tls' : 'tcp',
null,
electrumCallbacks
);
this.electrumClient.initElectrum(electrumConfig, electrumPersistencePolicy)
.then(() => {})
.catch((err) => {
logger.err(`Error connecting to Electrum Server at ${config.ELECTRUM.HOST}:${config.ELECTRUM.PORT}`);
});
}
async $getAddress(address: string): Promise<IEsploraApi.Address> {
const addressInfo = await this.bitcoindClient.validateAddress(address);
if (!addressInfo || !addressInfo.isvalid) {
return ({
'address': address,
'chain_stats': {
'funded_txo_count': 0,
'funded_txo_sum': 0,
'spent_txo_count': 0,
'spent_txo_sum': 0,
'tx_count': 0
},
'mempool_stats': {
'funded_txo_count': 0,
'funded_txo_sum': 0,
'spent_txo_count': 0,
'spent_txo_sum': 0,
'tx_count': 0
}
});
}
try {
const balance = await this.$getScriptHashBalance(addressInfo.scriptPubKey);
const history = await this.$getScriptHashHistory(addressInfo.scriptPubKey);
const unconfirmed = history.filter((h) => h.fee).length;
return {
'address': addressInfo.address,
'chain_stats': {
'funded_txo_count': 0,
'funded_txo_sum': balance.confirmed ? balance.confirmed : 0,
'spent_txo_count': 0,
'spent_txo_sum': balance.confirmed < 0 ? balance.confirmed : 0,
'tx_count': history.length - unconfirmed,
},
'mempool_stats': {
'funded_txo_count': 0,
'funded_txo_sum': balance.unconfirmed > 0 ? balance.unconfirmed : 0,
'spent_txo_count': 0,
'spent_txo_sum': balance.unconfirmed < 0 ? -balance.unconfirmed : 0,
'tx_count': unconfirmed,
},
'electrum': true,
};
} catch (e: any) {
throw new Error(typeof e === 'string' ? e : e && e.message || e);
}
}
async $getAddressTransactions(address: string, lastSeenTxId: string): Promise<IEsploraApi.Transaction[]> {
const addressInfo = await this.bitcoindClient.validateAddress(address);
if (!addressInfo || !addressInfo.isvalid) {
return [];
}
try {
loadingIndicators.setProgress('address-' + address, 0);
const transactions: IEsploraApi.Transaction[] = [];
const history = await this.$getScriptHashHistory(addressInfo.scriptPubKey);
history.sort((a, b) => (b.height || 9999999) - (a.height || 9999999));
let startingIndex = 0;
if (lastSeenTxId) {
const pos = history.findIndex((historicalTx) => historicalTx.tx_hash === lastSeenTxId);
if (pos) {
startingIndex = pos + 1;
}
}
const endIndex = Math.min(startingIndex + 10, history.length);
for (let i = startingIndex; i < endIndex; i++) {
const tx = await this.$getRawTransaction(history[i].tx_hash, false, true);
transactions.push(tx);
loadingIndicators.setProgress('address-' + address, (i + 1) / endIndex * 100);
}
return transactions;
} catch (e: any) {
loadingIndicators.setProgress('address-' + address, 100);
throw new Error(typeof e === 'string' ? e : e && e.message || e);
}
}
private $getScriptHashBalance(scriptHash: string): Promise<IElectrumApi.ScriptHashBalance> {
return this.electrumClient.blockchainScripthash_getBalance(this.encodeScriptHash(scriptHash));
}
private $getScriptHashHistory(scriptHash: string): Promise<IElectrumApi.ScriptHashHistory[]> {
const fromCache = memoryCache.get<IElectrumApi.ScriptHashHistory[]>('Scripthash_getHistory', scriptHash);
if (fromCache) {
return Promise.resolve(fromCache);
}
return this.electrumClient.blockchainScripthash_getHistory(this.encodeScriptHash(scriptHash))
.then((history) => {
memoryCache.set('Scripthash_getHistory', scriptHash, history, 2);
return history;
});
}
private encodeScriptHash(scriptPubKey: string): string {
const addrScripthash = hexEnc.stringify(sha256(hexEnc.parse(scriptPubKey)));
return addrScripthash.match(/.{2}/g).reverse().join('');
}
}
export default BitcoindElectrsApi;

View File

@@ -0,0 +1,172 @@
export namespace IEsploraApi {
export interface Transaction {
txid: string;
version: number;
locktime: number;
size: number;
weight: number;
fee: number;
vin: Vin[];
vout: Vout[];
status: Status;
hex?: string;
}
export interface Recent {
txid: string;
fee: number;
vsize: number;
value: number;
}
export interface Vin {
txid: string;
vout: number;
is_coinbase: boolean;
scriptsig: string;
scriptsig_asm: string;
inner_redeemscript_asm?: string;
inner_witnessscript_asm?: string;
sequence: any;
witness?: string[];
prevout: Vout | null;
// Elements
is_pegin?: boolean;
issuance?: Issuance;
// Custom
lazy?: boolean;
}
interface Issuance {
asset_id: string;
is_reissuance: string;
asset_blinding_nonce: string;
asset_entropy: string;
contract_hash: string;
assetamount?: number;
assetamountcommitment?: string;
tokenamount?: number;
tokenamountcommitment?: string;
}
export interface Vout {
scriptpubkey: string;
scriptpubkey_asm: string;
scriptpubkey_type: string;
scriptpubkey_address: string;
value: number;
// Elements
valuecommitment?: number;
asset?: string;
pegout?: Pegout;
}
interface Pegout {
genesis_hash: string;
scriptpubkey: string;
scriptpubkey_asm: string;
scriptpubkey_address: string;
}
export interface Status {
confirmed: boolean;
block_height?: number;
block_hash?: string;
block_time?: number;
}
export interface Block {
id: string;
height: number;
version: number;
timestamp: number;
bits: number;
nonce: number;
difficulty: number;
merkle_root: string;
tx_count: number;
size: number;
weight: number;
previousblockhash: string;
}
export interface Address {
address: string;
chain_stats: ChainStats;
mempool_stats: MempoolStats;
electrum?: boolean;
}
export interface ChainStats {
funded_txo_count: number;
funded_txo_sum: number;
spent_txo_count: number;
spent_txo_sum: number;
tx_count: number;
}
export interface MempoolStats {
funded_txo_count: number;
funded_txo_sum: number;
spent_txo_count: number;
spent_txo_sum: number;
tx_count: number;
}
export interface Outspend {
spent: boolean;
txid?: string;
vin?: number;
status?: Status;
}
export interface Asset {
asset_id: string;
issuance_txin: IssuanceTxin;
issuance_prevout: IssuancePrevout;
reissuance_token: string;
contract_hash: string;
status: Status;
chain_stats: AssetStats;
mempool_stats: AssetStats;
}
export interface AssetExtended extends Asset {
name: string;
ticker: string;
precision: number;
entity: Entity;
version: number;
issuer_pubkey: string;
}
export interface Entity {
domain: string;
}
interface IssuanceTxin {
txid: string;
vin: number;
}
interface IssuancePrevout {
txid: string;
vout: number;
}
interface AssetStats {
tx_count: number;
issuance_count: number;
issued_amount: number;
burned_amount: number;
has_blinded_issuances: boolean;
reissuance_tokens: number;
burned_reissuance_tokens: number;
peg_in_count: number;
peg_in_amount: number;
peg_out_count: number;
peg_out_amount: number;
burn_count: number;
}
}

View File

@@ -0,0 +1,69 @@
import config from '../../config';
import axios, { AxiosRequestConfig } from 'axios';
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
import { IEsploraApi } from './esplora-api.interface';
class ElectrsApi implements AbstractBitcoinApi {
axiosConfig: AxiosRequestConfig = {
timeout: 10000,
};
constructor() { }
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]> {
return axios.get<IEsploraApi.Transaction['txid'][]>(config.ESPLORA.REST_API_URL + '/mempool/txids', this.axiosConfig)
.then((response) => response.data);
}
$getRawTransaction(txId: string): Promise<IEsploraApi.Transaction> {
return axios.get<IEsploraApi.Transaction>(config.ESPLORA.REST_API_URL + '/tx/' + txId, this.axiosConfig)
.then((response) => response.data);
}
$getBlockHeightTip(): Promise<number> {
return axios.get<number>(config.ESPLORA.REST_API_URL + '/blocks/tip/height', this.axiosConfig)
.then((response) => response.data);
}
$getTxIdsForBlock(hash: string): Promise<string[]> {
return axios.get<string[]>(config.ESPLORA.REST_API_URL + '/block/' + hash + '/txids', this.axiosConfig)
.then((response) => response.data);
}
$getBlockHash(height: number): Promise<string> {
return axios.get<string>(config.ESPLORA.REST_API_URL + '/block-height/' + height, this.axiosConfig)
.then((response) => response.data);
}
$getBlockHeader(hash: string): Promise<string> {
return axios.get<string>(config.ESPLORA.REST_API_URL + '/block/' + hash + '/header', this.axiosConfig)
.then((response) => response.data);
}
$getBlock(hash: string): Promise<IEsploraApi.Block> {
return axios.get<IEsploraApi.Block>(config.ESPLORA.REST_API_URL + '/block/' + hash, this.axiosConfig)
.then((response) => response.data);
}
$getAddress(address: string): Promise<IEsploraApi.Address> {
throw new Error('Method getAddress not implemented.');
}
$getAddressTransactions(address: string, txId?: string): Promise<IEsploraApi.Transaction[]> {
throw new Error('Method getAddressTransactions not implemented.');
}
$getAddressPrefix(prefix: string): string[] {
throw new Error('Method not implemented.');
}
$sendRawTransaction(rawTransaction: string): Promise<string> {
throw new Error('Method not implemented.');
}
$getOutspends(): Promise<IEsploraApi.Outspend[]> {
throw new Error('Method not implemented.');
}
}
export default ElectrsApi;

View File

@@ -1,214 +1,499 @@
const config = require('../../mempool-config.json');
import config from '../config';
import bitcoinApi from './bitcoin/bitcoin-api-factory';
import { DB } from '../database';
import { IBlock, ITransaction } from '../interfaces';
import logger from '../logger';
import memPool from './mempool';
import { BlockExtended, PoolTag, TransactionExtended, TransactionMinerInfo } from '../mempool.interfaces';
import { Common } from './common';
import diskCache from './disk-cache';
import transactionUtils from './transaction-utils';
import bitcoinClient from './bitcoin/bitcoin-client';
import { IEsploraApi } from './bitcoin/esplora-api.interface';
import poolsRepository from '../repositories/PoolsRepository';
import blocksRepository from '../repositories/BlocksRepository';
import loadingIndicators from './loading-indicators';
import BitcoinApi from './bitcoin/bitcoin-api';
import { prepareBlock } from '../utils/blocks-utils';
import BlocksRepository from '../repositories/BlocksRepository';
import HashratesRepository from '../repositories/HashratesRepository';
import indexer from '../indexer';
import fiatConversion from './fiat-conversion';
import RatesRepository from '../repositories/RatesRepository';
import poolsParser from './pools-parser';
class Blocks {
private blocks: IBlock[] = [];
private newBlockCallback: Function | undefined;
private blocks: BlockExtended[] = [];
private currentBlockHeight = 0;
private currentDifficulty = 0;
private lastDifficultyAdjustmentTime = 0;
private previousDifficultyRetarget = 0;
private newBlockCallbacks: ((block: BlockExtended, txIds: string[], transactions: TransactionExtended[]) => void)[] = [];
constructor() {
setInterval(this.$clearOldTransactionsAndBlocksFromDatabase.bind(this), 86400000);
}
constructor() { }
public setNewBlockCallback(fn: Function) {
this.newBlockCallback = fn;
}
public getBlocks(): IBlock[] {
public getBlocks(): BlockExtended[] {
return this.blocks;
}
public formatBlock(block: IBlock) {
return {
hash: block.hash,
height: block.height,
nTx: block.nTx - 1,
size: block.size,
time: block.time,
weight: block.weight,
fees: block.fees,
minFee: block.minFee,
maxFee: block.maxFee,
medianFee: block.medianFee,
};
public setBlocks(blocks: BlockExtended[]) {
this.blocks = blocks;
}
public async updateBlocks() {
try {
const blockCount = await bitcoinApi.getBlockCount();
public setNewBlockCallback(fn: (block: BlockExtended, txIds: string[], transactions: TransactionExtended[]) => void) {
this.newBlockCallbacks.push(fn);
}
if (this.blocks.length === 0) {
this.currentBlockHeight = blockCount - config.INITIAL_BLOCK_AMOUNT;
} else {
this.currentBlockHeight = this.blocks[this.blocks.length - 1].height;
/**
* Return the list of transaction for a block
* @param blockHash
* @param blockHeight
* @param onlyCoinbase - Set to true if you only need the coinbase transaction
* @returns Promise<TransactionExtended[]>
*/
private async $getTransactionsExtended(
blockHash: string,
blockHeight: number,
onlyCoinbase: boolean,
quiet: boolean = false,
): Promise<TransactionExtended[]> {
const transactions: TransactionExtended[] = [];
const txIds: string[] = await bitcoinApi.$getTxIdsForBlock(blockHash);
const mempool = memPool.getMempool();
let transactionsFound = 0;
let transactionsFetched = 0;
for (let i = 0; i < txIds.length; i++) {
if (mempool[txIds[i]]) {
// We update blocks before the mempool (index.ts), therefore we can
// optimize here by directly fetching txs in the "outdated" mempool
transactions.push(mempool[txIds[i]]);
transactionsFound++;
} else if (config.MEMPOOL.BACKEND === 'esplora' || !memPool.hasPriority() || i === 0) {
// Otherwise we fetch the tx data through backend services (esplora, electrum, core rpc...)
if (!quiet && (i % (Math.round((txIds.length) / 10)) === 0 || i + 1 === txIds.length)) { // Avoid log spam
logger.debug(`Indexing tx ${i + 1} of ${txIds.length} in block #${blockHeight}`);
}
try {
const tx = await transactionUtils.$getTransactionExtended(txIds[i]);
transactions.push(tx);
transactionsFetched++;
} catch (e) {
if (i === 0) {
const msg = `Cannot fetch coinbase tx ${txIds[i]}. Reason: ` + (e instanceof Error ? e.message : e);
logger.err(msg);
throw new Error(msg);
} else {
logger.err(`Cannot fetch tx ${txIds[i]}. Reason: ` + (e instanceof Error ? e.message : e));
}
}
}
while (this.currentBlockHeight < blockCount) {
this.currentBlockHeight++;
if (onlyCoinbase === true) {
break; // Fetch the first transaction and exit
}
}
let block: IBlock | undefined;
transactions.forEach((tx) => {
if (!tx.cpfpChecked) {
Common.setRelativesAndGetCpfpInfo(tx, mempool); // Child Pay For Parent
}
});
const storedBlock = await this.$getBlockFromDatabase(this.currentBlockHeight);
if (storedBlock) {
block = storedBlock;
if (!quiet) {
logger.debug(`${transactionsFound} of ${txIds.length} found in mempool. ${transactionsFetched} fetched through backend service.`);
}
return transactions;
}
/**
* Return a block with additional data (reward, coinbase, fees...)
* @param block
* @param transactions
* @returns BlockExtended
*/
private async $getBlockExtended(block: IEsploraApi.Block, transactions: TransactionExtended[]): Promise<BlockExtended> {
const blockExtended: BlockExtended = Object.assign({ extras: {} }, block);
blockExtended.extras.reward = transactions[0].vout.reduce((acc, curr) => acc + curr.value, 0);
blockExtended.extras.coinbaseTx = transactionUtils.stripCoinbaseTransaction(transactions[0]);
blockExtended.extras.coinbaseRaw = blockExtended.extras.coinbaseTx.vin[0].scriptsig;
if (block.height === 0) {
blockExtended.extras.medianFee = 0; // 50th percentiles
blockExtended.extras.feeRange = [0, 0, 0, 0, 0, 0, 0];
blockExtended.extras.totalFees = 0;
blockExtended.extras.avgFee = 0;
blockExtended.extras.avgFeeRate = 0;
} else {
const stats = await bitcoinClient.getBlockStats(block.id, [
'feerate_percentiles', 'minfeerate', 'maxfeerate', 'totalfee', 'avgfee', 'avgfeerate'
]);
blockExtended.extras.medianFee = stats.feerate_percentiles[2]; // 50th percentiles
blockExtended.extras.feeRange = [stats.minfeerate, stats.feerate_percentiles, stats.maxfeerate].flat();
blockExtended.extras.totalFees = stats.totalfee;
blockExtended.extras.avgFee = stats.avgfee;
blockExtended.extras.avgFeeRate = stats.avgfeerate;
}
if (['mainnet', 'testnet', 'signet', 'regtest'].includes(config.MEMPOOL.NETWORK)) {
let pool: PoolTag;
if (blockExtended.extras?.coinbaseTx !== undefined) {
pool = await this.$findBlockMiner(blockExtended.extras?.coinbaseTx);
} else {
if (config.DATABASE.ENABLED === true) {
pool = await poolsRepository.$getUnknownPool();
} else {
const blockHash = await bitcoinApi.getBlockHash(this.currentBlockHeight);
block = await bitcoinApi.getBlockAndTransactions(blockHash);
pool = poolsParser.unknownPool;
}
}
const coinbase = await memPool.getRawTransaction(block.tx[0], true);
if (coinbase && coinbase.totalOut) {
block.fees = coinbase.totalOut;
if (!pool) { // We should never have this situation in practise
logger.warn(`Cannot assign pool to block ${blockExtended.height} and 'unknown' pool does not exist. ` +
`Check your "pools" table entries`);
return blockExtended;
}
blockExtended.extras.pool = {
id: pool.id,
name: pool.name,
slug: pool.slug,
};
}
return blockExtended;
}
/**
* Try to find which miner found the block
* @param txMinerInfo
* @returns
*/
private async $findBlockMiner(txMinerInfo: TransactionMinerInfo | undefined): Promise<PoolTag> {
if (txMinerInfo === undefined || txMinerInfo.vout.length < 1) {
if (config.DATABASE.ENABLED === true) {
return await poolsRepository.$getUnknownPool();
} else {
return poolsParser.unknownPool;
}
}
const asciiScriptSig = transactionUtils.hex2ascii(txMinerInfo.vin[0].scriptsig);
const address = txMinerInfo.vout[0].scriptpubkey_address;
let pools: PoolTag[] = [];
if (config.DATABASE.ENABLED === true) {
pools = await poolsRepository.$getPools();
} else {
pools = poolsParser.miningPools;
}
for (let i = 0; i < pools.length; ++i) {
if (address !== undefined) {
const addresses: string[] = JSON.parse(pools[i].addresses);
if (addresses.indexOf(address) !== -1) {
return pools[i];
}
}
const regexes: string[] = JSON.parse(pools[i].regexes);
for (let y = 0; y < regexes.length; ++y) {
const regex = new RegExp(regexes[y], 'i');
const match = asciiScriptSig.match(regex);
if (match !== null) {
return pools[i];
}
}
}
if (config.DATABASE.ENABLED === true) {
return await poolsRepository.$getUnknownPool();
} else {
return poolsParser.unknownPool;
}
}
/**
* [INDEXING] Index all blocks metadata for the mining dashboard
*/
public async $generateBlockDatabase() {
const blockchainInfo = await bitcoinClient.getBlockchainInfo();
if (blockchainInfo.blocks !== blockchainInfo.headers) { // Wait for node to sync
return;
}
try {
let currentBlockHeight = blockchainInfo.blocks;
let indexingBlockAmount = Math.min(config.MEMPOOL.INDEXING_BLOCKS_AMOUNT, blockchainInfo.blocks);
if (indexingBlockAmount <= -1) {
indexingBlockAmount = currentBlockHeight + 1;
}
const lastBlockToIndex = Math.max(0, currentBlockHeight - indexingBlockAmount + 1);
logger.debug(`Indexing blocks from #${currentBlockHeight} to #${lastBlockToIndex}`);
loadingIndicators.setProgress('block-indexing', 0);
const chunkSize = 10000;
let totalIndexed = await blocksRepository.$blockCountBetweenHeight(currentBlockHeight, lastBlockToIndex);
let indexedThisRun = 0;
let newlyIndexed = 0;
const startedAt = new Date().getTime() / 1000;
let timer = new Date().getTime() / 1000;
while (currentBlockHeight >= lastBlockToIndex) {
const endBlock = Math.max(0, lastBlockToIndex, currentBlockHeight - chunkSize + 1);
const missingBlockHeights: number[] = await blocksRepository.$getMissingBlocksBetweenHeights(
currentBlockHeight, endBlock);
if (missingBlockHeights.length <= 0) {
currentBlockHeight -= chunkSize;
continue;
}
logger.info(`Indexing ${missingBlockHeights.length} blocks from #${currentBlockHeight} to #${endBlock}`);
for (const blockHeight of missingBlockHeights) {
if (blockHeight < lastBlockToIndex) {
break;
}
++indexedThisRun;
++totalIndexed;
const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer));
if (elapsedSeconds > 5 || blockHeight === lastBlockToIndex) {
const runningFor = Math.max(1, Math.round((new Date().getTime() / 1000) - startedAt));
const blockPerSeconds = Math.max(1, Math.round(indexedThisRun / elapsedSeconds));
const progress = Math.round(totalIndexed / indexingBlockAmount * 10000) / 100;
const timeLeft = Math.round((indexingBlockAmount - totalIndexed) / blockPerSeconds);
logger.debug(`Indexing block #${blockHeight} | ~${blockPerSeconds.toFixed(2)} blocks/sec | total: ${totalIndexed}/${indexingBlockAmount} (${progress}%) | elapsed: ${runningFor} seconds | left: ~${timeLeft} seconds`);
timer = new Date().getTime() / 1000;
indexedThisRun = 0;
loadingIndicators.setProgress('block-indexing', progress, false);
}
const blockHash = await bitcoinApi.$getBlockHash(blockHeight);
const block = BitcoinApi.convertBlock(await bitcoinClient.getBlock(blockHash));
const transactions = await this.$getTransactionsExtended(blockHash, block.height, true, true);
const blockExtended = await this.$getBlockExtended(block, transactions);
const mempool = memPool.getMempool();
let found = 0;
let notFound = 0;
newlyIndexed++;
await blocksRepository.$saveBlockInDatabase(blockExtended);
}
let transactions: ITransaction[] = [];
currentBlockHeight -= chunkSize;
}
logger.info(`Indexed ${newlyIndexed} blocks`);
loadingIndicators.setProgress('block-indexing', 100);
} catch (e) {
logger.err('Block indexing failed. Trying again later. Reason: ' + (e instanceof Error ? e.message : e));
loadingIndicators.setProgress('block-indexing', 100);
return;
}
for (let i = 1; i < block.tx.length; i++) {
if (mempool[block.tx[i]]) {
transactions.push(mempool[block.tx[i]]);
found++;
} else {
console.log(`Fetching block tx ${i} of ${block.tx.length}`);
const tx = await memPool.getRawTransaction(block.tx[i]);
if (tx) {
transactions.push(tx);
}
notFound++;
const chainValid = await BlocksRepository.$validateChain();
if (!chainValid) {
indexer.reindex();
}
}
public async $updateBlocks() {
let fastForwarded = false;
const blockHeightTip = await bitcoinApi.$getBlockHeightTip();
if (this.blocks.length === 0) {
this.currentBlockHeight = Math.max(blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT, -1);
} else {
this.currentBlockHeight = this.blocks[this.blocks.length - 1].height;
}
if (blockHeightTip - this.currentBlockHeight > config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 2) {
logger.info(`${blockHeightTip - this.currentBlockHeight} blocks since tip. Fast forwarding to the ${config.MEMPOOL.INITIAL_BLOCKS_AMOUNT} recent blocks`);
this.currentBlockHeight = blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT;
fastForwarded = true;
logger.info(`Re-indexing skipped blocks and corresponding hashrates data`);
indexer.reindex(); // Make sure to index the skipped blocks #1619
}
if (!this.lastDifficultyAdjustmentTime) {
const blockchainInfo = await bitcoinClient.getBlockchainInfo();
if (blockchainInfo.blocks === blockchainInfo.headers) {
const heightDiff = blockHeightTip % 2016;
const blockHash = await bitcoinApi.$getBlockHash(blockHeightTip - heightDiff);
const block = BitcoinApi.convertBlock(await bitcoinClient.getBlock(blockHash));
this.lastDifficultyAdjustmentTime = block.timestamp;
this.currentDifficulty = block.difficulty;
if (blockHeightTip >= 2016) {
const previousPeriodBlockHash = await bitcoinApi.$getBlockHash(blockHeightTip - heightDiff - 2016);
const previousPeriodBlock = await bitcoinApi.$getBlock(previousPeriodBlockHash);
this.previousDifficultyRetarget = (block.difficulty - previousPeriodBlock.difficulty) / previousPeriodBlock.difficulty * 100;
logger.debug(`Initial difficulty adjustment data set.`);
}
} else {
logger.debug(`Blockchain headers (${blockchainInfo.headers}) and blocks (${blockchainInfo.blocks}) not in sync. Waiting...`);
}
}
while (this.currentBlockHeight < blockHeightTip) {
if (this.currentBlockHeight < blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT) {
this.currentBlockHeight = blockHeightTip;
} else {
this.currentBlockHeight++;
logger.debug(`New block found (#${this.currentBlockHeight})!`);
}
const blockHash = await bitcoinApi.$getBlockHash(this.currentBlockHeight);
const block = BitcoinApi.convertBlock(await bitcoinClient.getBlock(blockHash));
const txIds: string[] = await bitcoinApi.$getTxIdsForBlock(blockHash);
const transactions = await this.$getTransactionsExtended(blockHash, block.height, false);
const blockExtended: BlockExtended = await this.$getBlockExtended(block, transactions);
if (Common.indexingEnabled()) {
if (!fastForwarded) {
const lastBlock = await blocksRepository.$getBlockByHeight(blockExtended.height - 1);
if (lastBlock !== null && blockExtended.previousblockhash !== lastBlock['hash']) {
logger.warn(`Chain divergence detected at block ${lastBlock['height']}, re-indexing most recent data`);
// We assume there won't be a reorg with more than 10 block depth
await BlocksRepository.$deleteBlocksFrom(lastBlock['height'] - 10);
await HashratesRepository.$deleteLastEntries();
for (let i = 10; i >= 0; --i) {
await this.$indexBlock(lastBlock['height'] - i);
}
}
transactions.sort((a, b) => b.feePerVsize - a.feePerVsize);
transactions = transactions.filter((tx: ITransaction) => tx.feePerVsize);
block.minFee = transactions[transactions.length - 1] ? transactions[transactions.length - 1].feePerVsize : 0;
block.maxFee = transactions[0] ? transactions[0].feePerVsize : 0;
block.medianFee = this.median(transactions.map((tx) => tx.feePerVsize));
console.log(`New block found (#${this.currentBlockHeight})! `
+ `${found} of ${block.tx.length} found in mempool. ${notFound} not found.`);
if (this.newBlockCallback) {
this.newBlockCallback(block);
}
this.$saveBlockToDatabase(block);
this.$saveTransactionsToDatabase(block.height, transactions);
await blocksRepository.$saveBlockInDatabase(blockExtended);
}
}
if (fiatConversion.ratesInitialized === true && config.DATABASE.ENABLED === true) {
await RatesRepository.$saveRate(blockExtended.height, fiatConversion.getConversionRates());
}
this.blocks.push(block);
if (this.blocks.length > config.KEEP_BLOCK_AMOUNT) {
this.blocks.shift();
if (block.height % 2016 === 0) {
this.previousDifficultyRetarget = (block.difficulty - this.currentDifficulty) / this.currentDifficulty * 100;
this.lastDifficultyAdjustmentTime = block.timestamp;
this.currentDifficulty = block.difficulty;
}
this.blocks.push(blockExtended);
if (this.blocks.length > config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 4) {
this.blocks = this.blocks.slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 4);
}
if (this.newBlockCallbacks.length) {
this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions));
}
if (!memPool.hasPriority()) {
diskCache.$saveCacheToDisk();
}
}
}
/**
* Index a block if it's missing from the database. Returns the block after indexing
*/
public async $indexBlock(height: number): Promise<BlockExtended> {
const dbBlock = await blocksRepository.$getBlockByHeight(height);
if (dbBlock != null) {
return prepareBlock(dbBlock);
}
const blockHash = await bitcoinApi.$getBlockHash(height);
const block = BitcoinApi.convertBlock(await bitcoinClient.getBlock(blockHash));
const transactions = await this.$getTransactionsExtended(blockHash, block.height, true);
const blockExtended = await this.$getBlockExtended(block, transactions);
await blocksRepository.$saveBlockInDatabase(blockExtended);
return prepareBlock(blockExtended);
}
/**
* Index a block by hash if it's missing from the database. Returns the block after indexing
*/
public async $getBlock(hash: string): Promise<BlockExtended | IEsploraApi.Block> {
// Check the memory cache
const blockByHash = this.getBlocks().find((b) => b.id === hash);
if (blockByHash) {
return blockByHash;
}
// Block has already been indexed
if (Common.indexingEnabled()) {
const dbBlock = await blocksRepository.$getBlockByHash(hash);
if (dbBlock != null) {
return prepareBlock(dbBlock);
}
}
const block = await bitcoinApi.$getBlock(hash);
// Not Bitcoin network, return the block as it
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) === false) {
return block;
}
// Bitcoin network, add our custom data on top
const transactions = await this.$getTransactionsExtended(hash, block.height, true);
const blockExtended = await this.$getBlockExtended(block, transactions);
if (Common.indexingEnabled()) {
delete(blockExtended['coinbaseTx']);
await blocksRepository.$saveBlockInDatabase(blockExtended);
}
return blockExtended;
}
public async $getBlocks(fromHeight?: number, limit: number = 15): Promise<BlockExtended[]> {
try {
let currentHeight = fromHeight !== undefined ? fromHeight : this.getCurrentBlockHeight();
const returnBlocks: BlockExtended[] = [];
if (currentHeight < 0) {
return returnBlocks;
}
if (currentHeight === 0 && Common.indexingEnabled()) {
currentHeight = await blocksRepository.$mostRecentBlockHeight();
}
// Check if block height exist in local cache to skip the hash lookup
const blockByHeight = this.getBlocks().find((b) => b.height === currentHeight);
let startFromHash: string | null = null;
if (blockByHeight) {
startFromHash = blockByHeight.id;
} else if (!Common.indexingEnabled()) {
startFromHash = await bitcoinApi.$getBlockHash(currentHeight);
}
let nextHash = startFromHash;
for (let i = 0; i < limit && currentHeight >= 0; i++) {
let block = this.getBlocks().find((b) => b.height === currentHeight);
if (block) {
returnBlocks.push(block);
} else if (Common.indexingEnabled()) {
block = await this.$indexBlock(currentHeight);
returnBlocks.push(block);
} else if (nextHash != null) {
block = prepareBlock(await bitcoinApi.$getBlock(nextHash));
nextHash = block.previousblockhash;
returnBlocks.push(block);
}
}
} catch (err) {
console.log('Error getBlockCount', err);
}
}
private async $getBlockFromDatabase(height: number): Promise<IBlock | undefined> {
try {
const connection = await DB.pool.getConnection();
const query = `
SELECT * FROM blocks WHERE height = ?
`;
const [rows] = await connection.query<any>(query, [height]);
connection.release();
if (rows[0]) {
return rows[0];
}
} catch (e) {
console.log('$get() block error', e);
}
}
private async $saveBlockToDatabase(block: IBlock) {
try {
const connection = await DB.pool.getConnection();
const query = `
INSERT IGNORE INTO blocks
(height, hash, size, weight, minFee, maxFee, time, fees, nTx, medianFee)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`;
const params: (any)[] = [
block.height,
block.hash,
block.size,
block.weight,
block.minFee,
block.maxFee,
block.time,
block.fees,
block.nTx - 1,
block.medianFee,
];
await connection.query(query, params);
connection.release();
} catch (e) {
console.log('$create() block error', e);
}
}
private async $saveTransactionsToDatabase(blockheight: number, transactions: ITransaction[]) {
try {
const connection = await DB.pool.getConnection();
for (let i = 0; i < transactions.length; i++) {
const query = `
INSERT IGNORE INTO transactions
(blockheight, txid, fee, feePerVsize)
VALUES(?, ?, ?, ?)
`;
const params: (any)[] = [
blockheight,
transactions[i].txid,
transactions[i].fee,
transactions[i].feePerVsize,
];
await connection.query(query, params);
currentHeight--;
}
connection.release();
return returnBlocks;
} catch (e) {
console.log('$create() transaction error', e);
throw e;
}
}
private async $clearOldTransactionsAndBlocksFromDatabase() {
try {
const connection = await DB.pool.getConnection();
let query = `DELETE FROM blocks WHERE height < ?`;
await connection.query<any>(query, [this.currentBlockHeight - config.KEEP_BLOCK_AMOUNT]);
query = `DELETE FROM transactions WHERE blockheight < ?`;
await connection.query<any>(query, [this.currentBlockHeight - config.KEEP_BLOCK_AMOUNT]);
connection.release();
} catch (e) {
console.log('$clearOldTransactionsFromDatabase() error', e);
}
public getLastDifficultyAdjustmentTime(): number {
return this.lastDifficultyAdjustmentTime;
}
private median(numbers: number[]) {
if (!numbers.length) { return 0; }
let medianNr = 0;
const numsLen = numbers.length;
if (numsLen % 2 === 0) {
medianNr = (numbers[numsLen / 2 - 1] + numbers[numsLen / 2]) / 2;
} else {
medianNr = numbers[(numsLen - 1) / 2];
}
return medianNr;
public getPreviousDifficultyRetarget(): number {
return this.previousDifficultyRetarget;
}
public getCurrentBlockHeight(): number {
return this.currentBlockHeight;
}
}

180
backend/src/api/common.ts Normal file
View File

@@ -0,0 +1,180 @@
import { CpfpInfo, TransactionExtended, TransactionStripped } from '../mempool.interfaces';
import config from '../config';
export class Common {
static nativeAssetId = config.MEMPOOL.NETWORK === 'liquidtestnet' ?
'144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49'
: '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d';
static _isLiquid = config.MEMPOOL.NETWORK === 'liquid' || config.MEMPOOL.NETWORK === 'liquidtestnet';
static isLiquid(): boolean {
return this._isLiquid;
}
static median(numbers: number[]) {
let medianNr = 0;
const numsLen = numbers.length;
if (numsLen % 2 === 0) {
medianNr = (numbers[numsLen / 2 - 1] + numbers[numsLen / 2]) / 2;
} else {
medianNr = numbers[(numsLen - 1) / 2];
}
return medianNr;
}
static percentile(numbers: number[], percentile: number) {
if (percentile === 50) {
return this.median(numbers);
}
const index = Math.ceil(numbers.length * (100 - percentile) * 1e-2);
if (index < 0 || index > numbers.length - 1) {
return 0;
}
return numbers[index];
}
static getFeesInRange(transactions: TransactionExtended[], rangeLength: number) {
const arr = [transactions[transactions.length - 1].effectiveFeePerVsize];
const chunk = 1 / (rangeLength - 1);
let itemsToAdd = rangeLength - 2;
while (itemsToAdd > 0) {
arr.push(transactions[Math.floor(transactions.length * chunk * itemsToAdd)].effectiveFeePerVsize);
itemsToAdd--;
}
arr.push(transactions[0].effectiveFeePerVsize);
return arr;
}
static findRbfTransactions(added: TransactionExtended[], deleted: TransactionExtended[]): { [txid: string]: TransactionExtended } {
const matches: { [txid: string]: TransactionExtended } = {};
deleted
// The replaced tx must have at least one input with nSequence < maxint-1 (Thats the opt-in)
.filter((tx) => tx.vin.some((vin) => vin.sequence < 0xfffffffe))
.forEach((deletedTx) => {
const foundMatches = added.find((addedTx) => {
// The new tx must, absolutely speaking, pay at least as much fee as the replaced tx.
return addedTx.fee > deletedTx.fee
// The new transaction must pay more fee per kB than the replaced tx.
&& addedTx.feePerVsize > deletedTx.feePerVsize
// Spends one or more of the same inputs
&& deletedTx.vin.some((deletedVin) =>
addedTx.vin.some((vin) => vin.txid === deletedVin.txid));
});
if (foundMatches) {
matches[deletedTx.txid] = foundMatches;
}
});
return matches;
}
static stripTransaction(tx: TransactionExtended): TransactionStripped {
return {
txid: tx.txid,
fee: tx.fee,
vsize: tx.weight / 4,
value: tx.vout.reduce((acc, vout) => acc + (vout.value ? vout.value : 0), 0),
};
}
static sleep$(ms: number): Promise<void> {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, ms);
});
}
static shuffleArray(array: any[]) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
static setRelativesAndGetCpfpInfo(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): CpfpInfo {
const parents = this.findAllParents(tx, memPool);
const lowerFeeParents = parents.filter((parent) => parent.feePerVsize < tx.effectiveFeePerVsize);
let totalWeight = tx.weight + lowerFeeParents.reduce((prev, val) => prev + val.weight, 0);
let totalFees = tx.fee + lowerFeeParents.reduce((prev, val) => prev + val.fee, 0);
tx.ancestors = parents
.map((t) => {
return {
txid: t.txid,
weight: t.weight,
fee: t.fee,
};
});
// Add high (high fee) decendant weight and fees
if (tx.bestDescendant) {
totalWeight += tx.bestDescendant.weight;
totalFees += tx.bestDescendant.fee;
}
tx.effectiveFeePerVsize = Math.max(Common.isLiquid() ? 0.1 : 1, totalFees / (totalWeight / 4));
tx.cpfpChecked = true;
return {
ancestors: tx.ancestors,
bestDescendant: tx.bestDescendant || null,
};
}
private static findAllParents(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): TransactionExtended[] {
let parents: TransactionExtended[] = [];
tx.vin.forEach((parent) => {
if (parents.find((p) => p.txid === parent.txid)) {
return;
}
const parentTx = memPool[parent.txid];
if (parentTx) {
if (tx.bestDescendant && tx.bestDescendant.fee / (tx.bestDescendant.weight / 4) > parentTx.feePerVsize) {
if (parentTx.bestDescendant && parentTx.bestDescendant.fee < tx.fee + tx.bestDescendant.fee) {
parentTx.bestDescendant = {
weight: tx.weight + tx.bestDescendant.weight,
fee: tx.fee + tx.bestDescendant.fee,
txid: tx.txid,
};
}
} else if (tx.feePerVsize > parentTx.feePerVsize) {
parentTx.bestDescendant = {
weight: tx.weight,
fee: tx.fee,
txid: tx.txid
};
}
parents.push(parentTx);
parents = parents.concat(this.findAllParents(parentTx, memPool));
}
});
return parents;
}
static getSqlInterval(interval: string | null): string | null {
switch (interval) {
case '24h': return '1 DAY';
case '3d': return '3 DAY';
case '1w': return '1 WEEK';
case '1m': return '1 MONTH';
case '3m': return '3 MONTH';
case '6m': return '6 MONTH';
case '1y': return '1 YEAR';
case '2y': return '2 YEAR';
case '3y': return '3 YEAR';
default: return null;
}
}
static indexingEnabled(): boolean {
return (
['mainnet', 'testnet', 'signet', 'regtest'].includes(config.MEMPOOL.NETWORK) &&
config.DATABASE.ENABLED === true &&
config.MEMPOOL.INDEXING_BLOCKS_AMOUNT !== 0
);
}
}

View File

@@ -0,0 +1,503 @@
import config from '../config';
import DB from '../database';
import logger from '../logger';
import { Common } from './common';
class DatabaseMigration {
private static currentVersion = 19;
private queryTimeout = 120000;
private statisticsAddedIndexed = false;
constructor() { }
/**
* Entry point
*/
public async $initializeOrMigrateDatabase(): Promise<void> {
logger.debug('MIGRATIONS: Running migrations');
await this.$printDatabaseVersion();
// First of all, if the `state` database does not exist, create it so we can track migration version
if (!await this.$checkIfTableExists('state')) {
logger.debug('MIGRATIONS: `state` table does not exist. Creating it.');
try {
await this.$createMigrationStateTable();
} catch (e) {
logger.err('MIGRATIONS: Unable to create `state` table, aborting in 10 seconds. ' + e);
await Common.sleep$(10000);
process.exit(-1);
}
logger.debug('MIGRATIONS: `state` table initialized.');
}
let databaseSchemaVersion = 0;
try {
databaseSchemaVersion = await this.$getSchemaVersionFromDatabase();
} catch (e) {
logger.err('MIGRATIONS: Unable to get current database migration version, aborting in 10 seconds. ' + e);
await Common.sleep$(10000);
process.exit(-1);
}
logger.debug('MIGRATIONS: Current state.schema_version ' + databaseSchemaVersion);
logger.debug('MIGRATIONS: Latest DatabaseMigration.version is ' + DatabaseMigration.currentVersion);
if (databaseSchemaVersion >= DatabaseMigration.currentVersion) {
logger.debug('MIGRATIONS: Nothing to do.');
return;
}
// Now, create missing tables. Those queries cannot be wrapped into a transaction unfortunately
try {
await this.$createMissingTablesAndIndexes(databaseSchemaVersion);
} catch (e) {
logger.err('MIGRATIONS: Unable to create required tables, aborting in 10 seconds. ' + e);
await Common.sleep$(10000);
process.exit(-1);
}
if (DatabaseMigration.currentVersion > databaseSchemaVersion) {
logger.notice('MIGRATIONS: Upgrading database schema');
try {
await this.$migrateTableSchemaFromVersion(databaseSchemaVersion);
logger.notice(`MIGRATIONS: OK. Database schema have been migrated from version ${databaseSchemaVersion} to ${DatabaseMigration.currentVersion} (latest version)`);
} catch (e) {
logger.err('MIGRATIONS: Unable to migrate database, aborting. ' + e);
}
}
return;
}
/**
* Create all missing tables
*/
private async $createMissingTablesAndIndexes(databaseSchemaVersion: number) {
await this.$setStatisticsAddedIndexedFlag(databaseSchemaVersion);
const isBitcoin = ['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK);
try {
await this.$executeQuery(this.getCreateElementsTableQuery(), await this.$checkIfTableExists('elements_pegs'));
await this.$executeQuery(this.getCreateStatisticsQuery(), await this.$checkIfTableExists('statistics'));
if (databaseSchemaVersion < 2 && this.statisticsAddedIndexed === false) {
await this.$executeQuery(`CREATE INDEX added ON statistics (added);`);
}
if (databaseSchemaVersion < 3) {
await this.$executeQuery(this.getCreatePoolsTableQuery(), await this.$checkIfTableExists('pools'));
}
if (databaseSchemaVersion < 4) {
await this.$executeQuery('DROP table IF EXISTS blocks;');
await this.$executeQuery(this.getCreateBlocksTableQuery(), await this.$checkIfTableExists('blocks'));
}
if (databaseSchemaVersion < 5 && isBitcoin === true) {
logger.warn(`'blocks' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE blocks;'); // Need to re-index
await this.$executeQuery('ALTER TABLE blocks ADD `reward` double unsigned NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 6 && isBitcoin === true) {
logger.warn(`'blocks' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE blocks;'); // Need to re-index
// Cleanup original blocks fields type
await this.$executeQuery('ALTER TABLE blocks MODIFY `height` integer unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `tx_count` smallint unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `size` integer unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `weight` integer unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `difficulty` double NOT NULL DEFAULT "0"');
// We also fix the pools.id type so we need to drop/re-create the foreign key
await this.$executeQuery('ALTER TABLE blocks DROP FOREIGN KEY IF EXISTS `blocks_ibfk_1`');
await this.$executeQuery('ALTER TABLE pools MODIFY `id` smallint unsigned AUTO_INCREMENT');
await this.$executeQuery('ALTER TABLE blocks MODIFY `pool_id` smallint unsigned NULL');
await this.$executeQuery('ALTER TABLE blocks ADD FOREIGN KEY (`pool_id`) REFERENCES `pools` (`id`)');
// Add new block indexing fields
await this.$executeQuery('ALTER TABLE blocks ADD `version` integer unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks ADD `bits` integer unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks ADD `nonce` bigint unsigned NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks ADD `merkle_root` varchar(65) NOT NULL DEFAULT ""');
await this.$executeQuery('ALTER TABLE blocks ADD `previous_block_hash` varchar(65) NULL');
}
if (databaseSchemaVersion < 7 && isBitcoin === true) {
await this.$executeQuery('DROP table IF EXISTS hashrates;');
await this.$executeQuery(this.getCreateDailyStatsTableQuery(), await this.$checkIfTableExists('hashrates'));
}
if (databaseSchemaVersion < 8 && isBitcoin === true) {
logger.warn(`'hashrates' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE hashrates;'); // Need to re-index
await this.$executeQuery('ALTER TABLE `hashrates` DROP INDEX `PRIMARY`');
await this.$executeQuery('ALTER TABLE `hashrates` ADD `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST');
await this.$executeQuery('ALTER TABLE `hashrates` ADD `share` float NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE `hashrates` ADD `type` enum("daily", "weekly") DEFAULT "daily"');
}
if (databaseSchemaVersion < 9 && isBitcoin === true) {
logger.warn(`'hashrates' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE hashrates;'); // Need to re-index
await this.$executeQuery('ALTER TABLE `state` CHANGE `name` `name` varchar(100)');
await this.$executeQuery('ALTER TABLE `hashrates` ADD UNIQUE `hashrate_timestamp_pool_id` (`hashrate_timestamp`, `pool_id`)');
}
if (databaseSchemaVersion < 10 && isBitcoin === true) {
await this.$executeQuery('ALTER TABLE `blocks` ADD INDEX `blockTimestamp` (`blockTimestamp`)');
}
if (databaseSchemaVersion < 11 && isBitcoin === true) {
logger.warn(`'blocks' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE blocks;'); // Need to re-index
await this.$executeQuery(`ALTER TABLE blocks
ADD avg_fee INT UNSIGNED NULL,
ADD avg_fee_rate INT UNSIGNED NULL
`);
await this.$executeQuery('ALTER TABLE blocks MODIFY `reward` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `median_fee` INT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `fees` INT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 12 && isBitcoin === true) {
// No need to re-index because the new data type can contain larger values
await this.$executeQuery('ALTER TABLE blocks MODIFY `fees` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 13 && isBitcoin === true) {
await this.$executeQuery('ALTER TABLE blocks MODIFY `difficulty` DOUBLE UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `median_fee` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `avg_fee` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery('ALTER TABLE blocks MODIFY `avg_fee_rate` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 14 && isBitcoin === true) {
logger.warn(`'hashrates' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE hashrates;'); // Need to re-index
await this.$executeQuery('ALTER TABLE `hashrates` DROP FOREIGN KEY `hashrates_ibfk_1`');
await this.$executeQuery('ALTER TABLE `hashrates` MODIFY `pool_id` SMALLINT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 16 && isBitcoin === true) {
logger.warn(`'hashrates' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery('TRUNCATE hashrates;'); // Need to re-index because we changed timestamps
}
if (databaseSchemaVersion < 17 && isBitcoin === true) {
await this.$executeQuery('ALTER TABLE `pools` ADD `slug` CHAR(50) NULL');
}
if (databaseSchemaVersion < 18 && isBitcoin === true) {
await this.$executeQuery('ALTER TABLE `blocks` ADD INDEX `hash` (`hash`);');
}
if (databaseSchemaVersion < 19) {
await this.$executeQuery(this.getCreateRatesTableQuery(), await this.$checkIfTableExists('rates'));
}
} catch (e) {
throw e;
}
}
/**
* Special case here for the `statistics` table - It appeared that somehow some dbs already had the `added` field indexed
* while it does not appear in previous schemas. The mariadb command "CREATE INDEX IF NOT EXISTS" is not supported on
* older mariadb version. Therefore we set a flag here in order to know if the index needs to be created or not before
* running the migration process
*/
private async $setStatisticsAddedIndexedFlag(databaseSchemaVersion: number) {
if (databaseSchemaVersion >= 2) {
this.statisticsAddedIndexed = true;
return;
}
try {
// We don't use "CREATE INDEX IF NOT EXISTS" because it is not supported on old mariadb version 5.X
const query = `SELECT COUNT(1) hasIndex FROM INFORMATION_SCHEMA.STATISTICS
WHERE table_schema=DATABASE() AND table_name='statistics' AND index_name='added';`;
const [rows] = await this.$executeQuery(query, true);
if (rows[0].hasIndex === 0) {
logger.debug('MIGRATIONS: `statistics.added` is not indexed');
this.statisticsAddedIndexed = false;
} else if (rows[0].hasIndex === 1) {
logger.debug('MIGRATIONS: `statistics.added` is already indexed');
this.statisticsAddedIndexed = true;
}
} catch (e) {
// Should really never happen but just in case it fails, we just don't execute
// any query related to this indexing so it won't fail if the index actually already exists
logger.err('MIGRATIONS: Unable to check if `statistics.added` INDEX exist or not.');
this.statisticsAddedIndexed = true;
}
}
/**
* Small query execution wrapper to log all executed queries
*/
private async $executeQuery(query: string, silent: boolean = false): Promise<any> {
if (!silent) {
logger.debug('MIGRATIONS: Execute query:\n' + query);
}
return DB.query({ sql: query, timeout: this.queryTimeout });
}
/**
* Check if 'table' exists in the database
*/
private async $checkIfTableExists(table: string): Promise<boolean> {
const query = `SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '${config.DATABASE.DATABASE}' AND TABLE_NAME = '${table}'`;
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return rows[0]['COUNT(*)'] === 1;
}
/**
* Get current database version
*/
private async $getSchemaVersionFromDatabase(): Promise<number> {
const query = `SELECT number FROM state WHERE name = 'schema_version';`;
const [rows] = await this.$executeQuery(query, true);
return rows[0]['number'];
}
/**
* Create the `state` table
*/
private async $createMigrationStateTable(): Promise<void> {
try {
const query = `CREATE TABLE IF NOT EXISTS state (
name varchar(25) NOT NULL,
number int(11) NULL,
string varchar(100) NULL,
CONSTRAINT name_unique UNIQUE (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
await this.$executeQuery(query);
// Set initial values
await this.$executeQuery(`INSERT INTO state VALUES('schema_version', 0, NULL);`);
await this.$executeQuery(`INSERT INTO state VALUES('last_elements_block', 0, NULL);`);
} catch (e) {
throw e;
}
}
/**
* We actually execute the migrations queries here
*/
private async $migrateTableSchemaFromVersion(version: number): Promise<void> {
const transactionQueries: string[] = [];
for (const query of this.getMigrationQueriesFromVersion(version)) {
transactionQueries.push(query);
}
transactionQueries.push(this.getUpdateToLatestSchemaVersionQuery());
try {
await this.$executeQuery('START TRANSACTION;');
for (const query of transactionQueries) {
await this.$executeQuery(query);
}
await this.$executeQuery('COMMIT;');
} catch (e) {
await this.$executeQuery('ROLLBACK;');
throw e;
}
}
/**
* Generate migration queries based on schema version
*/
private getMigrationQueriesFromVersion(version: number): string[] {
const queries: string[] = [];
const isBitcoin = ['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK);
if (version < 1) {
if (config.MEMPOOL.NETWORK !== 'liquid' && config.MEMPOOL.NETWORK !== 'liquidtestnet') {
queries.push(this.getShiftStatisticsQuery());
}
}
if (version < 7 && isBitcoin === true) {
queries.push(`INSERT INTO state(name, number, string) VALUES ('last_hashrates_indexing', 0, NULL)`);
}
if (version < 9 && isBitcoin === true) {
queries.push(`INSERT INTO state(name, number, string) VALUES ('last_weekly_hashrates_indexing', 0, NULL)`);
}
return queries;
}
/**
* Save the schema version in the database
*/
private getUpdateToLatestSchemaVersionQuery(): string {
return `UPDATE state SET number = ${DatabaseMigration.currentVersion} WHERE name = 'schema_version';`;
}
/**
* Print current database version
*/
private async $printDatabaseVersion() {
try {
const [rows] = await this.$executeQuery('SELECT VERSION() as version;', true);
logger.debug(`MIGRATIONS: Database engine version '${rows[0].version}'`);
} catch (e) {
logger.debug(`MIGRATIONS: Could not fetch database engine version. ` + e);
}
}
// Couple of wrappers to clean the main logic
private getShiftStatisticsQuery(): string {
return `UPDATE statistics SET
vsize_1 = vsize_1 + vsize_2, vsize_2 = vsize_3,
vsize_3 = vsize_4, vsize_4 = vsize_5,
vsize_5 = vsize_6, vsize_6 = vsize_8,
vsize_8 = vsize_10, vsize_10 = vsize_12,
vsize_12 = vsize_15, vsize_15 = vsize_20,
vsize_20 = vsize_30, vsize_30 = vsize_40,
vsize_40 = vsize_50, vsize_50 = vsize_60,
vsize_60 = vsize_70, vsize_70 = vsize_80,
vsize_80 = vsize_90, vsize_90 = vsize_100,
vsize_100 = vsize_125, vsize_125 = vsize_150,
vsize_150 = vsize_175, vsize_175 = vsize_200,
vsize_200 = vsize_250, vsize_250 = vsize_300,
vsize_300 = vsize_350, vsize_350 = vsize_400,
vsize_400 = vsize_500, vsize_500 = vsize_600,
vsize_600 = vsize_700, vsize_700 = vsize_800,
vsize_800 = vsize_900, vsize_900 = vsize_1000,
vsize_1000 = vsize_1200, vsize_1200 = vsize_1400,
vsize_1400 = vsize_1800, vsize_1800 = vsize_2000, vsize_2000 = 0;`;
}
private getCreateStatisticsQuery(): string {
return `CREATE TABLE IF NOT EXISTS statistics (
id int(11) NOT NULL AUTO_INCREMENT,
added datetime NOT NULL,
unconfirmed_transactions int(11) UNSIGNED NOT NULL,
tx_per_second float UNSIGNED NOT NULL,
vbytes_per_second int(10) UNSIGNED NOT NULL,
mempool_byte_weight int(10) UNSIGNED NOT NULL,
fee_data longtext NOT NULL,
total_fee double UNSIGNED NOT NULL,
vsize_1 int(11) NOT NULL,
vsize_2 int(11) NOT NULL,
vsize_3 int(11) NOT NULL,
vsize_4 int(11) NOT NULL,
vsize_5 int(11) NOT NULL,
vsize_6 int(11) NOT NULL,
vsize_8 int(11) NOT NULL,
vsize_10 int(11) NOT NULL,
vsize_12 int(11) NOT NULL,
vsize_15 int(11) NOT NULL,
vsize_20 int(11) NOT NULL,
vsize_30 int(11) NOT NULL,
vsize_40 int(11) NOT NULL,
vsize_50 int(11) NOT NULL,
vsize_60 int(11) NOT NULL,
vsize_70 int(11) NOT NULL,
vsize_80 int(11) NOT NULL,
vsize_90 int(11) NOT NULL,
vsize_100 int(11) NOT NULL,
vsize_125 int(11) NOT NULL,
vsize_150 int(11) NOT NULL,
vsize_175 int(11) NOT NULL,
vsize_200 int(11) NOT NULL,
vsize_250 int(11) NOT NULL,
vsize_300 int(11) NOT NULL,
vsize_350 int(11) NOT NULL,
vsize_400 int(11) NOT NULL,
vsize_500 int(11) NOT NULL,
vsize_600 int(11) NOT NULL,
vsize_700 int(11) NOT NULL,
vsize_800 int(11) NOT NULL,
vsize_900 int(11) NOT NULL,
vsize_1000 int(11) NOT NULL,
vsize_1200 int(11) NOT NULL,
vsize_1400 int(11) NOT NULL,
vsize_1600 int(11) NOT NULL,
vsize_1800 int(11) NOT NULL,
vsize_2000 int(11) NOT NULL,
CONSTRAINT PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
}
private getCreateElementsTableQuery(): string {
return `CREATE TABLE IF NOT EXISTS elements_pegs (
block int(11) NOT NULL,
datetime int(11) NOT NULL,
amount bigint(20) NOT NULL,
txid varchar(65) NOT NULL,
txindex int(11) NOT NULL,
bitcoinaddress varchar(100) NOT NULL,
bitcointxid varchar(65) NOT NULL,
bitcoinindex int(11) NOT NULL,
final_tx int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
}
private getCreatePoolsTableQuery(): string {
return `CREATE TABLE IF NOT EXISTS pools (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
link varchar(255) NOT NULL,
addresses text NOT NULL,
regexes text NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`;
}
private getCreateBlocksTableQuery(): string {
return `CREATE TABLE IF NOT EXISTS blocks (
height int(11) unsigned NOT NULL,
hash varchar(65) NOT NULL,
blockTimestamp timestamp NOT NULL,
size int(11) unsigned NOT NULL,
weight int(11) unsigned NOT NULL,
tx_count int(11) unsigned NOT NULL,
coinbase_raw text,
difficulty bigint(20) unsigned NOT NULL,
pool_id int(11) DEFAULT -1,
fees double unsigned NOT NULL,
fee_span json NOT NULL,
median_fee double unsigned NOT NULL,
PRIMARY KEY (height),
INDEX (pool_id),
FOREIGN KEY (pool_id) REFERENCES pools (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
}
private getCreateDailyStatsTableQuery(): string {
return `CREATE TABLE IF NOT EXISTS hashrates (
hashrate_timestamp timestamp NOT NULL,
avg_hashrate double unsigned DEFAULT '0',
pool_id smallint unsigned NULL,
PRIMARY KEY (hashrate_timestamp),
INDEX (pool_id),
FOREIGN KEY (pool_id) REFERENCES pools (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
}
private getCreateRatesTableQuery(): string {
return `CREATE TABLE IF NOT EXISTS rates (
height int(10) unsigned NOT NULL,
bisq_rates JSON NOT NULL,
PRIMARY KEY (height)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;
}
public async $truncateIndexedData(tables: string[]) {
const allowedTables = ['blocks', 'hashrates'];
try {
for (const table of tables) {
if (!allowedTables.includes(table)) {
logger.debug(`Table ${table} cannot to be re-indexed (not allowed)`);
continue;
}
await this.$executeQuery(`TRUNCATE ${table}`, true);
if (table === 'hashrates') {
await this.$executeQuery('UPDATE state set number = 0 where name = "last_hashrates_indexing"', true);
}
logger.notice(`Table ${table} has been truncated`);
}
} catch (e) {
logger.warn(`Unable to erase indexed data`);
}
}
}
export default new DatabaseMigration();

View File

@@ -0,0 +1,67 @@
import config from '../config';
import { IDifficultyAdjustment } from '../mempool.interfaces';
import blocks from './blocks';
class DifficultyAdjustmentApi {
constructor() { }
public getDifficultyAdjustment(): IDifficultyAdjustment {
const DATime = blocks.getLastDifficultyAdjustmentTime();
const previousRetarget = blocks.getPreviousDifficultyRetarget();
const blockHeight = blocks.getCurrentBlockHeight();
const blocksCache = blocks.getBlocks();
const latestBlock = blocksCache[blocksCache.length - 1];
const now = new Date().getTime() / 1000;
const diff = now - DATime;
const blocksInEpoch = blockHeight % 2016;
const progressPercent = (blocksInEpoch >= 0) ? blocksInEpoch / 2016 * 100 : 100;
const remainingBlocks = 2016 - blocksInEpoch;
const nextRetargetHeight = blockHeight + remainingBlocks;
let difficultyChange = 0;
if (remainingBlocks < 1870) {
if (blocksInEpoch > 0) {
difficultyChange = (600 / (diff / blocksInEpoch) - 1) * 100;
}
if (difficultyChange > 300) {
difficultyChange = 300;
}
if (difficultyChange < -75) {
difficultyChange = -75;
}
}
let timeAvgMins = blocksInEpoch && blocksInEpoch > 146 ? diff / blocksInEpoch / 60 : 10;
// Testnet difficulty is set to 1 after 20 minutes of no blocks,
// therefore the time between blocks will always be below 20 minutes (1200s).
let timeOffset = 0;
if (config.MEMPOOL.NETWORK === 'testnet') {
if (timeAvgMins > 20) {
timeAvgMins = 20;
}
if (now - latestBlock.timestamp + timeAvgMins * 60 > 1200) {
timeOffset = -Math.min(now - latestBlock.timestamp, 1200) * 1000;
}
}
const timeAvg = timeAvgMins * 60 * 1000 ;
const remainingTime = (remainingBlocks * timeAvg) + (now * 1000);
const estimatedRetargetDate = remainingTime + now;
return {
progressPercent,
difficultyChange,
estimatedRetargetDate,
remainingBlocks,
remainingTime,
previousRetarget,
nextRetargetHeight,
timeAvg,
timeOffset,
};
}
}
export default new DifficultyAdjustmentApi();

View File

@@ -1,15 +1,117 @@
import * as fs from 'fs';
const fsPromises = fs.promises;
import * as cluster from 'cluster';
import memPool from './mempool';
import blocks from './blocks';
import logger from '../logger';
import config from '../config';
import { TransactionExtended } from '../mempool.interfaces';
import { Common } from './common';
class DiskCache {
static FILE_NAME = './cache.json';
private cacheSchemaVersion = 1;
private static FILE_NAME = config.MEMPOOL.CACHE_DIR + '/cache.json';
private static FILE_NAMES = config.MEMPOOL.CACHE_DIR + '/cache{number}.json';
private static CHUNK_FILES = 25;
private isWritingCache = false;
constructor() { }
saveData(dataBlob: string) {
fs.writeFileSync(DiskCache.FILE_NAME, dataBlob, 'utf8');
async $saveCacheToDisk(): Promise<void> {
if (!cluster.isMaster) {
return;
}
if (this.isWritingCache) {
logger.debug('Saving cache already in progress. Skipping.')
return;
}
try {
logger.debug('Writing mempool and blocks data to disk cache (async)...');
this.isWritingCache = true;
const mempool = memPool.getMempool();
const mempoolArray: TransactionExtended[] = [];
for (const tx in mempool) {
mempoolArray.push(mempool[tx]);
}
Common.shuffleArray(mempoolArray);
const chunkSize = Math.floor(mempoolArray.length / DiskCache.CHUNK_FILES);
await fsPromises.writeFile(DiskCache.FILE_NAME, JSON.stringify({
cacheSchemaVersion: this.cacheSchemaVersion,
blocks: blocks.getBlocks(),
mempool: {},
mempoolArray: mempoolArray.splice(0, chunkSize),
}), {flag: 'w'});
for (let i = 1; i < DiskCache.CHUNK_FILES; i++) {
await fsPromises.writeFile(DiskCache.FILE_NAMES.replace('{number}', i.toString()), JSON.stringify({
mempool: {},
mempoolArray: mempoolArray.splice(0, chunkSize),
}), {flag: 'w'});
}
logger.debug('Mempool and blocks data saved to disk cache');
this.isWritingCache = false;
} catch (e) {
logger.warn('Error writing to cache file: ' + (e instanceof Error ? e.message : e));
this.isWritingCache = false;
}
}
loadData(): string {
return fs.readFileSync(DiskCache.FILE_NAME, 'utf8');
wipeCache() {
fs.unlinkSync(DiskCache.FILE_NAME);
for (let i = 1; i < DiskCache.CHUNK_FILES; i++) {
fs.unlinkSync(DiskCache.FILE_NAMES.replace('{number}', i.toString()));
}
}
loadMempoolCache() {
if (!fs.existsSync(DiskCache.FILE_NAME)) {
return;
}
try {
let data: any = {};
const cacheData = fs.readFileSync(DiskCache.FILE_NAME, 'utf8');
if (cacheData) {
logger.info('Restoring mempool and blocks data from disk cache');
data = JSON.parse(cacheData);
if (data.cacheSchemaVersion === undefined || data.cacheSchemaVersion !== this.cacheSchemaVersion) {
logger.notice('Disk cache contains an outdated schema version. Clearing it and skipping the cache loading.');
return this.wipeCache();
}
if (data.mempoolArray) {
for (const tx of data.mempoolArray) {
data.mempool[tx.txid] = tx;
}
}
}
for (let i = 1; i < DiskCache.CHUNK_FILES; i++) {
const fileName = DiskCache.FILE_NAMES.replace('{number}', i.toString());
try {
if (fs.existsSync(fileName)) {
const cacheData2 = JSON.parse(fs.readFileSync(fileName, 'utf8'));
if (cacheData2.mempoolArray) {
for (const tx of cacheData2.mempoolArray) {
data.mempool[tx.txid] = tx;
}
} else {
Object.assign(data.mempool, cacheData2.mempool);
}
}
} catch (e) {
logger.info('Error parsing ' + fileName + '. Skipping. Reason: ' + (e instanceof Error ? e.message : e));
}
}
memPool.setMempool(data.mempool);
blocks.setBlocks(data.blocks);
} catch (e) {
logger.warn('Failed to parse mempoool and blocks cache. Skipping. Reason: ' + (e instanceof Error ? e.message : e));
}
}
}

View File

@@ -1,47 +1,52 @@
import projectedBlocks from './projected-blocks';
import { DB } from '../database';
import { MempoolBlock } from '../mempool.interfaces';
import { Common } from './common';
import mempool from './mempool';
import projectedBlocks from './mempool-blocks';
class FeeApi {
constructor() { }
defaultFee = Common.isLiquid() ? 0.1 : 1;
public getRecommendedFee() {
const pBlocks = projectedBlocks.getProjectedBlocks();
const pBlocks = projectedBlocks.getMempoolBlocks();
const mPool = mempool.getMempoolInfo();
const minimumFee = Math.ceil(mPool.mempoolminfee * 100000);
if (!pBlocks.length) {
return {
'fastestFee': 0,
'halfHourFee': 0,
'hourFee': 0,
'fastestFee': this.defaultFee,
'halfHourFee': this.defaultFee,
'hourFee': this.defaultFee,
'economyFee': minimumFee,
'minimumFee': minimumFee,
};
}
let firstMedianFee = Math.ceil(pBlocks[0].medianFee);
if (pBlocks.length === 1 && pBlocks[0].blockWeight <= 2000000) {
firstMedianFee = 1;
}
const secondMedianFee = pBlocks[1] ? Math.ceil(pBlocks[1].medianFee) : firstMedianFee;
const thirdMedianFee = pBlocks[2] ? Math.ceil(pBlocks[2].medianFee) : secondMedianFee;
const firstMedianFee = this.optimizeMedianFee(pBlocks[0], pBlocks[1]);
const secondMedianFee = pBlocks[1] ? this.optimizeMedianFee(pBlocks[1], pBlocks[2], firstMedianFee) : this.defaultFee;
const thirdMedianFee = pBlocks[2] ? this.optimizeMedianFee(pBlocks[2], pBlocks[3], secondMedianFee) : this.defaultFee;
return {
'fastestFee': firstMedianFee,
'halfHourFee': secondMedianFee,
'hourFee': thirdMedianFee,
'economyFee': Math.min(2 * minimumFee, thirdMedianFee),
'minimumFee': minimumFee,
};
}
public async $getTransactionsForBlock(blockHeight: number): Promise<any[]> {
try {
const connection = await DB.pool.getConnection();
const query = `SELECT feePerVsize AS fpv FROM transactions WHERE blockheight = ? ORDER BY feePerVsize ASC`;
const [rows] = await connection.query<any>(query, [blockHeight]);
connection.release();
return rows;
} catch (e) {
console.log('$getTransactionsForBlock() error', e);
return [];
private optimizeMedianFee(pBlock: MempoolBlock, nextBlock: MempoolBlock | undefined, previousFee?: number): number {
const useFee = previousFee ? (pBlock.medianFee + previousFee) / 2 : pBlock.medianFee;
if (pBlock.blockVSize <= 500000) {
return this.defaultFee;
}
if (pBlock.blockVSize <= 950000 && !nextBlock) {
const multiplier = (pBlock.blockVSize - 500000) / 500000;
return Math.max(Math.round(useFee * multiplier), this.defaultFee);
}
return Math.ceil(useFee);
}
}
export default new FeeApi();

View File

@@ -1,30 +1,122 @@
import * as request from 'request';
import logger from '../logger';
import * as http from 'http';
import * as https from 'https';
import axios, { AxiosResponse } from 'axios';
import { IConversionRates } from '../mempool.interfaces';
import config from '../config';
import backendInfo from './backend-info';
import { SocksProxyAgent } from 'socks-proxy-agent';
class FiatConversion {
private tickers = {
'BTCUSD': {
'USD': 4110.78
},
};
private debasingFiatCurrencies = ['AED', 'AUD', 'BDT', 'BHD', 'BMD', 'BRL', 'CAD', 'CHF', 'CLP',
'CNY', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HUF', 'IDR', 'ILS', 'INR', 'JPY', 'KRW', 'KWD',
'LKR', 'MMK', 'MXN', 'MYR', 'NGN', 'NOK', 'NZD', 'PHP', 'PKR', 'PLN', 'RUB', 'SAR', 'SEK',
'SGD', 'THB', 'TRY', 'TWD', 'UAH', 'USD', 'VND', 'ZAR'];
private conversionRates: IConversionRates = {};
private ratesChangedCallback: ((rates: IConversionRates) => void) | undefined;
public ratesInitialized = false; // If true, it means rates are ready for use
constructor() { }
constructor() {
for (const fiat of this.debasingFiatCurrencies) {
this.conversionRates[fiat] = 0;
}
}
public setProgressChangedCallback(fn: (rates: IConversionRates) => void) {
this.ratesChangedCallback = fn;
}
public startService() {
setInterval(this.updateCurrency.bind(this), 1000 * 60 * 60);
const fiatConversionUrl = (config.SOCKS5PROXY.ENABLED === true) && (config.SOCKS5PROXY.USE_ONION === true) ? config.PRICE_DATA_SERVER.TOR_URL : config.PRICE_DATA_SERVER.CLEARNET_URL;
logger.info('Starting currency rates service');
if (config.SOCKS5PROXY.ENABLED) {
logger.info(`Currency rates service will be queried over the Tor network using ${fiatConversionUrl}`);
} else {
logger.info(`Currency rates service will be queried over clearnet using ${config.PRICE_DATA_SERVER.CLEARNET_URL}`);
}
setInterval(this.updateCurrency.bind(this), 1000 * config.MEMPOOL.PRICE_FEED_UPDATE_INTERVAL);
this.updateCurrency();
}
public getTickers() {
return this.tickers;
public getConversionRates() {
return this.conversionRates;
}
private updateCurrency() {
request('https://api.opennode.co/v1/rates', { json: true }, (err, res, body) => {
if (err) { return console.log(err); }
if (body && body.data) {
this.tickers = body.data;
private async updateCurrency(): Promise<void> {
type axiosOptions = {
headers: {
'User-Agent': string
};
timeout: number;
httpAgent?: http.Agent;
httpsAgent?: https.Agent;
}
const setDelay = (secs: number = 1): Promise<void> => new Promise(resolve => setTimeout(() => resolve(), secs * 1000));
const fiatConversionUrl = (config.SOCKS5PROXY.ENABLED === true) && (config.SOCKS5PROXY.USE_ONION === true) ? config.PRICE_DATA_SERVER.TOR_URL : config.PRICE_DATA_SERVER.CLEARNET_URL;
const isHTTP = (new URL(fiatConversionUrl).protocol.split(':')[0] === 'http') ? true : false;
const axiosOptions: axiosOptions = {
headers: {
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
timeout: config.SOCKS5PROXY.ENABLED ? 30000 : 10000
};
let retry = 0;
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
try {
if (config.SOCKS5PROXY.ENABLED) {
let socksOptions: any = {
agentOptions: {
keepAlive: true,
},
hostname: config.SOCKS5PROXY.HOST,
port: config.SOCKS5PROXY.PORT
};
if (config.SOCKS5PROXY.USERNAME && config.SOCKS5PROXY.PASSWORD) {
socksOptions.username = config.SOCKS5PROXY.USERNAME;
socksOptions.password = config.SOCKS5PROXY.PASSWORD;
} else {
// Retry with different tor circuits https://stackoverflow.com/a/64960234
socksOptions.username = `circuit${retry}`;
}
// Handle proxy agent for onion addresses
if (isHTTP) {
axiosOptions.httpAgent = new SocksProxyAgent(socksOptions);
} else {
axiosOptions.httpsAgent = new SocksProxyAgent(socksOptions);
}
}
logger.debug('Querying currency rates service...');
const response: AxiosResponse = await axios.get(`${fiatConversionUrl}`, axiosOptions);
if (response.statusText === 'error' || !response.data) {
throw new Error(`Could not fetch data from ${fiatConversionUrl}, Error: ${response.status}`);
}
for (const rate of response.data.data) {
if (this.debasingFiatCurrencies.includes(rate.currencyCode) && rate.provider === 'Bisq-Aggregate') {
this.conversionRates[rate.currencyCode] = Math.round(100 * rate.price) / 100;
}
}
this.ratesInitialized = true;
logger.debug(`USD Conversion Rate: ${this.conversionRates.USD}`);
if (this.ratesChangedCallback) {
this.ratesChangedCallback(this.conversionRates);
}
break;
} catch (e) {
logger.err('Error updating fiat conversion rates: ' + (e instanceof Error ? e.message : e));
await setDelay(config.MEMPOOL.EXTERNAL_RETRY_INTERVAL);
retry++;
}
});
}
}
}

View File

@@ -0,0 +1,103 @@
import { IBitcoinApi } from '../bitcoin/bitcoin-api.interface';
import bitcoinClient from '../bitcoin/bitcoin-client';
import bitcoinSecondClient from '../bitcoin/bitcoin-second-client';
import { Common } from '../common';
import DB from '../../database';
import logger from '../../logger';
class ElementsParser {
private isRunning = false;
constructor() { }
public async $parse() {
if (this.isRunning) {
return;
}
try {
this.isRunning = true;
const result = await bitcoinClient.getChainTips();
const tip = result[0].height;
const latestBlockHeight = await this.$getLatestBlockHeightFromDatabase();
for (let height = latestBlockHeight + 1; height <= tip; height++) {
const blockHash: IBitcoinApi.ChainTips = await bitcoinClient.getBlockHash(height);
const block: IBitcoinApi.Block = await bitcoinClient.getBlock(blockHash, 2);
await this.$parseBlock(block);
await this.$saveLatestBlockToDatabase(block.height);
}
this.isRunning = false;
} catch (e) {
this.isRunning = false;
throw new Error(e instanceof Error ? e.message : 'Error');
}
}
public async $getPegDataByMonth(): Promise<any> {
const query = `SELECT SUM(amount) AS amount, DATE_FORMAT(FROM_UNIXTIME(datetime), '%Y-%m-01') AS date FROM elements_pegs GROUP BY DATE_FORMAT(FROM_UNIXTIME(datetime), '%Y%m')`;
const [rows] = await DB.query(query);
return rows;
}
protected async $parseBlock(block: IBitcoinApi.Block) {
for (const tx of block.tx) {
await this.$parseInputs(tx, block);
await this.$parseOutputs(tx, block);
}
}
protected async $parseInputs(tx: IBitcoinApi.Transaction, block: IBitcoinApi.Block) {
for (const [index, input] of tx.vin.entries()) {
if (input.is_pegin) {
await this.$parsePegIn(input, index, tx.txid, block);
}
}
}
protected async $parsePegIn(input: IBitcoinApi.Vin, vindex: number, txid: string, block: IBitcoinApi.Block) {
const bitcoinTx: IBitcoinApi.Transaction = await bitcoinSecondClient.getRawTransaction(input.txid, true);
const prevout = bitcoinTx.vout[input.vout || 0];
const outputAddress = prevout.scriptPubKey.address || (prevout.scriptPubKey.addresses && prevout.scriptPubKey.addresses[0]) || '';
await this.$savePegToDatabase(block.height, block.time, prevout.value * 100000000, txid, vindex,
outputAddress, bitcoinTx.txid, prevout.n, 1);
}
protected async $parseOutputs(tx: IBitcoinApi.Transaction, block: IBitcoinApi.Block) {
for (const output of tx.vout) {
if (output.scriptPubKey.pegout_chain) {
await this.$savePegToDatabase(block.height, block.time, 0 - output.value * 100000000, tx.txid, output.n,
(output.scriptPubKey.pegout_addresses && output.scriptPubKey.pegout_addresses[0] || ''), '', 0, 0);
}
if (!output.scriptPubKey.pegout_chain && output.scriptPubKey.type === 'nulldata'
&& output.value && output.value > 0 && output.asset && output.asset === Common.nativeAssetId) {
await this.$savePegToDatabase(block.height, block.time, 0 - output.value * 100000000, tx.txid, output.n,
(output.scriptPubKey.pegout_addresses && output.scriptPubKey.pegout_addresses[0] || ''), '', 0, 1);
}
}
}
protected async $savePegToDatabase(height: number, blockTime: number, amount: number, txid: string,
txindex: number, bitcoinaddress: string, bitcointxid: string, bitcoinindex: number, final_tx: number): Promise<void> {
const query = `INSERT INTO elements_pegs(
block, datetime, amount, txid, txindex, bitcoinaddress, bitcointxid, bitcoinindex, final_tx
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`;
const params: (string | number)[] = [
height, blockTime, amount, txid, txindex, bitcoinaddress, bitcointxid, bitcoinindex, final_tx
];
await DB.query(query, params);
logger.debug(`Saved L-BTC peg from block height #${height} with TXID ${txid}.`);
}
protected async $getLatestBlockHeightFromDatabase(): Promise<number> {
const query = `SELECT number FROM state WHERE name = 'last_elements_block'`;
const [rows] = await DB.query(query);
return rows[0]['number'];
}
protected async $saveLatestBlockToDatabase(blockHeight: number) {
const query = `UPDATE state SET number = ? WHERE name = 'last_elements_block'`;
await DB.query(query, [blockHeight]);
}
}
export default new ElementsParser();

View File

@@ -0,0 +1,38 @@
import * as fs from 'fs';
import logger from '../../logger';
class Icons {
private static FILE_NAME = './icons.json';
private iconIds: string[] = [];
private icons: { [assetId: string]: string; } = {};
constructor() {}
public loadIcons() {
if (!fs.existsSync(Icons.FILE_NAME)) {
logger.warn(`${Icons.FILE_NAME} does not exist. No Liquid icons loaded.`);
return;
}
const cacheData = fs.readFileSync(Icons.FILE_NAME, 'utf8');
this.icons = JSON.parse(cacheData);
for (const i in this.icons) {
this.iconIds.push(i);
}
logger.debug(`Liquid icons has been loaded.`);
}
public getIconByAssetId(assetId: string): Buffer | undefined {
const icon = this.icons[assetId];
if (icon) {
return Buffer.from(icon, 'base64');
}
}
public getAllIconIds() {
return this.iconIds;
}
}
export default new Icons();

View File

@@ -0,0 +1,32 @@
import { ILoadingIndicators } from '../mempool.interfaces';
class LoadingIndicators {
private loadingIndicators: ILoadingIndicators = {
'mempool': 0,
};
private progressChangedCallback: ((loadingIndicators: ILoadingIndicators) => void) | undefined;
constructor() { }
public setProgressChangedCallback(fn: (loadingIndicators: ILoadingIndicators) => void) {
this.progressChangedCallback = fn;
}
public setProgress(name: string, progressPercent: number, rounded: boolean = true) {
const newProgress = rounded === true ? Math.round(progressPercent) : progressPercent;
if (newProgress >= 100) {
delete this.loadingIndicators[name];
} else {
this.loadingIndicators[name] = newProgress;
}
if (this.progressChangedCallback) {
this.progressChangedCallback(this.loadingIndicators);
}
}
public getLoadingIndicators() {
return this.loadingIndicators;
}
}
export default new LoadingIndicators();

View File

@@ -0,0 +1,38 @@
interface ICache {
type: string;
id: string;
expires: Date;
data: any;
}
class MemoryCache {
private cache: ICache[] = [];
constructor() {
setInterval(this.cleanup.bind(this), 1000);
}
public set(type: string, id: string, data: any, secondsExpiry: number) {
const expiry = new Date();
expiry.setSeconds(expiry.getSeconds() + secondsExpiry);
this.cache.push({
type: type,
id: id,
data: data,
expires: expiry,
});
}
public get<T>(type: string, id: string): T | null {
const found = this.cache.find((cache) => cache.type === type && cache.id === id);
if (found) {
return found.data;
}
return null;
}
private cleanup() {
this.cache = this.cache.filter((cache) => cache.expires < (new Date()));
}
}
export default new MemoryCache();

View File

@@ -0,0 +1,165 @@
import logger from '../logger';
import { MempoolBlock, TransactionExtended, TransactionStripped, MempoolBlockWithTransactions, MempoolBlockDelta } from '../mempool.interfaces';
import { Common } from './common';
import config from '../config';
class MempoolBlocks {
private mempoolBlocks: MempoolBlockWithTransactions[] = [];
private mempoolBlockDeltas: MempoolBlockDelta[] = [];
constructor() {}
public getMempoolBlocks(): MempoolBlock[] {
return this.mempoolBlocks.map((block) => {
return {
blockSize: block.blockSize,
blockVSize: block.blockVSize,
nTx: block.nTx,
totalFees: block.totalFees,
medianFee: block.medianFee,
feeRange: block.feeRange,
};
});
}
public getMempoolBlocksWithTransactions(): MempoolBlockWithTransactions[] {
return this.mempoolBlocks;
}
public getMempoolBlockDeltas(): MempoolBlockDelta[] {
return this.mempoolBlockDeltas;
}
public updateMempoolBlocks(memPool: { [txid: string]: TransactionExtended }): void {
const latestMempool = memPool;
const memPoolArray: TransactionExtended[] = [];
for (const i in latestMempool) {
if (latestMempool.hasOwnProperty(i)) {
memPoolArray.push(latestMempool[i]);
}
}
const start = new Date().getTime();
// Clear bestDescendants & ancestors
memPoolArray.forEach((tx) => {
tx.bestDescendant = null;
tx.ancestors = [];
tx.cpfpChecked = false;
if (!tx.effectiveFeePerVsize) {
tx.effectiveFeePerVsize = tx.feePerVsize;
}
});
// First sort
memPoolArray.sort((a, b) => b.feePerVsize - a.feePerVsize);
// Loop through and traverse all ancestors and sum up all the sizes + fees
// Pass down size + fee to all unconfirmed children
let sizes = 0;
memPoolArray.forEach((tx, i) => {
sizes += tx.weight;
if (sizes > 4000000 * 8) {
return;
}
Common.setRelativesAndGetCpfpInfo(tx, memPool);
});
// Final sort, by effective fee
memPoolArray.sort((a, b) => b.effectiveFeePerVsize - a.effectiveFeePerVsize);
const end = new Date().getTime();
const time = end - start;
logger.debug('Mempool blocks calculated in ' + time / 1000 + ' seconds');
const { blocks, deltas } = this.calculateMempoolBlocks(memPoolArray, this.mempoolBlocks);
this.mempoolBlocks = blocks;
this.mempoolBlockDeltas = deltas;
}
private calculateMempoolBlocks(transactionsSorted: TransactionExtended[], prevBlocks: MempoolBlockWithTransactions[]):
{ blocks: MempoolBlockWithTransactions[], deltas: MempoolBlockDelta[] } {
const mempoolBlocks: MempoolBlockWithTransactions[] = [];
const mempoolBlockDeltas: MempoolBlockDelta[] = [];
let blockWeight = 0;
let blockSize = 0;
let transactions: TransactionExtended[] = [];
transactionsSorted.forEach((tx) => {
if (blockWeight + tx.weight <= config.MEMPOOL.BLOCK_WEIGHT_UNITS
|| mempoolBlocks.length === config.MEMPOOL.MEMPOOL_BLOCKS_AMOUNT - 1) {
blockWeight += tx.weight;
blockSize += tx.size;
transactions.push(tx);
} else {
mempoolBlocks.push(this.dataToMempoolBlocks(transactions, blockSize, blockWeight, mempoolBlocks.length));
blockWeight = tx.weight;
blockSize = tx.size;
transactions = [tx];
}
});
if (transactions.length) {
mempoolBlocks.push(this.dataToMempoolBlocks(transactions, blockSize, blockWeight, mempoolBlocks.length));
}
// Calculate change from previous block states
for (let i = 0; i < Math.max(mempoolBlocks.length, prevBlocks.length); i++) {
let added: TransactionStripped[] = [];
let removed: string[] = [];
if (mempoolBlocks[i] && !prevBlocks[i]) {
added = mempoolBlocks[i].transactions;
} else if (!mempoolBlocks[i] && prevBlocks[i]) {
removed = prevBlocks[i].transactions.map(tx => tx.txid);
} else if (mempoolBlocks[i] && prevBlocks[i]) {
const prevIds = {};
const newIds = {};
prevBlocks[i].transactions.forEach(tx => {
prevIds[tx.txid] = true;
});
mempoolBlocks[i].transactions.forEach(tx => {
newIds[tx.txid] = true;
});
prevBlocks[i].transactions.forEach(tx => {
if (!newIds[tx.txid]) {
removed.push(tx.txid);
}
});
mempoolBlocks[i].transactions.forEach(tx => {
if (!prevIds[tx.txid]) {
added.push(tx);
}
});
}
mempoolBlockDeltas.push({
added,
removed
});
}
return {
blocks: mempoolBlocks,
deltas: mempoolBlockDeltas
};
}
private dataToMempoolBlocks(transactions: TransactionExtended[],
blockSize: number, blockWeight: number, blocksIndex: number): MempoolBlockWithTransactions {
let rangeLength = 4;
if (blocksIndex === 0) {
rangeLength = 8;
}
if (transactions.length > 4000) {
rangeLength = 6;
} else if (transactions.length > 10000) {
rangeLength = 8;
}
return {
blockSize: blockSize,
blockVSize: blockWeight / 4,
nTx: transactions.length,
totalFees: transactions.reduce((acc, cur) => acc + cur.fee, 0),
medianFee: Common.percentile(transactions.map((tx) => tx.effectiveFeePerVsize), config.MEMPOOL.RECOMMENDED_FEE_PERCENTILE),
feeRange: Common.getFeesInRange(transactions, rangeLength),
transactionIds: transactions.map((tx) => tx.txid),
transactions: transactions.map((tx) => Common.stripTransaction(tx)),
};
}
}
export default new MempoolBlocks();

View File

@@ -1,35 +1,84 @@
const config = require('../../mempool-config.json');
import config from '../config';
import bitcoinApi from './bitcoin/bitcoin-api-factory';
import { ITransaction, IMempoolInfo, IMempool } from '../interfaces';
import { TransactionExtended, VbytesPerSecond } from '../mempool.interfaces';
import logger from '../logger';
import { Common } from './common';
import transactionUtils from './transaction-utils';
import { IBitcoinApi } from './bitcoin/bitcoin-api.interface';
import loadingIndicators from './loading-indicators';
import bitcoinClient from './bitcoin/bitcoin-client';
import bitcoinSecondClient from './bitcoin/bitcoin-second-client';
import rbfCache from './rbf-cache';
class Mempool {
private mempool: IMempool = {};
private mempoolInfo: IMempoolInfo | undefined;
private mempoolChangedCallback: Function | undefined;
private static WEBSOCKET_REFRESH_RATE_MS = 10000;
private static LAZY_DELETE_AFTER_SECONDS = 30;
private inSync: boolean = false;
private mempoolCacheDelta: number = -1;
private mempoolCache: { [txId: string]: TransactionExtended } = {};
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0, total_fee: 0,
maxmempool: 300000000, mempoolminfee: 0.00001000, minrelaytxfee: 0.00001000 };
private mempoolChangedCallback: ((newMempool: {[txId: string]: TransactionExtended; }, newTransactions: TransactionExtended[],
deletedTransactions: TransactionExtended[]) => void) | undefined;
private txPerSecondArray: number[] = [];
private txPerSecond: number = 0;
private vBytesPerSecondArray: any[] = [];
private vBytesPerSecondArray: VbytesPerSecond[] = [];
private vBytesPerSecond: number = 0;
private mempoolProtection = 0;
private latestTransactions: any[] = [];
constructor() {
setInterval(this.updateTxPerSecond.bind(this), 1000);
setInterval(this.deleteExpiredTransactions.bind(this), 20000);
}
public setMempoolChangedCallback(fn: Function) {
/**
* Return true if we should leave resources available for mempool tx caching
*/
public hasPriority(): boolean {
if (this.inSync) {
return false;
} else {
return this.mempoolCacheDelta == -1 || this.mempoolCacheDelta > 25;
}
}
public isInSync(): boolean {
return this.inSync;
}
public setOutOfSync(): void {
this.inSync = false;
loadingIndicators.setProgress('mempool', 99);
}
public getLatestTransactions() {
return this.latestTransactions;
}
public setMempoolChangedCallback(fn: (newMempool: { [txId: string]: TransactionExtended; },
newTransactions: TransactionExtended[], deletedTransactions: TransactionExtended[]) => void) {
this.mempoolChangedCallback = fn;
}
public getMempool(): { [txid: string]: ITransaction } {
return this.mempool;
public getMempool(): { [txid: string]: TransactionExtended } {
return this.mempoolCache;
}
public setMempool(mempoolData: any) {
this.mempool = mempoolData;
public setMempool(mempoolData: { [txId: string]: TransactionExtended }) {
this.mempoolCache = mempoolData;
if (this.mempoolChangedCallback) {
this.mempoolChangedCallback(this.mempoolCache, [], []);
}
}
public getMempoolInfo(): IMempoolInfo | undefined {
public async $updateMemPoolInfo() {
this.mempoolInfo = await this.$getMempoolInfo();
}
public getMempoolInfo(): IBitcoinApi.MempoolInfo {
return this.mempoolInfo;
}
@@ -41,128 +90,165 @@ class Mempool {
return this.vBytesPerSecond;
}
public async updateMemPoolInfo() {
try {
this.mempoolInfo = await bitcoinApi.getMempoolInfo();
} catch (err) {
console.log('Error getMempoolInfo', err);
}
}
public async getRawTransaction(txId: string, isCoinbase = false): Promise<ITransaction | false> {
try {
const transaction = await bitcoinApi.getRawTransaction(txId);
let totalOut = 0;
transaction.vout.forEach((output) => totalOut += output.value);
if (config.BACKEND_API === 'electrs') {
transaction.feePerWeightUnit = (transaction.fee * 100000000) / transaction.weight || 0;
transaction.feePerVsize = (transaction.fee * 100000000) / (transaction.vsize) || 0;
transaction.totalOut = totalOut / 100000000;
public getFirstSeenForTransactions(txIds: string[]): number[] {
const txTimes: number[] = [];
txIds.forEach((txId: string) => {
const tx = this.mempoolCache[txId];
if (tx && tx.firstSeen) {
txTimes.push(tx.firstSeen);
} else {
let totalIn = 0;
if (!isCoinbase) {
for (let i = 0; i < transaction.vin.length; i++) {
try {
const result = await bitcoinApi.getRawTransaction(transaction.vin[i].txid);
transaction.vin[i]['value'] = result.vout[transaction.vin[i].vout].value;
totalIn += result.vout[transaction.vin[i].vout].value;
} catch (err) {
console.log('Locating historical tx error');
}
}
}
if (totalIn > totalOut) {
transaction.fee = parseFloat((totalIn - totalOut).toFixed(8));
transaction.feePerWeightUnit = (transaction.fee * 100000000) / (transaction.vsize * 4) || 0;
transaction.feePerVsize = (transaction.fee * 100000000) / (transaction.vsize) || 0;
} else if (!isCoinbase) {
transaction.fee = 0;
transaction.feePerVsize = 0;
transaction.feePerWeightUnit = 0;
console.log('Minus fee error!');
}
transaction.totalOut = totalOut;
txTimes.push(0);
}
return transaction;
} catch (e) {
console.log(txId + ' not found');
return false;
}
});
return txTimes;
}
public async updateMempool() {
console.log('Updating mempool');
public async $updateMempool() {
logger.debug('Updating mempool');
const start = new Date().getTime();
let hasChange: boolean = false;
const currentMempoolSize = Object.keys(this.mempoolCache).length;
let txCount = 0;
try {
const transactions = await bitcoinApi.getRawMempool();
const diff = transactions.length - Object.keys(this.mempool).length;
for (const tx of transactions) {
if (!this.mempool[tx]) {
const transaction = await this.getRawTransaction(tx);
if (transaction) {
this.mempool[tx] = transaction;
txCount++;
const transactions = await bitcoinApi.$getRawMempool();
const diff = transactions.length - currentMempoolSize;
const newTransactions: TransactionExtended[] = [];
this.mempoolCacheDelta = Math.abs(diff);
if (!this.inSync) {
loadingIndicators.setProgress('mempool', Object.keys(this.mempoolCache).length / transactions.length * 100);
}
for (const txid of transactions) {
if (!this.mempoolCache[txid]) {
try {
const transaction = await transactionUtils.$getTransactionExtended(txid);
this.mempoolCache[txid] = transaction;
txCount++;
if (this.inSync) {
this.txPerSecondArray.push(new Date().getTime());
this.vBytesPerSecondArray.push({
unixTime: new Date().getTime(),
vSize: transaction.vsize,
});
hasChange = true;
if (diff > 0) {
console.log('Calculated fee for transaction ' + txCount + ' / ' + diff);
} else {
console.log('Calculated fee for transaction ' + txCount);
}
} else {
console.log('Error finding transaction in mempool.');
}
}
if ((new Date().getTime()) - start > config.MEMPOOL_REFRESH_RATE_MS * 10) {
break;
}
}
const newMempool: IMempool = {};
transactions.forEach((tx) => {
if (this.mempool[tx]) {
newMempool[tx] = this.mempool[tx];
} else {
hasChange = true;
if (diff > 0) {
logger.debug('Fetched transaction ' + txCount + ' / ' + diff);
} else {
logger.debug('Fetched transaction ' + txCount);
}
newTransactions.push(transaction);
} catch (e) {
logger.debug('Error finding transaction in mempool: ' + (e instanceof Error ? e.message : e));
}
});
this.mempool = newMempool;
if (hasChange && this.mempoolChangedCallback) {
this.mempoolChangedCallback(this.mempool);
}
const end = new Date().getTime();
const time = end - start;
console.log('Mempool updated in ' + time / 1000 + ' seconds');
} catch (err) {
console.log('getRawMempool error.', err);
if ((new Date().getTime()) - start > Mempool.WEBSOCKET_REFRESH_RATE_MS) {
break;
}
}
// Prevent mempool from clear on bitcoind restart by delaying the deletion
if (this.mempoolProtection === 0
&& currentMempoolSize > 20000
&& transactions.length / currentMempoolSize <= 0.80
) {
this.mempoolProtection = 1;
this.inSync = false;
logger.warn(`Mempool clear protection triggered because transactions.length: ${transactions.length} and currentMempoolSize: ${currentMempoolSize}.`);
setTimeout(() => {
this.mempoolProtection = 2;
logger.warn('Mempool clear protection resumed.');
}, 1000 * 60 * config.MEMPOOL.CLEAR_PROTECTION_MINUTES);
}
const deletedTransactions: TransactionExtended[] = [];
if (this.mempoolProtection !== 1) {
this.mempoolProtection = 0;
// Index object for faster search
const transactionsObject = {};
transactions.forEach((txId) => transactionsObject[txId] = true);
// Flag transactions for lazy deletion
for (const tx in this.mempoolCache) {
if (!transactionsObject[tx] && !this.mempoolCache[tx].deleteAfter) {
deletedTransactions.push(this.mempoolCache[tx]);
this.mempoolCache[tx].deleteAfter = new Date().getTime() + Mempool.LAZY_DELETE_AFTER_SECONDS * 1000;
}
}
}
const newTransactionsStripped = newTransactions.map((tx) => Common.stripTransaction(tx));
this.latestTransactions = newTransactionsStripped.concat(this.latestTransactions).slice(0, 6);
if (!this.inSync && transactions.length === Object.keys(this.mempoolCache).length) {
this.inSync = true;
logger.notice('The mempool is now in sync!');
loadingIndicators.setProgress('mempool', 100);
}
this.mempoolCacheDelta = Math.abs(transactions.length - Object.keys(this.mempoolCache).length);
if (this.mempoolChangedCallback && (hasChange || deletedTransactions.length)) {
this.mempoolChangedCallback(this.mempoolCache, newTransactions, deletedTransactions);
}
const end = new Date().getTime();
const time = end - start;
logger.debug(`New mempool size: ${Object.keys(this.mempoolCache).length} Change: ${diff}`);
logger.debug('Mempool updated in ' + time / 1000 + ' seconds');
}
public handleRbfTransactions(rbfTransactions: { [txid: string]: TransactionExtended; }) {
for (const rbfTransaction in rbfTransactions) {
if (this.mempoolCache[rbfTransaction]) {
// Store replaced transactions
rbfCache.add(rbfTransaction, rbfTransactions[rbfTransaction].txid);
// Erase the replaced transactions from the local mempool
delete this.mempoolCache[rbfTransaction];
}
}
}
private updateTxPerSecond() {
const nowMinusTimeSpan = new Date().getTime() - (1000 * config.TX_PER_SECOND_SPAN_SECONDS);
const nowMinusTimeSpan = new Date().getTime() - (1000 * config.STATISTICS.TX_PER_SECOND_SAMPLE_PERIOD);
this.txPerSecondArray = this.txPerSecondArray.filter((unixTime) => unixTime > nowMinusTimeSpan);
this.txPerSecond = this.txPerSecondArray.length / config.TX_PER_SECOND_SPAN_SECONDS || 0;
this.txPerSecond = this.txPerSecondArray.length / config.STATISTICS.TX_PER_SECOND_SAMPLE_PERIOD || 0;
this.vBytesPerSecondArray = this.vBytesPerSecondArray.filter((data) => data.unixTime > nowMinusTimeSpan);
if (this.vBytesPerSecondArray.length) {
this.vBytesPerSecond = Math.round(
this.vBytesPerSecondArray.map((data) => data.vSize).reduce((a, b) => a + b) / config.TX_PER_SECOND_SPAN_SECONDS
this.vBytesPerSecondArray.map((data) => data.vSize).reduce((a, b) => a + b) / config.STATISTICS.TX_PER_SECOND_SAMPLE_PERIOD
);
}
}
private deleteExpiredTransactions() {
const now = new Date().getTime();
for (const tx in this.mempoolCache) {
const lazyDeleteAt = this.mempoolCache[tx].deleteAfter;
if (lazyDeleteAt && lazyDeleteAt < now) {
delete this.mempoolCache[tx];
}
}
}
private $getMempoolInfo() {
if (config.MEMPOOL.USE_SECOND_NODE_FOR_MINFEE) {
return Promise.all([
bitcoinClient.getMempoolInfo(),
bitcoinSecondClient.getMempoolInfo()
]).then(([mempoolInfo, secondMempoolInfo]) => {
mempoolInfo.maxmempool = secondMempoolInfo.maxmempool;
mempoolInfo.mempoolminfee = secondMempoolInfo.mempoolminfee;
mempoolInfo.minrelaytxfee = secondMempoolInfo.minrelaytxfee;
return mempoolInfo;
});
}
return bitcoinClient.getMempoolInfo();
}
}
export default new Mempool();

405
backend/src/api/mining.ts Normal file
View File

@@ -0,0 +1,405 @@
import { PoolInfo, PoolStats, RewardStats } from '../mempool.interfaces';
import BlocksRepository from '../repositories/BlocksRepository';
import PoolsRepository from '../repositories/PoolsRepository';
import HashratesRepository from '../repositories/HashratesRepository';
import bitcoinClient from './bitcoin/bitcoin-client';
import logger from '../logger';
import { Common } from './common';
import loadingIndicators from './loading-indicators';
import { escape } from 'mysql2';
class Mining {
constructor() {
}
/**
* Get historical block total fee
*/
public async $getHistoricalBlockFees(interval: string | null = null): Promise<any> {
return await BlocksRepository.$getHistoricalBlockFees(
this.getTimeRange(interval),
Common.getSqlInterval(interval)
);
}
/**
* Get historical block rewards
*/
public async $getHistoricalBlockRewards(interval: string | null = null): Promise<any> {
return await BlocksRepository.$getHistoricalBlockRewards(
this.getTimeRange(interval),
Common.getSqlInterval(interval)
);
}
/**
* Get historical block fee rates percentiles
*/
public async $getHistoricalBlockFeeRates(interval: string | null = null): Promise<any> {
return await BlocksRepository.$getHistoricalBlockFeeRates(
this.getTimeRange(interval),
Common.getSqlInterval(interval)
);
}
/**
* Get historical block sizes
*/
public async $getHistoricalBlockSizes(interval: string | null = null): Promise<any> {
return await BlocksRepository.$getHistoricalBlockSizes(
this.getTimeRange(interval),
Common.getSqlInterval(interval)
);
}
/**
* Get historical block weights
*/
public async $getHistoricalBlockWeights(interval: string | null = null): Promise<any> {
return await BlocksRepository.$getHistoricalBlockWeights(
this.getTimeRange(interval),
Common.getSqlInterval(interval)
);
}
/**
* Generate high level overview of the pool ranks and general stats
*/
public async $getPoolsStats(interval: string | null): Promise<object> {
const poolsStatistics = {};
const poolsInfo: PoolInfo[] = await PoolsRepository.$getPoolsInfo(interval);
const emptyBlocks: any[] = await BlocksRepository.$countEmptyBlocks(null, interval);
const poolsStats: PoolStats[] = [];
let rank = 1;
poolsInfo.forEach((poolInfo: PoolInfo) => {
const emptyBlocksCount = emptyBlocks.filter((emptyCount) => emptyCount.poolId === poolInfo.poolId);
const poolStat: PoolStats = {
poolId: poolInfo.poolId, // mysql row id
name: poolInfo.name,
link: poolInfo.link,
blockCount: poolInfo.blockCount,
rank: rank++,
emptyBlocks: emptyBlocksCount.length > 0 ? emptyBlocksCount[0]['count'] : 0,
slug: poolInfo.slug,
};
poolsStats.push(poolStat);
});
poolsStatistics['pools'] = poolsStats;
const blockCount: number = await BlocksRepository.$blockCount(null, interval);
poolsStatistics['blockCount'] = blockCount;
const totalBlock24h: number = await BlocksRepository.$blockCount(null, '24h');
try {
poolsStatistics['lastEstimatedHashrate'] = await bitcoinClient.getNetworkHashPs(totalBlock24h);
} catch (e) {
poolsStatistics['lastEstimatedHashrate'] = 0;
logger.debug('Bitcoin Core is not available, using zeroed value for current hashrate');
}
return poolsStatistics;
}
/**
* Get all mining pool stats for a pool
*/
public async $getPoolStat(slug: string): Promise<object> {
const pool = await PoolsRepository.$getPool(slug);
if (!pool) {
throw new Error('This mining pool does not exist ' + escape(slug));
}
const blockCount: number = await BlocksRepository.$blockCount(pool.id);
const totalBlock: number = await BlocksRepository.$blockCount(null, null);
const blockCount24h: number = await BlocksRepository.$blockCount(pool.id, '24h');
const totalBlock24h: number = await BlocksRepository.$blockCount(null, '24h');
const blockCount1w: number = await BlocksRepository.$blockCount(pool.id, '1w');
const totalBlock1w: number = await BlocksRepository.$blockCount(null, '1w');
let currentEstimatedHashrate = 0;
try {
currentEstimatedHashrate = await bitcoinClient.getNetworkHashPs(totalBlock24h);
} catch (e) {
logger.debug('Bitcoin Core is not available, using zeroed value for current hashrate');
}
return {
pool: pool,
blockCount: {
'all': blockCount,
'24h': blockCount24h,
'1w': blockCount1w,
},
blockShare: {
'all': blockCount / totalBlock,
'24h': blockCount24h / totalBlock24h,
'1w': blockCount1w / totalBlock1w,
},
estimatedHashrate: currentEstimatedHashrate * (blockCount24h / totalBlock24h),
reportedHashrate: null,
};
}
/**
* Get miner reward stats
*/
public async $getRewardStats(blockCount: number): Promise<RewardStats> {
return await BlocksRepository.$getBlockStats(blockCount);
}
/**
* [INDEXING] Generate weekly mining pool hashrate history
*/
public async $generatePoolHashrateHistory(): Promise<void> {
const now = new Date();
try {
const lastestRunDate = await HashratesRepository.$getLatestRun('last_weekly_hashrates_indexing');
// Run only if:
// * lastestRunDate is set to 0 (node backend restart, reorg)
// * we started a new week (around Monday midnight)
const runIndexing = lastestRunDate === 0 || now.getUTCDay() === 1 && lastestRunDate !== now.getUTCDate();
if (!runIndexing) {
return;
}
} catch (e) {
throw e;
}
try {
const indexedTimestamp = await HashratesRepository.$getWeeklyHashrateTimestamps();
const hashrates: any[] = [];
const genesisTimestamp = 1231006505000; // bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
const lastMonday = new Date(now.setDate(now.getDate() - (now.getDay() + 6) % 7));
const lastMondayMidnight = this.getDateMidnight(lastMonday);
let toTimestamp = lastMondayMidnight.getTime();
const totalWeekIndexed = (await BlocksRepository.$blockCount(null, null)) / 1008;
let indexedThisRun = 0;
let totalIndexed = 0;
let newlyIndexed = 0;
const startedAt = new Date().getTime() / 1000;
let timer = new Date().getTime() / 1000;
logger.debug(`Indexing weekly mining pool hashrate`);
loadingIndicators.setProgress('weekly-hashrate-indexing', 0);
while (toTimestamp > genesisTimestamp) {
const fromTimestamp = toTimestamp - 604800000;
// Skip already indexed weeks
if (indexedTimestamp.includes(toTimestamp / 1000)) {
toTimestamp -= 604800000;
++totalIndexed;
continue;
}
// Check if we have blocks for the previous week (which mean that the week
// we are currently indexing has complete data)
const blockStatsPreviousWeek: any = await BlocksRepository.$blockCountBetweenTimestamp(
null, (fromTimestamp - 604800000) / 1000, (toTimestamp - 604800000) / 1000);
if (blockStatsPreviousWeek.blockCount === 0) { // We are done indexing
break;
}
const blockStats: any = await BlocksRepository.$blockCountBetweenTimestamp(
null, fromTimestamp / 1000, toTimestamp / 1000);
const lastBlockHashrate = await bitcoinClient.getNetworkHashPs(blockStats.blockCount,
blockStats.lastBlockHeight);
let pools = await PoolsRepository.$getPoolsInfoBetween(fromTimestamp / 1000, toTimestamp / 1000);
const totalBlocks = pools.reduce((acc, pool) => acc + pool.blockCount, 0);
pools = pools.map((pool: any) => {
pool.hashrate = (pool.blockCount / totalBlocks) * lastBlockHashrate;
pool.share = (pool.blockCount / totalBlocks);
return pool;
});
for (const pool of pools) {
hashrates.push({
hashrateTimestamp: toTimestamp / 1000,
avgHashrate: pool['hashrate'],
poolId: pool.poolId,
share: pool['share'],
type: 'weekly',
});
}
newlyIndexed += hashrates.length;
await HashratesRepository.$saveHashrates(hashrates);
hashrates.length = 0;
const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer));
if (elapsedSeconds > 1) {
const runningFor = Math.max(1, Math.round((new Date().getTime() / 1000) - startedAt));
const weeksPerSeconds = Math.max(1, Math.round(indexedThisRun / elapsedSeconds));
const progress = Math.round(totalIndexed / totalWeekIndexed * 10000) / 100;
const timeLeft = Math.round((totalWeekIndexed - totalIndexed) / weeksPerSeconds);
const formattedDate = new Date(fromTimestamp).toUTCString();
logger.debug(`Getting weekly pool hashrate for ${formattedDate} | ~${weeksPerSeconds.toFixed(2)} weeks/sec | total: ~${totalIndexed}/${Math.round(totalWeekIndexed)} (${progress}%) | elapsed: ${runningFor} seconds | left: ~${timeLeft} seconds`);
timer = new Date().getTime() / 1000;
indexedThisRun = 0;
loadingIndicators.setProgress('weekly-hashrate-indexing', progress, false);
}
toTimestamp -= 604800000;
++indexedThisRun;
++totalIndexed;
}
await HashratesRepository.$setLatestRun('last_weekly_hashrates_indexing', new Date().getUTCDate());
if (newlyIndexed > 0) {
logger.info(`Indexed ${newlyIndexed} pools weekly hashrate`);
}
loadingIndicators.setProgress('weekly-hashrate-indexing', 100);
} catch (e) {
loadingIndicators.setProgress('weekly-hashrate-indexing', 100);
throw e;
}
}
/**
* [INDEXING] Generate daily hashrate data
*/
public async $generateNetworkHashrateHistory(): Promise<void> {
try {
// We only run this once a day around midnight
const latestRunDate = await HashratesRepository.$getLatestRun('last_hashrates_indexing');
const now = new Date().getUTCDate();
if (now === latestRunDate) {
return;
}
} catch (e) {
throw e;
}
try {
const indexedTimestamp = (await HashratesRepository.$getNetworkDailyHashrate(null)).map(hashrate => hashrate.timestamp);
const genesisTimestamp = 1231006505000; // bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
const lastMidnight = this.getDateMidnight(new Date());
let toTimestamp = Math.round(lastMidnight.getTime());
const hashrates: any[] = [];
const totalDayIndexed = (await BlocksRepository.$blockCount(null, null)) / 144;
let indexedThisRun = 0;
let totalIndexed = 0;
let newlyIndexed = 0;
const startedAt = new Date().getTime() / 1000;
let timer = new Date().getTime() / 1000;
logger.debug(`Indexing daily network hashrate`);
loadingIndicators.setProgress('daily-hashrate-indexing', 0);
while (toTimestamp > genesisTimestamp) {
const fromTimestamp = toTimestamp - 86400000;
// Skip already indexed weeks
if (indexedTimestamp.includes(toTimestamp / 1000)) {
toTimestamp -= 86400000;
++totalIndexed;
continue;
}
// Check if we have blocks for the previous day (which mean that the day
// we are currently indexing has complete data)
const blockStatsPreviousDay: any = await BlocksRepository.$blockCountBetweenTimestamp(
null, (fromTimestamp - 86400000) / 1000, (toTimestamp - 86400000) / 1000);
if (blockStatsPreviousDay.blockCount === 0) { // We are done indexing
break;
}
const blockStats: any = await BlocksRepository.$blockCountBetweenTimestamp(
null, fromTimestamp / 1000, toTimestamp / 1000);
const lastBlockHashrate = await bitcoinClient.getNetworkHashPs(blockStats.blockCount,
blockStats.lastBlockHeight);
hashrates.push({
hashrateTimestamp: toTimestamp / 1000,
avgHashrate: lastBlockHashrate,
poolId: 0,
share: 1,
type: 'daily',
});
if (hashrates.length > 10) {
newlyIndexed += hashrates.length;
await HashratesRepository.$saveHashrates(hashrates);
hashrates.length = 0;
}
const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer));
if (elapsedSeconds > 1) {
const runningFor = Math.max(1, Math.round((new Date().getTime() / 1000) - startedAt));
const daysPerSeconds = Math.max(1, Math.round(indexedThisRun / elapsedSeconds));
const progress = Math.round(totalIndexed / totalDayIndexed * 10000) / 100;
const timeLeft = Math.round((totalDayIndexed - totalIndexed) / daysPerSeconds);
const formattedDate = new Date(fromTimestamp).toUTCString();
logger.debug(`Getting network daily hashrate for ${formattedDate} | ~${daysPerSeconds.toFixed(2)} days/sec | total: ~${totalIndexed}/${Math.round(totalDayIndexed)} (${progress}%) | elapsed: ${runningFor} seconds | left: ~${timeLeft} seconds`);
timer = new Date().getTime() / 1000;
indexedThisRun = 0;
loadingIndicators.setProgress('daily-hashrate-indexing', progress);
}
toTimestamp -= 86400000;
++indexedThisRun;
++totalIndexed;
}
// Add genesis block manually
if (toTimestamp <= genesisTimestamp && !indexedTimestamp.includes(genesisTimestamp)) {
hashrates.push({
hashrateTimestamp: genesisTimestamp,
avgHashrate: await bitcoinClient.getNetworkHashPs(1, 1),
poolId: null,
type: 'daily',
});
}
newlyIndexed += hashrates.length;
await HashratesRepository.$saveHashrates(hashrates);
await HashratesRepository.$setLatestRun('last_hashrates_indexing', new Date().getUTCDate());
if (newlyIndexed > 0) {
logger.info(`Indexed ${newlyIndexed} day of network hashrate`);
}
loadingIndicators.setProgress('daily-hashrate-indexing', 100);
} catch (e) {
loadingIndicators.setProgress('daily-hashrate-indexing', 100);
throw e;
}
}
private getDateMidnight(date: Date): Date {
date.setUTCHours(0);
date.setUTCMinutes(0);
date.setUTCSeconds(0);
date.setUTCMilliseconds(0);
return date;
}
private getTimeRange(interval: string | null): number {
switch (interval) {
case '3y': return 43200; // 12h
case '2y': return 28800; // 8h
case '1y': return 28800; // 8h
case '6m': return 10800; // 3h
case '3m': return 7200; // 2h
case '1m': return 1800; // 30min
case '1w': return 300; // 5min
case '3d': return 1;
case '24h': return 1;
default: return 86400; // 24h
}
}
}
export default new Mining();

View File

@@ -0,0 +1,206 @@
import DB from '../database';
import logger from '../logger';
import config from '../config';
interface Pool {
name: string;
link: string;
regexes: string[];
addresses: string[];
slug: string;
}
class PoolsParser {
miningPools: any[] = [];
unknownPool: any = {
'name': "Unknown",
'link': "https://learnmeabitcoin.com/technical/coinbase-transaction",
'regexes': "[]",
'addresses': "[]",
'slug': 'unknown'
};
slugWarnFlag = false;
/**
* Parse the pools.json file, consolidate the data and dump it into the database
*/
public async migratePoolsJson(poolsJson: object) {
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) === false) {
return;
}
// First we save every entries without paying attention to pool duplication
const poolsDuplicated: Pool[] = [];
logger.debug('Parse coinbase_tags');
const coinbaseTags = Object.entries(poolsJson['coinbase_tags']);
for (let i = 0; i < coinbaseTags.length; ++i) {
poolsDuplicated.push({
'name': (<Pool>coinbaseTags[i][1]).name,
'link': (<Pool>coinbaseTags[i][1]).link,
'regexes': [coinbaseTags[i][0]],
'addresses': [],
'slug': ''
});
}
logger.debug('Parse payout_addresses');
const addressesTags = Object.entries(poolsJson['payout_addresses']);
for (let i = 0; i < addressesTags.length; ++i) {
poolsDuplicated.push({
'name': (<Pool>addressesTags[i][1]).name,
'link': (<Pool>addressesTags[i][1]).link,
'regexes': [],
'addresses': [addressesTags[i][0]],
'slug': ''
});
}
// Then, we find unique mining pool names
logger.debug('Identify unique mining pools');
const poolNames: string[] = [];
for (let i = 0; i < poolsDuplicated.length; ++i) {
if (poolNames.indexOf(poolsDuplicated[i].name) === -1) {
poolNames.push(poolsDuplicated[i].name);
}
}
logger.debug(`Found ${poolNames.length} unique mining pools`);
// Get existing pools from the db
let existingPools;
try {
if (config.DATABASE.ENABLED === true) {
[existingPools] = await DB.query({ sql: 'SELECT * FROM pools;', timeout: 120000 });
} else {
existingPools = [];
}
} catch (e) {
logger.err('Cannot get existing pools from the database, skipping pools.json import');
return;
}
this.miningPools = [];
// Finally, we generate the final consolidated pools data
const finalPoolDataAdd: Pool[] = [];
const finalPoolDataUpdate: Pool[] = [];
for (let i = 0; i < poolNames.length; ++i) {
let allAddresses: string[] = [];
let allRegexes: string[] = [];
const match = poolsDuplicated.filter((pool: Pool) => pool.name === poolNames[i]);
for (let y = 0; y < match.length; ++y) {
allAddresses = allAddresses.concat(match[y].addresses);
allRegexes = allRegexes.concat(match[y].regexes);
}
const finalPoolName = poolNames[i].replace(`'`, `''`); // To support single quote in names when doing db queries
let slug: string | undefined;
try {
slug = poolsJson['slugs'][poolNames[i]];
} catch (e) {
if (this.slugWarnFlag === false) {
logger.warn(`pools.json does not seem to contain the 'slugs' object`);
this.slugWarnFlag = true;
}
}
if (slug === undefined) {
// Only keep alphanumerical
slug = poolNames[i].replace(/[^a-z0-9]/gi, '').toLowerCase();
logger.warn(`No slug found for '${poolNames[i]}', generating it => '${slug}'`);
}
const poolObj = {
'name': finalPoolName,
'link': match[0].link,
'regexes': allRegexes,
'addresses': allAddresses,
'slug': slug
};
if (existingPools.find((pool) => pool.name === poolNames[i]) !== undefined) {
finalPoolDataUpdate.push(poolObj);
} else {
logger.debug(`Add '${finalPoolName}' mining pool`);
finalPoolDataAdd.push(poolObj);
}
this.miningPools.push({
'name': finalPoolName,
'link': match[0].link,
'regexes': JSON.stringify(allRegexes),
'addresses': JSON.stringify(allAddresses),
'slug': slug
});
}
if (config.DATABASE.ENABLED === false) { // Don't run db operations
logger.info('Mining pools.json import completed (no database)');
return;
}
logger.debug(`Update pools table now`);
// Add new mining pools into the database
let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses, slug) VALUES ';
for (let i = 0; i < finalPoolDataAdd.length; ++i) {
queryAdd += `('${finalPoolDataAdd[i].name}', '${finalPoolDataAdd[i].link}',
'${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}',
${JSON.stringify(finalPoolDataAdd[i].slug)}),`;
}
queryAdd = queryAdd.slice(0, -1) + ';';
// Updated existing mining pools in the database
const updateQueries: string[] = [];
for (let i = 0; i < finalPoolDataUpdate.length; ++i) {
updateQueries.push(`
UPDATE pools
SET name='${finalPoolDataUpdate[i].name}', link='${finalPoolDataUpdate[i].link}',
regexes='${JSON.stringify(finalPoolDataUpdate[i].regexes)}', addresses='${JSON.stringify(finalPoolDataUpdate[i].addresses)}',
slug='${finalPoolDataUpdate[i].slug}'
WHERE name='${finalPoolDataUpdate[i].name}'
;`);
}
try {
if (finalPoolDataAdd.length > 0) {
await DB.query({ sql: queryAdd, timeout: 120000 });
}
for (const query of updateQueries) {
await DB.query({ sql: query, timeout: 120000 });
}
await this.insertUnknownPool();
logger.info('Mining pools.json import completed');
} catch (e) {
logger.err(`Cannot import pools in the database`);
throw e;
}
}
/**
* Manually add the 'unknown pool'
*/
private async insertUnknownPool() {
try {
const [rows]: any[] = await DB.query({ sql: 'SELECT name from pools where name="Unknown"', timeout: 120000 });
if (rows.length === 0) {
await DB.query({
sql: `INSERT INTO pools(name, link, regexes, addresses, slug)
VALUES("Unknown", "https://learnmeabitcoin.com/technical/coinbase-transaction", "[]", "[]", "unknown");
`});
} else {
await DB.query(`UPDATE pools
SET name='Unknown', link='https://learnmeabitcoin.com/technical/coinbase-transaction',
regexes='[]', addresses='[]',
slug='unknown'
WHERE name='Unknown'
`);
}
} catch (e) {
logger.err('Unable to insert "Unknown" mining pool');
}
}
}
export default new PoolsParser();

View File

@@ -1,101 +0,0 @@
const config = require('../../mempool-config.json');
import { ITransaction, IProjectedBlock, IMempool, IProjectedBlockInternal } from '../interfaces';
class ProjectedBlocks {
private transactionsSorted: ITransaction[] = [];
constructor() {}
public getProjectedBlockFeesForBlock(index: number) {
const projectedBlock = this.getProjectedBlocksInternal()[index];
if (!projectedBlock) {
throw new Error('No projected block for that index');
}
return projectedBlock.txFeePerVsizes.map((fpv) => {
return {'fpv': fpv};
});
}
public updateProjectedBlocks(memPool: IMempool): void {
const latestMempool = memPool;
const memPoolArray: ITransaction[] = [];
for (const i in latestMempool) {
if (latestMempool.hasOwnProperty(i)) {
memPoolArray.push(latestMempool[i]);
}
}
memPoolArray.sort((a, b) => b.feePerWeightUnit - a.feePerWeightUnit);
this.transactionsSorted = memPoolArray.filter((tx) => tx.feePerWeightUnit);
}
public getProjectedBlocks(txId?: string, numberOfBlocks: number = config.DEFAULT_PROJECTED_BLOCKS_AMOUNT): IProjectedBlock[] {
return this.getProjectedBlocksInternal(numberOfBlocks).map((projectedBlock) => {
return {
blockSize: projectedBlock.blockSize,
blockWeight: projectedBlock.blockWeight,
nTx: projectedBlock.nTx,
minFee: projectedBlock.minFee,
maxFee: projectedBlock.maxFee,
minWeightFee: projectedBlock.minWeightFee,
maxWeightFee: projectedBlock.maxWeightFee,
medianFee: projectedBlock.medianFee,
fees: projectedBlock.fees,
hasMytx: txId ? projectedBlock.txIds.some((tx) => tx === txId) : false
};
});
}
private getProjectedBlocksInternal(numberOfBlocks: number = config.DEFAULT_PROJECTED_BLOCKS_AMOUNT): IProjectedBlockInternal[] {
const projectedBlocks: IProjectedBlockInternal[] = [];
let blockWeight = 0;
let blockSize = 0;
let transactions: ITransaction[] = [];
this.transactionsSorted.forEach((tx) => {
if (blockWeight + tx.vsize * 4 < 4000000 || projectedBlocks.length === numberOfBlocks) {
blockWeight += tx.weight || tx.vsize * 4;
blockSize += tx.size;
transactions.push(tx);
} else {
projectedBlocks.push(this.dataToProjectedBlock(transactions, blockSize, blockWeight));
blockWeight = 0;
blockSize = 0;
transactions = [];
}
});
if (transactions.length) {
projectedBlocks.push(this.dataToProjectedBlock(transactions, blockSize, blockWeight));
}
return projectedBlocks;
}
private dataToProjectedBlock(transactions: ITransaction[], blockSize: number, blockWeight: number): IProjectedBlockInternal {
return {
blockSize: blockSize,
blockWeight: blockWeight,
nTx: transactions.length,
minFee: transactions[transactions.length - 1].feePerVsize,
maxFee: transactions[0].feePerVsize,
minWeightFee: transactions[transactions.length - 1].feePerWeightUnit,
maxWeightFee: transactions[0].feePerWeightUnit,
medianFee: this.median(transactions.map((tx) => tx.feePerVsize)),
txIds: transactions.map((tx) => tx.txid),
txFeePerVsizes: transactions.map((tx) => tx.feePerVsize).reverse(),
fees: transactions.map((tx) => tx.fee).reduce((acc, currValue) => acc + currValue),
};
}
private median(numbers: number[]) {
let medianNr = 0;
const numsLen = numbers.length;
if (numsLen % 2 === 0) {
medianNr = (numbers[numsLen / 2 - 1] + numbers[numsLen / 2]) / 2;
} else {
medianNr = numbers[(numsLen - 1) / 2];
}
return medianNr;
}
}
export default new ProjectedBlocks();

View File

@@ -0,0 +1,34 @@
export interface CachedRbf {
txid: string;
expires: Date;
}
class RbfCache {
private cache: { [txid: string]: CachedRbf; } = {};
constructor() {
setInterval(this.cleanup.bind(this), 1000 * 60 * 60);
}
public add(replacedTxId: string, newTxId: string): void {
this.cache[replacedTxId] = {
expires: new Date(Date.now() + 1000 * 604800), // 1 week
txid: newTxId,
};
}
public get(txId: string): CachedRbf | undefined {
return this.cache[txId];
}
private cleanup(): void {
const currentDate = new Date();
for (const c in this.cache) {
if (this.cache[c].expires < currentDate) {
delete this.cache[c];
}
}
}
}
export default new RbfCache();

View File

@@ -1,20 +1,25 @@
import memPool from './mempool';
import { DB } from '../database';
import DB from '../database';
import logger from '../logger';
import { ITransaction, IMempoolStats } from '../interfaces';
import { Statistic, TransactionExtended, OptimizedStatistic } from '../mempool.interfaces';
import config from '../config';
import { Common } from './common';
class Statistics {
protected intervalTimer: NodeJS.Timer | undefined;
protected newStatisticsEntryCallback: Function | undefined;
protected newStatisticsEntryCallback: ((stats: OptimizedStatistic) => void) | undefined;
protected queryTimeout = 120000;
public setNewStatisticsEntryCallback(fn: Function) {
public setNewStatisticsEntryCallback(fn: (stats: OptimizedStatistic) => void) {
this.newStatisticsEntryCallback = fn;
}
constructor() {
}
constructor() { }
public startStatistics(): void {
logger.info('Starting statistics service');
const now = new Date();
const nextInterval = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(),
Math.floor(now.getMinutes() / 1) * 1 + 1, 0, 0);
@@ -22,60 +27,63 @@ class Statistics {
setTimeout(() => {
this.runStatistics();
this.intervalTimer = setInterval(() => { this.runStatistics(); }, 1 * 60 * 1000);
this.intervalTimer = setInterval(() => {
this.runStatistics();
}, 1 * 60 * 1000);
}, difference);
}
private async runStatistics(): Promise<void> {
if (!memPool.isInSync()) {
return;
}
const currentMempool = memPool.getMempool();
const txPerSecond = memPool.getTxPerSecond();
const vBytesPerSecond = memPool.getVBytesPerSecond();
if (txPerSecond === 0) {
return;
}
logger.debug('Running statistics');
console.log('Running statistics');
let memPoolArray: ITransaction[] = [];
let memPoolArray: TransactionExtended[] = [];
for (const i in currentMempool) {
if (currentMempool.hasOwnProperty(i)) {
memPoolArray.push(currentMempool[i]);
}
}
// Remove 0 and undefined
memPoolArray = memPoolArray.filter((tx) => tx.feePerWeightUnit);
memPoolArray = memPoolArray.filter((tx) => tx.effectiveFeePerVsize);
if (!memPoolArray.length) {
try {
const insertIdZeroed = await this.$createZeroedStatistic();
if (this.newStatisticsEntryCallback && insertIdZeroed) {
const newStats = await this.$get(insertIdZeroed);
if (newStats) {
this.newStatisticsEntryCallback(newStats);
}
}
} catch (e) {
logger.err('Unable to insert zeroed statistics. ' + e);
}
return;
}
memPoolArray.sort((a, b) => a.feePerWeightUnit - b.feePerWeightUnit);
memPoolArray.sort((a, b) => a.effectiveFeePerVsize - b.effectiveFeePerVsize);
const totalWeight = memPoolArray.map((tx) => tx.vsize).reduce((acc, curr) => acc + curr) * 4;
const totalFee = memPoolArray.map((tx) => tx.fee).reduce((acc, curr) => acc + curr);
const logFees = [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200,
250, 300, 350, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000];
const weightUnitFees: { [feePerWU: number]: number } = {};
const weightVsizeFees: { [feePerWU: number]: number } = {};
const lastItem = logFees.length - 1;
memPoolArray.forEach((transaction) => {
for (let i = 0; i < logFees.length; i++) {
if ((logFees[i] === 2000 && transaction.feePerWeightUnit >= 2000) || transaction.feePerWeightUnit <= logFees[i]) {
if (weightUnitFees[logFees[i]]) {
weightUnitFees[logFees[i]] += transaction.vsize * 4;
} else {
weightUnitFees[logFees[i]] = transaction.vsize * 4;
}
break;
}
}
});
memPoolArray.forEach((transaction) => {
for (let i = 0; i < logFees.length; i++) {
if ((logFees[i] === 2000 && transaction.feePerVsize >= 2000) || transaction.feePerVsize <= logFees[i]) {
if (
(Common.isLiquid() && (i === lastItem || transaction.effectiveFeePerVsize * 10 < logFees[i + 1]))
||
(!Common.isLiquid() && (i === lastItem || transaction.effectiveFeePerVsize < logFees[i + 1]))
) {
if (weightVsizeFees[logFees[i]]) {
weightVsizeFees[logFees[i]] += transaction.vsize;
} else {
@@ -86,66 +94,126 @@ class Statistics {
}
});
const insertId = await this.$create({
added: 'NOW()',
unconfirmed_transactions: memPoolArray.length,
tx_per_second: txPerSecond,
vbytes_per_second: Math.round(vBytesPerSecond),
mempool_byte_weight: totalWeight,
total_fee: totalFee,
fee_data: JSON.stringify({
'wu': weightUnitFees,
'vsize': weightVsizeFees
}),
vsize_1: weightVsizeFees['1'] || 0,
vsize_2: weightVsizeFees['2'] || 0,
vsize_3: weightVsizeFees['3'] || 0,
vsize_4: weightVsizeFees['4'] || 0,
vsize_5: weightVsizeFees['5'] || 0,
vsize_6: weightVsizeFees['6'] || 0,
vsize_8: weightVsizeFees['8'] || 0,
vsize_10: weightVsizeFees['10'] || 0,
vsize_12: weightVsizeFees['12'] || 0,
vsize_15: weightVsizeFees['15'] || 0,
vsize_20: weightVsizeFees['20'] || 0,
vsize_30: weightVsizeFees['30'] || 0,
vsize_40: weightVsizeFees['40'] || 0,
vsize_50: weightVsizeFees['50'] || 0,
vsize_60: weightVsizeFees['60'] || 0,
vsize_70: weightVsizeFees['70'] || 0,
vsize_80: weightVsizeFees['80'] || 0,
vsize_90: weightVsizeFees['90'] || 0,
vsize_100: weightVsizeFees['100'] || 0,
vsize_125: weightVsizeFees['125'] || 0,
vsize_150: weightVsizeFees['150'] || 0,
vsize_175: weightVsizeFees['175'] || 0,
vsize_200: weightVsizeFees['200'] || 0,
vsize_250: weightVsizeFees['250'] || 0,
vsize_300: weightVsizeFees['300'] || 0,
vsize_350: weightVsizeFees['350'] || 0,
vsize_400: weightVsizeFees['400'] || 0,
vsize_500: weightVsizeFees['500'] || 0,
vsize_600: weightVsizeFees['600'] || 0,
vsize_700: weightVsizeFees['700'] || 0,
vsize_800: weightVsizeFees['800'] || 0,
vsize_900: weightVsizeFees['900'] || 0,
vsize_1000: weightVsizeFees['1000'] || 0,
vsize_1200: weightVsizeFees['1200'] || 0,
vsize_1400: weightVsizeFees['1400'] || 0,
vsize_1600: weightVsizeFees['1600'] || 0,
vsize_1800: weightVsizeFees['1800'] || 0,
vsize_2000: weightVsizeFees['2000'] || 0,
});
try {
const insertId = await this.$create({
added: 'NOW()',
unconfirmed_transactions: memPoolArray.length,
tx_per_second: txPerSecond,
vbytes_per_second: Math.round(vBytesPerSecond),
mempool_byte_weight: totalWeight,
total_fee: totalFee,
fee_data: '',
vsize_1: weightVsizeFees['1'] || 0,
vsize_2: weightVsizeFees['2'] || 0,
vsize_3: weightVsizeFees['3'] || 0,
vsize_4: weightVsizeFees['4'] || 0,
vsize_5: weightVsizeFees['5'] || 0,
vsize_6: weightVsizeFees['6'] || 0,
vsize_8: weightVsizeFees['8'] || 0,
vsize_10: weightVsizeFees['10'] || 0,
vsize_12: weightVsizeFees['12'] || 0,
vsize_15: weightVsizeFees['15'] || 0,
vsize_20: weightVsizeFees['20'] || 0,
vsize_30: weightVsizeFees['30'] || 0,
vsize_40: weightVsizeFees['40'] || 0,
vsize_50: weightVsizeFees['50'] || 0,
vsize_60: weightVsizeFees['60'] || 0,
vsize_70: weightVsizeFees['70'] || 0,
vsize_80: weightVsizeFees['80'] || 0,
vsize_90: weightVsizeFees['90'] || 0,
vsize_100: weightVsizeFees['100'] || 0,
vsize_125: weightVsizeFees['125'] || 0,
vsize_150: weightVsizeFees['150'] || 0,
vsize_175: weightVsizeFees['175'] || 0,
vsize_200: weightVsizeFees['200'] || 0,
vsize_250: weightVsizeFees['250'] || 0,
vsize_300: weightVsizeFees['300'] || 0,
vsize_350: weightVsizeFees['350'] || 0,
vsize_400: weightVsizeFees['400'] || 0,
vsize_500: weightVsizeFees['500'] || 0,
vsize_600: weightVsizeFees['600'] || 0,
vsize_700: weightVsizeFees['700'] || 0,
vsize_800: weightVsizeFees['800'] || 0,
vsize_900: weightVsizeFees['900'] || 0,
vsize_1000: weightVsizeFees['1000'] || 0,
vsize_1200: weightVsizeFees['1200'] || 0,
vsize_1400: weightVsizeFees['1400'] || 0,
vsize_1600: weightVsizeFees['1600'] || 0,
vsize_1800: weightVsizeFees['1800'] || 0,
vsize_2000: weightVsizeFees['2000'] || 0,
});
if (this.newStatisticsEntryCallback && insertId) {
const newStats = await this.$get(insertId);
this.newStatisticsEntryCallback(newStats);
if (this.newStatisticsEntryCallback && insertId) {
const newStats = await this.$get(insertId);
if (newStats) {
this.newStatisticsEntryCallback(newStats);
}
}
} catch (e) {
logger.err('Unable to insert statistics. ' + e);
}
}
private async $create(statistics: IMempoolStats): Promise<number | undefined> {
private async $createZeroedStatistic(): Promise<number | undefined> {
try {
const query = `INSERT INTO statistics(
added,
unconfirmed_transactions,
tx_per_second,
vbytes_per_second,
mempool_byte_weight,
fee_data,
total_fee,
vsize_1,
vsize_2,
vsize_3,
vsize_4,
vsize_5,
vsize_6,
vsize_8,
vsize_10,
vsize_12,
vsize_15,
vsize_20,
vsize_30,
vsize_40,
vsize_50,
vsize_60,
vsize_70,
vsize_80,
vsize_90,
vsize_100,
vsize_125,
vsize_150,
vsize_175,
vsize_200,
vsize_250,
vsize_300,
vsize_350,
vsize_400,
vsize_500,
vsize_600,
vsize_700,
vsize_800,
vsize_900,
vsize_1000,
vsize_1200,
vsize_1400,
vsize_1600,
vsize_1800,
vsize_2000
)
VALUES (NOW(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)`;
const [result]: any = await DB.query(query);
return result.insertId;
} catch (e) {
logger.err('$create() error' + (e instanceof Error ? e.message : e));
}
}
private async $create(statistics: Statistic): Promise<number | undefined> {
try {
const connection = await DB.pool.getConnection();
const query = `INSERT INTO statistics(
added,
unconfirmed_transactions,
@@ -242,148 +310,271 @@ class Statistics {
statistics.vsize_1800,
statistics.vsize_2000,
];
const [result]: any = await connection.query(query, params);
connection.release();
const [result]: any = await DB.query(query, params);
return result.insertId;
} catch (e) {
console.log('$create() error', e);
logger.err('$create() error' + (e instanceof Error ? e.message : e));
}
}
private getQueryForDays(days: number, groupBy: number) {
return `SELECT id, added, unconfirmed_transactions,
AVG(tx_per_second) AS tx_per_second,
AVG(vbytes_per_second) AS vbytes_per_second,
AVG(vsize_1) AS vsize_1,
AVG(vsize_2) AS vsize_2,
AVG(vsize_3) AS vsize_3,
AVG(vsize_4) AS vsize_4,
AVG(vsize_5) AS vsize_5,
AVG(vsize_6) AS vsize_6,
AVG(vsize_8) AS vsize_8,
AVG(vsize_10) AS vsize_10,
AVG(vsize_12) AS vsize_12,
AVG(vsize_15) AS vsize_15,
AVG(vsize_20) AS vsize_20,
AVG(vsize_30) AS vsize_30,
AVG(vsize_40) AS vsize_40,
AVG(vsize_50) AS vsize_50,
AVG(vsize_60) AS vsize_60,
AVG(vsize_70) AS vsize_70,
AVG(vsize_80) AS vsize_80,
AVG(vsize_90) AS vsize_90,
AVG(vsize_100) AS vsize_100,
AVG(vsize_125) AS vsize_125,
AVG(vsize_150) AS vsize_150,
AVG(vsize_175) AS vsize_175,
AVG(vsize_200) AS vsize_200,
AVG(vsize_250) AS vsize_250,
AVG(vsize_300) AS vsize_300,
AVG(vsize_350) AS vsize_350,
AVG(vsize_400) AS vsize_400,
AVG(vsize_500) AS vsize_500,
AVG(vsize_600) AS vsize_600,
AVG(vsize_700) AS vsize_700,
AVG(vsize_800) AS vsize_800,
AVG(vsize_900) AS vsize_900,
AVG(vsize_1000) AS vsize_1000,
AVG(vsize_1200) AS vsize_1200,
AVG(vsize_1400) AS vsize_1400,
AVG(vsize_1600) AS vsize_1600,
AVG(vsize_1800) AS vsize_1800,
AVG(vsize_2000) AS vsize_2000 FROM statistics GROUP BY UNIX_TIMESTAMP(added) DIV ${groupBy} ORDER BY id DESC LIMIT ${days}`;
private getQueryForDaysAvg(div: number, interval: string) {
return `SELECT
UNIX_TIMESTAMP(added) as added,
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
CAST(avg(vsize_1) as DOUBLE) as vsize_1,
CAST(avg(vsize_2) as DOUBLE) as vsize_2,
CAST(avg(vsize_3) as DOUBLE) as vsize_3,
CAST(avg(vsize_4) as DOUBLE) as vsize_4,
CAST(avg(vsize_5) as DOUBLE) as vsize_5,
CAST(avg(vsize_6) as DOUBLE) as vsize_6,
CAST(avg(vsize_8) as DOUBLE) as vsize_8,
CAST(avg(vsize_10) as DOUBLE) as vsize_10,
CAST(avg(vsize_12) as DOUBLE) as vsize_12,
CAST(avg(vsize_15) as DOUBLE) as vsize_15,
CAST(avg(vsize_20) as DOUBLE) as vsize_20,
CAST(avg(vsize_30) as DOUBLE) as vsize_30,
CAST(avg(vsize_40) as DOUBLE) as vsize_40,
CAST(avg(vsize_50) as DOUBLE) as vsize_50,
CAST(avg(vsize_60) as DOUBLE) as vsize_60,
CAST(avg(vsize_70) as DOUBLE) as vsize_70,
CAST(avg(vsize_80) as DOUBLE) as vsize_80,
CAST(avg(vsize_90) as DOUBLE) as vsize_90,
CAST(avg(vsize_100) as DOUBLE) as vsize_100,
CAST(avg(vsize_125) as DOUBLE) as vsize_125,
CAST(avg(vsize_150) as DOUBLE) as vsize_150,
CAST(avg(vsize_175) as DOUBLE) as vsize_175,
CAST(avg(vsize_200) as DOUBLE) as vsize_200,
CAST(avg(vsize_250) as DOUBLE) as vsize_250,
CAST(avg(vsize_300) as DOUBLE) as vsize_300,
CAST(avg(vsize_350) as DOUBLE) as vsize_350,
CAST(avg(vsize_400) as DOUBLE) as vsize_400,
CAST(avg(vsize_500) as DOUBLE) as vsize_500,
CAST(avg(vsize_600) as DOUBLE) as vsize_600,
CAST(avg(vsize_700) as DOUBLE) as vsize_700,
CAST(avg(vsize_800) as DOUBLE) as vsize_800,
CAST(avg(vsize_900) as DOUBLE) as vsize_900,
CAST(avg(vsize_1000) as DOUBLE) as vsize_1000,
CAST(avg(vsize_1200) as DOUBLE) as vsize_1200,
CAST(avg(vsize_1400) as DOUBLE) as vsize_1400,
CAST(avg(vsize_1600) as DOUBLE) as vsize_1600,
CAST(avg(vsize_1800) as DOUBLE) as vsize_1800,
CAST(avg(vsize_2000) as DOUBLE) as vsize_2000 \
FROM statistics \
WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \
GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \
ORDER BY statistics.added DESC;`;
}
public async $get(id: number): Promise<IMempoolStats | undefined> {
private getQueryForDays(div: number, interval: string) {
return `SELECT
UNIX_TIMESTAMP(added) as added,
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
vsize_1,
vsize_2,
vsize_3,
vsize_4,
vsize_5,
vsize_6,
vsize_8,
vsize_10,
vsize_12,
vsize_15,
vsize_20,
vsize_30,
vsize_40,
vsize_50,
vsize_60,
vsize_70,
vsize_80,
vsize_90,
vsize_100,
vsize_125,
vsize_150,
vsize_175,
vsize_200,
vsize_250,
vsize_300,
vsize_350,
vsize_400,
vsize_500,
vsize_600,
vsize_700,
vsize_800,
vsize_900,
vsize_1000,
vsize_1200,
vsize_1400,
vsize_1600,
vsize_1800,
vsize_2000 \
FROM statistics \
WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \
GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \
ORDER BY statistics.added DESC;`;
}
private async $get(id: number): Promise<OptimizedStatistic | undefined> {
try {
const connection = await DB.pool.getConnection();
const query = `SELECT * FROM statistics WHERE id = ?`;
const [rows] = await connection.query<any>(query, [id]);
connection.release();
return rows[0];
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics WHERE id = ?`;
const [rows] = await DB.query(query, [id]);
if (rows[0]) {
return this.mapStatisticToOptimizedStatistic([rows[0]])[0];
}
} catch (e) {
console.log('$list2H() error', e);
logger.err('$list2H() error' + (e instanceof Error ? e.message : e));
}
}
public async $list2H(): Promise<IMempoolStats[]> {
public async $list2H(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = `SELECT * FROM statistics ORDER BY id DESC LIMIT 120`;
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY statistics.added DESC LIMIT 120`;
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
console.log('$list2H() error', e);
logger.err('$list2H() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list24H(): Promise<IMempoolStats[]> {
public async $list24H(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDays(120, 720);
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY statistics.added DESC LIMIT 1440`;
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
logger.err('$list24h() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list1W(): Promise<IMempoolStats[]> {
public async $list1W(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDays(120, 5040);
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = this.getQueryForDaysAvg(300, '1 WEEK'); // 5m interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
console.log('$list1W() error', e);
logger.err('$list1W() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list1M(): Promise<IMempoolStats[]> {
public async $list1M(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDays(120, 20160);
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = this.getQueryForDaysAvg(1800, '1 MONTH'); // 30m interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
console.log('$list1M() error', e);
logger.err('$list1M() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list3M(): Promise<IMempoolStats[]> {
public async $list3M(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDays(120, 60480);
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = this.getQueryForDaysAvg(7200, '3 MONTH'); // 2h interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
console.log('$list3M() error', e);
logger.err('$list3M() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list6M(): Promise<IMempoolStats[]> {
public async $list6M(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDays(120, 120960);
const [rows] = await connection.query<any>(query);
connection.release();
return rows;
const query = this.getQueryForDaysAvg(10800, '6 MONTH'); // 3h interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
console.log('$list6M() error', e);
logger.err('$list6M() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list1Y(): Promise<OptimizedStatistic[]> {
try {
const query = this.getQueryForDays(28800, '1 YEAR'); // 8h interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
logger.err('$list1Y() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list2Y(): Promise<OptimizedStatistic[]> {
try {
const query = this.getQueryForDays(28800, '2 YEAR'); // 8h interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
logger.err('$list2Y() error' + (e instanceof Error ? e.message : e));
return [];
}
}
public async $list3Y(): Promise<OptimizedStatistic[]> {
try {
const query = this.getQueryForDays(43200, '3 YEAR'); // 12h interval
const [rows] = await DB.query({ sql: query, timeout: this.queryTimeout });
return this.mapStatisticToOptimizedStatistic(rows as Statistic[]);
} catch (e) {
logger.err('$list3Y() error' + (e instanceof Error ? e.message : e));
return [];
}
}
private mapStatisticToOptimizedStatistic(statistic: Statistic[]): OptimizedStatistic[] {
return statistic.map((s) => {
return {
added: s.added,
vbytes_per_second: s.vbytes_per_second,
mempool_byte_weight: s.mempool_byte_weight,
total_fee: s.total_fee,
vsizes: [
s.vsize_1,
s.vsize_2,
s.vsize_3,
s.vsize_4,
s.vsize_5,
s.vsize_6,
s.vsize_8,
s.vsize_10,
s.vsize_12,
s.vsize_15,
s.vsize_20,
s.vsize_30,
s.vsize_40,
s.vsize_50,
s.vsize_60,
s.vsize_70,
s.vsize_80,
s.vsize_90,
s.vsize_100,
s.vsize_125,
s.vsize_150,
s.vsize_175,
s.vsize_200,
s.vsize_250,
s.vsize_300,
s.vsize_350,
s.vsize_400,
s.vsize_500,
s.vsize_600,
s.vsize_700,
s.vsize_800,
s.vsize_900,
s.vsize_1000,
s.vsize_1200,
s.vsize_1400,
s.vsize_1600,
s.vsize_1800,
s.vsize_2000,
]
};
});
}
}
export default new Statistics();

View File

@@ -0,0 +1,57 @@
import bitcoinApi from './bitcoin/bitcoin-api-factory';
import { TransactionExtended, TransactionMinerInfo } from '../mempool.interfaces';
import { IEsploraApi } from './bitcoin/esplora-api.interface';
import config from '../config';
import { Common } from './common';
class TransactionUtils {
constructor() { }
public stripCoinbaseTransaction(tx: TransactionExtended): TransactionMinerInfo {
return {
vin: [{
scriptsig: tx.vin[0].scriptsig || tx.vin[0]['coinbase']
}],
vout: tx.vout
.map((vout) => ({
scriptpubkey_address: vout.scriptpubkey_address,
value: vout.value
}))
.filter((vout) => vout.value)
};
}
public async $getTransactionExtended(txId: string, addPrevouts = false, lazyPrevouts = false): Promise<TransactionExtended> {
const transaction: IEsploraApi.Transaction = await bitcoinApi.$getRawTransaction(txId, false, addPrevouts, lazyPrevouts);
return this.extendTransaction(transaction);
}
private extendTransaction(transaction: IEsploraApi.Transaction): TransactionExtended {
// @ts-ignore
if (transaction.vsize) {
// @ts-ignore
return transaction;
}
const feePerVbytes = Math.max(Common.isLiquid() ? 0.1 : 1,
(transaction.fee || 0) / (transaction.weight / 4));
const transactionExtended: TransactionExtended = Object.assign({
vsize: Math.round(transaction.weight / 4),
feePerVsize: feePerVbytes,
effectiveFeePerVsize: feePerVbytes,
}, transaction);
if (!transaction.status.confirmed) {
transactionExtended.firstSeen = Math.round((new Date().getTime() / 1000));
}
return transactionExtended;
}
public hex2ascii(hex: string) {
let str = '';
for (let i = 0; i < hex.length; i += 2) {
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return str;
}
}
export default new TransactionUtils();

View File

@@ -0,0 +1,540 @@
import logger from '../logger';
import * as WebSocket from 'ws';
import { BlockExtended, TransactionExtended, WebsocketResponse, MempoolBlock, MempoolBlockDelta,
OptimizedStatistic, ILoadingIndicators, IConversionRates } from '../mempool.interfaces';
import blocks from './blocks';
import memPool from './mempool';
import backendInfo from './backend-info';
import mempoolBlocks from './mempool-blocks';
import fiatConversion from './fiat-conversion';
import { Common } from './common';
import loadingIndicators from './loading-indicators';
import config from '../config';
import transactionUtils from './transaction-utils';
import rbfCache from './rbf-cache';
import difficultyAdjustment from './difficulty-adjustment';
import feeApi from './fee-api';
class WebsocketHandler {
private wss: WebSocket.Server | undefined;
private extraInitProperties = {};
constructor() { }
setWebsocketServer(wss: WebSocket.Server) {
this.wss = wss;
}
setExtraInitProperties(property: string, value: any) {
this.extraInitProperties[property] = value;
}
setupConnectionHandling() {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
this.wss.on('connection', (client: WebSocket) => {
client.on('error', logger.info);
client.on('message', async (message: string) => {
try {
const parsedMessage: WebsocketResponse = JSON.parse(message);
const response = {};
if (parsedMessage.action === 'want') {
client['want-blocks'] = parsedMessage.data.indexOf('blocks') > -1;
client['want-mempool-blocks'] = parsedMessage.data.indexOf('mempool-blocks') > -1;
client['want-live-2h-chart'] = parsedMessage.data.indexOf('live-2h-chart') > -1;
client['want-stats'] = parsedMessage.data.indexOf('stats') > -1;
}
if (parsedMessage && parsedMessage['track-tx']) {
if (/^[a-fA-F0-9]{64}$/.test(parsedMessage['track-tx'])) {
client['track-tx'] = parsedMessage['track-tx'];
// Client is telling the transaction wasn't found
if (parsedMessage['watch-mempool']) {
const rbfCacheTx = rbfCache.get(client['track-tx']);
if (rbfCacheTx) {
response['txReplaced'] = {
txid: rbfCacheTx.txid,
};
client['track-tx'] = null;
} else {
// It might have appeared before we had the time to start watching for it
const tx = memPool.getMempool()[client['track-tx']];
if (tx) {
if (config.MEMPOOL.BACKEND === 'esplora') {
response['tx'] = tx;
} else {
// tx.prevout is missing from transactions when in bitcoind mode
try {
const fullTx = await transactionUtils.$getTransactionExtended(tx.txid, true);
response['tx'] = fullTx;
} catch (e) {
logger.debug('Error finding transaction: ' + (e instanceof Error ? e.message : e));
}
}
} else {
try {
const fullTx = await transactionUtils.$getTransactionExtended(client['track-tx'], true);
response['tx'] = fullTx;
} catch (e) {
logger.debug('Error finding transaction. ' + (e instanceof Error ? e.message : e));
client['track-mempool-tx'] = parsedMessage['track-tx'];
}
}
}
}
} else {
client['track-tx'] = null;
}
}
if (parsedMessage && parsedMessage['track-address']) {
if (/^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,100}|[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100})$/
.test(parsedMessage['track-address'])) {
let matchedAddress = parsedMessage['track-address'];
if (/^[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100}$/.test(parsedMessage['track-address'])) {
matchedAddress = matchedAddress.toLowerCase();
}
client['track-address'] = matchedAddress;
} else {
client['track-address'] = null;
}
}
if (parsedMessage && parsedMessage['track-asset']) {
if (/^[a-fA-F0-9]{64}$/.test(parsedMessage['track-asset'])) {
client['track-asset'] = parsedMessage['track-asset'];
} else {
client['track-asset'] = null;
}
}
if (parsedMessage && parsedMessage['track-mempool-block'] !== undefined) {
if (Number.isInteger(parsedMessage['track-mempool-block']) && parsedMessage['track-mempool-block'] >= 0) {
const index = parsedMessage['track-mempool-block'];
client['track-mempool-block'] = index;
const mBlocksWithTransactions = mempoolBlocks.getMempoolBlocksWithTransactions();
response['projected-block-transactions'] = {
index: index,
blockTransactions: mBlocksWithTransactions[index]?.transactions || [],
};
} else {
client['track-mempool-block'] = null;
}
}
if (parsedMessage.action === 'init') {
const _blocks = blocks.getBlocks().slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT);
if (!_blocks) {
return;
}
client.send(JSON.stringify(this.getInitData(_blocks)));
}
if (parsedMessage.action === 'ping') {
response['pong'] = true;
}
if (parsedMessage['track-donation'] && parsedMessage['track-donation'].length === 22) {
client['track-donation'] = parsedMessage['track-donation'];
}
if (parsedMessage['track-bisq-market']) {
if (/^[a-z]{3}_[a-z]{3}$/.test(parsedMessage['track-bisq-market'])) {
client['track-bisq-market'] = parsedMessage['track-bisq-market'];
} else {
client['track-bisq-market'] = null;
}
}
if (Object.keys(response).length) {
client.send(JSON.stringify(response));
}
} catch (e) {
logger.debug('Error parsing websocket message: ' + (e instanceof Error ? e.message : e));
}
});
});
}
handleNewDonation(id: string) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
if (client['track-donation'] === id) {
client.send(JSON.stringify({ donationConfirmed: true }));
}
});
}
handleLoadingChanged(indicators: ILoadingIndicators) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
client.send(JSON.stringify({ loadingIndicators: indicators }));
});
}
handleNewConversionRates(conversionRates: IConversionRates) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
client.send(JSON.stringify({ conversions: conversionRates }));
});
}
getInitData(_blocks?: BlockExtended[]) {
if (!_blocks) {
_blocks = blocks.getBlocks().slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT);
}
return {
'mempoolInfo': memPool.getMempoolInfo(),
'vBytesPerSecond': memPool.getVBytesPerSecond(),
'blocks': _blocks,
'conversions': fiatConversion.getConversionRates(),
'mempool-blocks': mempoolBlocks.getMempoolBlocks(),
'transactions': memPool.getLatestTransactions(),
'backendInfo': backendInfo.getBackendInfo(),
'loadingIndicators': loadingIndicators.getLoadingIndicators(),
'da': difficultyAdjustment.getDifficultyAdjustment(),
'fees': feeApi.getRecommendedFee(),
...this.extraInitProperties
};
}
handleNewStatistic(stats: OptimizedStatistic) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
if (!client['want-live-2h-chart']) {
return;
}
client.send(JSON.stringify({
'live-2h-chart': stats
}));
});
}
handleMempoolChange(newMempool: { [txid: string]: TransactionExtended },
newTransactions: TransactionExtended[], deletedTransactions: TransactionExtended[]) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
mempoolBlocks.updateMempoolBlocks(newMempool);
const mBlocks = mempoolBlocks.getMempoolBlocks();
const mBlockDeltas = mempoolBlocks.getMempoolBlockDeltas();
const mempoolInfo = memPool.getMempoolInfo();
const vBytesPerSecond = memPool.getVBytesPerSecond();
const rbfTransactions = Common.findRbfTransactions(newTransactions, deletedTransactions);
const da = difficultyAdjustment.getDifficultyAdjustment();
memPool.handleRbfTransactions(rbfTransactions);
const recommendedFees = feeApi.getRecommendedFee();
this.wss.clients.forEach(async (client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
const response = {};
if (client['want-stats']) {
response['mempoolInfo'] = mempoolInfo;
response['vBytesPerSecond'] = vBytesPerSecond;
response['transactions'] = newTransactions.slice(0, 6).map((tx) => Common.stripTransaction(tx));
response['da'] = da;
response['fees'] = recommendedFees;
}
if (client['want-mempool-blocks']) {
response['mempool-blocks'] = mBlocks;
}
if (client['track-mempool-tx']) {
const tx = newTransactions.find((t) => t.txid === client['track-mempool-tx']);
if (tx) {
if (config.MEMPOOL.BACKEND !== 'esplora') {
try {
const fullTx = await transactionUtils.$getTransactionExtended(tx.txid, true);
response['tx'] = fullTx;
} catch (e) {
logger.debug('Error finding transaction in mempool: ' + (e instanceof Error ? e.message : e));
}
} else {
response['tx'] = tx;
}
client['track-mempool-tx'] = null;
}
}
if (client['track-address']) {
const foundTransactions: TransactionExtended[] = [];
for (const tx of newTransactions) {
const someVin = tx.vin.some((vin) => !!vin.prevout && vin.prevout.scriptpubkey_address === client['track-address']);
if (someVin) {
if (config.MEMPOOL.BACKEND !== 'esplora') {
try {
const fullTx = await transactionUtils.$getTransactionExtended(tx.txid, true);
foundTransactions.push(fullTx);
} catch (e) {
logger.debug('Error finding transaction in mempool: ' + (e instanceof Error ? e.message : e));
}
} else {
foundTransactions.push(tx);
}
return;
}
const someVout = tx.vout.some((vout) => vout.scriptpubkey_address === client['track-address']);
if (someVout) {
if (config.MEMPOOL.BACKEND !== 'esplora') {
try {
const fullTx = await transactionUtils.$getTransactionExtended(tx.txid, true);
foundTransactions.push(fullTx);
} catch (e) {
logger.debug('Error finding transaction in mempool: ' + (e instanceof Error ? e.message : e));
}
} else {
foundTransactions.push(tx);
}
}
}
if (foundTransactions.length) {
response['address-transactions'] = foundTransactions;
}
}
if (client['track-asset']) {
const foundTransactions: TransactionExtended[] = [];
newTransactions.forEach((tx) => {
if (client['track-asset'] === Common.nativeAssetId) {
if (tx.vin.some((vin) => !!vin.is_pegin)) {
foundTransactions.push(tx);
return;
}
if (tx.vout.some((vout) => !!vout.pegout)) {
foundTransactions.push(tx);
}
} else {
if (tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset'])) {
foundTransactions.push(tx);
return;
}
if (tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset'])) {
foundTransactions.push(tx);
}
}
});
if (foundTransactions.length) {
response['address-transactions'] = foundTransactions;
}
}
if (client['track-tx']) {
const outspends: object = {};
newTransactions.forEach((tx) => tx.vin.forEach((vin, i) => {
if (vin.txid === client['track-tx']) {
outspends[vin.vout] = {
vin: i,
txid: tx.txid,
};
}
}));
if (Object.keys(outspends).length) {
response['utxoSpent'] = outspends;
}
if (rbfTransactions[client['track-tx']]) {
for (const rbfTransaction in rbfTransactions) {
if (client['track-tx'] === rbfTransaction) {
response['rbfTransaction'] = {
txid: rbfTransactions[rbfTransaction].txid,
};
break;
}
}
}
}
if (client['track-mempool-block'] >= 0) {
const index = client['track-mempool-block'];
if (mBlockDeltas[index]) {
response['projected-block-transactions'] = {
index: index,
delta: mBlockDeltas[index],
};
}
}
if (Object.keys(response).length) {
client.send(JSON.stringify(response));
}
});
}
handleNewBlock(block: BlockExtended, txIds: string[], transactions: TransactionExtended[]) {
if (!this.wss) {
throw new Error('WebSocket.Server is not set');
}
let mBlocks: undefined | MempoolBlock[];
let mBlockDeltas: undefined | MempoolBlockDelta[];
let matchRate = 0;
const _memPool = memPool.getMempool();
const _mempoolBlocks = mempoolBlocks.getMempoolBlocksWithTransactions();
if (_mempoolBlocks[0]) {
const matches: string[] = [];
for (const txId of txIds) {
if (_mempoolBlocks[0].transactionIds.indexOf(txId) > -1) {
matches.push(txId);
}
delete _memPool[txId];
}
matchRate = Math.round((matches.length / (txIds.length - 1)) * 100);
mempoolBlocks.updateMempoolBlocks(_memPool);
mBlocks = mempoolBlocks.getMempoolBlocks();
mBlockDeltas = mempoolBlocks.getMempoolBlockDeltas();
}
if (block.extras) {
block.extras.matchRate = matchRate;
}
const da = difficultyAdjustment.getDifficultyAdjustment();
const fees = feeApi.getRecommendedFee();
this.wss.clients.forEach((client) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
if (!client['want-blocks']) {
return;
}
const response = {
'block': block,
'mempoolInfo': memPool.getMempoolInfo(),
'da': da,
'fees': fees,
};
if (mBlocks && client['want-mempool-blocks']) {
response['mempool-blocks'] = mBlocks;
}
if (client['track-tx'] && txIds.indexOf(client['track-tx']) > -1) {
response['txConfirmed'] = true;
}
if (client['track-address']) {
const foundTransactions: TransactionExtended[] = [];
transactions.forEach((tx) => {
if (tx.vin && tx.vin.some((vin) => !!vin.prevout && vin.prevout.scriptpubkey_address === client['track-address'])) {
foundTransactions.push(tx);
return;
}
if (tx.vout && tx.vout.some((vout) => vout.scriptpubkey_address === client['track-address'])) {
foundTransactions.push(tx);
}
});
if (foundTransactions.length) {
foundTransactions.forEach((tx) => {
tx.status = {
confirmed: true,
block_height: block.height,
block_hash: block.id,
block_time: block.timestamp,
};
});
response['block-transactions'] = foundTransactions;
}
}
if (client['track-asset']) {
const foundTransactions: TransactionExtended[] = [];
transactions.forEach((tx) => {
if (client['track-asset'] === Common.nativeAssetId) {
if (tx.vin && tx.vin.some((vin) => !!vin.is_pegin)) {
foundTransactions.push(tx);
return;
}
if (tx.vout && tx.vout.some((vout) => !!vout.pegout)) {
foundTransactions.push(tx);
}
} else {
if (tx.vin && tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset'])) {
foundTransactions.push(tx);
return;
}
if (tx.vout && tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset'])) {
foundTransactions.push(tx);
}
}
});
if (foundTransactions.length) {
foundTransactions.forEach((tx) => {
tx.status = {
confirmed: true,
block_height: block.height,
block_hash: block.id,
block_time: block.timestamp,
};
});
response['block-transactions'] = foundTransactions;
}
}
if (client['track-mempool-block'] >= 0) {
const index = client['track-mempool-block'];
if (mBlockDeltas && mBlockDeltas[index]) {
response['projected-block-transactions'] = {
index: index,
delta: mBlockDeltas[index],
};
}
}
client.send(JSON.stringify(response));
});
}
}
export default new WebsocketHandler();

222
backend/src/config.ts Normal file
View File

@@ -0,0 +1,222 @@
const configFile = require('../mempool-config.json');
interface IConfig {
MEMPOOL: {
NETWORK: 'mainnet' | 'testnet' | 'signet' | 'liquid' | 'liquidtestnet';
BACKEND: 'esplora' | 'electrum' | 'none';
HTTP_PORT: number;
SPAWN_CLUSTER_PROCS: number;
API_URL_PREFIX: string;
POLL_RATE_MS: number;
CACHE_DIR: string;
CLEAR_PROTECTION_MINUTES: number;
RECOMMENDED_FEE_PERCENTILE: number;
BLOCK_WEIGHT_UNITS: number;
INITIAL_BLOCKS_AMOUNT: number;
MEMPOOL_BLOCKS_AMOUNT: number;
INDEXING_BLOCKS_AMOUNT: number;
PRICE_FEED_UPDATE_INTERVAL: number;
USE_SECOND_NODE_FOR_MINFEE: boolean;
EXTERNAL_ASSETS: string[];
EXTERNAL_MAX_RETRY: number;
EXTERNAL_RETRY_INTERVAL: number;
USER_AGENT: string;
STDOUT_LOG_MIN_PRIORITY: 'emerg' | 'alert' | 'crit' | 'err' | 'warn' | 'notice' | 'info' | 'debug';
};
ESPLORA: {
REST_API_URL: string;
};
ELECTRUM: {
HOST: string;
PORT: number;
TLS_ENABLED: boolean;
};
CORE_RPC: {
HOST: string;
PORT: number;
USERNAME: string;
PASSWORD: string;
};
SECOND_CORE_RPC: {
HOST: string;
PORT: number;
USERNAME: string;
PASSWORD: string;
};
DATABASE: {
ENABLED: boolean;
HOST: string,
SOCKET: string,
PORT: number;
DATABASE: string;
USERNAME: string;
PASSWORD: string;
};
SYSLOG: {
ENABLED: boolean;
HOST: string;
PORT: number;
MIN_PRIORITY: 'emerg' | 'alert' | 'crit' | 'err' | 'warn' | 'notice' | 'info' | 'debug';
FACILITY: string;
};
STATISTICS: {
ENABLED: boolean;
TX_PER_SECOND_SAMPLE_PERIOD: number;
};
BISQ: {
ENABLED: boolean;
DATA_PATH: string;
};
SOCKS5PROXY: {
ENABLED: boolean;
USE_ONION: boolean;
HOST: string;
PORT: number;
USERNAME: string;
PASSWORD: string;
};
PRICE_DATA_SERVER: {
TOR_URL: string;
CLEARNET_URL: string;
};
EXTERNAL_DATA_SERVER: {
MEMPOOL_API: string;
MEMPOOL_ONION: string;
LIQUID_API: string;
LIQUID_ONION: string;
BISQ_URL: string;
BISQ_ONION: string;
};
}
const defaults: IConfig = {
'MEMPOOL': {
'NETWORK': 'mainnet',
'BACKEND': 'none',
'HTTP_PORT': 8999,
'SPAWN_CLUSTER_PROCS': 0,
'API_URL_PREFIX': '/api/v1/',
'POLL_RATE_MS': 2000,
'CACHE_DIR': './cache',
'CLEAR_PROTECTION_MINUTES': 20,
'RECOMMENDED_FEE_PERCENTILE': 50,
'BLOCK_WEIGHT_UNITS': 4000000,
'INITIAL_BLOCKS_AMOUNT': 8,
'MEMPOOL_BLOCKS_AMOUNT': 8,
'INDEXING_BLOCKS_AMOUNT': 11000, // 0 = disable indexing, -1 = index all blocks
'PRICE_FEED_UPDATE_INTERVAL': 600,
'USE_SECOND_NODE_FOR_MINFEE': false,
'EXTERNAL_ASSETS': [],
'EXTERNAL_MAX_RETRY': 1,
'EXTERNAL_RETRY_INTERVAL': 0,
'USER_AGENT': 'mempool',
'STDOUT_LOG_MIN_PRIORITY': 'debug',
},
'ESPLORA': {
'REST_API_URL': 'http://127.0.0.1:3000',
},
'ELECTRUM': {
'HOST': '127.0.0.1',
'PORT': 3306,
'TLS_ENABLED': true,
},
'CORE_RPC': {
'HOST': '127.0.0.1',
'PORT': 8332,
'USERNAME': 'mempool',
'PASSWORD': 'mempool'
},
'SECOND_CORE_RPC': {
'HOST': '127.0.0.1',
'PORT': 8332,
'USERNAME': 'mempool',
'PASSWORD': 'mempool'
},
'DATABASE': {
'ENABLED': true,
'HOST': '127.0.0.1',
'SOCKET': '',
'PORT': 3306,
'DATABASE': 'mempool',
'USERNAME': 'mempool',
'PASSWORD': 'mempool'
},
'SYSLOG': {
'ENABLED': true,
'HOST': '127.0.0.1',
'PORT': 514,
'MIN_PRIORITY': 'info',
'FACILITY': 'local7'
},
'STATISTICS': {
'ENABLED': true,
'TX_PER_SECOND_SAMPLE_PERIOD': 150
},
'BISQ': {
'ENABLED': false,
'DATA_PATH': '/bisq/statsnode-data/btc_mainnet/db'
},
'SOCKS5PROXY': {
'ENABLED': false,
'USE_ONION': true,
'HOST': '127.0.0.1',
'PORT': 9050,
'USERNAME': '',
'PASSWORD': ''
},
"PRICE_DATA_SERVER": {
'TOR_URL': 'http://wizpriceje6q5tdrxkyiazsgu7irquiqjy2dptezqhrtu7l2qelqktid.onion/getAllMarketPrices',
'CLEARNET_URL': 'https://price.bisq.wiz.biz/getAllMarketPrices'
},
"EXTERNAL_DATA_SERVER": {
'MEMPOOL_API': 'https://mempool.space/api/v1',
'MEMPOOL_ONION': 'http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/api/v1',
'LIQUID_API': 'https://liquid.network/api/v1',
'LIQUID_ONION': 'http://liquidmom47f6s3m53ebfxn47p76a6tlnxib3wp6deux7wuzotdr6cyd.onion/api/v1',
'BISQ_URL': 'https://bisq.markets/api',
'BISQ_ONION': 'http://bisqmktse2cabavbr2xjq7xw3h6g5ottemo5rolfcwt6aly6tp5fdryd.onion/api'
}
};
class Config implements IConfig {
MEMPOOL: IConfig['MEMPOOL'];
ESPLORA: IConfig['ESPLORA'];
ELECTRUM: IConfig['ELECTRUM'];
CORE_RPC: IConfig['CORE_RPC'];
SECOND_CORE_RPC: IConfig['SECOND_CORE_RPC'];
DATABASE: IConfig['DATABASE'];
SYSLOG: IConfig['SYSLOG'];
STATISTICS: IConfig['STATISTICS'];
BISQ: IConfig['BISQ'];
SOCKS5PROXY: IConfig['SOCKS5PROXY'];
PRICE_DATA_SERVER: IConfig['PRICE_DATA_SERVER'];
EXTERNAL_DATA_SERVER: IConfig['EXTERNAL_DATA_SERVER'];
constructor() {
const configs = this.merge(configFile, defaults);
this.MEMPOOL = configs.MEMPOOL;
this.ESPLORA = configs.ESPLORA;
this.ELECTRUM = configs.ELECTRUM;
this.CORE_RPC = configs.CORE_RPC;
this.SECOND_CORE_RPC = configs.SECOND_CORE_RPC;
this.DATABASE = configs.DATABASE;
this.SYSLOG = configs.SYSLOG;
this.STATISTICS = configs.STATISTICS;
this.BISQ = configs.BISQ;
this.SOCKS5PROXY = configs.SOCKS5PROXY;
this.PRICE_DATA_SERVER = configs.PRICE_DATA_SERVER;
this.EXTERNAL_DATA_SERVER = configs.EXTERNAL_DATA_SERVER;
}
merge = (...objects: object[]): IConfig => {
// @ts-ignore
return objects.reduce((prev, next) => {
Object.keys(prev).forEach(key => {
next[key] = { ...next[key], ...prev[key] };
});
return next;
});
}
}
export default new Config();

View File

@@ -1,26 +1,59 @@
const config = require('../mempool-config.json');
import { createPool } from 'mysql2/promise';
import config from './config';
import { createPool, Pool, PoolConnection } from 'mysql2/promise';
import logger from './logger';
import { PoolOptions } from 'mysql2/typings/mysql';
export class DB {
static pool = createPool({
host: config.DB_HOST,
port: config.DB_PORT,
database: config.DB_DATABASE,
user: config.DB_USER,
password: config.DB_PASSWORD,
class DB {
constructor() {
if (config.DATABASE.SOCKET !== '') {
this.poolConfig.socketPath = config.DATABASE.SOCKET;
} else {
this.poolConfig.host = config.DATABASE.HOST;
}
}
private pool: Pool | null = null;
private poolConfig: PoolOptions = {
port: config.DATABASE.PORT,
database: config.DATABASE.DATABASE,
user: config.DATABASE.USERNAME,
password: config.DATABASE.PASSWORD,
connectionLimit: 10,
supportBigNumbers: true,
});
}
timezone: '+00:00',
};
export async function checkDbConnection() {
try {
const connection = await DB.pool.getConnection();
console.log('MySQL connection established.');
connection.release();
} catch (e) {
console.log('Could not connect to MySQL.');
console.log(e);
process.exit(1);
private checkDBFlag() {
if (config.DATABASE.ENABLED === false) {
logger.err('Trying to use DB feature but config.DATABASE.ENABLED is set to false, please open an issue');
}
}
public async query(query, params?) {
this.checkDBFlag();
const pool = await this.getPool();
return pool.query(query, params);
}
public async checkDbConnection() {
this.checkDBFlag();
try {
await this.query('SELECT ?', [1]);
logger.info('Database connection established.');
} catch (e) {
logger.err('Could not connect to database: ' + (e instanceof Error ? e.message : e));
process.exit(1);
}
}
private async getPool(): Promise<Pool> {
if (this.pool === null) {
this.pool = createPool(this.poolConfig);
this.pool.on('connection', function (newConnection: PoolConnection) {
newConnection.query(`SET time_zone='+00:00'`);
});
}
return this.pool;
}
}
export default new DB();

View File

@@ -1,284 +1,359 @@
const config = require('../mempool-config.json');
import * as fs from 'fs';
import { Express, Request, Response, NextFunction } from 'express';
import * as express from 'express';
import * as compression from 'compression';
import * as http from 'http';
import * as https from 'https';
import * as WebSocket from 'ws';
import * as cluster from 'cluster';
import axios from 'axios';
import bitcoinApi from './api/bitcoin/bitcoin-api-factory';
import diskCache from './api/disk-cache';
import memPool from './api/mempool';
import blocks from './api/blocks';
import projectedBlocks from './api/projected-blocks';
import statistics from './api/statistics';
import { IBlock, IMempool, ITransaction, IMempoolStats } from './interfaces';
import DB from './database';
import config from './config';
import routes from './routes';
import blocks from './api/blocks';
import memPool from './api/mempool';
import diskCache from './api/disk-cache';
import statistics from './api/statistics';
import websocketHandler from './api/websocket-handler';
import fiatConversion from './api/fiat-conversion';
import bisq from './api/bisq/bisq';
import bisqMarkets from './api/bisq/markets';
import logger from './logger';
import backendInfo from './api/backend-info';
import loadingIndicators from './api/loading-indicators';
import mempool from './api/mempool';
import elementsParser from './api/liquid/elements-parser';
import databaseMigration from './api/database-migration';
import syncAssets from './sync-assets';
import icons from './api/liquid/icons';
import { Common } from './api/common';
import poolsUpdater from './tasks/pools-updater';
import indexer from './indexer';
class MempoolSpace {
private wss: WebSocket.Server;
private server: https.Server | http.Server;
private app: any;
class Server {
private wss: WebSocket.Server | undefined;
private server: http.Server | undefined;
private app: Express;
private currentBackendRetryInterval = 5;
constructor() {
this.app = express();
if (!config.MEMPOOL.SPAWN_CLUSTER_PROCS) {
this.startServer();
return;
}
if (cluster.isMaster) {
logger.notice(`Mempool Server (Master) is running on port ${config.MEMPOOL.HTTP_PORT} (${backendInfo.getShortCommitHash()})`);
const numCPUs = config.MEMPOOL.SPAWN_CLUSTER_PROCS;
for (let i = 0; i < numCPUs; i++) {
const env = { workerId: i };
const worker = cluster.fork(env);
worker.process['env'] = env;
}
cluster.on('exit', (worker, code, signal) => {
const workerId = worker.process['env'].workerId;
logger.warn(`Mempool Worker PID #${worker.process.pid} workerId: ${workerId} died. Restarting in 10 seconds... ${signal || code}`);
setTimeout(() => {
const env = { workerId: workerId };
const newWorker = cluster.fork(env);
newWorker.process['env'] = env;
}, 10000);
});
} else {
this.startServer(true);
}
}
async startServer(worker = false) {
logger.notice(`Starting Mempool Server${worker ? ' (worker)' : ''}... (${backendInfo.getShortCommitHash()})`);
this.app
.use((req, res, next) => {
.use((req: Request, res: Response, next: NextFunction) => {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
})
.use(compression());
if (config.ENV === 'dev') {
this.server = http.createServer(this.app);
this.wss = new WebSocket.Server({ server: this.server });
} else {
const credentials = {
cert: fs.readFileSync('/etc/letsencrypt/live/mempool.space/fullchain.pem'),
key: fs.readFileSync('/etc/letsencrypt/live/mempool.space/privkey.pem'),
};
this.server = https.createServer(credentials, this.app);
this.wss = new WebSocket.Server({ server: this.server });
.use(express.urlencoded({ extended: true }))
.use(express.text())
;
this.server = http.createServer(this.app);
this.wss = new WebSocket.Server({ server: this.server });
this.setUpWebsocketHandling();
await syncAssets.syncAssets$();
diskCache.loadMempoolCache();
if (config.DATABASE.ENABLED) {
await DB.checkDbConnection();
try {
if (process.env.npm_config_reindex !== undefined) { // Re-index requests
const tables = process.env.npm_config_reindex.split(',');
logger.warn(`Indexed data for "${process.env.npm_config_reindex}" tables will be erased in 5 seconds (using '--reindex')`);
await Common.sleep$(5000);
await databaseMigration.$truncateIndexedData(tables);
}
await databaseMigration.$initializeOrMigrateDatabase();
if (Common.indexingEnabled()) {
await indexer.$resetHashratesIndexingState();
}
} catch (e) {
throw new Error(e instanceof Error ? e.message : 'Error');
}
}
this.setUpRoutes();
this.setUpWebsocketHandling();
this.setUpMempoolCache();
this.runMempoolIntervalFunctions();
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED && cluster.isMaster) {
statistics.startStatistics();
}
if (Common.isLiquid()) {
try {
icons.loadIcons();
} catch (e) {
logger.err('Cannot load liquid icons. Ignoring. Reason: ' + (e instanceof Error ? e.message : e));
}
}
statistics.startStatistics();
fiatConversion.startService();
const opts = {
host: '127.0.0.1',
port: 8999
};
this.server.listen(opts, () => {
console.log(`Server started on ${opts.host}:${opts.port}`);
});
}
this.setUpHttpApiRoutes();
this.runMainUpdateLoop();
private async runMempoolIntervalFunctions() {
await blocks.updateBlocks();
await memPool.updateMemPoolInfo();
await memPool.updateMempool();
setTimeout(this.runMempoolIntervalFunctions.bind(this), config.MEMPOOL_REFRESH_RATE_MS);
}
private setUpMempoolCache() {
const cacheData = diskCache.loadData();
if (cacheData) {
memPool.setMempool(JSON.parse(cacheData));
if (config.BISQ.ENABLED) {
bisq.startBisqService();
bisq.setPriceCallbackFunction((price) => websocketHandler.setExtraInitProperties('bsq-price', price));
blocks.setNewBlockCallback(bisq.handleNewBitcoinBlock.bind(bisq));
bisqMarkets.startBisqService();
}
process.on('SIGINT', (options) => {
console.log('SIGINT');
diskCache.saveData(JSON.stringify(memPool.getMempool()));
process.exit(2);
this.server.listen(config.MEMPOOL.HTTP_PORT, () => {
if (worker) {
logger.info(`Mempool Server worker #${process.pid} started`);
} else {
logger.notice(`Mempool Server is running on port ${config.MEMPOOL.HTTP_PORT}`);
}
});
}
private setUpWebsocketHandling() {
this.wss.on('connection', (client: WebSocket) => {
let theBlocks = blocks.getBlocks();
theBlocks = theBlocks.concat([]).splice(theBlocks.length - config.INITIAL_BLOCK_AMOUNT);
const formatedBlocks = theBlocks.map((b) => blocks.formatBlock(b));
async runMainUpdateLoop() {
try {
try {
await memPool.$updateMemPoolInfo();
} catch (e) {
const msg = `updateMempoolInfo: ${(e instanceof Error ? e.message : e)}`;
if (config.MEMPOOL.USE_SECOND_NODE_FOR_MINFEE) {
logger.warn(msg);
} else {
logger.debug(msg);
}
}
await poolsUpdater.updatePoolsJson();
await blocks.$updateBlocks();
await memPool.$updateMempool();
indexer.$run();
client.send(JSON.stringify({
'mempoolInfo': memPool.getMempoolInfo(),
'blocks': formatedBlocks,
'projectedBlocks': projectedBlocks.getProjectedBlocks(),
'txPerSecond': memPool.getTxPerSecond(),
'vBytesPerSecond': memPool.getVBytesPerSecond(),
'conversions': fiatConversion.getTickers()['BTCUSD'],
}));
setTimeout(this.runMainUpdateLoop.bind(this), config.MEMPOOL.POLL_RATE_MS);
this.currentBackendRetryInterval = 5;
} catch (e) {
const loggerMsg = `runMainLoop error: ${(e instanceof Error ? e.message : e)}. Retrying in ${this.currentBackendRetryInterval} sec.`;
if (this.currentBackendRetryInterval > 5) {
logger.warn(loggerMsg);
mempool.setOutOfSync();
} else {
logger.debug(loggerMsg);
}
logger.debug(JSON.stringify(e));
setTimeout(this.runMainUpdateLoop.bind(this), 1000 * this.currentBackendRetryInterval);
this.currentBackendRetryInterval *= 2;
this.currentBackendRetryInterval = Math.min(this.currentBackendRetryInterval, 60);
}
}
client.on('message', async (message: any) => {
setUpWebsocketHandling() {
if (this.wss) {
websocketHandler.setWebsocketServer(this.wss);
}
if (Common.isLiquid() && config.DATABASE.ENABLED) {
blocks.setNewBlockCallback(async () => {
try {
const parsedMessage = JSON.parse(message);
if (parsedMessage.action === 'want') {
client['want-stats'] = parsedMessage.data.indexOf('stats') > -1;
client['want-blocks'] = parsedMessage.data.indexOf('blocks') > -1;
client['want-projected-blocks'] = parsedMessage.data.indexOf('projected-blocks') > -1;
client['want-live-2h-chart'] = parsedMessage.data.indexOf('live-2h-chart') > -1;
}
if (parsedMessage.action === 'track-tx' && parsedMessage.txId && /^[a-fA-F0-9]{64}$/.test(parsedMessage.txId)) {
const tx = await memPool.getRawTransaction(parsedMessage.txId);
if (tx) {
console.log('Now tracking: ' + parsedMessage.txId);
client['trackingTx'] = true;
client['txId'] = parsedMessage.txId;
client['tx'] = tx;
if (tx.blockhash) {
const currentBlocks = blocks.getBlocks();
const foundBlock = currentBlocks.find((block) => block.tx && block.tx.some((i: string) => i === parsedMessage.txId));
if (foundBlock) {
console.log('Found block by looking in local cache');
client['blockHeight'] = foundBlock.height;
} else {
const theBlock = await bitcoinApi.getBlockAndTransactions(tx.blockhash);
if (theBlock) {
client['blockHeight'] = theBlock.height;
}
}
} else {
client['blockHeight'] = 0;
}
client.send(JSON.stringify({
'projectedBlocks': projectedBlocks.getProjectedBlocks(client['txId']),
'track-tx': {
tracking: true,
blockHeight: client['blockHeight'],
tx: client['tx'],
}
}));
} else {
console.log('TX NOT FOUND, NOT TRACKING');
client['trackingTx'] = false;
client['blockHeight'] = 0;
client['tx'] = null;
client.send(JSON.stringify({
'track-tx': {
tracking: false,
blockHeight: 0,
message: 'not-found',
}
}));
}
}
if (parsedMessage.action === 'stop-tracking-tx') {
console.log('STOP TRACKING');
client['trackingTx'] = false;
client.send(JSON.stringify({
'track-tx': {
tracking: false,
blockHeight: 0,
message: 'not-found',
}
}));
}
await elementsParser.$parse();
} catch (e) {
console.log(e);
logger.warn('Elements parsing error: ' + (e instanceof Error ? e.message : e));
}
});
client.on('close', () => {
client['trackingTx'] = false;
});
});
blocks.setNewBlockCallback((block: IBlock) => {
const formattedBlocks = blocks.formatBlock(block);
this.wss.clients.forEach((client) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
const response = {};
if (client['trackingTx'] === true && client['blockHeight'] === 0) {
if (block.tx.some((tx: ITransaction) => tx === client['txId'])) {
client['blockHeight'] = block.height;
}
}
response['track-tx'] = {
tracking: client['trackingTx'] || false,
blockHeight: client['blockHeight'],
};
response['block'] = formattedBlocks;
client.send(JSON.stringify(response));
});
});
memPool.setMempoolChangedCallback((newMempool: IMempool) => {
projectedBlocks.updateProjectedBlocks(newMempool);
const pBlocks = projectedBlocks.getProjectedBlocks();
const mempoolInfo = memPool.getMempoolInfo();
const txPerSecond = memPool.getTxPerSecond();
const vBytesPerSecond = memPool.getVBytesPerSecond();
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
const response = {};
if (client['want-stats']) {
response['mempoolInfo'] = mempoolInfo;
response['txPerSecond'] = txPerSecond;
response['vBytesPerSecond'] = vBytesPerSecond;
response['track-tx'] = {
tracking: client['trackingTx'] || false,
blockHeight: client['blockHeight'],
};
}
if (client['want-projected-blocks'] && client['trackingTx'] && client['blockHeight'] === 0) {
response['projectedBlocks'] = projectedBlocks.getProjectedBlocks(client['txId']);
} else if (client['want-projected-blocks']) {
response['projectedBlocks'] = pBlocks;
}
if (Object.keys(response).length) {
client.send(JSON.stringify(response));
}
});
});
statistics.setNewStatisticsEntryCallback((stats: IMempoolStats) => {
this.wss.clients.forEach((client: WebSocket) => {
if (client.readyState !== WebSocket.OPEN) {
return;
}
if (client['want-live-2h-chart']) {
client.send(JSON.stringify({
'live-2h-chart': stats
}));
}
});
});
}
websocketHandler.setupConnectionHandling();
statistics.setNewStatisticsEntryCallback(websocketHandler.handleNewStatistic.bind(websocketHandler));
blocks.setNewBlockCallback(websocketHandler.handleNewBlock.bind(websocketHandler));
memPool.setMempoolChangedCallback(websocketHandler.handleMempoolChange.bind(websocketHandler));
fiatConversion.setProgressChangedCallback(websocketHandler.handleNewConversionRates.bind(websocketHandler));
loadingIndicators.setProgressChangedCallback(websocketHandler.handleLoadingChanged.bind(websocketHandler));
}
private setUpRoutes() {
setUpHttpApiRoutes() {
this.app
.get(config.API_ENDPOINT + 'transactions/height/:id', routes.$getgetTransactionsForBlock)
.get(config.API_ENDPOINT + 'transactions/projected/:id', routes.getgetTransactionsForProjectedBlock)
.get(config.API_ENDPOINT + 'fees/recommended', routes.getRecommendedFees)
.get(config.API_ENDPOINT + 'fees/projected-blocks', routes.getProjectedBlocks)
.get(config.API_ENDPOINT + 'statistics/2h', routes.get2HStatistics)
.get(config.API_ENDPOINT + 'statistics/24h', routes.get24HStatistics.bind(routes))
.get(config.API_ENDPOINT + 'statistics/1w', routes.get1WHStatistics.bind(routes))
.get(config.API_ENDPOINT + 'statistics/1m', routes.get1MStatistics.bind(routes))
.get(config.API_ENDPOINT + 'statistics/3m', routes.get3MStatistics.bind(routes))
.get(config.API_ENDPOINT + 'statistics/6m', routes.get6MStatistics.bind(routes))
;
.get(config.MEMPOOL.API_URL_PREFIX + 'transaction-times', routes.getTransactionTimes)
.get(config.MEMPOOL.API_URL_PREFIX + 'cpfp/:txId', routes.getCpfpInfo)
.get(config.MEMPOOL.API_URL_PREFIX + 'difficulty-adjustment', routes.getDifficultyChange)
.get(config.MEMPOOL.API_URL_PREFIX + 'fees/recommended', routes.getRecommendedFees)
.get(config.MEMPOOL.API_URL_PREFIX + 'fees/mempool-blocks', routes.getMempoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'backend-info', routes.getBackendInfo)
.get(config.MEMPOOL.API_URL_PREFIX + 'init-data', routes.getInitData)
.get(config.MEMPOOL.API_URL_PREFIX + 'validate-address/:address', routes.validateAddress)
.post(config.MEMPOOL.API_URL_PREFIX + 'tx/push', routes.$postTransactionForm)
.get(config.MEMPOOL.API_URL_PREFIX + 'donations', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/donations`, { responseType: 'stream', timeout: 10000 });
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'donations/images/:id', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/donations/images/${req.params.id}`, {
responseType: 'stream', timeout: 10000
});
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'contributors', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/contributors`, { responseType: 'stream', timeout: 10000 });
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'contributors/images/:id', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/contributors/images/${req.params.id}`, {
responseType: 'stream', timeout: 10000
});
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'translators', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/translators`, { responseType: 'stream', timeout: 10000 });
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'translators/images/:id', async (req, res) => {
try {
const response = await axios.get(`${config.EXTERNAL_DATA_SERVER.MEMPOOL_API}/translators/images/${req.params.id}`, {
responseType: 'stream', timeout: 10000
});
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
;
if (config.BACKEND_API === 'electrs') {
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {
this.app
.get(config.API_ENDPOINT + 'explorer/blocks', routes.getBlocks)
.get(config.API_ENDPOINT + 'explorer/blocks/:height', routes.getBlocks)
.get(config.API_ENDPOINT + 'explorer/tx/:id', routes.getRawTransaction)
.get(config.API_ENDPOINT + 'explorer/block/:hash', routes.getBlock)
.get(config.API_ENDPOINT + 'explorer/block/:hash/tx', routes.getBlockTransactions)
.get(config.API_ENDPOINT + 'explorer/block/:hash/tx/:index', routes.getBlockTransactionsFromIndex)
.get(config.API_ENDPOINT + 'explorer/address/:address', routes.getAddress)
.get(config.API_ENDPOINT + 'explorer/address/:address/tx', routes.getAddressTransactions)
.get(config.API_ENDPOINT + 'explorer/address/:address/tx/chain/:txid', routes.getAddressTransactionsFromTxid)
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/2h', routes.$getStatisticsByTime.bind(routes, '2h'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/24h', routes.$getStatisticsByTime.bind(routes, '24h'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/1w', routes.$getStatisticsByTime.bind(routes, '1w'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/1m', routes.$getStatisticsByTime.bind(routes, '1m'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/3m', routes.$getStatisticsByTime.bind(routes, '3m'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/6m', routes.$getStatisticsByTime.bind(routes, '6m'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/1y', routes.$getStatisticsByTime.bind(routes, '1y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/2y', routes.$getStatisticsByTime.bind(routes, '2y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/3y', routes.$getStatisticsByTime.bind(routes, '3y'))
;
}
if (Common.indexingEnabled()) {
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/:interval', routes.$getPools)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:slug/hashrate', routes.$getPoolHistoricalHashrate)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:slug/blocks', routes.$getPoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:slug/blocks/:height', routes.$getPoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:slug', routes.$getPool)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/hashrate/pools/:interval', routes.$getPoolsHistoricalHashrate)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/hashrate/:interval', routes.$getHistoricalHashrate)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/reward-stats/:blockCount', routes.$getRewardStats)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/blocks/fees/:interval', routes.$getHistoricalBlockFees)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/blocks/rewards/:interval', routes.$getHistoricalBlockRewards)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/blocks/fee-rates/:interval', routes.$getHistoricalBlockFeeRates)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/blocks/sizes-weights/:interval', routes.$getHistoricalBlockSizeAndWeight)
;
}
if (config.BISQ.ENABLED) {
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/stats', routes.getBisqStats)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/tx/:txId', routes.getBisqTransaction)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/block/:hash', routes.getBisqBlock)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/blocks/tip/height', routes.getBisqTip)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/blocks/:index/:length', routes.getBisqBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/address/:address', routes.getBisqAddress)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/txs/:index/:length', routes.getBisqTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/currencies', routes.getBisqMarketCurrencies.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/depth', routes.getBisqMarketDepth.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/hloc', routes.getBisqMarketHloc.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/markets', routes.getBisqMarketMarkets.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/offers', routes.getBisqMarketOffers.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/ticker', routes.getBisqMarketTicker.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/trades', routes.getBisqMarketTrades.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/volumes', routes.getBisqMarketVolumes.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/volumes/7d', routes.getBisqMarketVolumes7d.bind(routes))
;
}
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'blocks', routes.getBlocks.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'blocks/:height', routes.getBlocks.bind(routes))
.get(config.MEMPOOL.API_URL_PREFIX + 'block/:hash', routes.getBlock);
if (config.MEMPOOL.BACKEND !== 'esplora') {
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'mempool', routes.getMempool)
.get(config.MEMPOOL.API_URL_PREFIX + 'mempool/txids', routes.getMempoolTxIds)
.get(config.MEMPOOL.API_URL_PREFIX + 'mempool/recent', routes.getRecentMempoolTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId', routes.getTransaction)
.post(config.MEMPOOL.API_URL_PREFIX + 'tx', routes.$postTransaction)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/hex', routes.getRawTransaction)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/status', routes.getTransactionStatus)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/outspends', routes.getTransactionOutspends)
.get(config.MEMPOOL.API_URL_PREFIX + 'block/:hash/header', routes.getBlockHeader)
.get(config.MEMPOOL.API_URL_PREFIX + 'blocks/tip/height', routes.getBlockTipHeight)
.get(config.MEMPOOL.API_URL_PREFIX + 'block/:hash/txs', routes.getBlockTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'block/:hash/txs/:index', routes.getBlockTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'block/:hash/txids', routes.getTxIdsForBlock)
.get(config.MEMPOOL.API_URL_PREFIX + 'block-height/:height', routes.getBlockHeight)
.get(config.MEMPOOL.API_URL_PREFIX + 'address/:address', routes.getAddress)
.get(config.MEMPOOL.API_URL_PREFIX + 'address/:address/txs', routes.getAddressTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'address/:address/txs/chain/:txId', routes.getAddressTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'address-prefix/:prefix', routes.getAddressPrefix)
;
}
if (Common.isLiquid()) {
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'assets/icons', routes.getAllLiquidIcon)
.get(config.MEMPOOL.API_URL_PREFIX + 'assets/featured', routes.$getAllFeaturedLiquidAssets)
.get(config.MEMPOOL.API_URL_PREFIX + 'asset/:assetId/icon', routes.getLiquidIcon)
.get(config.MEMPOOL.API_URL_PREFIX + 'assets/group/:id', routes.$getAssetGroup)
;
}
if (Common.isLiquid() && config.DATABASE.ENABLED) {
this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'liquid/pegs/month', routes.$getElementsPegsByMonth)
;
}
}
}
const mempoolSpace = new MempoolSpace();
const server = new Server();

54
backend/src/indexer.ts Normal file
View File

@@ -0,0 +1,54 @@
import { Common } from './api/common';
import blocks from './api/blocks';
import mempool from './api/mempool';
import mining from './api/mining';
import logger from './logger';
import HashratesRepository from './repositories/HashratesRepository';
class Indexer {
runIndexer = true;
indexerRunning = false;
constructor() {
}
public reindex() {
if (Common.indexingEnabled()) {
this.runIndexer = true;
}
}
public async $run() {
if (!Common.indexingEnabled() || this.runIndexer === false ||
this.indexerRunning === true || mempool.hasPriority()
) {
return;
}
this.runIndexer = false;
this.indexerRunning = true;
try {
await blocks.$generateBlockDatabase();
await this.$resetHashratesIndexingState();
await mining.$generateNetworkHashrateHistory();
await mining.$generatePoolHashrateHistory();
} catch (e) {
this.reindex();
logger.err(`Indexer failed, trying again later. Reason: ` + (e instanceof Error ? e.message : e));
}
this.indexerRunning = false;
}
async $resetHashratesIndexingState() {
try {
await HashratesRepository.$setLatestRun('last_hashrates_indexing', 0);
await HashratesRepository.$setLatestRun('last_weekly_hashrates_indexing', 0);
} catch (e) {
logger.err(`Cannot reset hashrate indexing timestamps. Reason: ` + (e instanceof Error ? e.message : e));
}
}
}
export default new Indexer();

View File

@@ -1,152 +0,0 @@
export interface IMempoolInfo {
size: number;
bytes: number;
usage?: number;
maxmempool?: number;
mempoolminfee?: number;
minrelaytxfee?: number;
}
export interface ITransaction {
txid: string;
hash: string;
version: number;
size: number;
vsize: number;
weight: number;
locktime: number;
vin: Vin[];
vout: Vout[];
hex: string;
fee: number;
feePerWeightUnit: number;
feePerVsize: number;
blockhash?: string;
confirmations?: number;
time?: number;
blocktime?: number;
totalOut?: number;
}
export interface IBlock {
hash: string;
confirmations: number;
strippedsize: number;
size: number;
weight: number;
height: number;
version: number;
versionHex: string;
merkleroot: string;
tx: any;
time: number;
mediantime: number;
nonce: number;
bits: string;
difficulty: number;
chainwork: string;
nTx: number;
previousblockhash: string;
fees: number;
minFee?: number;
maxFee?: number;
medianFee?: number;
}
interface ScriptSig {
asm: string;
hex: string;
}
interface Vin {
txid: string;
vout: number;
scriptSig: ScriptSig;
sequence: number;
}
interface ScriptPubKey {
asm: string;
hex: string;
reqSigs: number;
type: string;
addresses: string[];
}
interface Vout {
value: number;
n: number;
scriptPubKey: ScriptPubKey;
}
export interface IMempoolStats {
id?: number;
added: string;
unconfirmed_transactions: number;
tx_per_second: number;
vbytes_per_second: number;
total_fee: number;
mempool_byte_weight: number;
fee_data: string;
vsize_1: number;
vsize_2: number;
vsize_3: number;
vsize_4: number;
vsize_5: number;
vsize_6: number;
vsize_8: number;
vsize_10: number;
vsize_12: number;
vsize_15: number;
vsize_20: number;
vsize_30: number;
vsize_40: number;
vsize_50: number;
vsize_60: number;
vsize_70: number;
vsize_80: number;
vsize_90: number;
vsize_100: number;
vsize_125: number;
vsize_150: number;
vsize_175: number;
vsize_200: number;
vsize_250: number;
vsize_300: number;
vsize_350: number;
vsize_400: number;
vsize_500: number;
vsize_600: number;
vsize_700: number;
vsize_800: number;
vsize_900: number;
vsize_1000: number;
vsize_1200: number;
vsize_1400: number;
vsize_1600: number;
vsize_1800: number;
vsize_2000: number;
}
export interface IProjectedBlockInternal extends IProjectedBlock {
txIds: string[];
txFeePerVsizes: number[];
}
export interface IProjectedBlock {
blockSize: number;
blockWeight: number;
maxFee: number;
maxWeightFee: number;
medianFee: number;
minFee: number;
minWeightFee: number;
nTx: number;
fees: number;
hasMyTxId?: boolean;
}
export interface IMempool { [txid: string]: ITransaction; }

148
backend/src/logger.ts Normal file
View File

@@ -0,0 +1,148 @@
import config from './config';
import * as dgram from 'dgram';
class Logger {
static priorities = {
emerg: 0,
alert: 1,
crit: 2,
err: 3,
warn: 4,
notice: 5,
info: 6,
debug: 7
};
static facilities = {
kern: 0,
user: 1,
mail: 2,
daemon: 3,
auth: 4,
syslog: 5,
lpr: 6,
news: 7,
uucp: 8,
local0: 16,
local1: 17,
local2: 18,
local3: 19,
local4: 20,
local5: 21,
local6: 22,
local7: 23
};
// @ts-ignore
public emerg: ((msg: string) => void);
// @ts-ignore
public alert: ((msg: string) => void);
// @ts-ignore
public crit: ((msg: string) => void);
// @ts-ignore
public err: ((msg: string) => void);
// @ts-ignore
public warn: ((msg: string) => void);
// @ts-ignore
public notice: ((msg: string) => void);
// @ts-ignore
public info: ((msg: string) => void);
// @ts-ignore
public debug: ((msg: string) => void);
private name = 'mempool';
private client: dgram.Socket;
private network: string;
constructor() {
let prio;
for (prio in Logger.priorities) {
if (true) {
this.addprio(prio);
}
}
this.client = dgram.createSocket('udp4');
this.network = this.getNetwork();
}
private addprio(prio): void {
this[prio] = (function(_this) {
return function(msg) {
return _this.msg(prio, msg);
};
})(this);
}
private getNetwork(): string {
if (config.BISQ.ENABLED) {
return 'bisq';
}
if (config.MEMPOOL.NETWORK && config.MEMPOOL.NETWORK !== 'mainnet') {
return config.MEMPOOL.NETWORK;
}
return '';
}
private msg(priority, msg) {
let consolemsg, prionum, syslogmsg;
if (typeof msg === 'string' && msg.length > 0) {
while (msg[msg.length - 1].charCodeAt(0) === 10) {
msg = msg.slice(0, msg.length - 1);
}
}
const network = this.network ? ' <' + this.network + '>' : '';
prionum = Logger.priorities[priority] || Logger.priorities.info;
consolemsg = `${this.ts()} [${process.pid}] ${priority.toUpperCase()}:${network} ${msg}`;
if (config.SYSLOG.ENABLED && Logger.priorities[priority] <= Logger.priorities[config.SYSLOG.MIN_PRIORITY]) {
syslogmsg = `<${(Logger.facilities[config.SYSLOG.FACILITY] * 8 + prionum)}> ${this.name}[${process.pid}]: ${priority.toUpperCase()}${network} ${msg}`;
this.syslog(syslogmsg);
}
if (Logger.priorities[priority] > Logger.priorities[config.MEMPOOL.STDOUT_LOG_MIN_PRIORITY]) {
return;
}
if (priority === 'warning') {
priority = 'warn';
}
if (priority === 'debug') {
priority = 'info';
}
if (priority === 'err') {
priority = 'error';
}
return (console[priority] || console.error)(consolemsg);
}
private syslog(msg) {
let msgbuf;
msgbuf = Buffer.from(msg);
this.client.send(msgbuf, 0, msgbuf.length, config.SYSLOG.PORT, config.SYSLOG.HOST, function(err, bytes) {
if (err) {
console.log(err);
}
});
}
private leadZero(n: number): number | string {
if (n < 10) {
return '0' + n;
}
return n;
}
private ts() {
let day, dt, hours, minutes, month, months, seconds;
dt = new Date();
hours = this.leadZero(dt.getHours());
minutes = this.leadZero(dt.getMinutes());
seconds = this.leadZero(dt.getSeconds());
month = dt.getMonth();
day = dt.getDate();
if (day < 10) {
day = ' ' + day;
}
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return months[month] + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds;
}
}
export default new Logger();

View File

@@ -0,0 +1,226 @@
import { IEsploraApi } from './api/bitcoin/esplora-api.interface';
export interface PoolTag {
id: number; // mysql row id
name: string;
link: string;
regexes: string; // JSON array
addresses: string; // JSON array
slug: string;
}
export interface PoolInfo {
poolId: number; // mysql row id
name: string;
link: string;
blockCount: number;
slug: string;
}
export interface PoolStats extends PoolInfo {
rank: number;
emptyBlocks: number;
}
export interface MempoolBlock {
blockSize: number;
blockVSize: number;
nTx: number;
medianFee: number;
totalFees: number;
feeRange: number[];
}
export interface MempoolBlockWithTransactions extends MempoolBlock {
transactionIds: string[];
transactions: TransactionStripped[];
}
export interface MempoolBlockDelta {
added: TransactionStripped[];
removed: string[];
}
interface VinStrippedToScriptsig {
scriptsig: string;
}
interface VoutStrippedToScriptPubkey {
scriptpubkey_address: string | undefined;
value: number;
}
export interface TransactionExtended extends IEsploraApi.Transaction {
vsize: number;
feePerVsize: number;
firstSeen?: number;
effectiveFeePerVsize: number;
ancestors?: Ancestor[];
bestDescendant?: BestDescendant | null;
cpfpChecked?: boolean;
deleteAfter?: number;
}
interface Ancestor {
txid: string;
weight: number;
fee: number;
}
interface BestDescendant {
txid: string;
weight: number;
fee: number;
}
export interface CpfpInfo {
ancestors: Ancestor[];
bestDescendant: BestDescendant | null;
}
export interface TransactionStripped {
txid: string;
fee: number;
vsize: number;
value: number;
}
export interface BlockExtension {
totalFees?: number;
medianFee?: number;
feeRange?: number[];
reward?: number;
coinbaseTx?: TransactionMinerInfo;
matchRate?: number;
pool?: {
id: number;
name: string;
slug: string;
};
avgFee?: number;
avgFeeRate?: number;
coinbaseRaw?: string;
}
export interface BlockExtended extends IEsploraApi.Block {
extras: BlockExtension;
}
export interface TransactionMinerInfo {
vin: VinStrippedToScriptsig[];
vout: VoutStrippedToScriptPubkey[];
}
export interface MempoolStats {
funded_txo_count: number;
funded_txo_sum: number;
spent_txo_count: number;
spent_txo_sum: number;
tx_count: number;
}
export interface Statistic {
id?: number;
added: string;
unconfirmed_transactions: number;
tx_per_second: number;
vbytes_per_second: number;
total_fee: number;
mempool_byte_weight: number;
fee_data: string;
vsize_1: number;
vsize_2: number;
vsize_3: number;
vsize_4: number;
vsize_5: number;
vsize_6: number;
vsize_8: number;
vsize_10: number;
vsize_12: number;
vsize_15: number;
vsize_20: number;
vsize_30: number;
vsize_40: number;
vsize_50: number;
vsize_60: number;
vsize_70: number;
vsize_80: number;
vsize_90: number;
vsize_100: number;
vsize_125: number;
vsize_150: number;
vsize_175: number;
vsize_200: number;
vsize_250: number;
vsize_300: number;
vsize_350: number;
vsize_400: number;
vsize_500: number;
vsize_600: number;
vsize_700: number;
vsize_800: number;
vsize_900: number;
vsize_1000: number;
vsize_1200: number;
vsize_1400: number;
vsize_1600: number;
vsize_1800: number;
vsize_2000: number;
}
export interface OptimizedStatistic {
added: string;
vbytes_per_second: number;
total_fee: number;
mempool_byte_weight: number;
vsizes: number[];
}
export interface WebsocketResponse {
action: string;
data: string[];
'track-tx': string;
'track-address': string;
'watch-mempool': boolean;
'track-bisq-market': string;
}
export interface VbytesPerSecond {
unixTime: number;
vSize: number;
}
export interface RequiredSpec { [name: string]: RequiredParams; }
interface RequiredParams {
required: boolean;
types: ('@string' | '@number' | '@boolean' | string)[];
}
export interface ILoadingIndicators { [name: string]: number; }
export interface IConversionRates { [currency: string]: number; }
export interface IBackendInfo {
hostname: string;
gitCommit: string;
version: string;
}
export interface IDifficultyAdjustment {
progressPercent: number;
difficultyChange: number;
estimatedRetargetDate: number;
remainingBlocks: number;
remainingTime: number;
previousRetarget: number;
nextRetargetHeight: number;
timeAvg: number;
timeOffset: number;
}
export interface RewardStats {
totalReward: number;
totalFee: number;
totalTx: number;
}

View File

@@ -0,0 +1,657 @@
import { BlockExtended } from '../mempool.interfaces';
import DB from '../database';
import logger from '../logger';
import { Common } from '../api/common';
import { prepareBlock } from '../utils/blocks-utils';
import PoolsRepository from './PoolsRepository';
import HashratesRepository from './HashratesRepository';
import { escape } from 'mysql2';
class BlocksRepository {
/**
* Save indexed block data in the database
*/
public async $saveBlockInDatabase(block: BlockExtended) {
try {
const query = `INSERT INTO blocks(
height, hash, blockTimestamp, size,
weight, tx_count, coinbase_raw, difficulty,
pool_id, fees, fee_span, median_fee,
reward, version, bits, nonce,
merkle_root, previous_block_hash, avg_fee, avg_fee_rate
) VALUE (
?, ?, FROM_UNIXTIME(?), ?,
?, ?, ?, ?,
?, ?, ?, ?,
?, ?, ?, ?,
?, ?, ?, ?
)`;
const params: any[] = [
block.height,
block.id,
block.timestamp,
block.size,
block.weight,
block.tx_count,
block.extras.coinbaseRaw,
block.difficulty,
block.extras.pool?.id, // Should always be set to something
block.extras.totalFees,
JSON.stringify(block.extras.feeRange),
block.extras.medianFee,
block.extras.reward,
block.version,
block.bits,
block.nonce,
block.merkle_root,
block.previousblockhash,
block.extras.avgFee,
block.extras.avgFeeRate,
];
await DB.query(query, params);
} catch (e: any) {
if (e.errno === 1062) { // ER_DUP_ENTRY - This scenario is possible upon node backend restart
logger.debug(`$saveBlockInDatabase() - Block ${block.height} has already been indexed, ignoring`);
} else {
logger.err('Cannot save indexed block into db. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
}
/**
* Get all block height that have not been indexed between [startHeight, endHeight]
*/
public async $getMissingBlocksBetweenHeights(startHeight: number, endHeight: number): Promise<number[]> {
if (startHeight < endHeight) {
return [];
}
try {
const [rows]: any[] = await DB.query(`
SELECT height
FROM blocks
WHERE height <= ? AND height >= ?
ORDER BY height DESC;
`, [startHeight, endHeight]);
const indexedBlockHeights: number[] = [];
rows.forEach((row: any) => { indexedBlockHeights.push(row.height); });
const seekedBlocks: number[] = Array.from(Array(startHeight - endHeight + 1).keys(), n => n + endHeight).reverse();
const missingBlocksHeights = seekedBlocks.filter(x => indexedBlockHeights.indexOf(x) === -1);
return missingBlocksHeights;
} catch (e) {
logger.err('Cannot retrieve blocks list to index. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get empty blocks for one or all pools
*/
public async $countEmptyBlocks(poolId: number | null, interval: string | null = null): Promise<any> {
interval = Common.getSqlInterval(interval);
const params: any[] = [];
let query = `SELECT count(height) as count, pools.id as poolId
FROM blocks
JOIN pools on pools.id = blocks.pool_id
WHERE tx_count = 1`;
if (poolId) {
query += ` AND pool_id = ?`;
params.push(poolId);
}
if (interval) {
query += ` AND blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP by pools.id`;
try {
const [rows] = await DB.query(query, params);
return rows;
} catch (e) {
logger.err('Cannot count empty blocks. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Return most recent block height
*/
public async $mostRecentBlockHeight(): Promise<number> {
try {
const [row] = await DB.query('SELECT MAX(height) as maxHeight from blocks');
return row[0]['maxHeight'];
} catch (e) {
logger.err(`Cannot count blocks for this pool (using offset). Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get blocks count for a period
*/
public async $blockCount(poolId: number | null, interval: string | null = null): Promise<number> {
interval = Common.getSqlInterval(interval);
const params: any[] = [];
let query = `SELECT count(height) as blockCount
FROM blocks`;
if (poolId) {
query += ` WHERE pool_id = ?`;
params.push(poolId);
}
if (interval) {
if (poolId) {
query += ` AND`;
} else {
query += ` WHERE`;
}
query += ` blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
try {
const [rows] = await DB.query(query, params);
return <number>rows[0].blockCount;
} catch (e) {
logger.err(`Cannot count blocks for this pool (using offset). Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get blocks count between two dates
* @param poolId
* @param from - The oldest timestamp
* @param to - The newest timestamp
* @returns
*/
public async $blockCountBetweenTimestamp(poolId: number | null, from: number, to: number): Promise<number> {
const params: any[] = [];
let query = `SELECT
count(height) as blockCount,
max(height) as lastBlockHeight
FROM blocks`;
if (poolId) {
query += ` WHERE pool_id = ?`;
params.push(poolId);
}
if (poolId) {
query += ` AND`;
} else {
query += ` WHERE`;
}
query += ` blockTimestamp BETWEEN FROM_UNIXTIME('${from}') AND FROM_UNIXTIME('${to}')`;
try {
const [rows] = await DB.query(query, params);
return <number>rows[0];
} catch (e) {
logger.err(`Cannot count blocks for this pool (using timestamps). Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get blocks count for a period
*/
public async $blockCountBetweenHeight(startHeight: number, endHeight: number): Promise<number> {
const params: any[] = [];
let query = `SELECT count(height) as blockCount
FROM blocks
WHERE height <= ${startHeight} AND height >= ${endHeight}`;
try {
const [rows] = await DB.query(query, params);
return <number>rows[0].blockCount;
} catch (e) {
logger.err(`Cannot count blocks for this pool (using offset). Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get the oldest indexed block
*/
public async $oldestBlockTimestamp(): Promise<number> {
const query = `SELECT UNIX_TIMESTAMP(blockTimestamp) as blockTimestamp
FROM blocks
ORDER BY height
LIMIT 1;`;
try {
const [rows]: any[] = await DB.query(query);
if (rows.length <= 0) {
return -1;
}
return <number>rows[0].blockTimestamp;
} catch (e) {
logger.err('Cannot get oldest indexed block timestamp. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get blocks mined by a specific mining pool
*/
public async $getBlocksByPool(slug: string, startHeight?: number): Promise<object[]> {
const pool = await PoolsRepository.$getPool(slug);
if (!pool) {
throw new Error('This mining pool does not exist ' + escape(slug));
}
const params: any[] = [];
let query = ` SELECT
height,
hash as id,
UNIX_TIMESTAMP(blocks.blockTimestamp) as blockTimestamp,
size,
weight,
tx_count,
coinbase_raw,
difficulty,
fees,
fee_span,
median_fee,
reward,
version,
bits,
nonce,
merkle_root,
previous_block_hash as previousblockhash,
avg_fee,
avg_fee_rate
FROM blocks
WHERE pool_id = ?`;
params.push(pool.id);
if (startHeight !== undefined) {
query += ` AND height < ?`;
params.push(startHeight);
}
query += ` ORDER BY height DESC
LIMIT 10`;
try {
const [rows] = await DB.query(query, params);
const blocks: BlockExtended[] = [];
for (const block of <object[]>rows) {
blocks.push(prepareBlock(block));
}
return blocks;
} catch (e) {
logger.err('Cannot get blocks for this pool. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get one block by height
*/
public async $getBlockByHeight(height: number): Promise<object | null> {
try {
const [rows]: any[] = await DB.query(`SELECT
height,
hash,
hash as id,
UNIX_TIMESTAMP(blocks.blockTimestamp) as blockTimestamp,
size,
weight,
tx_count,
coinbase_raw,
difficulty,
pools.id as pool_id,
pools.name as pool_name,
pools.link as pool_link,
pools.slug as pool_slug,
pools.addresses as pool_addresses,
pools.regexes as pool_regexes,
fees,
fee_span,
median_fee,
reward,
version,
bits,
nonce,
merkle_root,
previous_block_hash as previousblockhash,
avg_fee,
avg_fee_rate
FROM blocks
JOIN pools ON blocks.pool_id = pools.id
WHERE height = ${height};
`);
if (rows.length <= 0) {
return null;
}
rows[0].fee_span = JSON.parse(rows[0].fee_span);
return rows[0];
} catch (e) {
logger.err(`Cannot get indexed block ${height}. Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get one block by hash
*/
public async $getBlockByHash(hash: string): Promise<object | null> {
try {
const query = `
SELECT *, UNIX_TIMESTAMP(blocks.blockTimestamp) as blockTimestamp, hash as id,
pools.id as pool_id, pools.name as pool_name, pools.link as pool_link, pools.slug as pool_slug,
pools.addresses as pool_addresses, pools.regexes as pool_regexes,
previous_block_hash as previousblockhash
FROM blocks
JOIN pools ON blocks.pool_id = pools.id
WHERE hash = '${hash}';
`;
const [rows]: any[] = await DB.query(query);
if (rows.length <= 0) {
return null;
}
rows[0].fee_span = JSON.parse(rows[0].fee_span);
return rows[0];
} catch (e) {
logger.err(`Cannot get indexed block ${hash}. Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Return blocks difficulty
*/
public async $getBlocksDifficulty(interval: string | null): Promise<object[]> {
interval = Common.getSqlInterval(interval);
// :D ... Yeah don't ask me about this one https://stackoverflow.com/a/40303162
// Basically, using temporary user defined fields, we are able to extract all
// difficulty adjustments from the blocks tables.
// This allow use to avoid indexing it in another table.
let query = `
SELECT
*
FROM
(
SELECT
UNIX_TIMESTAMP(blockTimestamp) as timestamp, difficulty, height,
IF(@prevStatus = YT.difficulty, @rn := @rn + 1,
IF(@prevStatus := YT.difficulty, @rn := 1, @rn := 1)
) AS rn
FROM blocks YT
CROSS JOIN
(
SELECT @prevStatus := -1, @rn := 1
) AS var
`;
if (interval) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += `
ORDER BY YT.height
) AS t
WHERE t.rn = 1
ORDER BY t.height
`;
try {
const [rows]: any[] = await DB.query(query);
for (const row of rows) {
delete row['rn'];
}
return rows;
} catch (e) {
logger.err('Cannot generate difficulty history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get general block stats
*/
public async $getBlockStats(blockCount: number): Promise<any> {
try {
// We need to use a subquery
const query = `
SELECT MIN(height) as startBlock, MAX(height) as endBlock, SUM(reward) as totalReward, SUM(fees) as totalFee, SUM(tx_count) as totalTx
FROM
(SELECT height, reward, fees, tx_count FROM blocks
ORDER by height DESC
LIMIT ?) as sub`;
const [rows]: any = await DB.query(query, [blockCount]);
return rows[0];
} catch (e) {
logger.err('Cannot generate reward stats. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/*
* Check if the last 10 blocks chain is valid
*/
public async $validateRecentBlocks(): Promise<boolean> {
try {
const [lastBlocks]: any[] = await DB.query(`SELECT height, hash, previous_block_hash FROM blocks ORDER BY height DESC LIMIT 10`);
for (let i = 0; i < lastBlocks.length - 1; ++i) {
if (lastBlocks[i].previous_block_hash !== lastBlocks[i + 1].hash) {
logger.warn(`Chain divergence detected at block ${lastBlocks[i].height}, re-indexing most recent data`);
return false;
}
}
return true;
} catch (e) {
return true; // Don't do anything if there is a db error
}
}
/**
* Check if the chain of block hash is valid and delete data from the stale branch if needed
*/
public async $validateChain(): Promise<boolean> {
try {
const start = new Date().getTime();
const [blocks]: any[] = await DB.query(`SELECT height, hash, previous_block_hash,
UNIX_TIMESTAMP(blockTimestamp) as timestamp FROM blocks ORDER BY height`);
let partialMsg = false;
let idx = 1;
while (idx < blocks.length) {
if (blocks[idx].height - 1 !== blocks[idx - 1].height) {
if (partialMsg === false) {
logger.info('Some blocks are not indexed, skipping missing blocks during chain validation');
partialMsg = true;
}
++idx;
continue;
}
if (blocks[idx].previous_block_hash !== blocks[idx - 1].hash) {
logger.warn(`Chain divergence detected at block ${blocks[idx - 1].height}, re-indexing newer blocks and hashrates`);
await this.$deleteBlocksFrom(blocks[idx - 1].height);
await HashratesRepository.$deleteHashratesFromTimestamp(blocks[idx - 1].timestamp - 604800);
return false;
}
++idx;
}
logger.info(`${idx} blocks hash validated in ${new Date().getTime() - start} ms`);
return true;
} catch (e) {
logger.err('Cannot validate chain of block hash. Reason: ' + (e instanceof Error ? e.message : e));
return true; // Don't do anything if there is a db error
}
}
/**
* Delete blocks from the database from blockHeight
*/
public async $deleteBlocksFrom(blockHeight: number) {
logger.info(`Delete newer blocks from height ${blockHeight} from the database`);
try {
await DB.query(`DELETE FROM blocks where height >= ${blockHeight}`);
} catch (e) {
logger.err('Cannot delete indexed blocks. Reason: ' + (e instanceof Error ? e.message : e));
}
}
/**
* Get the historical averaged block fees
*/
public async $getHistoricalBlockFees(div: number, interval: string | null): Promise<any> {
try {
let query = `SELECT
CAST(AVG(height) as INT) as avgHeight,
CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
CAST(AVG(fees) as INT) as avgFees
FROM blocks`;
if (interval !== null) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot generate block fees history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get the historical averaged block rewards
*/
public async $getHistoricalBlockRewards(div: number, interval: string | null): Promise<any> {
try {
let query = `SELECT
CAST(AVG(height) as INT) as avgHeight,
CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
CAST(AVG(reward) as INT) as avgRewards
FROM blocks`;
if (interval !== null) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot generate block rewards history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get the historical averaged block fee rate percentiles
*/
public async $getHistoricalBlockFeeRates(div: number, interval: string | null): Promise<any> {
try {
let query = `SELECT
CAST(AVG(height) as INT) as avgHeight,
CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
CAST(AVG(JSON_EXTRACT(fee_span, '$[0]')) as INT) as avgFee_0,
CAST(AVG(JSON_EXTRACT(fee_span, '$[1]')) as INT) as avgFee_10,
CAST(AVG(JSON_EXTRACT(fee_span, '$[2]')) as INT) as avgFee_25,
CAST(AVG(JSON_EXTRACT(fee_span, '$[3]')) as INT) as avgFee_50,
CAST(AVG(JSON_EXTRACT(fee_span, '$[4]')) as INT) as avgFee_75,
CAST(AVG(JSON_EXTRACT(fee_span, '$[5]')) as INT) as avgFee_90,
CAST(AVG(JSON_EXTRACT(fee_span, '$[6]')) as INT) as avgFee_100
FROM blocks`;
if (interval !== null) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot generate block fee rates history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get the historical averaged block sizes
*/
public async $getHistoricalBlockSizes(div: number, interval: string | null): Promise<any> {
try {
let query = `SELECT
CAST(AVG(height) as INT) as avgHeight,
CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
CAST(AVG(size) as INT) as avgSize
FROM blocks`;
if (interval !== null) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot generate block size and weight history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get the historical averaged block weights
*/
public async $getHistoricalBlockWeights(div: number, interval: string | null): Promise<any> {
try {
let query = `SELECT
CAST(AVG(height) as INT) as avgHeight,
CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
CAST(AVG(weight) as INT) as avgWeight
FROM blocks`;
if (interval !== null) {
query += ` WHERE blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot generate block size and weight history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
}
export default new BlocksRepository();

View File

@@ -0,0 +1,217 @@
import { escape } from 'mysql2';
import { Common } from '../api/common';
import DB from '../database';
import logger from '../logger';
import PoolsRepository from './PoolsRepository';
class HashratesRepository {
/**
* Save indexed block data in the database
*/
public async $saveHashrates(hashrates: any) {
if (hashrates.length === 0) {
return;
}
let query = `INSERT INTO
hashrates(hashrate_timestamp, avg_hashrate, pool_id, share, type) VALUES`;
for (const hashrate of hashrates) {
query += ` (FROM_UNIXTIME(${hashrate.hashrateTimestamp}), ${hashrate.avgHashrate}, ${hashrate.poolId}, ${hashrate.share}, "${hashrate.type}"),`;
}
query = query.slice(0, -1);
try {
await DB.query(query);
} catch (e: any) {
logger.err('Cannot save indexed hashrate into db. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
public async $getNetworkDailyHashrate(interval: string | null): Promise<any[]> {
interval = Common.getSqlInterval(interval);
let query = `SELECT UNIX_TIMESTAMP(hashrate_timestamp) as timestamp, avg_hashrate as avgHashrate
FROM hashrates`;
if (interval) {
query += ` WHERE hashrate_timestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()
AND hashrates.type = 'daily'`;
} else {
query += ` WHERE hashrates.type = 'daily'`;
}
query += ` ORDER by hashrate_timestamp`;
try {
const [rows]: any[] = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot fetch network hashrate history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
public async $getWeeklyHashrateTimestamps(): Promise<number[]> {
const query = `SELECT UNIX_TIMESTAMP(hashrate_timestamp) as timestamp
FROM hashrates
WHERE type = 'weekly'
GROUP BY hashrate_timestamp`;
try {
const [rows]: any[] = await DB.query(query);
return rows.map(row => row.timestamp);
} catch (e) {
logger.err('Cannot retreive indexed weekly hashrate timestamps. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Returns the current biggest pool hashrate history
*/
public async $getPoolsWeeklyHashrate(interval: string | null): Promise<any[]> {
interval = Common.getSqlInterval(interval);
const topPoolsId = (await PoolsRepository.$getPoolsInfo('1w')).map((pool) => pool.poolId);
let query = `SELECT UNIX_TIMESTAMP(hashrate_timestamp) as timestamp, avg_hashrate as avgHashrate, share, pools.name as poolName
FROM hashrates
JOIN pools on pools.id = pool_id`;
if (interval) {
query += ` WHERE hashrate_timestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()
AND hashrates.type = 'weekly'
AND pool_id IN (${topPoolsId})`;
} else {
query += ` WHERE hashrates.type = 'weekly'
AND pool_id IN (${topPoolsId})`;
}
query += ` ORDER by hashrate_timestamp, FIELD(pool_id, ${topPoolsId})`;
try {
const [rows]: any[] = await DB.query(query);
return rows;
} catch (e) {
logger.err('Cannot fetch weekly pools hashrate history. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Returns a pool hashrate history
*/
public async $getPoolWeeklyHashrate(slug: string): Promise<any[]> {
const pool = await PoolsRepository.$getPool(slug);
if (!pool) {
throw new Error('This mining pool does not exist ' + escape(slug));
}
// Find hashrate boundaries
let query = `SELECT MIN(hashrate_timestamp) as firstTimestamp, MAX(hashrate_timestamp) as lastTimestamp
FROM hashrates
JOIN pools on pools.id = pool_id
WHERE hashrates.type = 'weekly' AND pool_id = ? AND avg_hashrate != 0
ORDER by hashrate_timestamp LIMIT 1`;
let boundaries = {
firstTimestamp: '1970-01-01',
lastTimestamp: '9999-01-01'
};
try {
const [rows]: any[] = await DB.query(query, [pool.id]);
boundaries = rows[0];
} catch (e) {
logger.err('Cannot fetch hashrate start/end timestamps for this pool. Reason: ' + (e instanceof Error ? e.message : e));
}
// Get hashrates entries between boundaries
query = `SELECT UNIX_TIMESTAMP(hashrate_timestamp) as timestamp, avg_hashrate as avgHashrate, share, pools.name as poolName
FROM hashrates
JOIN pools on pools.id = pool_id
WHERE hashrates.type = 'weekly' AND hashrate_timestamp BETWEEN ? AND ?
AND pool_id = ?
ORDER by hashrate_timestamp`;
try {
const [rows]: any[] = await DB.query(query, [boundaries.firstTimestamp, boundaries.lastTimestamp, pool.id]);
return rows;
} catch (e) {
logger.err('Cannot fetch pool hashrate history for this pool. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Set latest run timestamp
*/
public async $setLatestRun(key: string, val: number) {
const query = `UPDATE state SET number = ? WHERE name = ?`;
try {
await DB.query(query, [val, key]);
} catch (e) {
logger.err(`Cannot set last indexing run for ${key}. Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get latest run timestamp
*/
public async $getLatestRun(key: string): Promise<number> {
const query = `SELECT number FROM state WHERE name = ?`;
try {
const [rows]: any[] = await DB.query(query, [key]);
if (rows.length === 0) {
return 0;
}
return rows[0]['number'];
} catch (e) {
logger.err(`Cannot retrieve last indexing run for ${key}. Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Delete most recent data points for re-indexing
*/
public async $deleteLastEntries() {
logger.info(`Delete latest hashrates data points from the database`);
try {
const [rows]: any[] = await DB.query(`SELECT MAX(hashrate_timestamp) as timestamp FROM hashrates GROUP BY type`);
for (const row of rows) {
await DB.query(`DELETE FROM hashrates WHERE hashrate_timestamp = ?`, [row.timestamp]);
}
// Re-run the hashrate indexing to fill up missing data
await this.$setLatestRun('last_hashrates_indexing', 0);
await this.$setLatestRun('last_weekly_hashrates_indexing', 0);
} catch (e) {
logger.err('Cannot delete latest hashrates data points. Reason: ' + (e instanceof Error ? e.message : e));
}
}
/**
* Delete hashrates from the database from timestamp
*/
public async $deleteHashratesFromTimestamp(timestamp: number) {
logger.info(`Delete newer hashrates from timestamp ${new Date(timestamp * 1000).toUTCString()} from the database`);
try {
await DB.query(`DELETE FROM hashrates WHERE hashrate_timestamp >= FROM_UNIXTIME(?)`, [timestamp]);
// Re-run the hashrate indexing to fill up missing data
await this.$setLatestRun('last_hashrates_indexing', 0);
await this.$setLatestRun('last_weekly_hashrates_indexing', 0);
} catch (e) {
logger.err('Cannot delete latest hashrates data points. Reason: ' + (e instanceof Error ? e.message : e));
}
}
}
export default new HashratesRepository();

View File

@@ -0,0 +1,99 @@
import { Common } from '../api/common';
import config from '../config';
import DB from '../database';
import logger from '../logger';
import { PoolInfo, PoolTag } from '../mempool.interfaces';
class PoolsRepository {
/**
* Get all pools tagging info
*/
public async $getPools(): Promise<PoolTag[]> {
const [rows] = await DB.query('SELECT id, name, addresses, regexes, slug FROM pools;');
return <PoolTag[]>rows;
}
/**
* Get unknown pool tagging info
*/
public async $getUnknownPool(): Promise<PoolTag> {
const [rows] = await DB.query('SELECT id, name, slug FROM pools where name = "Unknown"');
return <PoolTag>rows[0];
}
/**
* Get basic pool info and block count
*/
public async $getPoolsInfo(interval: string | null = null): Promise<PoolInfo[]> {
interval = Common.getSqlInterval(interval);
let query = `SELECT COUNT(height) as blockCount, pool_id as poolId, pools.name as name, pools.link as link, slug
FROM blocks
JOIN pools on pools.id = pool_id`;
if (interval) {
query += ` WHERE blocks.blockTimestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`;
}
query += ` GROUP BY pool_id
ORDER BY COUNT(height) DESC`;
try {
const [rows] = await DB.query(query);
return <PoolInfo[]>rows;
} catch (e) {
logger.err(`Cannot generate pools stats. Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get basic pool info and block count between two timestamp
*/
public async $getPoolsInfoBetween(from: number, to: number): Promise<PoolInfo[]> {
const query = `SELECT COUNT(height) as blockCount, pools.id as poolId, pools.name as poolName
FROM pools
LEFT JOIN blocks on pools.id = blocks.pool_id AND blocks.blockTimestamp BETWEEN FROM_UNIXTIME(?) AND FROM_UNIXTIME(?)
GROUP BY pools.id`;
try {
const [rows] = await DB.query(query, [from, to]);
return <PoolInfo[]>rows;
} catch (e) {
logger.err('Cannot generate pools blocks count. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
/**
* Get mining pool statistics for one pool
*/
public async $getPool(slug: string): Promise<PoolTag | null> {
const query = `
SELECT *
FROM pools
WHERE pools.slug = ?`;
try {
const [rows]: any[] = await DB.query(query, [slug]);
if (rows.length < 1) {
return null;
}
rows[0].regexes = JSON.parse(rows[0].regexes);
if (['testnet', 'signet'].includes(config.MEMPOOL.NETWORK)) {
rows[0].addresses = []; // pools.json only contains mainnet addresses
} else {
rows[0].addresses = JSON.parse(rows[0].addresses);
}
return rows[0];
} catch (e) {
logger.err('Cannot get pool from db. Reason: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
}
export default new PoolsRepository();

View File

@@ -0,0 +1,21 @@
import DB from '../database';
import logger from '../logger';
import { IConversionRates } from '../mempool.interfaces';
class RatesRepository {
public async $saveRate(height: number, rates: IConversionRates) {
try {
await DB.query(`INSERT INTO rates(height, bisq_rates) VALUE (?, ?)`, [height, JSON.stringify(rates)]);
} catch (e: any) {
if (e.errno === 1062) { // ER_DUP_ENTRY - This scenario is possible upon node backend restart
logger.debug(`Rate already exists for block ${height}, ignoring`);
} else {
logger.err(`Cannot save exchange rate into db for block ${height} Reason: ` + (e instanceof Error ? e.message : e));
throw e;
}
}
}
}
export default new RatesRepository();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,92 @@
module.exports = {
addMultiSigAddress: 'addmultisigaddress',
addNode: 'addnode', // bitcoind v0.8.0+
backupWallet: 'backupwallet',
createMultiSig: 'createmultisig',
createRawTransaction: 'createrawtransaction', // bitcoind v0.7.0+
decodeRawTransaction: 'decoderawtransaction', // bitcoind v0.7.0+
decodeScript: 'decodescript',
dumpPrivKey: 'dumpprivkey',
dumpWallet: 'dumpwallet', // bitcoind v0.9.0+
encryptWallet: 'encryptwallet',
estimateFee: 'estimatefee', // bitcoind v0.10.0x
estimatePriority: 'estimatepriority', // bitcoind v0.10.0+
generate: 'generate', // bitcoind v0.11.0+
getAccount: 'getaccount',
getAccountAddress: 'getaccountaddress',
getAddedNodeInfo: 'getaddednodeinfo', // bitcoind v0.8.0+
getAddressesByAccount: 'getaddressesbyaccount',
getBalance: 'getbalance',
getBestBlockHash: 'getbestblockhash', // bitcoind v0.9.0+
getBlock: 'getblock',
getBlockStats: 'getblockstats',
getBlockFilter: 'getblockfilter',
getBlockchainInfo: 'getblockchaininfo', // bitcoind v0.9.2+
getBlockCount: 'getblockcount',
getBlockHash: 'getblockhash',
getBlockHeader: 'getblockheader',
getBlockTemplate: 'getblocktemplate', // bitcoind v0.7.0+
getChainTips: 'getchaintips', // bitcoind v0.10.0+
getChainTxStats: 'getchaintxstats',
getConnectionCount: 'getconnectioncount',
getDifficulty: 'getdifficulty',
getGenerate: 'getgenerate',
getInfo: 'getinfo',
getMempoolAncestors: 'getmempoolancestors',
getMempoolDescendants: 'getmempooldescendants',
getMempoolEntry: 'getmempoolentry',
getMempoolInfo: 'getmempoolinfo', // bitcoind v0.10+
getMiningInfo: 'getmininginfo',
getNetTotals: 'getnettotals',
getNetworkInfo: 'getnetworkinfo', // bitcoind v0.9.2+
getNetworkHashPs: 'getnetworkhashps', // bitcoind v0.9.0+
getNewAddress: 'getnewaddress',
getPeerInfo: 'getpeerinfo', // bitcoind v0.7.0+
getRawChangeAddress: 'getrawchangeaddress', // bitcoin v0.9+
getRawMemPool: 'getrawmempool', // bitcoind v0.7.0+
getRawTransaction: 'getrawtransaction', // bitcoind v0.7.0+
getReceivedByAccount: 'getreceivedbyaccount',
getReceivedByAddress: 'getreceivedbyaddress',
getTransaction: 'gettransaction',
getTxOut: 'gettxout', // bitcoind v0.7.0+
getTxOutProof: 'gettxoutproof', // bitcoind v0.11.0+
getTxOutSetInfo: 'gettxoutsetinfo', // bitcoind v0.7.0+
getUnconfirmedBalance: 'getunconfirmedbalance', // bitcoind v0.9.0+
getWalletInfo: 'getwalletinfo', // bitcoind v0.9.2+
help: 'help',
importAddress: 'importaddress', // bitcoind v0.10.0+
importPrivKey: 'importprivkey',
importWallet: 'importwallet', // bitcoind v0.9.0+
keypoolRefill: 'keypoolrefill',
keyPoolRefill: 'keypoolrefill',
listAccounts: 'listaccounts',
listAddressGroupings: 'listaddressgroupings', // bitcoind v0.7.0+
listLockUnspent: 'listlockunspent', // bitcoind v0.8.0+
listReceivedByAccount: 'listreceivedbyaccount',
listReceivedByAddress: 'listreceivedbyaddress',
listSinceBlock: 'listsinceblock',
listTransactions: 'listtransactions',
listUnspent: 'listunspent', // bitcoind v0.7.0+
lockUnspent: 'lockunspent', // bitcoind v0.8.0+
move: 'move',
ping: 'ping', // bitcoind v0.9.0+
prioritiseTransaction: 'prioritisetransaction', // bitcoind v0.10.0+
sendFrom: 'sendfrom',
sendMany: 'sendmany',
sendRawTransaction: 'sendrawtransaction', // bitcoind v0.7.0+
sendToAddress: 'sendtoaddress',
setAccount: 'setaccount',
setGenerate: 'setgenerate',
setTxFee: 'settxfee',
signMessage: 'signmessage',
signRawTransaction: 'signrawtransaction', // bitcoind v0.7.0+
stop: 'stop',
submitBlock: 'submitblock', // bitcoind v0.7.0+
validateAddress: 'validateaddress',
verifyChain: 'verifychain', // bitcoind v0.9.0+
verifyMessage: 'verifymessage',
verifyTxOutProof: 'verifytxoutproof', // bitcoind v0.11.0+
walletLock: 'walletlock',
walletPassphrase: 'walletpassphrase',
walletPassphraseChange: 'walletpassphrasechange'
}

View File

@@ -0,0 +1,61 @@
var commands = require('./commands')
var rpc = require('./jsonrpc')
// ===----------------------------------------------------------------------===//
// JsonRPC
// ===----------------------------------------------------------------------===//
function Client (opts) {
// @ts-ignore
this.rpc = new rpc.JsonRPC(opts)
}
// ===----------------------------------------------------------------------===//
// cmd
// ===----------------------------------------------------------------------===//
Client.prototype.cmd = function () {
var args = [].slice.call(arguments)
var cmd = args.shift()
callRpc(cmd, args, this.rpc)
}
// ===----------------------------------------------------------------------===//
// callRpc
// ===----------------------------------------------------------------------===//
function callRpc (cmd, args, rpc) {
var fn = args[args.length - 1]
// If the last argument is a callback, pop it from the args list
if (typeof fn === 'function') {
args.pop()
} else {
fn = function () {}
}
return rpc.call(cmd, args, function () {
var args = [].slice.call(arguments)
// @ts-ignore
args.unshift(null)
// @ts-ignore
fn.apply(this, args)
}, function (err) {
fn(err)
})
}
// ===----------------------------------------------------------------------===//
// Initialize wrappers
// ===----------------------------------------------------------------------===//
(function () {
for (var protoFn in commands) {
(function (protoFn) {
Client.prototype[protoFn] = function () {
var args = [].slice.call(arguments)
return callRpc(commands[protoFn], args, this.rpc)
}
})(protoFn)
}
})()
// Export!
module.exports.Client = Client;

View File

@@ -0,0 +1,162 @@
var http = require('http')
var https = require('https')
var JsonRPC = function (opts) {
// @ts-ignore
this.opts = opts || {}
// @ts-ignore
this.http = this.opts.ssl ? https : http
}
JsonRPC.prototype.call = function (method, params) {
return new Promise((resolve, reject) => {
var time = Date.now()
var requestJSON
if (Array.isArray(method)) {
// multiple rpc batch call
requestJSON = []
method.forEach(function (batchCall, i) {
requestJSON.push({
id: time + '-' + i,
method: batchCall.method,
params: batchCall.params
})
})
} else {
// single rpc call
requestJSON = {
id: time,
method: method,
params: params
}
}
// First we encode the request into JSON
requestJSON = JSON.stringify(requestJSON)
// prepare request options
var requestOptions = {
host: this.opts.host || 'localhost',
port: this.opts.port || 8332,
method: 'POST',
path: '/',
headers: {
'Host': this.opts.host || 'localhost',
'Content-Length': requestJSON.length
},
agent: false,
rejectUnauthorized: this.opts.ssl && this.opts.sslStrict !== false
}
if (this.opts.ssl && this.opts.sslCa) {
// @ts-ignore
requestOptions.ca = this.opts.sslCa
}
// use HTTP auth if user and password set
if (this.opts.user && this.opts.pass) {
// @ts-ignore
requestOptions.auth = this.opts.user + ':' + this.opts.pass
}
// Now we'll make a request to the server
var cbCalled = false
var request = this.http.request(requestOptions)
// start request timeout timer
var reqTimeout = setTimeout(function () {
if (cbCalled) return
cbCalled = true
request.abort()
var err = new Error('ETIMEDOUT')
// @ts-ignore
err.code = 'ETIMEDOUT'
reject(err)
}, this.opts.timeout || 30000)
// set additional timeout on socket in case of remote freeze after sending headers
request.setTimeout(this.opts.timeout || 30000, function () {
if (cbCalled) return
cbCalled = true
request.abort()
var err = new Error('ESOCKETTIMEDOUT')
// @ts-ignore
err.code = 'ESOCKETTIMEDOUT'
reject(err)
})
request.on('error', function (err) {
if (cbCalled) return
cbCalled = true
clearTimeout(reqTimeout)
reject(err)
})
request.on('response', function (response) {
clearTimeout(reqTimeout)
// We need to buffer the response chunks in a nonblocking way.
var buffer = ''
response.on('data', function (chunk) {
buffer = buffer + chunk
})
// When all the responses are finished, we decode the JSON and
// depending on whether it's got a result or an error, we call
// emitSuccess or emitError on the promise.
response.on('end', function () {
var err
if (cbCalled) return
cbCalled = true
try {
var decoded = JSON.parse(buffer)
} catch (e) {
if (response.statusCode !== 200) {
err = new Error('Invalid params, response status code: ' + response.statusCode)
err.code = -32602
reject(err)
} else {
err = new Error('Problem parsing JSON response from server')
err.code = -32603
reject(err)
}
return
}
if (!Array.isArray(decoded)) {
decoded = [decoded]
}
// iterate over each response, normally there will be just one
// unless a batch rpc call response is being processed
decoded.forEach(function (decodedResponse, i) {
if (decodedResponse.hasOwnProperty('error') && decodedResponse.error != null) {
if (reject) {
err = new Error(decodedResponse.error.message || '')
if (decodedResponse.error.code) {
err.code = decodedResponse.error.code
}
reject(err)
}
} else if (decodedResponse.hasOwnProperty('result')) {
// @ts-ignore
resolve(decodedResponse.result, response.headers)
} else {
if (reject) {
err = new Error(decodedResponse.error.message || '')
if (decodedResponse.error.code) {
err.code = decodedResponse.error.code
}
reject(err)
}
}
})
})
})
request.end(requestJSON);
});
}
module.exports.JsonRPC = JsonRPC

View File

@@ -0,0 +1,85 @@
import axios, { AxiosResponse } from 'axios';
import * as fs from 'fs';
import config from './config';
import backendInfo from './api/backend-info';
import logger from './logger';
import { SocksProxyAgent } from 'socks-proxy-agent';
const PATH = './';
class SyncAssets {
constructor() { }
public async syncAssets$() {
for (const url of config.MEMPOOL.EXTERNAL_ASSETS) {
try {
await this.downloadFile$(url);
} catch (e) {
throw new Error(`Failed to download external asset. ` + (e instanceof Error ? e.message : e));
}
}
}
private async downloadFile$(url: string) {
return new Promise((resolve, reject) => {
const fileName = url.split('/').slice(-1)[0];
try {
if (config.SOCKS5PROXY.ENABLED) {
const socksOptions: any = {
agentOptions: {
keepAlive: true,
},
hostname: config.SOCKS5PROXY.HOST,
port: config.SOCKS5PROXY.PORT
};
if (config.SOCKS5PROXY.USERNAME && config.SOCKS5PROXY.PASSWORD) {
socksOptions.username = config.SOCKS5PROXY.USERNAME;
socksOptions.password = config.SOCKS5PROXY.PASSWORD;
}
const agent = new SocksProxyAgent(socksOptions);
logger.info(`Downloading external asset ${fileName} over the Tor network...`);
return axios.get(url, {
headers: {
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
httpAgent: agent,
httpsAgent: agent,
responseType: 'stream',
timeout: 30000
}).then(function (response) {
const writer = fs.createWriteStream(PATH + fileName);
writer.on('finish', () => {
logger.info(`External asset ${fileName} saved to ${PATH + fileName}`);
resolve(0);
});
response.data.pipe(writer);
});
} else {
logger.info(`Downloading external asset ${fileName} over clearnet...`);
return axios.get(url, {
headers: {
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
responseType: 'stream',
timeout: 30000
}).then(function (response) {
const writer = fs.createWriteStream(PATH + fileName);
writer.on('finish', () => {
logger.info(`External asset ${fileName} saved to ${PATH + fileName}`);
resolve(0);
});
response.data.pipe(writer);
});
}
} catch (e: any) {
reject(e);
}
});
}
}
export default new SyncAssets();

View File

@@ -0,0 +1,175 @@
import axios, { AxiosResponse } from 'axios';
import poolsParser from '../api/pools-parser';
import config from '../config';
import DB from '../database';
import backendInfo from '../api/backend-info';
import logger from '../logger';
import { SocksProxyAgent } from 'socks-proxy-agent';
import * as https from 'https';
/**
* Maintain the most recent version of pools.json
*/
class PoolsUpdater {
lastRun: number = 0;
currentSha: any = undefined;
constructor() {
}
public async updatePoolsJson() {
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) === false) {
return;
}
const oneWeek = 604800;
const oneDay = 86400;
const now = new Date().getTime() / 1000;
if (now - this.lastRun < oneWeek) { // Execute the PoolsUpdate only once a week, or upon restart
return;
}
this.lastRun = now;
logger.info('Updating latest mining pools from Github');
if (config.SOCKS5PROXY.ENABLED) {
logger.info('List of public pools will be queried over the Tor network');
} else {
logger.info('List of public pools will be queried over clearnet');
}
try {
const githubSha = await this.fetchPoolsSha(); // Fetch pools.json sha from github
if (githubSha === undefined) {
return;
}
if (config.DATABASE.ENABLED === true) {
this.currentSha = await this.getShaFromDb();
}
logger.debug(`Pools.json sha | Current: ${this.currentSha} | Github: ${githubSha}`);
if (this.currentSha !== undefined && this.currentSha === githubSha) {
return;
}
logger.warn('Pools.json is outdated, fetch latest from github');
const poolsJson = await this.query('https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json');
if (poolsJson === undefined) {
return;
}
await poolsParser.migratePoolsJson(poolsJson);
await this.updateDBSha(githubSha);
logger.notice('PoolsUpdater completed');
} catch (e) {
this.lastRun = now - (oneWeek - oneDay); // Try again in 24h instead of waiting next week
logger.err('PoolsUpdater failed. Will try again in 24h. Reason: ' + (e instanceof Error ? e.message : e));
}
}
/**
* Fetch our latest pools.json sha from the db
*/
private async updateDBSha(githubSha: string) {
this.currentSha = githubSha;
if (config.DATABASE.ENABLED === true) {
try {
await DB.query('DELETE FROM state where name="pools_json_sha"');
await DB.query(`INSERT INTO state VALUES('pools_json_sha', NULL, '${githubSha}')`);
} catch (e) {
logger.err('Cannot save github pools.json sha into the db. Reason: ' + (e instanceof Error ? e.message : e));
}
}
}
/**
* Fetch our latest pools.json sha from the db
*/
private async getShaFromDb(): Promise<string | undefined> {
try {
const [rows]: any[] = await DB.query('SELECT string FROM state WHERE name="pools_json_sha"');
return (rows.length > 0 ? rows[0].string : undefined);
} catch (e) {
logger.err('Cannot fetch pools.json sha from db. Reason: ' + (e instanceof Error ? e.message : e));
return undefined;
}
}
/**
* Fetch our latest pools.json sha from github
*/
private async fetchPoolsSha(): Promise<string | undefined> {
const response = await this.query('https://api.github.com/repos/mempool/mining-pools/git/trees/master');
if (response !== undefined) {
for (const file of response['tree']) {
if (file['path'] === 'pools.json') {
return file['sha'];
}
}
}
logger.err('Cannot to find latest pools.json sha from github api response');
return undefined;
}
/**
* Http request wrapper
*/
private async query(path): Promise<object | undefined> {
type axiosOptions = {
headers: {
'User-Agent': string
};
timeout: number;
httpsAgent?: https.Agent;
}
const setDelay = (secs: number = 1): Promise<void> => new Promise(resolve => setTimeout(() => resolve(), secs * 1000));
const axiosOptions: axiosOptions = {
headers: {
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
timeout: config.SOCKS5PROXY.ENABLED ? 30000 : 10000
};
let retry = 0;
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
try {
if (config.SOCKS5PROXY.ENABLED) {
const socksOptions: any = {
agentOptions: {
keepAlive: true,
},
hostname: config.SOCKS5PROXY.HOST,
port: config.SOCKS5PROXY.PORT
};
if (config.SOCKS5PROXY.USERNAME && config.SOCKS5PROXY.PASSWORD) {
socksOptions.username = config.SOCKS5PROXY.USERNAME;
socksOptions.password = config.SOCKS5PROXY.PASSWORD;
} else {
// Retry with different tor circuits https://stackoverflow.com/a/64960234
socksOptions.username = `circuit${retry}`;
}
axiosOptions.httpsAgent = new SocksProxyAgent(socksOptions);
}
const data: AxiosResponse = await axios.get(path, axiosOptions);
if (data.statusText === 'error' || !data.data) {
throw new Error(`Could not fetch data from Github, Error: ${data.status}`);
}
return data.data;
} catch (e) {
logger.err('Could not connect to Github. Reason: ' + (e instanceof Error ? e.message : e));
retry++;
}
await setDelay(config.MEMPOOL.EXTERNAL_RETRY_INTERVAL);
}
return undefined;
}
}
export default new PoolsUpdater();

View File

@@ -0,0 +1,32 @@
import { BlockExtended } from '../mempool.interfaces';
export function prepareBlock(block: any): BlockExtended {
return <BlockExtended>{
id: block.id ?? block.hash, // hash for indexed block
timestamp: block.timestamp ?? block.blockTimestamp, // blockTimestamp for indexed block
height: block.height,
version: block.version,
bits: block.bits,
nonce: block.nonce,
difficulty: block.difficulty,
merkle_root: block.merkle_root,
tx_count: block.tx_count,
size: block.size,
weight: block.weight,
previousblockhash: block.previousblockhash,
extras: {
coinbaseRaw: block.coinbase_raw ?? block.extras?.coinbaseRaw,
medianFee: block.medianFee ?? block.median_fee ?? block.extras?.medianFee,
feeRange: block.feeRange ?? block.fee_span,
reward: block.reward ?? block?.extras?.reward,
totalFees: block.totalFees ?? block?.fees ?? block?.extras?.totalFees,
avgFee: block?.extras?.avgFee ?? block.avg_fee,
avgFeeRate: block?.avgFeeRate ?? block.avg_fee_rate,
pool: block?.extras?.pool ?? (block?.pool_id ? {
id: block.pool_id,
name: block.pool_name,
slug: block.pool_slug,
} : undefined),
}
};
}

View File

@@ -1,7 +1,8 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "esnext",
"lib": ["es2019", "dom"],
"strict": true,
"noImplicitAny": false,
"sourceMap": false,
@@ -9,7 +10,8 @@
"moduleResolution": "node",
"typeRoots": [
"node_modules/@types"
]
],
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*.ts"

View File

@@ -12,7 +12,7 @@
"severity": "warn"
},
"eofline": true,
"forin": true,
"forin": false,
"import-blacklist": [
true,
"rxjs",

File diff suppressed because it is too large Load Diff

3
contributors/TechMiX.txt Normal file
View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: TechMiX

View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: antonilol

View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of May 15, 2022.
Signed: ayanamidev

3
contributors/bosch-0.txt Normal file
View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: Bosch-0

3
contributors/dsbaars.txt Normal file
View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: dsbaars

1
contributors/emzy.txt Normal file
View File

@@ -0,0 +1 @@
Mempool Space K.K. has a signed CLA or other agreement on file with @emzy as of January 25, 2022

1
contributors/hunicus.txt Normal file
View File

@@ -0,0 +1 @@
Mempool Space K.K. has a signed CLA or other agreement on file with @hunicus as of January 25, 2022

View File

@@ -0,0 +1 @@
Mempool Space K.K. has a signed CLA or other agreement on file with @knorrium as of January 25, 2022

View File

@@ -0,0 +1 @@
Mempool Space K.K. has a signed CLA or other agreement on file with @miguelmedeiros as of January 25, 2022

View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of May 31, 2022.
Signed: mononaut

View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of March 11, 2022.
Signed: naveensrinivasan

View File

@@ -0,0 +1 @@
Mempool Space K.K. has a signed CLA or other agreement on file with @nymkappa as of January 25, 2022

View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: softsimon

3
contributors/wiz.txt Normal file
View File

@@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of January 25, 2022.
Signed: wiz

Some files were not shown because too many files have changed in this diff Show More