Compare commits
333 Commits
v2.1.1
...
v2.2.0-rc4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6be733490f | ||
|
|
fdf15c39a6 | ||
|
|
3b020046b7 | ||
|
|
8574ee6edd | ||
|
|
f937ea5745 | ||
|
|
741a020579 | ||
|
|
33d37a9b5b | ||
|
|
446bdfebea | ||
|
|
ca91afe45b | ||
|
|
33a5be5a7d | ||
|
|
6a4eee3711 | ||
|
|
13931ceec6 | ||
|
|
0c418a9e33 | ||
|
|
6f8b95a17f | ||
|
|
389c1d794c | ||
|
|
fca66f1b9f | ||
|
|
4c7d0cd2e5 | ||
|
|
1016586992 | ||
|
|
38c8f3acb4 | ||
|
|
962023fbc4 | ||
|
|
b4f8bb2f48 | ||
|
|
c26461fada | ||
|
|
1a996e1640 | ||
|
|
c80532b420 | ||
|
|
74c49b9ae7 | ||
|
|
3f03c9c2b6 | ||
|
|
f00e727e68 | ||
|
|
4338dd6c3f | ||
|
|
8385c50605 | ||
|
|
93c4b1caf1 | ||
|
|
49810b6a47 | ||
|
|
28d685a661 | ||
|
|
95d3d0feaf | ||
|
|
cbc5d67f62 | ||
|
|
87575bc0a2 | ||
|
|
8f74ef58f8 | ||
|
|
2475c67d5b | ||
|
|
bf45bf7b39 | ||
|
|
a1f0417997 | ||
|
|
237f265aab | ||
|
|
0087700aa5 | ||
|
|
861344ed6d | ||
|
|
9e343b346a | ||
|
|
e857dbc874 | ||
|
|
a10cd09ba8 | ||
|
|
f30777934f | ||
|
|
4f6bf297bf | ||
|
|
0121052f0b | ||
|
|
1bd0c40c15 | ||
|
|
2ee96cae44 | ||
|
|
28c8d7dba0 | ||
|
|
9b05ecedc6 | ||
|
|
8fbd273733 | ||
|
|
dec8ae2930 | ||
|
|
353b0e8729 | ||
|
|
71bfcea8a6 | ||
|
|
c54c30209e | ||
|
|
abc6b1519e | ||
|
|
4dcda2cf47 | ||
|
|
d055fabfeb | ||
|
|
dbb365f5e3 | ||
|
|
efb5deda43 | ||
|
|
a4cd6450e3 | ||
|
|
edad15da0d | ||
|
|
e70fd0045d | ||
|
|
794bc99cb6 | ||
|
|
cd1ec53af0 | ||
|
|
3e435d1394 | ||
|
|
50b94f8b72 | ||
|
|
f6f5b69487 | ||
|
|
66b27b9dd0 | ||
|
|
71fa2d67cb | ||
|
|
5cd2cfa097 | ||
|
|
cfd13b3655 | ||
|
|
3ffa60db1f | ||
|
|
4442964124 | ||
|
|
cb034020ef | ||
|
|
5aa57d6df9 | ||
|
|
c1a79e3a33 | ||
|
|
bbd21c9401 | ||
|
|
ad22f9cb46 | ||
|
|
939955fb84 | ||
|
|
63e67dba38 | ||
|
|
8a1230623e | ||
|
|
f20c73af7b | ||
|
|
12c99b86b7 | ||
|
|
934dd67384 | ||
|
|
870bd54b38 | ||
|
|
89300dae98 | ||
|
|
482a891cec | ||
|
|
098ab7d3a7 | ||
|
|
147d44d14b | ||
|
|
8ccdf3973c | ||
|
|
c09eb651ef | ||
|
|
ac91d814d6 | ||
|
|
be2f024da1 | ||
|
|
f137f45cef | ||
|
|
90784deacc | ||
|
|
8ed664e3a9 | ||
|
|
17b6916f31 | ||
|
|
b778d96910 | ||
|
|
5b2eb16d1c | ||
|
|
af61357ced | ||
|
|
f281e84396 | ||
|
|
0dc255edf9 | ||
|
|
2f8f3ca2e9 | ||
|
|
39bb93970b | ||
|
|
72d01a0b67 | ||
|
|
0b4da88802 | ||
|
|
d2fe000ad0 | ||
|
|
dcedc8a5ff | ||
|
|
0d03a9e6cc | ||
|
|
24b7acdc60 | ||
|
|
1000f4dd4d | ||
|
|
d5dba9128e | ||
|
|
84b0375c0c | ||
|
|
bf23a6649c | ||
|
|
aea35d4c86 | ||
|
|
52b7efdd53 | ||
|
|
492abad7a6 | ||
|
|
f566eae471 | ||
|
|
2f2be5c64b | ||
|
|
5d1af0a86e | ||
|
|
5cd5280b21 | ||
|
|
3a957ece05 | ||
|
|
3ead05fa51 | ||
|
|
8a838cd4dc | ||
|
|
b05f731332 | ||
|
|
06fd821bf8 | ||
|
|
6dbfcc9d1a | ||
|
|
001bddd529 | ||
|
|
56518b9655 | ||
|
|
da050ee3dc | ||
|
|
5878a2e631 | ||
|
|
c1fc08196b | ||
|
|
95a80157a7 | ||
|
|
165aa6eee2 | ||
|
|
b8fe7b621c | ||
|
|
04ec5e9564 | ||
|
|
2d4dff6de8 | ||
|
|
5cb98b9813 | ||
|
|
d4508bd876 | ||
|
|
6ccac1df79 | ||
|
|
b38fc824e6 | ||
|
|
cdbe90c182 | ||
|
|
6b5b80f866 | ||
|
|
d74677628b | ||
|
|
f0d46d6ed8 | ||
|
|
220d9afd97 | ||
|
|
dfd88a7ff9 | ||
|
|
eec36ae4e6 | ||
|
|
0a07a16650 | ||
|
|
e62ee72149 | ||
|
|
117f5410d7 | ||
|
|
f6ea45b61f | ||
|
|
90b06833ba | ||
|
|
221fccf3bc | ||
|
|
3740980007 | ||
|
|
d1b53f4c3a | ||
|
|
d51ea54ab9 | ||
|
|
3300f0e8d3 | ||
|
|
cd1273981d | ||
|
|
fd0ffd2a39 | ||
|
|
d60bc10941 | ||
|
|
5085e0c420 | ||
|
|
3dbddedf91 | ||
|
|
e255bec7ad | ||
|
|
cbe79d7051 | ||
|
|
344d1247bd | ||
|
|
089bb38e6a | ||
|
|
2077126064 | ||
|
|
fcf7955d63 | ||
|
|
7a4ad0ee2f | ||
|
|
4bb68d0163 | ||
|
|
f80a11d1f4 | ||
|
|
f61e3d8cec | ||
|
|
7fab42baa5 | ||
|
|
4ab4581393 | ||
|
|
4c8d261da0 | ||
|
|
88c9fd0c7b | ||
|
|
f1c5f83412 | ||
|
|
2d9b9b5c5d | ||
|
|
c7c4895eab | ||
|
|
979b870c9c | ||
|
|
041aa2a163 | ||
|
|
1bb990b796 | ||
|
|
a6e7e1966e | ||
|
|
db263b8db4 | ||
|
|
0289620262 | ||
|
|
d8ef0cd3ac | ||
|
|
68be897379 | ||
|
|
2016d4bca6 | ||
|
|
0c2d88960c | ||
|
|
e3e1cddd2f | ||
|
|
00b564149d | ||
|
|
dee614f6ac | ||
|
|
896a4cbcfc | ||
|
|
e731077077 | ||
|
|
4a907f9dc6 | ||
|
|
b0baf6aa0d | ||
|
|
8dddfe38a9 | ||
|
|
0f9f905fd1 | ||
|
|
bc8e3109fa | ||
|
|
56b0eab9b4 | ||
|
|
5914d99283 | ||
|
|
d942cb48a5 | ||
|
|
4d0429b786 | ||
|
|
2b1c511611 | ||
|
|
8a86b63693 | ||
|
|
2a2c1a6291 | ||
|
|
ce1860b7d1 | ||
|
|
37e01c5e91 | ||
|
|
0ff05d5551 | ||
|
|
9b428821f6 | ||
|
|
21bb879fc1 | ||
|
|
8a97880cdb | ||
|
|
ca267744a6 | ||
|
|
a4253301dc | ||
|
|
402c5e3444 | ||
|
|
f12eb333d2 | ||
|
|
a0b50d7735 | ||
|
|
3967ce0854 | ||
|
|
ed55e86a9d | ||
|
|
c93adba276 | ||
|
|
1ae002385d | ||
|
|
e05ca7d691 | ||
|
|
dc36bfcfe4 | ||
|
|
e688948e42 | ||
|
|
5148de8f17 | ||
|
|
6f1cdd0c8b | ||
|
|
d3c53c7406 | ||
|
|
b2d08d69cf | ||
|
|
b85c2a6e0f | ||
|
|
f1f847a9f8 | ||
|
|
8b5d3dabe7 | ||
|
|
ac4588cdab | ||
|
|
baa75b77a7 | ||
|
|
f2a08444fe | ||
|
|
c866fbf6df | ||
|
|
da77dbece1 | ||
|
|
6a07eb0d91 | ||
|
|
057a96001d | ||
|
|
f173b17b90 | ||
|
|
8e29a4cefd | ||
|
|
6b47895aec | ||
|
|
146fcfc16d | ||
|
|
308dd2c7ad | ||
|
|
4cbf2e0eb4 | ||
|
|
1d4ed85d50 | ||
|
|
a530d8b17f | ||
|
|
e32066affd | ||
|
|
d5cc558670 | ||
|
|
a52f98c39d | ||
|
|
7beb832007 | ||
|
|
3e1c4a7e59 | ||
|
|
3b8d3221cf | ||
|
|
b594a9d249 | ||
|
|
d20cec4e59 | ||
|
|
e5972aa181 | ||
|
|
b0912064cc | ||
|
|
84737bca6e | ||
|
|
14db7e4c8b | ||
|
|
d99fd5d59a | ||
|
|
9624801716 | ||
|
|
904cf62c78 | ||
|
|
92e2df4627 | ||
|
|
f157a50952 | ||
|
|
c3927c9f0a | ||
|
|
45505c86d9 | ||
|
|
4fbab41cc8 | ||
|
|
b2769d2af3 | ||
|
|
2fca34faaa | ||
|
|
8fa672e312 | ||
|
|
2c5cf94982 | ||
|
|
72ded16543 | ||
|
|
7d67c8ea6e | ||
|
|
1051919a8a | ||
|
|
8ca6f06650 | ||
|
|
906189c43a | ||
|
|
0ba6d651c0 | ||
|
|
2a7b4f9aed | ||
|
|
892cebd8f4 | ||
|
|
2e8bd7f32e | ||
|
|
275895bedd | ||
|
|
ec699f28fb | ||
|
|
38e866995f | ||
|
|
85ad0aaa27 | ||
|
|
eeb7447988 | ||
|
|
9e2581d734 | ||
|
|
be0fd7c582 | ||
|
|
26b4bd899b | ||
|
|
a3d9e87f0e | ||
|
|
4a24a173d3 | ||
|
|
05098b1141 | ||
|
|
6a7d5fbe6a | ||
|
|
75b8ec855b | ||
|
|
b89630953c | ||
|
|
04c42b82f4 | ||
|
|
6ec07e5315 | ||
|
|
ea5dc8738c | ||
|
|
619eee9492 | ||
|
|
c9f2bd4029 | ||
|
|
795fb9342a | ||
|
|
0b04dbbca2 | ||
|
|
55df5dbd35 | ||
|
|
0b79aaaf2f | ||
|
|
7d858a8abd | ||
|
|
32af9420dc | ||
|
|
7195d6ea31 | ||
|
|
a111dc044f | ||
|
|
563ae8540b | ||
|
|
279cba5d79 | ||
|
|
32c740e572 | ||
|
|
28bc08c5a8 | ||
|
|
a0e3468c51 | ||
|
|
d50e25bed7 | ||
|
|
7f8329aa4d | ||
|
|
6619f92502 | ||
|
|
edce0d118a | ||
|
|
26ba41cb91 | ||
|
|
475baf5634 | ||
|
|
6866b12e84 | ||
|
|
2743b35ea2 | ||
|
|
d39207e097 | ||
|
|
033d1451d0 | ||
|
|
befb192651 | ||
|
|
7489d3360a | ||
|
|
2641ae0c8e | ||
|
|
32290d1e0d | ||
|
|
584ef87fc8 | ||
|
|
63b52b9d9b | ||
|
|
5f6b7d94b1 | ||
|
|
95a1c002eb |
15
.github/workflows/on-tag.yml
vendored
15
.github/workflows/on-tag.yml
vendored
@@ -27,6 +27,9 @@ jobs:
|
|||||||
- name: Show set environment variables
|
- name: Show set environment variables
|
||||||
run: |
|
run: |
|
||||||
printf " TAG: %s\n" "$TAG"
|
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
|
- name: Login to Docker for building
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
@@ -64,14 +67,6 @@ jobs:
|
|||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
|
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
|
||||||
--output "type=registry" ./${{ matrix.service }}/
|
|
||||||
|
|
||||||
- name: Run Docker buildx for ${{ matrix.service }} against latest
|
|
||||||
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 }}:latest \
|
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \
|
||||||
--output "type=registry" ./${{ matrix.service }}/
|
--output "type=registry" ./${{ matrix.service }}/ \
|
||||||
|
--build-arg commitHash=$SHORT_SHA
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
sitemap
|
sitemap
|
||||||
|
data
|
||||||
|
docker-compose.yml
|
||||||
|
backend/mempool-config.json
|
||||||
|
|||||||
48
GNUmakefile
Executable file
48
GNUmakefile
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
# 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/db-scripts $(DATA)/mysql/data
|
||||||
|
install -v mariadb-structure.sql $(DATA)/mysql/db-scripts
|
||||||
|
#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
|
||||||
47
LICENSE
47
LICENSE
@@ -1,35 +1,24 @@
|
|||||||
MIT License with Commons Clause License Condition v1.0
|
The Mempool Open Source Project
|
||||||
|
Copyright (c) 2019-2021 The Mempool Open Source Project Developers
|
||||||
|
|
||||||
Copyright (c) 2019-2020 The Mempool Open Source Project
|
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
|
1) the GNU Affero General Public License as published by the Free Software
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
Foundation, either version 3 of the License or any later version approved by a
|
||||||
in the Software without restriction, including without limitation the rights
|
proxy statement published on <https://mempool.space/about>; or
|
||||||
to use, copy, modify, merge, publish, distribute, and/or sublicense
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
2) the GNU General Public License as published by the Free Software
|
||||||
copies or substantial portions of the 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
|
However, these licenses do not grant you any rights to use the "mempool.space"
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
trademarks or logos, or any other trademarks of Mempool Space K.K.
|
||||||
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.
|
|
||||||
|
|
||||||
Commons Clause License Condition v1.0
|
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.
|
||||||
|
|
||||||
Without limiting other conditions in the License, the grant of rights under
|
You should have received a copy of both the GNU Affero General Public License
|
||||||
the License will not include, and the License does not grant to you, the
|
and the GNU General Public License along with this program. If not, see
|
||||||
right to Sell the Software.
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
For purposes of the foregoing, “Sell” means practicing any or all of the
|
|
||||||
rights granted to you under the License to provide to third parties, for a
|
|
||||||
fee or other consideration (including without limitation fees for hosting or
|
|
||||||
consulting/ support services related to the Software), a product or service
|
|
||||||
whose value derives, entirely or substantially, from the functionality of
|
|
||||||
the Software. Any license notice or attribution required by the License must
|
|
||||||
also include this Commons Cause License Condition notice.
|
|
||||||
|
|||||||
660
LICENSE.AGPL-3.md
Normal file
660
LICENSE.AGPL-3.md
Normal 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
675
LICENSE.GPL-3.md
Normal 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>.
|
||||||
20
README.md
20
README.md
@@ -1,10 +1,22 @@
|
|||||||
# The Mempool Open Source Project
|
# The Mempool Open Source Project
|
||||||
|
|
||||||
Mempool is the fully featured mempool visualizer and block explorer website and API service running on [mempool.space](https://mempool.space/). The instructions below are for most users at home running on low-powered Raspberry Pi devices, but if you want to run a production website on a powerful server, see the [production setup guide](https://github.com/mempool/mempool/tree/master/production)
|
Mempool is the fully featured visualizer, explorer, and API service running on [mempool.space](https://mempool.space/), an open source project developed and operated for the benefit of the Bitcoin community, with a focus on the emerging transaction fee market to help our transition into a multi-layer ecosystem.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Installation
|
## Installation Methods
|
||||||
|
|
||||||
|
Mempool can be self-hosted on a wide variety of your own hardware, ranging from a simple one-click installation on a Raspberry Pi distro, all the way to an advanced high availability cluster of powerful servers for a production instance. We support the following installation methods, ranked in order from simple to advanced:
|
||||||
|
|
||||||
|
1) One-click installation on: [Umbrel](https://github.com/getumbrel/umbrel), [RaspiBlitz](https://github.com/rootzoll/raspiblitz), [RoninDojo](https://code.samourai.io/ronindojo/RoninDojo), or [MyNode](https://github.com/mynodebtc/mynode).
|
||||||
|
2) [Docker installation on Linux using docker-compose](https://github.com/mempool/mempool/tree/master/docker)
|
||||||
|
3) [Manual installation on Linux or FreeBSD](https://github.com/mempool/mempool#manual-installation)
|
||||||
|
4) [Production installation on a powerful FreeBSD server](https://github.com/mempool/mempool/tree/master/production)
|
||||||
|
5) [High Availability cluster using powerful FreeBSD servers](https://github.com/mempool/mempool/tree/master/production#high-availability)
|
||||||
|
|
||||||
|
# Manual Installation
|
||||||
|
|
||||||
|
The following instructions are for a manual installation on Linux or FreeBSD. The file and directory paths may need to be changed to match your OS.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
@@ -67,7 +79,7 @@ Install mempool dependencies from npm and build the backend:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# backend
|
# backend
|
||||||
cd ../backend/
|
cd backend
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|||||||
11
backend/.gitignore
vendored
11
backend/.gitignore
vendored
@@ -41,14 +41,3 @@ testem.log
|
|||||||
#System Files
|
#System Files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
cache.json
|
|
||||||
cache1.json
|
|
||||||
cache2.json
|
|
||||||
cache3.json
|
|
||||||
cache4.json
|
|
||||||
cache5.json
|
|
||||||
cache6.json
|
|
||||||
cache7.json
|
|
||||||
cache8.json
|
|
||||||
cache9.json
|
|
||||||
|
|||||||
1
backend/cache/.gitignore
vendored
Normal file
1
backend/cache/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.json
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
"SPAWN_CLUSTER_PROCS": 0,
|
"SPAWN_CLUSTER_PROCS": 0,
|
||||||
"API_URL_PREFIX": "/api/v1/",
|
"API_URL_PREFIX": "/api/v1/",
|
||||||
"POLL_RATE_MS": 2000,
|
"POLL_RATE_MS": 2000,
|
||||||
"CACHE_DIR": "./"
|
"CACHE_DIR": "./cache",
|
||||||
|
"CLEAR_PROTECTION_MINUTES": 20,
|
||||||
|
"RECOMMENDED_FEE_PERCENTILE": 50
|
||||||
},
|
},
|
||||||
"CORE_RPC": {
|
"CORE_RPC": {
|
||||||
"HOST": "127.0.0.1",
|
"HOST": "127.0.0.1",
|
||||||
@@ -37,15 +39,18 @@
|
|||||||
"USERNAME": "mempool",
|
"USERNAME": "mempool",
|
||||||
"PASSWORD": "mempool"
|
"PASSWORD": "mempool"
|
||||||
},
|
},
|
||||||
|
"SYSLOG": {
|
||||||
|
"ENABLED": true,
|
||||||
|
"HOST": "127.0.0.1",
|
||||||
|
"PORT": 514,
|
||||||
|
"MIN_PRIORITY": "info",
|
||||||
|
"FACILITY": "local7"
|
||||||
|
},
|
||||||
"STATISTICS": {
|
"STATISTICS": {
|
||||||
"ENABLED": true,
|
"ENABLED": true,
|
||||||
"TX_PER_SECOND_SAMPLE_PERIOD": 150
|
"TX_PER_SECOND_SAMPLE_PERIOD": 150
|
||||||
},
|
},
|
||||||
"BISQ_BLOCKS": {
|
"BISQ": {
|
||||||
"ENABLED": false,
|
|
||||||
"DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db/json"
|
|
||||||
},
|
|
||||||
"BISQ_MARKETS": {
|
|
||||||
"ENABLED": false,
|
"ENABLED": false,
|
||||||
"DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db"
|
"DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db"
|
||||||
}
|
}
|
||||||
|
|||||||
121
backend/package-lock.json
generated
121
backend/package-lock.json
generated
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "mempool-backend",
|
"name": "mempool-backend",
|
||||||
"version": "2.0.0",
|
"version": "2.2.0-dev",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mempool-backend",
|
"name": "mempool-backend",
|
||||||
"version": "2.0.0",
|
"version": "2.2.0-dev",
|
||||||
"license": "MIT",
|
"license": "GNU Affero General Public License v3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mempool/bitcoin": "^3.0.2",
|
"@mempool/bitcoin": "^3.0.2",
|
||||||
"@mempool/electrum-client": "^1.1.7",
|
"@mempool/electrum-client": "^1.1.7",
|
||||||
@@ -16,17 +16,17 @@
|
|||||||
"crypto-js": "^4.0.0",
|
"crypto-js": "^4.0.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"locutus": "^2.0.12",
|
"locutus": "^2.0.12",
|
||||||
"mysql2": "^2.2.5",
|
"mysql2": "2.2.5",
|
||||||
"node-worker-threads-pool": "^1.4.2",
|
"node-worker-threads-pool": "^1.4.3",
|
||||||
"ws": "^7.3.1"
|
"ws": "^7.4.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/compression": "^1.0.1",
|
"@types/compression": "^1.0.1",
|
||||||
"@types/express": "^4.17.2",
|
"@types/express": "^4.17.2",
|
||||||
"@types/locutus": "^0.0.6",
|
"@types/locutus": "^0.0.6",
|
||||||
"@types/ws": "^6.0.4",
|
"@types/ws": "^7.4.4",
|
||||||
"tslint": "~6.1.0",
|
"tslint": "^6.1.0",
|
||||||
"typescript": "~3.9.7"
|
"typescript": "^4.1.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
@@ -163,10 +163,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/ws": {
|
"node_modules/@types/ws": {
|
||||||
"version": "6.0.4",
|
"version": "7.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.4.tgz",
|
||||||
"integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==",
|
"integrity": "sha512-d/7W23JAXPodQNbOZNXvl2K+bqAQrCMwlh/nuQsPSQk6Fq0opHoPrUw43aHsvSbIiQPr8Of2hkFbnz1XBFVyZQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
@@ -548,17 +549,17 @@
|
|||||||
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||||
},
|
},
|
||||||
"node_modules/elliptic": {
|
"node_modules/elliptic": {
|
||||||
"version": "6.5.3",
|
"version": "6.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
|
||||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bn.js": "^4.4.0",
|
"bn.js": "^4.11.9",
|
||||||
"brorand": "^1.0.1",
|
"brorand": "^1.1.0",
|
||||||
"hash.js": "^1.0.0",
|
"hash.js": "^1.0.0",
|
||||||
"hmac-drbg": "^1.0.0",
|
"hmac-drbg": "^1.0.1",
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.4",
|
||||||
"minimalistic-assert": "^1.0.0",
|
"minimalistic-assert": "^1.0.1",
|
||||||
"minimalistic-crypto-utils": "^1.0.0"
|
"minimalistic-crypto-utils": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/encodeurl": {
|
"node_modules/encodeurl": {
|
||||||
@@ -569,11 +570,6 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/es6-promise": {
|
|
||||||
"version": "4.2.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
|
|
||||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
|
|
||||||
},
|
|
||||||
"node_modules/escape-html": {
|
"node_modules/escape-html": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
@@ -895,14 +891,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/locutus": {
|
"node_modules/locutus": {
|
||||||
"version": "2.0.14",
|
"version": "2.0.15",
|
||||||
"resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.15.tgz",
|
||||||
"integrity": "sha512-0H1o1iHNEp3kJ5rW57bT/CAP5g6Qm0Zd817Wcx2+rOMTYyIJoc482Ja1v9dB6IUjwvWKcBNdYi7x2lRXtlJ3bA==",
|
"integrity": "sha512-2xWC4RkoAoCVXEb/stzEgG1TNgd+mrkLBj6TuEDNyUoKeQ2XzDTyJUC23sMiqbL6zJmJSP3w59OZo+zc4IBOmA==",
|
||||||
"dependencies": {
|
|
||||||
"es6-promise": "^4.2.5"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.12.0"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/long": {
|
"node_modules/long": {
|
||||||
@@ -1480,9 +1473,9 @@
|
|||||||
"integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g=="
|
"integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g=="
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "3.9.7",
|
"version": "4.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz",
|
||||||
"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
|
"integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@@ -1544,9 +1537,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "7.4.2",
|
"version": "7.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||||
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.3.0"
|
"node": ">=8.3.0"
|
||||||
},
|
},
|
||||||
@@ -1698,9 +1691,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/ws": {
|
"@types/ws": {
|
||||||
"version": "6.0.4",
|
"version": "7.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.4.tgz",
|
||||||
"integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==",
|
"integrity": "sha512-d/7W23JAXPodQNbOZNXvl2K+bqAQrCMwlh/nuQsPSQk6Fq0opHoPrUw43aHsvSbIiQPr8Of2hkFbnz1XBFVyZQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
@@ -2042,17 +2035,17 @@
|
|||||||
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||||
},
|
},
|
||||||
"elliptic": {
|
"elliptic": {
|
||||||
"version": "6.5.3",
|
"version": "6.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
|
||||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "^4.4.0",
|
"bn.js": "^4.11.9",
|
||||||
"brorand": "^1.0.1",
|
"brorand": "^1.1.0",
|
||||||
"hash.js": "^1.0.0",
|
"hash.js": "^1.0.0",
|
||||||
"hmac-drbg": "^1.0.0",
|
"hmac-drbg": "^1.0.1",
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.4",
|
||||||
"minimalistic-assert": "^1.0.0",
|
"minimalistic-assert": "^1.0.1",
|
||||||
"minimalistic-crypto-utils": "^1.0.0"
|
"minimalistic-crypto-utils": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"encodeurl": {
|
"encodeurl": {
|
||||||
@@ -2060,11 +2053,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||||
},
|
},
|
||||||
"es6-promise": {
|
|
||||||
"version": "4.2.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
|
|
||||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
|
|
||||||
},
|
|
||||||
"escape-html": {
|
"escape-html": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
@@ -2321,12 +2309,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"locutus": {
|
"locutus": {
|
||||||
"version": "2.0.14",
|
"version": "2.0.15",
|
||||||
"resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.15.tgz",
|
||||||
"integrity": "sha512-0H1o1iHNEp3kJ5rW57bT/CAP5g6Qm0Zd817Wcx2+rOMTYyIJoc482Ja1v9dB6IUjwvWKcBNdYi7x2lRXtlJ3bA==",
|
"integrity": "sha512-2xWC4RkoAoCVXEb/stzEgG1TNgd+mrkLBj6TuEDNyUoKeQ2XzDTyJUC23sMiqbL6zJmJSP3w59OZo+zc4IBOmA=="
|
||||||
"requires": {
|
|
||||||
"es6-promise": "^4.2.5"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"long": {
|
"long": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
@@ -2785,9 +2770,9 @@
|
|||||||
"integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g=="
|
"integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g=="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.9.7",
|
"version": "4.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz",
|
||||||
"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
|
"integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unpipe": {
|
"unpipe": {
|
||||||
@@ -2833,9 +2818,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.4.2",
|
"version": "7.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||||
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "mempool-backend",
|
"name": "mempool-backend",
|
||||||
"version": "2.0.0",
|
"version": "2.2.0-dev",
|
||||||
"description": "Bitcoin mempool visualizer and blockchain explorer backend",
|
"description": "Bitcoin mempool visualizer and blockchain explorer backend",
|
||||||
"license": "MIT",
|
"license": "GNU Affero General Public License v3.0",
|
||||||
"homepage": "https://mempool.space",
|
"homepage": "https://mempool.space",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
"ng": "./node_modules/@angular/cli/bin/ng",
|
"ng": "./node_modules/@angular/cli/bin/ng",
|
||||||
"tsc": "./node_modules/typescript/bin/tsc",
|
"tsc": "./node_modules/typescript/bin/tsc",
|
||||||
"build": "npm run tsc",
|
"build": "npm run tsc",
|
||||||
"start": "node --max-old-space-size=4096 dist/index.js",
|
"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"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -35,15 +36,15 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"locutus": "^2.0.12",
|
"locutus": "^2.0.12",
|
||||||
"mysql2": "2.2.5",
|
"mysql2": "2.2.5",
|
||||||
"node-worker-threads-pool": "^1.4.2",
|
"node-worker-threads-pool": "^1.4.3",
|
||||||
"ws": "^7.3.1"
|
"ws": "^7.4.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/compression": "^1.0.1",
|
"@types/compression": "^1.0.1",
|
||||||
"@types/express": "^4.17.2",
|
"@types/express": "^4.17.2",
|
||||||
"@types/locutus": "^0.0.6",
|
"@types/locutus": "^0.0.6",
|
||||||
"@types/ws": "^6.0.4",
|
"@types/ws": "^7.4.4",
|
||||||
"tslint": "~6.1.0",
|
"tslint": "^6.1.0",
|
||||||
"typescript": "~3.9.7"
|
"typescript": "^4.1.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import logger from '../logger';
|
import logger from '../logger';
|
||||||
|
import { IBackendInfo } from '../mempool.interfaces';
|
||||||
|
|
||||||
class BackendInfo {
|
class BackendInfo {
|
||||||
gitCommitHash = '';
|
private gitCommitHash = '';
|
||||||
hostname = '';
|
private hostname = '';
|
||||||
|
private version = '';
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.setLatestCommitHash();
|
this.setLatestCommitHash();
|
||||||
|
this.setVersion();
|
||||||
this.hostname = os.hostname();
|
this.hostname = os.hostname();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBackendInfo() {
|
public getBackendInfo(): IBackendInfo {
|
||||||
return {
|
return {
|
||||||
'hostname': this.hostname,
|
hostname: this.hostname,
|
||||||
'git-commit': this.gitCommitHash,
|
gitCommit: this.gitCommitHash,
|
||||||
|
version: this.version,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +33,15 @@ class BackendInfo {
|
|||||||
logger.err('Could not load git commit info: ' + e.message || e);
|
logger.err('Could not load git commit info: ' + e.message || e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setVersion(): void {
|
||||||
|
try {
|
||||||
|
const packageJson = fs.readFileSync('package.json').toString();
|
||||||
|
this.version = JSON.parse(packageJson).version;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new BackendInfo();
|
export default new BackendInfo();
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import { StaticPool } from 'node-worker-threads-pool';
|
|||||||
import logger from '../../logger';
|
import logger from '../../logger';
|
||||||
|
|
||||||
class Bisq {
|
class Bisq {
|
||||||
private static BLOCKS_JSON_FILE_PATH = config.BISQ_BLOCKS.DATA_PATH + '/all/blocks.json';
|
private static BLOCKS_JSON_FILE_PATH = config.BISQ.DATA_PATH + '/json/all/blocks.json';
|
||||||
private latestBlockHeight = 0;
|
private latestBlockHeight = 0;
|
||||||
private blocks: BisqBlock[] = [];
|
private blocks: BisqBlock[] = [];
|
||||||
|
private allBlocks: BisqBlock[] = [];
|
||||||
private transactions: BisqTransaction[] = [];
|
private transactions: BisqTransaction[] = [];
|
||||||
private transactionIndex: { [txId: string]: BisqTransaction } = {};
|
private transactionIndex: { [txId: string]: BisqTransaction } = {};
|
||||||
private blockIndex: { [hash: string]: BisqBlock } = {};
|
private blockIndex: { [hash: string]: BisqBlock } = {};
|
||||||
@@ -98,7 +99,7 @@ class Bisq {
|
|||||||
this.topDirectoryWatcher.close();
|
this.topDirectoryWatcher.close();
|
||||||
}
|
}
|
||||||
let fsWait: NodeJS.Timeout | null = null;
|
let fsWait: NodeJS.Timeout | null = null;
|
||||||
this.topDirectoryWatcher = fs.watch(config.BISQ_BLOCKS.DATA_PATH, () => {
|
this.topDirectoryWatcher = fs.watch(config.BISQ.DATA_PATH + '/json', () => {
|
||||||
if (fsWait) {
|
if (fsWait) {
|
||||||
clearTimeout(fsWait);
|
clearTimeout(fsWait);
|
||||||
}
|
}
|
||||||
@@ -126,7 +127,7 @@ class Bisq {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let fsWait: NodeJS.Timeout | null = null;
|
let fsWait: NodeJS.Timeout | null = null;
|
||||||
this.subdirectoryWatcher = fs.watch(config.BISQ_BLOCKS.DATA_PATH + '/all', () => {
|
this.subdirectoryWatcher = fs.watch(config.BISQ.DATA_PATH + '/json/all', () => {
|
||||||
if (fsWait) {
|
if (fsWait) {
|
||||||
clearTimeout(fsWait);
|
clearTimeout(fsWait);
|
||||||
}
|
}
|
||||||
@@ -171,7 +172,7 @@ class Bisq {
|
|||||||
this.transactionIndex = {};
|
this.transactionIndex = {};
|
||||||
this.addressIndex = {};
|
this.addressIndex = {};
|
||||||
|
|
||||||
this.blocks.forEach((block) => {
|
this.allBlocks.forEach((block) => {
|
||||||
/* Build block index */
|
/* Build block index */
|
||||||
if (!this.blockIndex[block.hash]) {
|
if (!this.blockIndex[block.hash]) {
|
||||||
this.blockIndex[block.hash] = block;
|
this.blockIndex[block.hash] = block;
|
||||||
@@ -245,9 +246,10 @@ class Bisq {
|
|||||||
if (cacheData && cacheData.length !== 0) {
|
if (cacheData && cacheData.length !== 0) {
|
||||||
logger.debug('Processing Bisq data dump...');
|
logger.debug('Processing Bisq data dump...');
|
||||||
const data: BisqBlocks = await this.jsonParsePool.exec(cacheData);
|
const data: BisqBlocks = await this.jsonParsePool.exec(cacheData);
|
||||||
if (data.blocks && data.blocks.length !== this.blocks.length) {
|
if (data.blocks && data.blocks.length !== this.allBlocks.length) {
|
||||||
this.blocks = data.blocks.filter((block) => block.txs.length > 0);
|
this.allBlocks = data.blocks;
|
||||||
this.blocks.reverse();
|
this.allBlocks.reverse();
|
||||||
|
this.blocks = this.allBlocks.filter((block) => block.txs.length > 0);
|
||||||
this.latestBlockHeight = data.chainHeight;
|
this.latestBlockHeight = data.chainHeight;
|
||||||
const time = new Date().getTime() - start;
|
const time = new Date().getTime() - start;
|
||||||
logger.debug('Bisq dump processed in ' + time + ' ms (worker thread)');
|
logger.debug('Bisq dump processed in ' + time + ' ms (worker thread)');
|
||||||
|
|||||||
@@ -457,6 +457,30 @@ class BisqMarketsApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
private getTradesSummarized(trades: TradesData[], timestamp_from: number, interval?: string): SummarizedIntervals {
|
||||||
const intervals: any = {};
|
const intervals: any = {};
|
||||||
const intervals_prices: any = {};
|
const intervals_prices: any = {};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import logger from '../../logger';
|
|||||||
|
|
||||||
class Bisq {
|
class Bisq {
|
||||||
private static FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE = 4000;
|
private static FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE = 4000;
|
||||||
private static MARKET_JSON_PATH = config.BISQ_MARKETS.DATA_PATH;
|
private static MARKET_JSON_PATH = config.BISQ.DATA_PATH;
|
||||||
private static MARKET_JSON_FILE_PATHS = {
|
private static MARKET_JSON_FILE_PATHS = {
|
||||||
activeCryptoCurrency: '/active_crypto_currency_list.json',
|
activeCryptoCurrency: '/active_crypto_currency_list.json',
|
||||||
activeFiatCurrency: '/active_fiat_currency_list.json',
|
activeFiatCurrency: '/active_fiat_currency_list.json',
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { IEsploraApi } from './esplora-api.interface';
|
|||||||
export interface AbstractBitcoinApi {
|
export interface AbstractBitcoinApi {
|
||||||
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]>;
|
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]>;
|
||||||
$getRawTransaction(txId: string, skipConversion?: boolean, addPrevout?: boolean): Promise<IEsploraApi.Transaction>;
|
$getRawTransaction(txId: string, skipConversion?: boolean, addPrevout?: boolean): Promise<IEsploraApi.Transaction>;
|
||||||
$getRawTransactionBitcoind(txId: string, skipConversion?: boolean, addPrevout?: boolean): Promise<IEsploraApi.Transaction>;
|
|
||||||
$getBlockHeightTip(): Promise<number>;
|
$getBlockHeightTip(): Promise<number>;
|
||||||
$getTxIdsForBlock(hash: string): Promise<string[]>;
|
$getTxIdsForBlock(hash: string): Promise<string[]>;
|
||||||
$getBlockHash(height: number): Promise<string>;
|
$getBlockHash(height: number): Promise<string>;
|
||||||
|
|||||||
@@ -22,16 +22,6 @@ class BitcoinApi implements AbstractBitcoinApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$getRawTransactionBitcoind(txId: string, skipConversion = false, addPrevout = false): Promise<IEsploraApi.Transaction> {
|
|
||||||
return this.bitcoindClient.getRawTransaction(txId, true)
|
|
||||||
.then((transaction: IBitcoinApi.Transaction) => {
|
|
||||||
if (skipConversion) {
|
|
||||||
return transaction;
|
|
||||||
}
|
|
||||||
return this.$convertTransaction(transaction, addPrevout);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$getRawTransaction(txId: string, skipConversion = false, addPrevout = false): Promise<IEsploraApi.Transaction> {
|
$getRawTransaction(txId: string, skipConversion = false, addPrevout = false): Promise<IEsploraApi.Transaction> {
|
||||||
// If the transaction is in the mempool we already converted and fetched the fee. Only prevouts are missing
|
// If the transaction is in the mempool we already converted and fetched the fee. Only prevouts are missing
|
||||||
const txInMempool = mempool.getMempool()[txId];
|
const txInMempool = mempool.getMempool()[txId];
|
||||||
@@ -47,6 +37,9 @@ class BitcoinApi implements AbstractBitcoinApi {
|
|||||||
return this.bitcoindClient.getRawTransaction(txId, true)
|
return this.bitcoindClient.getRawTransaction(txId, true)
|
||||||
.then((transaction: IBitcoinApi.Transaction) => {
|
.then((transaction: IBitcoinApi.Transaction) => {
|
||||||
if (skipConversion) {
|
if (skipConversion) {
|
||||||
|
transaction.vout.forEach((vout) => {
|
||||||
|
vout.value = vout.value * 100000000;
|
||||||
|
});
|
||||||
return transaction;
|
return transaction;
|
||||||
}
|
}
|
||||||
return this.$convertTransaction(transaction, addPrevout);
|
return this.$convertTransaction(transaction, addPrevout);
|
||||||
@@ -154,6 +147,9 @@ class BitcoinApi implements AbstractBitcoinApi {
|
|||||||
esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction, addPrevout);
|
esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction, addPrevout);
|
||||||
} else {
|
} else {
|
||||||
esploraTransaction = await this.$appendMempoolFeeData(esploraTransaction);
|
esploraTransaction = await this.$appendMempoolFeeData(esploraTransaction);
|
||||||
|
if (addPrevout) {
|
||||||
|
esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction, addPrevout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return esploraTransaction;
|
return esploraTransaction;
|
||||||
|
|||||||
@@ -48,11 +48,6 @@ class ElectrsApi implements AbstractBitcoinApi {
|
|||||||
throw new Error('Method getAddressTransactions not implemented.');
|
throw new Error('Method getAddressTransactions not implemented.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$getRawTransactionBitcoind(txId: string): Promise<IEsploraApi.Transaction> {
|
|
||||||
return axios.get<IEsploraApi.Transaction>(config.ESPLORA.REST_API_URL + '/tx/' + txId, this.axiosConfig)
|
|
||||||
.then((response) => response.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$getAddressPrefix(prefix: string): string[] {
|
$getAddressPrefix(prefix: string): string[] {
|
||||||
throw new Error('Method not implemented.');
|
throw new Error('Method not implemented.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,14 +84,21 @@ class Blocks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transactions.forEach((tx) => {
|
||||||
|
if (!tx.cpfpChecked) {
|
||||||
|
Common.setRelativesAndGetCpfpInfo(tx, mempool);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
logger.debug(`${transactionsFound} of ${txIds.length} found in mempool. ${txIds.length - transactionsFound} not found.`);
|
logger.debug(`${transactionsFound} of ${txIds.length} found in mempool. ${txIds.length - transactionsFound} not found.`);
|
||||||
|
|
||||||
const blockExtended: BlockExtended = Object.assign({}, block);
|
const blockExtended: BlockExtended = Object.assign({}, block);
|
||||||
blockExtended.reward = transactions[0].vout.reduce((acc, curr) => acc + curr.value, 0);
|
blockExtended.reward = transactions[0].vout.reduce((acc, curr) => acc + curr.value, 0);
|
||||||
blockExtended.coinbaseTx = transactionUtils.stripCoinbaseTransaction(transactions[0]);
|
blockExtended.coinbaseTx = transactionUtils.stripCoinbaseTransaction(transactions[0]);
|
||||||
transactions.sort((a, b) => b.feePerVsize - a.feePerVsize);
|
transactions.shift();
|
||||||
blockExtended.medianFee = transactions.length > 1 ? Common.median(transactions.map((tx) => tx.feePerVsize)) : 0;
|
transactions.sort((a, b) => b.effectiveFeePerVsize - a.effectiveFeePerVsize);
|
||||||
blockExtended.feeRange = transactions.length > 1 ? Common.getFeesInRange(transactions.slice(0, transactions.length - 1), 8) : [0, 0];
|
blockExtended.medianFee = transactions.length > 1 ? Common.median(transactions.map((tx) => tx.effectiveFeePerVsize)) : 0;
|
||||||
|
blockExtended.feeRange = transactions.length > 1 ? Common.getFeesInRange(transactions, 8) : [0, 0];
|
||||||
|
|
||||||
if (block.height % 2016 === 0) {
|
if (block.height % 2016 === 0) {
|
||||||
this.lastDifficultyAdjustmentTime = block.timestamp;
|
this.lastDifficultyAdjustmentTime = block.timestamp;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { TransactionExtended, TransactionStripped } from '../mempool.interfaces';
|
import { CpfpInfo, TransactionExtended, TransactionStripped } from '../mempool.interfaces';
|
||||||
|
|
||||||
export class Common {
|
export class Common {
|
||||||
static median(numbers: number[]) {
|
static median(numbers: number[]) {
|
||||||
@@ -12,17 +12,28 @@ export class Common {
|
|||||||
return medianNr;
|
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) {
|
static getFeesInRange(transactions: TransactionExtended[], rangeLength: number) {
|
||||||
const arr = [transactions[transactions.length - 1].feePerVsize];
|
const arr = [transactions[transactions.length - 1].effectiveFeePerVsize];
|
||||||
const chunk = 1 / (rangeLength - 1);
|
const chunk = 1 / (rangeLength - 1);
|
||||||
let itemsToAdd = rangeLength - 2;
|
let itemsToAdd = rangeLength - 2;
|
||||||
|
|
||||||
while (itemsToAdd > 0) {
|
while (itemsToAdd > 0) {
|
||||||
arr.push(transactions[Math.floor(transactions.length * chunk * itemsToAdd)].feePerVsize);
|
arr.push(transactions[Math.floor(transactions.length * chunk * itemsToAdd)].effectiveFeePerVsize);
|
||||||
itemsToAdd--;
|
itemsToAdd--;
|
||||||
}
|
}
|
||||||
|
|
||||||
arr.push(transactions[0].feePerVsize);
|
arr.push(transactions[0].effectiveFeePerVsize);
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,4 +75,74 @@ export class Common {
|
|||||||
}, ms);
|
}, 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 = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,37 +5,55 @@ import memPool from './mempool';
|
|||||||
import blocks from './blocks';
|
import blocks from './blocks';
|
||||||
import logger from '../logger';
|
import logger from '../logger';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
|
import { TransactionExtended } from '../mempool.interfaces';
|
||||||
|
import { Common } from './common';
|
||||||
|
|
||||||
class DiskCache {
|
class DiskCache {
|
||||||
private static FILE_NAME = config.MEMPOOL.CACHE_DIR + 'cache.json';
|
private static FILE_NAME = config.MEMPOOL.CACHE_DIR + '/cache.json';
|
||||||
private static FILE_NAMES = config.MEMPOOL.CACHE_DIR + 'cache{number}.json';
|
private static FILE_NAMES = config.MEMPOOL.CACHE_DIR + '/cache{number}.json';
|
||||||
private static CHUNK_SIZE = 10000;
|
private static CHUNK_FILES = 25;
|
||||||
|
private isWritingCache = false;
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
async $saveCacheToDisk(): Promise<void> {
|
async $saveCacheToDisk(): Promise<void> {
|
||||||
if (!cluster.isMaster) {
|
if (!cluster.isMaster) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.isWritingCache) {
|
||||||
|
logger.debug('Saving cache already in progress. Skipping.')
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
logger.debug('Writing mempool and blocks data to disk cache (async)...');
|
logger.debug('Writing mempool and blocks data to disk cache (async)...');
|
||||||
const mempoolChunk_1 = Object.fromEntries(Object.entries(memPool.getMempool()).slice(0, DiskCache.CHUNK_SIZE));
|
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({
|
await fsPromises.writeFile(DiskCache.FILE_NAME, JSON.stringify({
|
||||||
blocks: blocks.getBlocks(),
|
blocks: blocks.getBlocks(),
|
||||||
mempool: mempoolChunk_1
|
mempool: {},
|
||||||
|
mempoolArray: mempoolArray.splice(0, chunkSize),
|
||||||
}), {flag: 'w'});
|
}), {flag: 'w'});
|
||||||
for (let i = 1; i < 10; i++) {
|
for (let i = 1; i < DiskCache.CHUNK_FILES; i++) {
|
||||||
const mempoolChunk = Object.fromEntries(
|
|
||||||
Object.entries(memPool.getMempool()).slice(
|
|
||||||
DiskCache.CHUNK_SIZE * i, i === 9 ? undefined : DiskCache.CHUNK_SIZE * i + DiskCache.CHUNK_SIZE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
await fsPromises.writeFile(DiskCache.FILE_NAMES.replace('{number}', i.toString()), JSON.stringify({
|
await fsPromises.writeFile(DiskCache.FILE_NAMES.replace('{number}', i.toString()), JSON.stringify({
|
||||||
mempool: mempoolChunk
|
mempool: {},
|
||||||
|
mempoolArray: mempoolArray.splice(0, chunkSize),
|
||||||
}), {flag: 'w'});
|
}), {flag: 'w'});
|
||||||
}
|
}
|
||||||
logger.debug('Mempool and blocks data saved to disk cache');
|
logger.debug('Mempool and blocks data saved to disk cache');
|
||||||
|
this.isWritingCache = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warn('Error writing to cache file: ' + e.message || e);
|
logger.warn('Error writing to cache file: ' + e.message || e);
|
||||||
|
this.isWritingCache = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,20 +67,35 @@ class DiskCache {
|
|||||||
if (cacheData) {
|
if (cacheData) {
|
||||||
logger.info('Restoring mempool and blocks data from disk cache');
|
logger.info('Restoring mempool and blocks data from disk cache');
|
||||||
data = JSON.parse(cacheData);
|
data = JSON.parse(cacheData);
|
||||||
|
if (data.mempoolArray) {
|
||||||
|
for (const tx of data.mempoolArray) {
|
||||||
|
data.mempool[tx.txid] = tx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 1; i < 10; i++) {
|
for (let i = 1; i < DiskCache.CHUNK_FILES; i++) {
|
||||||
const fileName = DiskCache.FILE_NAMES.replace('{number}', i.toString());
|
const fileName = DiskCache.FILE_NAMES.replace('{number}', i.toString());
|
||||||
if (fs.existsSync(fileName)) {
|
try {
|
||||||
const cacheData2 = JSON.parse(fs.readFileSync(fileName, 'utf8'));
|
if (fs.existsSync(fileName)) {
|
||||||
Object.assign(data.mempool, cacheData2.mempool);
|
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.debug('Error parsing ' + fileName + '. Skipping.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memPool.setMempool(data.mempool);
|
memPool.setMempool(data.mempool);
|
||||||
blocks.setBlocks(data.blocks);
|
blocks.setBlocks(data.blocks);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warn('Failed to parse mempoool and blocks cache. Skipping...');
|
logger.warn('Failed to parse mempoool and blocks cache. Skipping.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import config from '../config';
|
import config from '../config';
|
||||||
import { MempoolBlock } from '../mempool.interfaces';
|
import { MempoolBlock } from '../mempool.interfaces';
|
||||||
|
import mempool from './mempool';
|
||||||
import projectedBlocks from './mempool-blocks';
|
import projectedBlocks from './mempool-blocks';
|
||||||
|
|
||||||
class FeeApi {
|
class FeeApi {
|
||||||
@@ -9,12 +10,15 @@ class FeeApi {
|
|||||||
|
|
||||||
public getRecommendedFee() {
|
public getRecommendedFee() {
|
||||||
const pBlocks = projectedBlocks.getMempoolBlocks();
|
const pBlocks = projectedBlocks.getMempoolBlocks();
|
||||||
|
const mPool = mempool.getMempoolInfo();
|
||||||
|
const minimumFee = Math.ceil(mPool.mempoolminfee * 100000);
|
||||||
|
|
||||||
if (!pBlocks.length) {
|
if (!pBlocks.length) {
|
||||||
return {
|
return {
|
||||||
'fastestFee': this.defaultFee,
|
'fastestFee': this.defaultFee,
|
||||||
'halfHourFee': this.defaultFee,
|
'halfHourFee': this.defaultFee,
|
||||||
'hourFee': this.defaultFee,
|
'hourFee': this.defaultFee,
|
||||||
|
'minimumFee': minimumFee,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,6 +30,7 @@ class FeeApi {
|
|||||||
'fastestFee': firstMedianFee,
|
'fastestFee': firstMedianFee,
|
||||||
'halfHourFee': secondMedianFee,
|
'halfHourFee': secondMedianFee,
|
||||||
'hourFee': thirdMedianFee,
|
'hourFee': thirdMedianFee,
|
||||||
|
'minimumFee': minimumFee,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,11 +39,11 @@ class FeeApi {
|
|||||||
if (pBlock.blockVSize <= 500000) {
|
if (pBlock.blockVSize <= 500000) {
|
||||||
return this.defaultFee;
|
return this.defaultFee;
|
||||||
}
|
}
|
||||||
if (pBlock.blockVSize <= 950000 && nextBlock) {
|
if (pBlock.blockVSize <= 950000 && !nextBlock) {
|
||||||
const multiplier = (pBlock.blockVSize - 500000) / 500000;
|
const multiplier = (pBlock.blockVSize - 500000) / 500000;
|
||||||
return Math.max(Math.round(useFee * multiplier), this.defaultFee);
|
return Math.max(Math.round(useFee * multiplier), this.defaultFee);
|
||||||
}
|
}
|
||||||
return Math.round(useFee);
|
return Math.ceil(useFee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class FiatConversion {
|
|||||||
|
|
||||||
public startService() {
|
public startService() {
|
||||||
logger.info('Starting currency rates service');
|
logger.info('Starting currency rates service');
|
||||||
setInterval(this.updateCurrency.bind(this), 1000 * 60 * 60);
|
setInterval(this.updateCurrency.bind(this), 1000 * 60);
|
||||||
this.updateCurrency();
|
this.updateCurrency();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import logger from '../logger';
|
||||||
import { MempoolBlock, TransactionExtended, MempoolBlockWithTransactions } from '../mempool.interfaces';
|
import { MempoolBlock, TransactionExtended, MempoolBlockWithTransactions } from '../mempool.interfaces';
|
||||||
import { Common } from './common';
|
import { Common } from './common';
|
||||||
|
import config from '../config';
|
||||||
|
|
||||||
class MempoolBlocks {
|
class MempoolBlocks {
|
||||||
private static DEFAULT_PROJECTED_BLOCKS_AMOUNT = 8;
|
private static DEFAULT_PROJECTED_BLOCKS_AMOUNT = 8;
|
||||||
@@ -32,9 +34,40 @@ class MempoolBlocks {
|
|||||||
memPoolArray.push(latestMempool[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);
|
memPoolArray.sort((a, b) => b.feePerVsize - a.feePerVsize);
|
||||||
const transactionsSorted = memPoolArray.filter((tx) => tx.feePerVsize);
|
|
||||||
this.mempoolBlocks = this.calculateMempoolBlocks(transactionsSorted);
|
// 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');
|
||||||
|
|
||||||
|
this.mempoolBlocks = this.calculateMempoolBlocks(memPoolArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private calculateMempoolBlocks(transactionsSorted: TransactionExtended[]): MempoolBlockWithTransactions[] {
|
private calculateMempoolBlocks(transactionsSorted: TransactionExtended[]): MempoolBlockWithTransactions[] {
|
||||||
@@ -76,7 +109,7 @@ class MempoolBlocks {
|
|||||||
blockVSize: blockVSize,
|
blockVSize: blockVSize,
|
||||||
nTx: transactions.length,
|
nTx: transactions.length,
|
||||||
totalFees: transactions.reduce((acc, cur) => acc + cur.fee, 0),
|
totalFees: transactions.reduce((acc, cur) => acc + cur.fee, 0),
|
||||||
medianFee: Common.median(transactions.map((tx) => tx.feePerVsize)),
|
medianFee: Common.percentile(transactions.map((tx) => tx.effectiveFeePerVsize), config.MEMPOOL.RECOMMENDED_FEE_PERCENTILE),
|
||||||
feeRange: Common.getFeesInRange(transactions, rangeLength),
|
feeRange: Common.getFeesInRange(transactions, rangeLength),
|
||||||
transactionIds: transactions.map((tx) => tx.txid),
|
transactionIds: transactions.map((tx) => tx.txid),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import loadingIndicators from './loading-indicators';
|
|||||||
|
|
||||||
class Mempool {
|
class Mempool {
|
||||||
private static WEBSOCKET_REFRESH_RATE_MS = 10000;
|
private static WEBSOCKET_REFRESH_RATE_MS = 10000;
|
||||||
private static CLEAR_PROTECTION_MINUTES = 10;
|
private static LAZY_DELETE_AFTER_SECONDS = 30;
|
||||||
private inSync: boolean = false;
|
private inSync: boolean = false;
|
||||||
private mempoolCache: { [txId: string]: TransactionExtended } = {};
|
private mempoolCache: { [txId: string]: TransactionExtended } = {};
|
||||||
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0,
|
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0,
|
||||||
maxmempool: 0, mempoolminfee: 0, minrelaytxfee: 0 };
|
maxmempool: 300000000, mempoolminfee: 0.00001000, minrelaytxfee: 0.00001000 };
|
||||||
private mempoolChangedCallback: ((newMempool: {[txId: string]: TransactionExtended; }, newTransactions: TransactionExtended[],
|
private mempoolChangedCallback: ((newMempool: {[txId: string]: TransactionExtended; }, newTransactions: TransactionExtended[],
|
||||||
deletedTransactions: TransactionExtended[]) => void) | undefined;
|
deletedTransactions: TransactionExtended[]) => void) | undefined;
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ class Mempool {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
setInterval(this.updateTxPerSecond.bind(this), 1000);
|
setInterval(this.updateTxPerSecond.bind(this), 1000);
|
||||||
|
setInterval(this.deleteExpiredTransactions.bind(this), 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public isInSync(): boolean {
|
public isInSync(): boolean {
|
||||||
@@ -63,7 +64,7 @@ class Mempool {
|
|||||||
this.mempoolInfo = await bitcoinBaseApi.$getMempoolInfo();
|
this.mempoolInfo = await bitcoinBaseApi.$getMempoolInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMempoolInfo(): IBitcoinApi.MempoolInfo | undefined {
|
public getMempoolInfo(): IBitcoinApi.MempoolInfo {
|
||||||
return this.mempoolInfo;
|
return this.mempoolInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +135,6 @@ class Mempool {
|
|||||||
|
|
||||||
// Prevent mempool from clear on bitcoind restart by delaying the deletion
|
// Prevent mempool from clear on bitcoind restart by delaying the deletion
|
||||||
if (this.mempoolProtection === 0
|
if (this.mempoolProtection === 0
|
||||||
&& config.MEMPOOL.BACKEND === 'esplora'
|
|
||||||
&& currentMempoolSize > 20000
|
&& currentMempoolSize > 20000
|
||||||
&& transactions.length / currentMempoolSize <= 0.80
|
&& transactions.length / currentMempoolSize <= 0.80
|
||||||
) {
|
) {
|
||||||
@@ -144,10 +144,9 @@ class Mempool {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.mempoolProtection = 2;
|
this.mempoolProtection = 2;
|
||||||
logger.warn('Mempool clear protection resumed.');
|
logger.warn('Mempool clear protection resumed.');
|
||||||
}, 1000 * 60 * Mempool.CLEAR_PROTECTION_MINUTES);
|
}, 1000 * 60 * config.MEMPOOL.CLEAR_PROTECTION_MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
let newMempool = {};
|
|
||||||
const deletedTransactions: TransactionExtended[] = [];
|
const deletedTransactions: TransactionExtended[] = [];
|
||||||
|
|
||||||
if (this.mempoolProtection !== 1) {
|
if (this.mempoolProtection !== 1) {
|
||||||
@@ -156,35 +155,31 @@ class Mempool {
|
|||||||
const transactionsObject = {};
|
const transactionsObject = {};
|
||||||
transactions.forEach((txId) => transactionsObject[txId] = true);
|
transactions.forEach((txId) => transactionsObject[txId] = true);
|
||||||
|
|
||||||
// Replace mempool to separate deleted transactions
|
// Flag transactions for lazy deletion
|
||||||
for (const tx in this.mempoolCache) {
|
for (const tx in this.mempoolCache) {
|
||||||
if (transactionsObject[tx]) {
|
if (!transactionsObject[tx] && !this.mempoolCache[tx].deleteAfter) {
|
||||||
newMempool[tx] = this.mempoolCache[tx];
|
|
||||||
} else {
|
|
||||||
deletedTransactions.push(this.mempoolCache[tx]);
|
deletedTransactions.push(this.mempoolCache[tx]);
|
||||||
|
this.mempoolCache[tx].deleteAfter = new Date().getTime() + Mempool.LAZY_DELETE_AFTER_SECONDS * 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
newMempool = this.mempoolCache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const newTransactionsStripped = newTransactions.map((tx) => Common.stripTransaction(tx));
|
const newTransactionsStripped = newTransactions.map((tx) => Common.stripTransaction(tx));
|
||||||
this.latestTransactions = newTransactionsStripped.concat(this.latestTransactions).slice(0, 6);
|
this.latestTransactions = newTransactionsStripped.concat(this.latestTransactions).slice(0, 6);
|
||||||
|
|
||||||
if (!this.inSync && transactions.length === Object.keys(newMempool).length) {
|
if (!this.inSync && transactions.length === Object.keys(this.mempoolCache).length) {
|
||||||
this.inSync = true;
|
this.inSync = true;
|
||||||
logger.info('The mempool is now in sync!');
|
logger.notice('The mempool is now in sync!');
|
||||||
loadingIndicators.setProgress('mempool', 100);
|
loadingIndicators.setProgress('mempool', 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mempoolChangedCallback && (hasChange || deletedTransactions.length)) {
|
if (this.mempoolChangedCallback && (hasChange || deletedTransactions.length)) {
|
||||||
this.mempoolCache = newMempool;
|
|
||||||
this.mempoolChangedCallback(this.mempoolCache, newTransactions, deletedTransactions);
|
this.mempoolChangedCallback(this.mempoolCache, newTransactions, deletedTransactions);
|
||||||
}
|
}
|
||||||
|
|
||||||
const end = new Date().getTime();
|
const end = new Date().getTime();
|
||||||
const time = end - start;
|
const time = end - start;
|
||||||
logger.debug(`New mempool size: ${Object.keys(newMempool).length} Change: ${diff}`);
|
logger.debug(`New mempool size: ${Object.keys(this.mempoolCache).length} Change: ${diff}`);
|
||||||
logger.debug('Mempool updated in ' + time / 1000 + ' seconds');
|
logger.debug('Mempool updated in ' + time / 1000 + ' seconds');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,6 +195,16 @@ class Mempool {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Mempool();
|
export default new Mempool();
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ class Statistics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Remove 0 and undefined
|
// Remove 0 and undefined
|
||||||
memPoolArray = memPoolArray.filter((tx) => tx.feePerVsize);
|
memPoolArray = memPoolArray.filter((tx) => tx.effectiveFeePerVsize);
|
||||||
|
|
||||||
if (!memPoolArray.length) {
|
if (!memPoolArray.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memPoolArray.sort((a, b) => a.feePerVsize - b.feePerVsize);
|
memPoolArray.sort((a, b) => a.effectiveFeePerVsize - b.effectiveFeePerVsize);
|
||||||
const totalWeight = memPoolArray.map((tx) => tx.vsize).reduce((acc, curr) => acc + curr) * 4;
|
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 totalFee = memPoolArray.map((tx) => tx.fee).reduce((acc, curr) => acc + curr);
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ class Statistics {
|
|||||||
|
|
||||||
memPoolArray.forEach((transaction) => {
|
memPoolArray.forEach((transaction) => {
|
||||||
for (let i = 0; i < logFees.length; i++) {
|
for (let i = 0; i < logFees.length; i++) {
|
||||||
if ((logFees[i] === 2000 && transaction.feePerVsize >= 2000) || transaction.feePerVsize <= logFees[i]) {
|
if ((logFees[i] === 2000 && transaction.effectiveFeePerVsize >= 2000) || transaction.effectiveFeePerVsize <= logFees[i]) {
|
||||||
if (weightVsizeFees[logFees[i]]) {
|
if (weightVsizeFees[logFees[i]]) {
|
||||||
weightVsizeFees[logFees[i]] += transaction.vsize;
|
weightVsizeFees[logFees[i]] += transaction.vsize;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -26,9 +26,16 @@ class TransactionUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private extendTransaction(transaction: IEsploraApi.Transaction): TransactionExtended {
|
private extendTransaction(transaction: IEsploraApi.Transaction): TransactionExtended {
|
||||||
|
// @ts-ignore
|
||||||
|
if (transaction.vsize) {
|
||||||
|
// @ts-ignore
|
||||||
|
return transaction;
|
||||||
|
}
|
||||||
|
const feePerVbytes = Math.max(1, (transaction.fee || 0) / (transaction.weight / 4));
|
||||||
const transactionExtended: TransactionExtended = Object.assign({
|
const transactionExtended: TransactionExtended = Object.assign({
|
||||||
vsize: Math.round(transaction.weight / 4),
|
vsize: Math.round(transaction.weight / 4),
|
||||||
feePerVsize: Math.max(1, (transaction.fee || 0) / (transaction.weight / 4)),
|
feePerVsize: feePerVbytes,
|
||||||
|
effectiveFeePerVsize: feePerVbytes,
|
||||||
}, transaction);
|
}, transaction);
|
||||||
if (!transaction.status.confirmed) {
|
if (!transaction.status.confirmed) {
|
||||||
transactionExtended.firstSeen = Math.round((new Date().getTime() / 1000));
|
transactionExtended.firstSeen = Math.round((new Date().getTime() / 1000));
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class WebsocketHandler {
|
|||||||
|
|
||||||
this.wss.on('connection', (client: WebSocket) => {
|
this.wss.on('connection', (client: WebSocket) => {
|
||||||
client.on('error', logger.info);
|
client.on('error', logger.info);
|
||||||
client.on('message', (message: string) => {
|
client.on('message', async (message: string) => {
|
||||||
try {
|
try {
|
||||||
const parsedMessage: WebsocketResponse = JSON.parse(message);
|
const parsedMessage: WebsocketResponse = JSON.parse(message);
|
||||||
const response = {};
|
const response = {};
|
||||||
@@ -53,7 +53,16 @@ class WebsocketHandler {
|
|||||||
if (parsedMessage['watch-mempool']) {
|
if (parsedMessage['watch-mempool']) {
|
||||||
const tx = memPool.getMempool()[client['track-tx']];
|
const tx = memPool.getMempool()[client['track-tx']];
|
||||||
if (tx) {
|
if (tx) {
|
||||||
response['tx'] = 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.message || e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response['tx'] = tx;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
client['track-mempool-tx'] = parsedMessage['track-tx'];
|
client['track-mempool-tx'] = parsedMessage['track-tx'];
|
||||||
}
|
}
|
||||||
@@ -96,6 +105,14 @@ class WebsocketHandler {
|
|||||||
client['track-donation'] = parsedMessage['track-donation'];
|
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) {
|
if (Object.keys(response).length) {
|
||||||
client.send(JSON.stringify(response));
|
client.send(JSON.stringify(response));
|
||||||
}
|
}
|
||||||
@@ -159,8 +176,7 @@ class WebsocketHandler {
|
|||||||
'conversions': fiatConversion.getConversionRates(),
|
'conversions': fiatConversion.getConversionRates(),
|
||||||
'mempool-blocks': mempoolBlocks.getMempoolBlocks(),
|
'mempool-blocks': mempoolBlocks.getMempoolBlocks(),
|
||||||
'transactions': memPool.getLatestTransactions(),
|
'transactions': memPool.getLatestTransactions(),
|
||||||
'git-commit': backendInfo.gitCommitHash,
|
'backendInfo': backendInfo.getBackendInfo(),
|
||||||
'hostname': backendInfo.hostname,
|
|
||||||
'loadingIndicators': loadingIndicators.getLoadingIndicators(),
|
'loadingIndicators': loadingIndicators.getLoadingIndicators(),
|
||||||
...this.extraInitProperties
|
...this.extraInitProperties
|
||||||
};
|
};
|
||||||
@@ -194,10 +210,15 @@ class WebsocketHandler {
|
|||||||
|
|
||||||
mempoolBlocks.updateMempoolBlocks(newMempool);
|
mempoolBlocks.updateMempoolBlocks(newMempool);
|
||||||
const mBlocks = mempoolBlocks.getMempoolBlocks();
|
const mBlocks = mempoolBlocks.getMempoolBlocks();
|
||||||
|
const mempool = memPool.getMempool();
|
||||||
const mempoolInfo = memPool.getMempoolInfo();
|
const mempoolInfo = memPool.getMempoolInfo();
|
||||||
const vBytesPerSecond = memPool.getVBytesPerSecond();
|
const vBytesPerSecond = memPool.getVBytesPerSecond();
|
||||||
const rbfTransactions = Common.findRbfTransactions(newTransactions, deletedTransactions);
|
const rbfTransactions = Common.findRbfTransactions(newTransactions, deletedTransactions);
|
||||||
|
|
||||||
|
for (const rbfTransaction in rbfTransactions) {
|
||||||
|
delete mempool[rbfTransaction];
|
||||||
|
}
|
||||||
|
|
||||||
this.wss.clients.forEach(async (client: WebSocket) => {
|
this.wss.clients.forEach(async (client: WebSocket) => {
|
||||||
if (client.readyState !== WebSocket.OPEN) {
|
if (client.readyState !== WebSocket.OPEN) {
|
||||||
return;
|
return;
|
||||||
@@ -329,28 +350,23 @@ class WebsocketHandler {
|
|||||||
throw new Error('WebSocket.Server is not set');
|
throw new Error('WebSocket.Server is not set');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check how many transactions in the new block matches the latest projected mempool block
|
|
||||||
// If it's more than 0, recalculate the mempool blocks and send to client in the same update
|
|
||||||
let mBlocks: undefined | MempoolBlock[];
|
let mBlocks: undefined | MempoolBlock[];
|
||||||
let matchRate = 0;
|
let matchRate = 0;
|
||||||
|
const _memPool = memPool.getMempool();
|
||||||
const _mempoolBlocks = mempoolBlocks.getMempoolBlocksWithTransactions();
|
const _mempoolBlocks = mempoolBlocks.getMempoolBlocksWithTransactions();
|
||||||
|
|
||||||
if (_mempoolBlocks[0]) {
|
if (_mempoolBlocks[0]) {
|
||||||
const matches: string[] = [];
|
const matches: string[] = [];
|
||||||
for (const txId of txIds) {
|
for (const txId of txIds) {
|
||||||
if (_mempoolBlocks[0].transactionIds.indexOf(txId) > -1) {
|
if (_mempoolBlocks[0].transactionIds.indexOf(txId) > -1) {
|
||||||
matches.push(txId);
|
matches.push(txId);
|
||||||
}
|
}
|
||||||
|
delete _memPool[txId];
|
||||||
}
|
}
|
||||||
|
|
||||||
matchRate = Math.round((matches.length / (txIds.length - 1)) * 100);
|
matchRate = Math.round((matches.length / (txIds.length - 1)) * 100);
|
||||||
if (matchRate > 0) {
|
mempoolBlocks.updateMempoolBlocks(_memPool);
|
||||||
const currentMemPool = memPool.getMempool();
|
mBlocks = mempoolBlocks.getMempoolBlocks();
|
||||||
for (const txId of matches) {
|
|
||||||
delete currentMemPool[txId];
|
|
||||||
}
|
|
||||||
mempoolBlocks.updateMempoolBlocks(currentMemPool);
|
|
||||||
mBlocks = mempoolBlocks.getMempoolBlocks();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
block.matchRate = matchRate;
|
block.matchRate = matchRate;
|
||||||
|
|||||||
@@ -2,13 +2,15 @@ const configFile = require('../mempool-config.json');
|
|||||||
|
|
||||||
interface IConfig {
|
interface IConfig {
|
||||||
MEMPOOL: {
|
MEMPOOL: {
|
||||||
NETWORK: 'mainnet' | 'testnet' | 'liquid';
|
NETWORK: 'mainnet' | 'testnet' | 'signet' | 'liquid';
|
||||||
BACKEND: 'esplora' | 'electrum' | 'none';
|
BACKEND: 'esplora' | 'electrum' | 'none';
|
||||||
HTTP_PORT: number;
|
HTTP_PORT: number;
|
||||||
SPAWN_CLUSTER_PROCS: number;
|
SPAWN_CLUSTER_PROCS: number;
|
||||||
API_URL_PREFIX: string;
|
API_URL_PREFIX: string;
|
||||||
POLL_RATE_MS: number;
|
POLL_RATE_MS: number;
|
||||||
CACHE_DIR: string;
|
CACHE_DIR: string;
|
||||||
|
CLEAR_PROTECTION_MINUTES: number;
|
||||||
|
RECOMMENDED_FEE_PERCENTILE: number;
|
||||||
};
|
};
|
||||||
ESPLORA: {
|
ESPLORA: {
|
||||||
REST_API_URL: string;
|
REST_API_URL: string;
|
||||||
@@ -39,15 +41,18 @@ interface IConfig {
|
|||||||
USERNAME: string;
|
USERNAME: string;
|
||||||
PASSWORD: string;
|
PASSWORD: string;
|
||||||
};
|
};
|
||||||
|
SYSLOG: {
|
||||||
|
ENABLED: boolean;
|
||||||
|
HOST: string;
|
||||||
|
PORT: number;
|
||||||
|
MIN_PRIORITY: 'emerg' | 'alert' | 'crit' | 'err' |'warn' | 'notice' | 'info' | 'debug';
|
||||||
|
FACILITY: string;
|
||||||
|
};
|
||||||
STATISTICS: {
|
STATISTICS: {
|
||||||
ENABLED: boolean;
|
ENABLED: boolean;
|
||||||
TX_PER_SECOND_SAMPLE_PERIOD: number;
|
TX_PER_SECOND_SAMPLE_PERIOD: number;
|
||||||
};
|
};
|
||||||
BISQ_BLOCKS: {
|
BISQ: {
|
||||||
ENABLED: boolean;
|
|
||||||
DATA_PATH: string;
|
|
||||||
};
|
|
||||||
BISQ_MARKETS: {
|
|
||||||
ENABLED: boolean;
|
ENABLED: boolean;
|
||||||
DATA_PATH: string;
|
DATA_PATH: string;
|
||||||
};
|
};
|
||||||
@@ -61,7 +66,9 @@ const defaults: IConfig = {
|
|||||||
'SPAWN_CLUSTER_PROCS': 0,
|
'SPAWN_CLUSTER_PROCS': 0,
|
||||||
'API_URL_PREFIX': '/api/v1/',
|
'API_URL_PREFIX': '/api/v1/',
|
||||||
'POLL_RATE_MS': 2000,
|
'POLL_RATE_MS': 2000,
|
||||||
'CACHE_DIR': './'
|
'CACHE_DIR': './cache',
|
||||||
|
'CLEAR_PROTECTION_MINUTES': 20,
|
||||||
|
'RECOMMENDED_FEE_PERCENTILE': 50,
|
||||||
},
|
},
|
||||||
'ESPLORA': {
|
'ESPLORA': {
|
||||||
'REST_API_URL': 'http://127.0.0.1:3000',
|
'REST_API_URL': 'http://127.0.0.1:3000',
|
||||||
@@ -92,15 +99,18 @@ const defaults: IConfig = {
|
|||||||
'USERNAME': 'mempool',
|
'USERNAME': 'mempool',
|
||||||
'PASSWORD': 'mempool'
|
'PASSWORD': 'mempool'
|
||||||
},
|
},
|
||||||
|
'SYSLOG': {
|
||||||
|
'ENABLED': true,
|
||||||
|
'HOST': '127.0.0.1',
|
||||||
|
'PORT': 514,
|
||||||
|
'MIN_PRIORITY': 'info',
|
||||||
|
'FACILITY': 'local7'
|
||||||
|
},
|
||||||
'STATISTICS': {
|
'STATISTICS': {
|
||||||
'ENABLED': true,
|
'ENABLED': true,
|
||||||
'TX_PER_SECOND_SAMPLE_PERIOD': 150
|
'TX_PER_SECOND_SAMPLE_PERIOD': 150
|
||||||
},
|
},
|
||||||
'BISQ_BLOCKS': {
|
'BISQ': {
|
||||||
'ENABLED': false,
|
|
||||||
'DATA_PATH': '/bisq/statsnode-data/btc_mainnet/db/json'
|
|
||||||
},
|
|
||||||
'BISQ_MARKETS': {
|
|
||||||
'ENABLED': false,
|
'ENABLED': false,
|
||||||
'DATA_PATH': '/bisq/statsnode-data/btc_mainnet/db'
|
'DATA_PATH': '/bisq/statsnode-data/btc_mainnet/db'
|
||||||
},
|
},
|
||||||
@@ -113,9 +123,9 @@ class Config implements IConfig {
|
|||||||
CORE_RPC: IConfig['CORE_RPC'];
|
CORE_RPC: IConfig['CORE_RPC'];
|
||||||
CORE_RPC_MINFEE: IConfig['CORE_RPC_MINFEE'];
|
CORE_RPC_MINFEE: IConfig['CORE_RPC_MINFEE'];
|
||||||
DATABASE: IConfig['DATABASE'];
|
DATABASE: IConfig['DATABASE'];
|
||||||
|
SYSLOG: IConfig['SYSLOG'];
|
||||||
STATISTICS: IConfig['STATISTICS'];
|
STATISTICS: IConfig['STATISTICS'];
|
||||||
BISQ_BLOCKS: IConfig['BISQ_BLOCKS'];
|
BISQ: IConfig['BISQ'];
|
||||||
BISQ_MARKETS: IConfig['BISQ_MARKETS'];
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const configs = this.merge(configFile, defaults);
|
const configs = this.merge(configFile, defaults);
|
||||||
@@ -125,9 +135,9 @@ class Config implements IConfig {
|
|||||||
this.CORE_RPC = configs.CORE_RPC;
|
this.CORE_RPC = configs.CORE_RPC;
|
||||||
this.CORE_RPC_MINFEE = configs.CORE_RPC_MINFEE;
|
this.CORE_RPC_MINFEE = configs.CORE_RPC_MINFEE;
|
||||||
this.DATABASE = configs.DATABASE;
|
this.DATABASE = configs.DATABASE;
|
||||||
|
this.SYSLOG = configs.SYSLOG;
|
||||||
this.STATISTICS = configs.STATISTICS;
|
this.STATISTICS = configs.STATISTICS;
|
||||||
this.BISQ_BLOCKS = configs.BISQ_BLOCKS;
|
this.BISQ = configs.BISQ;
|
||||||
this.BISQ_MARKETS = configs.BISQ_MARKETS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
merge = (...objects: object[]): IConfig => {
|
merge = (...objects: object[]): IConfig => {
|
||||||
|
|||||||
@@ -73,29 +73,27 @@ class Server {
|
|||||||
this.server = http.createServer(this.app);
|
this.server = http.createServer(this.app);
|
||||||
this.wss = new WebSocket.Server({ server: this.server });
|
this.wss = new WebSocket.Server({ server: this.server });
|
||||||
|
|
||||||
|
this.setUpWebsocketHandling();
|
||||||
|
|
||||||
diskCache.loadMempoolCache();
|
diskCache.loadMempoolCache();
|
||||||
|
|
||||||
if (config.DATABASE.ENABLED) {
|
if (config.DATABASE.ENABLED) {
|
||||||
await checkDbConnection();
|
await checkDbConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {
|
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED && cluster.isMaster) {
|
||||||
statistics.startStatistics();
|
statistics.startStatistics();
|
||||||
}
|
}
|
||||||
|
|
||||||
fiatConversion.startService();
|
fiatConversion.startService();
|
||||||
|
|
||||||
this.setUpHttpApiRoutes();
|
this.setUpHttpApiRoutes();
|
||||||
this.setUpWebsocketHandling();
|
|
||||||
this.runMainUpdateLoop();
|
this.runMainUpdateLoop();
|
||||||
|
|
||||||
if (config.BISQ_BLOCKS.ENABLED) {
|
if (config.BISQ.ENABLED) {
|
||||||
bisq.startBisqService();
|
bisq.startBisqService();
|
||||||
bisq.setPriceCallbackFunction((price) => websocketHandler.setExtraInitProperties('bsq-price', price));
|
bisq.setPriceCallbackFunction((price) => websocketHandler.setExtraInitProperties('bsq-price', price));
|
||||||
blocks.setNewBlockCallback(bisq.handleNewBitcoinBlock.bind(bisq));
|
blocks.setNewBlockCallback(bisq.handleNewBitcoinBlock.bind(bisq));
|
||||||
}
|
|
||||||
|
|
||||||
if (config.BISQ_MARKETS.ENABLED) {
|
|
||||||
bisqMarkets.startBisqService();
|
bisqMarkets.startBisqService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +108,16 @@ class Server {
|
|||||||
|
|
||||||
async runMainUpdateLoop() {
|
async runMainUpdateLoop() {
|
||||||
try {
|
try {
|
||||||
await memPool.$updateMemPoolInfo();
|
try {
|
||||||
|
await memPool.$updateMemPoolInfo();
|
||||||
|
} catch (e) {
|
||||||
|
const msg = `updateMempoolInfo: ${(e.message || e)}`;
|
||||||
|
if (config.CORE_RPC_MINFEE.ENABLED) {
|
||||||
|
logger.warn(msg);
|
||||||
|
} else {
|
||||||
|
logger.debug(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
await blocks.$updateBlocks();
|
await blocks.$updateBlocks();
|
||||||
await memPool.$updateMempool();
|
await memPool.$updateMempool();
|
||||||
setTimeout(this.runMainUpdateLoop.bind(this), config.MEMPOOL.POLL_RATE_MS);
|
setTimeout(this.runMainUpdateLoop.bind(this), config.MEMPOOL.POLL_RATE_MS);
|
||||||
@@ -145,6 +152,7 @@ class Server {
|
|||||||
setUpHttpApiRoutes() {
|
setUpHttpApiRoutes() {
|
||||||
this.app
|
this.app
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'transaction-times', routes.getTransactionTimes)
|
.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 + 'fees/recommended', routes.getRecommendedFees)
|
.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 + 'fees/mempool-blocks', routes.getMempoolBlocks)
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'backend-info', routes.getBackendInfo)
|
.get(config.MEMPOOL.API_URL_PREFIX + 'backend-info', routes.getBackendInfo)
|
||||||
@@ -167,6 +175,24 @@ class Server {
|
|||||||
res.status(500).end();
|
res.status(500).end();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.get(config.MEMPOOL.API_URL_PREFIX + 'contributors', async (req, res) => {
|
||||||
|
try {
|
||||||
|
const response = await axios.get('https://mempool.space/api/v1/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('https://mempool.space/api/v1/contributors/images/' + req.params.id, {
|
||||||
|
responseType: 'stream', timeout: 10000
|
||||||
|
});
|
||||||
|
response.data.pipe(res);
|
||||||
|
} catch (e) {
|
||||||
|
res.status(500).end();
|
||||||
|
}
|
||||||
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {
|
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {
|
||||||
@@ -181,7 +207,7 @@ class Server {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.BISQ_BLOCKS.ENABLED) {
|
if (config.BISQ.ENABLED) {
|
||||||
this.app
|
this.app
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/stats', routes.getBisqStats)
|
.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/tx/:txId', routes.getBisqTransaction)
|
||||||
@@ -190,11 +216,6 @@ class Server {
|
|||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/blocks/:index/:length', routes.getBisqBlocks)
|
.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/address/:address', routes.getBisqAddress)
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/txs/:index/:length', routes.getBisqTransactions)
|
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/txs/:index/:length', routes.getBisqTransactions)
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.BISQ_MARKETS.ENABLED) {
|
|
||||||
this.app
|
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/currencies', routes.getBisqMarketCurrencies.bind(routes))
|
.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/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/hloc', routes.getBisqMarketHloc.bind(routes))
|
||||||
@@ -203,6 +224,7 @@ class Server {
|
|||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/ticker', routes.getBisqMarketTicker.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/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', routes.getBisqMarketVolumes.bind(routes))
|
||||||
|
.get(config.MEMPOOL.API_URL_PREFIX + 'bisq/markets/volumes/7d', routes.getBisqMarketVolumes7d.bind(routes))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,17 +50,11 @@ class Logger {
|
|||||||
public debug: ((msg: string) => void);
|
public debug: ((msg: string) => void);
|
||||||
|
|
||||||
private name = 'mempool';
|
private name = 'mempool';
|
||||||
private fac: any;
|
|
||||||
private loghost: string;
|
|
||||||
private logport: number;
|
|
||||||
private client: dgram.Socket;
|
private client: dgram.Socket;
|
||||||
private network: string;
|
private network: string;
|
||||||
|
|
||||||
constructor(fac) {
|
constructor() {
|
||||||
let prio;
|
let prio;
|
||||||
this.fac = fac != null ? fac : Logger.facilities.local0;
|
|
||||||
this.loghost = '127.0.0.1';
|
|
||||||
this.logport = 514;
|
|
||||||
for (prio in Logger.priorities) {
|
for (prio in Logger.priorities) {
|
||||||
if (true) {
|
if (true) {
|
||||||
this.addprio(prio);
|
this.addprio(prio);
|
||||||
@@ -79,7 +73,7 @@ class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getNetwork(): string {
|
private getNetwork(): string {
|
||||||
if (config.BISQ_BLOCKS.ENABLED) {
|
if (config.BISQ.ENABLED) {
|
||||||
return 'bisq';
|
return 'bisq';
|
||||||
}
|
}
|
||||||
if (config.MEMPOOL.NETWORK && config.MEMPOOL.NETWORK !== 'mainnet') {
|
if (config.MEMPOOL.NETWORK && config.MEMPOOL.NETWORK !== 'mainnet') {
|
||||||
@@ -97,10 +91,12 @@ class Logger {
|
|||||||
}
|
}
|
||||||
const network = this.network ? ' <' + this.network + '>' : '';
|
const network = this.network ? ' <' + this.network + '>' : '';
|
||||||
prionum = Logger.priorities[priority] || Logger.priorities.info;
|
prionum = Logger.priorities[priority] || Logger.priorities.info;
|
||||||
syslogmsg = `<${(this.fac * 8 + prionum)}> ${this.name}[${process.pid}]: ${priority.toUpperCase()}${network} ${msg}`;
|
|
||||||
consolemsg = `${this.ts()} [${process.pid}] ${priority.toUpperCase()}:${network} ${msg}`;
|
consolemsg = `${this.ts()} [${process.pid}] ${priority.toUpperCase()}:${network} ${msg}`;
|
||||||
|
|
||||||
this.syslog(syslogmsg);
|
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 (priority === 'warning') {
|
if (priority === 'warning') {
|
||||||
priority = 'warn';
|
priority = 'warn';
|
||||||
}
|
}
|
||||||
@@ -116,7 +112,7 @@ class Logger {
|
|||||||
private syslog(msg) {
|
private syslog(msg) {
|
||||||
let msgbuf;
|
let msgbuf;
|
||||||
msgbuf = Buffer.from(msg);
|
msgbuf = Buffer.from(msg);
|
||||||
this.client.send(msgbuf, 0, msgbuf.length, this.logport, this.loghost, function(err, bytes) {
|
this.client.send(msgbuf, 0, msgbuf.length, config.SYSLOG.PORT, config.SYSLOG.HOST, function(err, bytes) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@@ -146,4 +142,4 @@ class Logger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Logger(Logger.facilities.local7);
|
export default new Logger();
|
||||||
|
|||||||
@@ -26,6 +26,28 @@ export interface TransactionExtended extends IEsploraApi.Transaction {
|
|||||||
vsize: number;
|
vsize: number;
|
||||||
feePerVsize: number;
|
feePerVsize: number;
|
||||||
firstSeen?: 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 {
|
export interface TransactionStripped {
|
||||||
@@ -122,6 +144,7 @@ export interface WebsocketResponse {
|
|||||||
'track-tx': string;
|
'track-tx': string;
|
||||||
'track-address': string;
|
'track-address': string;
|
||||||
'watch-mempool': boolean;
|
'watch-mempool': boolean;
|
||||||
|
'track-bisq-market': string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VbytesPerSecond {
|
export interface VbytesPerSecond {
|
||||||
@@ -138,3 +161,9 @@ interface RequiredParams {
|
|||||||
|
|
||||||
export interface ILoadingIndicators { [name: string]: number; }
|
export interface ILoadingIndicators { [name: string]: number; }
|
||||||
export interface IConversionRates { [currency: string]: number; }
|
export interface IConversionRates { [currency: string]: number; }
|
||||||
|
|
||||||
|
export interface IBackendInfo {
|
||||||
|
hostname: string;
|
||||||
|
gitCommit: string;
|
||||||
|
version: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -94,6 +94,31 @@ class Routes {
|
|||||||
res.json(times);
|
res.json(times);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getCpfpInfo(req: Request, res: Response) {
|
||||||
|
if (!/^[a-fA-F0-9]{64}$/.test(req.params.txId)) {
|
||||||
|
res.status(501).send(`Invalid transaction ID.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tx = mempool.getMempool()[req.params.txId];
|
||||||
|
if (!tx) {
|
||||||
|
res.status(404).send(`Transaction doesn't exist in the mempool.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tx.cpfpChecked) {
|
||||||
|
res.json({
|
||||||
|
ancestors: tx.ancestors,
|
||||||
|
bestDescendant: tx.bestDescendant || null,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cpfpInfo = Common.setRelativesAndGetCpfpInfo(tx, mempool.getMempool());
|
||||||
|
|
||||||
|
res.json(cpfpInfo);
|
||||||
|
}
|
||||||
|
|
||||||
public getBackendInfo(req: Request, res: Response) {
|
public getBackendInfo(req: Request, res: Response) {
|
||||||
res.json(backendInfo.getBackendInfo());
|
res.json(backendInfo.getBackendInfo());
|
||||||
}
|
}
|
||||||
@@ -401,6 +426,15 @@ class Routes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getBisqMarketVolumes7d(req: Request, res: Response) {
|
||||||
|
const result = bisqMarket.getVolumesByTime(604800);
|
||||||
|
if (result) {
|
||||||
|
res.json(result);
|
||||||
|
} else {
|
||||||
|
res.status(500).json(this.getBisqMarketErrorResponse('getBisqMarketVolumes7d error'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private parseRequestParameters(requestParams: object, params: RequiredSpec): { [name: string]: any; } {
|
private parseRequestParameters(requestParams: object, params: RequiredSpec): { [name: string]: any; } {
|
||||||
const final = {};
|
const final = {};
|
||||||
for (const i in params) {
|
for (const i in params) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ In an empty dir create 2 sub-dirs
|
|||||||
mkdir -p data mysql/data mysql/db-scripts
|
mkdir -p data mysql/data mysql/db-scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
In the mysql/db-scripts sub-dir add the mariadb-structure.sql file from the mempool repo
|
In the `mysql/db-scripts` sub-dir add the `mariadb-structure.sql` file from the mempool repo
|
||||||
|
|
||||||
Your dir should now look like that:
|
Your dir should now look like that:
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ data db-scripts
|
|||||||
mariadb-structure.sql
|
mariadb-structure.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
In the main dir add the following docker-compose.yml
|
In the main dir add the following `docker-compose.yml`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
version: "3.7"
|
version: "3.7"
|
||||||
@@ -58,15 +58,17 @@ services:
|
|||||||
RPC_PORT: "8332"
|
RPC_PORT: "8332"
|
||||||
RPC_USER: "mempool"
|
RPC_USER: "mempool"
|
||||||
RPC_PASS: "mempool"
|
RPC_PASS: "mempool"
|
||||||
ELECTRS_HOST: "127.0.0.1"
|
ELECTRUM_HOST: "127.0.0.1"
|
||||||
ELECTRS_PORT: "50002"
|
ELECTRUM_PORT: "50002"
|
||||||
|
ELECTRUM_TLS: "false"
|
||||||
MYSQL_HOST: "db"
|
MYSQL_HOST: "db"
|
||||||
MYSQL_PORT: "3306"
|
MYSQL_PORT: "3306"
|
||||||
MYSQL_DATABASE: "mempool"
|
MYSQL_DATABASE: "mempool"
|
||||||
MYSQL_USER: "mempool"
|
MYSQL_USER: "mempool"
|
||||||
MYSQL_PASS: "mempool"
|
MYSQL_PASS: "mempool"
|
||||||
BACKEND_MAINNET_HTTP_PORT: "8999"
|
BACKEND_MAINNET_HTTP_PORT: "8999"
|
||||||
CACHE_DIR: "/backend/cache/"
|
CACHE_DIR: "/backend/cache"
|
||||||
|
MEMPOOL_CLEAR_PROTECTION_MINUTES: "20"
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.5.8
|
image: mariadb:10.5.8
|
||||||
user: "1000:1000"
|
user: "1000:1000"
|
||||||
@@ -83,7 +85,7 @@ services:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can update all the environment variables inside the API container, especially the RPC and ELECTRS ones
|
You can update all the environment variables inside the API container, especially the RPC and ELECTRUM ones
|
||||||
|
|
||||||
## Run it
|
## Run it
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
"SPAWN_CLUSTER_PROCS": 0,
|
"SPAWN_CLUSTER_PROCS": 0,
|
||||||
"API_URL_PREFIX": "/api/v1/",
|
"API_URL_PREFIX": "/api/v1/",
|
||||||
"POLL_RATE_MS": 2000,
|
"POLL_RATE_MS": 2000,
|
||||||
"CACHE_DIR": "__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__"
|
"CACHE_DIR": "__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__",
|
||||||
|
"CLEAR_PROTECTION_MINUTES": __MEMPOOL_BACKEND_CLEAR_PROTECTION_MINUTES__
|
||||||
},
|
},
|
||||||
"CORE_RPC": {
|
"CORE_RPC": {
|
||||||
"HOST": "__BITCOIN_MAINNET_RPC_HOST__",
|
"HOST": "__BITCOIN_MAINNET_RPC_HOST__",
|
||||||
@@ -15,10 +16,9 @@
|
|||||||
"PASSWORD": "__BITCOIN_MAINNET_RPC_PASS__"
|
"PASSWORD": "__BITCOIN_MAINNET_RPC_PASS__"
|
||||||
},
|
},
|
||||||
"ELECTRUM": {
|
"ELECTRUM": {
|
||||||
"HOST": "__ELECTRS_MAINNET_HTTP_HOST__",
|
"HOST": "__ELECTRUM_MAINNET_HTTP_HOST__",
|
||||||
"PORT": __ELECTRS_MAINNET_HTTP_PORT__,
|
"PORT": __ELECTRUM_MAINNET_HTTP_PORT__,
|
||||||
"TLS_ENABLED": false,
|
"TLS_ENABLED": __ELECTRUM_MAINNET_TLS_ENABLED__
|
||||||
"TX_LOOKUPS": true
|
|
||||||
},
|
},
|
||||||
"ESPLORA": {
|
"ESPLORA": {
|
||||||
"REST_API_URL": "http://127.0.0.1:3000"
|
"REST_API_URL": "http://127.0.0.1:3000"
|
||||||
|
|||||||
@@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
#MEMPOOL
|
#MEMPOOL
|
||||||
__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__=${BACKEND_MAINNET_HTTP_PORT:=8999}
|
__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__=${BACKEND_MAINNET_HTTP_PORT:=8999}
|
||||||
__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__=${CACHE_DIR:=./}
|
__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__=${CACHE_DIR:=./cache}
|
||||||
|
__MEMPOOL_BACKEND_CLEAR_PROTECTION_MINUTES__=${MEMPOOL_CLEAR_PROTECTION_MINUTES:=20}
|
||||||
# BITCOIN
|
# BITCOIN
|
||||||
__BITCOIN_MAINNET_RPC_HOST__=${RPC_HOST:=127.0.0.1}
|
__BITCOIN_MAINNET_RPC_HOST__=${RPC_HOST:=127.0.0.1}
|
||||||
__BITCOIN_MAINNET_RPC_PORT__=${RPC_PORT:=8332}
|
__BITCOIN_MAINNET_RPC_PORT__=${RPC_PORT:=8332}
|
||||||
__BITCOIN_MAINNET_RPC_USER__=${RPC_USER:=mempool}
|
__BITCOIN_MAINNET_RPC_USER__=${RPC_USER:=mempool}
|
||||||
__BITCOIN_MAINNET_RPC_PASS__=${RPC_PASS:=mempool}
|
__BITCOIN_MAINNET_RPC_PASS__=${RPC_PASS:=mempool}
|
||||||
# ELECTRUM
|
# ELECTRUM
|
||||||
__ELECTRS_MAINNET_HTTP_HOST__=${ELECTRS_HOST:=127.0.0.1}
|
__ELECTRUM_MAINNET_HTTP_HOST__=${ELECTRUM_HOST:=127.0.0.1}
|
||||||
__ELECTRS_MAINNET_HTTP_PORT__=${ELECTRS_PORT:=50002}
|
__ELECTRUM_MAINNET_HTTP_PORT__=${ELECTRUM_PORT:=50002} # 50001?
|
||||||
|
__ELECTRUM_MAINNET_TLS_ENABLED__=${ELECTRUM_TLS:=false}
|
||||||
# MYSQL
|
# MYSQL
|
||||||
__MYSQL_HOST__=${MYSQL_HOST:=127.0.0.1}
|
__MYSQL_HOST__=${MYSQL_HOST:=127.0.0.1}
|
||||||
__MYSQL_PORT__=${MYSQL_PORT:=3306}
|
__MYSQL_PORT__=${MYSQL_PORT:=3306}
|
||||||
@@ -24,8 +26,9 @@ sed -i "s/__BITCOIN_MAINNET_RPC_HOST__/${__BITCOIN_MAINNET_RPC_HOST__}/g" mempoo
|
|||||||
sed -i "s/__BITCOIN_MAINNET_RPC_PORT__/${__BITCOIN_MAINNET_RPC_PORT__}/g" mempool-config.json
|
sed -i "s/__BITCOIN_MAINNET_RPC_PORT__/${__BITCOIN_MAINNET_RPC_PORT__}/g" mempool-config.json
|
||||||
sed -i "s/__BITCOIN_MAINNET_RPC_USER__/${__BITCOIN_MAINNET_RPC_USER__}/g" mempool-config.json
|
sed -i "s/__BITCOIN_MAINNET_RPC_USER__/${__BITCOIN_MAINNET_RPC_USER__}/g" mempool-config.json
|
||||||
sed -i "s/__BITCOIN_MAINNET_RPC_PASS__/${__BITCOIN_MAINNET_RPC_PASS__}/g" mempool-config.json
|
sed -i "s/__BITCOIN_MAINNET_RPC_PASS__/${__BITCOIN_MAINNET_RPC_PASS__}/g" mempool-config.json
|
||||||
sed -i "s/__ELECTRS_MAINNET_HTTP_HOST__/${__ELECTRS_MAINNET_HTTP_HOST__}/g" mempool-config.json
|
sed -i "s/__ELECTRUM_MAINNET_HTTP_HOST__/${__ELECTRUM_MAINNET_HTTP_HOST__}/g" mempool-config.json
|
||||||
sed -i "s/__ELECTRS_MAINNET_HTTP_PORT__/${__ELECTRS_MAINNET_HTTP_PORT__}/g" mempool-config.json
|
sed -i "s/__ELECTRUM_MAINNET_HTTP_PORT__/${__ELECTRUM_MAINNET_HTTP_PORT__}/g" mempool-config.json
|
||||||
|
sed -i "s/__ELECTRUM_MAINNET_TLS_ENABLED__/${__ELECTRUM_MAINNET_TLS_ENABLED__}/g" mempool-config.json
|
||||||
sed -i "s/__MYSQL_HOST__/${__MYSQL_HOST__}/g" mempool-config.json
|
sed -i "s/__MYSQL_HOST__/${__MYSQL_HOST__}/g" mempool-config.json
|
||||||
sed -i "s/__MYSQL_PORT__/${__MYSQL_PORT__}/g" mempool-config.json
|
sed -i "s/__MYSQL_PORT__/${__MYSQL_PORT__}/g" mempool-config.json
|
||||||
sed -i "s/__MYSQL_DATABASE__/${__MYSQL_DATABASE__}/g" mempool-config.json
|
sed -i "s/__MYSQL_DATABASE__/${__MYSQL_DATABASE__}/g" mempool-config.json
|
||||||
@@ -33,5 +36,6 @@ sed -i "s/__MYSQL_USERNAME__/${__MYSQL_USERNAME__}/g" mempool-config.json
|
|||||||
sed -i "s/__MYSQL_PASSWORD__/${__MYSQL_PASSWORD__}/g" mempool-config.json
|
sed -i "s/__MYSQL_PASSWORD__/${__MYSQL_PASSWORD__}/g" mempool-config.json
|
||||||
sed -i "s!__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__!${__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__}!g" mempool-config.json
|
sed -i "s!__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__!${__MEMPOOL_BACKEND_MAINNET_CACHE_DIR__}!g" mempool-config.json
|
||||||
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__/${__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__}/g" mempool-config.json
|
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__/${__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__}/g" mempool-config.json
|
||||||
|
sed -i "s/__MEMPOOL_BACKEND_CLEAR_PROTECTION_MINUTES__/${__MEMPOOL_BACKEND_CLEAR_PROTECTION_MINUTES__}/g" mempool-config.json
|
||||||
|
|
||||||
node /backend/dist/index.js
|
node /backend/dist/index.js
|
||||||
|
|||||||
67
docker/docker-compose.yml
Normal file
67
docker/docker-compose.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
electrum:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: docker/electrum/Dockerfile
|
||||||
|
user: "1000:1000"
|
||||||
|
restart: on-failure
|
||||||
|
command: ""
|
||||||
|
ports:
|
||||||
|
- 50001:50001
|
||||||
|
- 50002:50002
|
||||||
|
- 4224:4224
|
||||||
|
- 8332:8332
|
||||||
|
environment:
|
||||||
|
ELECTRUM: "electrum"
|
||||||
|
# add electrs configs
|
||||||
|
web:
|
||||||
|
image: mempool/frontend:latest
|
||||||
|
user: "1000:1000"
|
||||||
|
restart: on-failure
|
||||||
|
stop_grace_period: 1m
|
||||||
|
command: "./wait-for db:3306 --timeout=720 -- nginx -g 'daemon off;'"
|
||||||
|
ports:
|
||||||
|
- 80:8080
|
||||||
|
environment:
|
||||||
|
FRONTEND_HTTP_PORT: "8080"
|
||||||
|
BACKEND_MAINNET_HTTP_HOST: "api"
|
||||||
|
api:
|
||||||
|
image: mempool/backend:latest
|
||||||
|
user: "1000:1000"
|
||||||
|
restart: on-failure
|
||||||
|
stop_grace_period: 1m
|
||||||
|
command: "./wait-for-it.sh db:3306 --timeout=720 --strict -- ./start.sh"
|
||||||
|
volumes:
|
||||||
|
- ./data:/backend/cache
|
||||||
|
environment:
|
||||||
|
RPC_HOST: "127.0.0.1"
|
||||||
|
RPC_PORT: "8332"
|
||||||
|
RPC_USER: "mempool"
|
||||||
|
RPC_PASS: "mempool"
|
||||||
|
ELECTRUM_HOST: "127.0.0.1"
|
||||||
|
ELECTRUM_PORT: "50002"
|
||||||
|
ELECTRUM_TLS: "false"
|
||||||
|
MYSQL_HOST: "db"
|
||||||
|
MYSQL_PORT: "3306"
|
||||||
|
MYSQL_DATABASE: "mempool"
|
||||||
|
MYSQL_USER: "mempool"
|
||||||
|
MYSQL_PASS: "mempool"
|
||||||
|
BACKEND_MAINNET_HTTP_PORT: "8999"
|
||||||
|
CACHE_DIR: "/backend/cache"
|
||||||
|
MEMPOOL_CLEAR_PROTECTION_MINUTES: "20"
|
||||||
|
db:
|
||||||
|
image: mariadb:10.5.8
|
||||||
|
user: "1000:1000"
|
||||||
|
restart: on-failure
|
||||||
|
stop_grace_period: 1m
|
||||||
|
volumes:
|
||||||
|
- ./mysql/data:/var/lib/mysql
|
||||||
|
- ./mysql/db-scripts:/docker-entrypoint-initdb.d
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: "mempool"
|
||||||
|
MYSQL_USER: "mempool"
|
||||||
|
MYSQL_PASSWORD: "mempool"
|
||||||
|
MYSQL_ROOT_PASSWORD: "admin"
|
||||||
32
docker/electrum/Dockerfile
Normal file
32
docker/electrum/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
MAINTAINER mempool.space developers
|
||||||
|
EXPOSE 50002
|
||||||
|
|
||||||
|
# runs as UID 1000 GID 1000 inside the container
|
||||||
|
|
||||||
|
ENV VERSION 4.0.9
|
||||||
|
RUN set -x \
|
||||||
|
&& apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gpg gpg-agent dirmngr \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget xpra python3-pyqt5 python3-wheel python3-pip python3-setuptools libsecp256k1-0 libsecp256k1-dev python3-numpy python3-dev build-essential \
|
||||||
|
&& wget -O /tmp/Electrum-${VERSION}.tar.gz https://download.electrum.org/${VERSION}/Electrum-${VERSION}.tar.gz \
|
||||||
|
&& wget -O /tmp/Electrum-${VERSION}.tar.gz.asc https://download.electrum.org/${VERSION}/Electrum-${VERSION}.tar.gz.asc \
|
||||||
|
&& gpg --keyserver keys.gnupg.net --recv-keys 6694D8DE7BE8EE5631BED9502BD5824B7F9470E6 \
|
||||||
|
&& gpg --verify /tmp/Electrum-${VERSION}.tar.gz.asc /tmp/Electrum-${VERSION}.tar.gz \
|
||||||
|
&& pip3 install /tmp/Electrum-${VERSION}.tar.gz \
|
||||||
|
&& test -f /usr/local/bin/electrum \
|
||||||
|
&& rm -vrf /tmp/Electrum-${VERSION}.tar.gz /tmp/Electrum-${VERSION}.tar.gz.asc ${HOME}/.gnupg \
|
||||||
|
&& apt-get purge --autoremove -y python3-wheel python3-pip python3-setuptools python3-dev build-essential libsecp256k1-dev curl gpg gpg-agent dirmngr \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& useradd -d /home/mempool -m mempool \
|
||||||
|
&& mkdir /electrum \
|
||||||
|
&& ln -s /electrum /home/mempool/.electrum \
|
||||||
|
&& chown mempool:mempool /electrum
|
||||||
|
|
||||||
|
USER mempool
|
||||||
|
ENV HOME /home/mempool
|
||||||
|
WORKDIR /home/mempool
|
||||||
|
VOLUME /electrum
|
||||||
|
|
||||||
|
CMD ["/usr/bin/xpra", "start", ":100", "--start-child=/usr/local/bin/electrum", "--bind-tcp=0.0.0.0:50002","--daemon=yes", "--notifications=no", "--mdns=no", "--pulseaudio=no", "--html=off", "--speaker=disabled", "--microphone=disabled", "--webcam=no", "--printing=no", "--dbus-launch=", "--exit-with-children"]
|
||||||
|
ENTRYPOINT ["electrum"]
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
FROM node:12-buster-slim AS builder
|
FROM node:12-buster-slim AS builder
|
||||||
|
|
||||||
|
ARG commitHash
|
||||||
|
ENV DOCKER_COMMIT_HASH=${commitHash}
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|||||||
5
frontend/.gitignore
vendored
5
frontend/.gitignore
vendored
@@ -54,3 +54,8 @@ src/resources/pools.json
|
|||||||
# environment config
|
# environment config
|
||||||
mempool-frontend-config.json
|
mempool-frontend-config.json
|
||||||
generated-config.js
|
generated-config.js
|
||||||
|
|
||||||
|
# e2e results
|
||||||
|
cypress/videos
|
||||||
|
cypress/screenshots
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,13 @@ https://www.transifex.com/mempool/mempool/dashboard/
|
|||||||
* French @Bayernatoor
|
* French @Bayernatoor
|
||||||
* Korean @kcalvinalvinn
|
* Korean @kcalvinalvinn
|
||||||
* Italian @HodlBits
|
* Italian @HodlBits
|
||||||
|
* Hebrew @Sh0ham
|
||||||
* Georgian @wyd_idk
|
* Georgian @wyd_idk
|
||||||
* Hungarian @btcdragonlord
|
* Hungarian @btcdragonlord
|
||||||
* Dutch @m__btc
|
* Dutch @m__btc
|
||||||
* Japanese @wiz @japananon
|
* Japanese @wiz @japananon
|
||||||
* Norwegian @T82771355
|
* Norwegian @T82771355
|
||||||
|
* Polish @maciejsoltysiak
|
||||||
* Portugese @jgcastro1985
|
* Portugese @jgcastro1985
|
||||||
* Slovenian @thepkbadger
|
* Slovenian @thepkbadger
|
||||||
* Finnish @bio_bitcoin
|
* Finnish @bio_bitcoin
|
||||||
@@ -29,3 +31,4 @@ https://www.transifex.com/mempool/mempool/dashboard/
|
|||||||
* Ukrainian @volbil
|
* Ukrainian @volbil
|
||||||
* Vietnamese @bitcoin_vietnam
|
* Vietnamese @bitcoin_vietnam
|
||||||
* Chinese @wdljt
|
* Chinese @wdljt
|
||||||
|
* Russian @TonyCrusoe @Bitconan
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"i18n": {
|
"i18n": {
|
||||||
"sourceLocale": {
|
"sourceLocale": {
|
||||||
"code":"en-US",
|
"code": "en-US",
|
||||||
"baseHref":"/"
|
"baseHref": "/"
|
||||||
},
|
},
|
||||||
"locales": {
|
"locales": {
|
||||||
"ar": {
|
"ar": {
|
||||||
@@ -59,6 +59,10 @@
|
|||||||
"translation": "src/locale/messages.it.xlf",
|
"translation": "src/locale/messages.it.xlf",
|
||||||
"baseHref": "/it/"
|
"baseHref": "/it/"
|
||||||
},
|
},
|
||||||
|
"he": {
|
||||||
|
"translation": "src/locale/messages.he.xlf",
|
||||||
|
"baseHref": "/he/"
|
||||||
|
},
|
||||||
"nl": {
|
"nl": {
|
||||||
"translation": "src/locale/messages.nl.xlf",
|
"translation": "src/locale/messages.nl.xlf",
|
||||||
"baseHref": "/nl/"
|
"baseHref": "/nl/"
|
||||||
@@ -67,6 +71,10 @@
|
|||||||
"translation": "src/locale/messages.nb.xlf",
|
"translation": "src/locale/messages.nb.xlf",
|
||||||
"baseHref": "/nb/"
|
"baseHref": "/nb/"
|
||||||
},
|
},
|
||||||
|
"pl": {
|
||||||
|
"translation": "src/locale/messages.pl.xlf",
|
||||||
|
"baseHref": "/pl/"
|
||||||
|
},
|
||||||
"pt": {
|
"pt": {
|
||||||
"translation": "src/locale/messages.pt.xlf",
|
"translation": "src/locale/messages.pt.xlf",
|
||||||
"baseHref": "/pt/"
|
"baseHref": "/pt/"
|
||||||
@@ -102,6 +110,10 @@
|
|||||||
"zh": {
|
"zh": {
|
||||||
"translation": "src/locale/messages.zh.xlf",
|
"translation": "src/locale/messages.zh.xlf",
|
||||||
"baseHref": "/zh/"
|
"baseHref": "/zh/"
|
||||||
|
},
|
||||||
|
"ru": {
|
||||||
|
"translation": "src/locale/messages.ru.xlf",
|
||||||
|
"baseHref": "/ru/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -139,7 +151,6 @@
|
|||||||
"optimization": true,
|
"optimization": true,
|
||||||
"outputHashing": "all",
|
"outputHashing": "all",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"extractCss": true,
|
|
||||||
"namedChunks": false,
|
"namedChunks": false,
|
||||||
"extractLicenses": true,
|
"extractLicenses": true,
|
||||||
"vendorChunk": false,
|
"vendorChunk": false,
|
||||||
@@ -166,6 +177,22 @@
|
|||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "mempool:build:production"
|
"browserTarget": "mempool:build:production"
|
||||||
|
},
|
||||||
|
"local": {
|
||||||
|
"proxyConfig": "proxy.conf.json",
|
||||||
|
"verbose": true
|
||||||
|
},
|
||||||
|
"staging": {
|
||||||
|
"proxyConfig": "proxy.stg.conf.json",
|
||||||
|
"disableHostCheck": true,
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"verbose": true
|
||||||
|
},
|
||||||
|
"local-prod": {
|
||||||
|
"proxyConfig": "proxy.prod.conf.json",
|
||||||
|
"disableHostCheck": true,
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"verbose": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -198,8 +225,8 @@
|
|||||||
"tsConfig": [
|
"tsConfig": [
|
||||||
"tsconfig.app.json",
|
"tsconfig.app.json",
|
||||||
"tsconfig.spec.json",
|
"tsconfig.spec.json",
|
||||||
"e2e/tsconfig.json",
|
"tsconfig.server.json",
|
||||||
"tsconfig.server.json"
|
"cypress/tsconfig.json"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/node_modules/**"
|
"**/node_modules/**"
|
||||||
@@ -207,10 +234,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"e2e": {
|
"e2e": {
|
||||||
"builder": "@angular-devkit/build-angular:protractor",
|
"builder": "@cypress/schematic:cypress",
|
||||||
"options": {
|
"options": {
|
||||||
"protractorConfig": "e2e/protractor.conf.js",
|
"devServerTarget": "mempool:serve:local-prod",
|
||||||
"devServerTarget": "mempool:serve"
|
"watch": true,
|
||||||
|
"headless": false
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
@@ -265,8 +293,27 @@
|
|||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {}
|
"production": {}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"cypress-run": {
|
||||||
|
"builder": "@cypress/schematic:cypress",
|
||||||
|
"options": {
|
||||||
|
"devServerTarget": "mempool:serve"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"devServerTarget": "mempool:serve:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cypress-open": {
|
||||||
|
"builder": "@cypress/schematic:cypress",
|
||||||
|
"options": {
|
||||||
|
"watch": true,
|
||||||
|
"headless": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}},
|
}
|
||||||
|
},
|
||||||
"defaultProject": "mempool"
|
"defaultProject": "mempool"
|
||||||
}
|
}
|
||||||
|
|||||||
9
frontend/cypress.json
Normal file
9
frontend/cypress.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"integrationFolder": "cypress/integration",
|
||||||
|
"supportFile": "cypress/support/index.ts",
|
||||||
|
"videosFolder": "cypress/videos",
|
||||||
|
"screenshotsFolder": "cypress/screenshots",
|
||||||
|
"pluginsFile": "cypress/plugins/index.js",
|
||||||
|
"fixturesFolder": "cypress/fixtures",
|
||||||
|
"baseUrl": "http://localhost:4200"
|
||||||
|
}
|
||||||
119
frontend/cypress/fixtures/assets.json
Normal file
119
frontend/cypress/fixtures/assets.json
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
{
|
||||||
|
"f59c5f3e8141f322276daa63ed5f307085808aea6d4ef9ba61e28154533fdec7": {
|
||||||
|
"asset_id": "f59c5f3e8141f322276daa63ed5f307085808aea6d4ef9ba61e28154533fdec7",
|
||||||
|
"contract": {
|
||||||
|
"entity": {
|
||||||
|
"domain": "listedreserve.com"
|
||||||
|
},
|
||||||
|
"issuer_pubkey": "031cc579d142a03b33cdd745922112821c16e5e8b74e3bd57f16f7fda872b6f1d0",
|
||||||
|
"name": "Liquid AUD",
|
||||||
|
"precision": 2,
|
||||||
|
"ticker": "AUDL",
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"issuance_txin": {
|
||||||
|
"txid": "e5c5144ba3dc48259ae29023fe9f7775dec1fc049f456dd3d1f7178e31901fb5",
|
||||||
|
"vin": 0
|
||||||
|
},
|
||||||
|
"issuance_prevout": {
|
||||||
|
"txid": "ed48be2e035ffa425d2c6faaa82b6a7b648aed1246b6ac76c72e0408db8cf057",
|
||||||
|
"vout": 1
|
||||||
|
},
|
||||||
|
"name": "Liquid AUD",
|
||||||
|
"ticker": "AUDL",
|
||||||
|
"precision": 2,
|
||||||
|
"entity": {
|
||||||
|
"domain": "listedreserve.com"
|
||||||
|
},
|
||||||
|
"version": 0,
|
||||||
|
"issuer_pubkey": "031cc579d142a03b33cdd745922112821c16e5e8b74e3bd57f16f7fda872b6f1d0"
|
||||||
|
},
|
||||||
|
"0e99c1a6da379d1f4151fb9df90449d40d0608f6cb33a5bcbfc8c265f42bab0a": {
|
||||||
|
"asset_id": "0e99c1a6da379d1f4151fb9df90449d40d0608f6cb33a5bcbfc8c265f42bab0a",
|
||||||
|
"contract": {
|
||||||
|
"entity": {
|
||||||
|
"domain": "lcad.bullbitcoin.com"
|
||||||
|
},
|
||||||
|
"issuer_pubkey": "027fa34026195b05f3aa217335416811dca4f5b579d00271a1bb6304c0152458a8",
|
||||||
|
"name": "Liquid CAD",
|
||||||
|
"precision": 8,
|
||||||
|
"ticker": "LCAD",
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"issuance_txin": {
|
||||||
|
"txid": "238badf029cadcf546d90ce23c7eafc2fa2082585c9bd62dc26f1aa11c7bd850",
|
||||||
|
"vin": 0
|
||||||
|
},
|
||||||
|
"issuance_prevout": {
|
||||||
|
"txid": "a87f13917c08c7ccd8eddb1830c5c9a2bcd59c7d167e9d528659ba40808a6b76",
|
||||||
|
"vout": 0
|
||||||
|
},
|
||||||
|
"name": "Liquid CAD",
|
||||||
|
"ticker": "LCAD",
|
||||||
|
"precision": 8,
|
||||||
|
"entity": {
|
||||||
|
"domain": "lcad.bullbitcoin.com"
|
||||||
|
},
|
||||||
|
"version": 0,
|
||||||
|
"issuer_pubkey": "027fa34026195b05f3aa217335416811dca4f5b579d00271a1bb6304c0152458a8"
|
||||||
|
},
|
||||||
|
"3438ecb49fc45c08e687de4749ed628c511e326460ea4336794e1cf02741329e": {
|
||||||
|
"asset_id": "3438ecb49fc45c08e687de4749ed628c511e326460ea4336794e1cf02741329e",
|
||||||
|
"contract": {
|
||||||
|
"entity": {
|
||||||
|
"domain": "settlenet.io"
|
||||||
|
},
|
||||||
|
"issuer_pubkey": "037b09d542bf7cea6a19fa624b4441790c1a6e44823597bf190e981a846a196541",
|
||||||
|
"name": "SETTLENET JPY Stablecoin by Crypto Garage",
|
||||||
|
"precision": 0,
|
||||||
|
"ticker": "JPYS",
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"issuance_txin": {
|
||||||
|
"txid": "e33ad5ce8879297d8bfa7daa193920b94abd3fb12f4e8dade9543dbb292387cb",
|
||||||
|
"vin": 0
|
||||||
|
},
|
||||||
|
"issuance_prevout": {
|
||||||
|
"txid": "328c4fadd817ea75e634e3648eb4be0bf7e669539b8da921c0f77af3bc148894",
|
||||||
|
"vout": 1
|
||||||
|
},
|
||||||
|
"name": "SETTLENET JPY Stablecoin by Crypto Garage",
|
||||||
|
"ticker": "JPYS",
|
||||||
|
"precision": 0,
|
||||||
|
"entity": {
|
||||||
|
"domain": "settlenet.io"
|
||||||
|
},
|
||||||
|
"version": 0,
|
||||||
|
"issuer_pubkey": "037b09d542bf7cea6a19fa624b4441790c1a6e44823597bf190e981a846a196541"
|
||||||
|
},
|
||||||
|
"ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2": {
|
||||||
|
"asset_id": "ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2",
|
||||||
|
"contract": {
|
||||||
|
"entity": {
|
||||||
|
"domain": "tether.to"
|
||||||
|
},
|
||||||
|
"issuer_pubkey": "0337cceec0beea0232ebe14cba0197a9fbd45fcf2ec946749de920e71434c2b904",
|
||||||
|
"name": "Tether USD",
|
||||||
|
"precision": 8,
|
||||||
|
"ticker": "USDt",
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"issuance_txin": {
|
||||||
|
"txid": "abb4080d91849e933ee2ed65da6b436f7c385cf363fb4aa08399f1e27c58ff3d",
|
||||||
|
"vin": 0
|
||||||
|
},
|
||||||
|
"issuance_prevout": {
|
||||||
|
"txid": "9596d259270ef5bac0020435e6d859aea633409483ba64e232b8ba04ce288668",
|
||||||
|
"vout": 0
|
||||||
|
},
|
||||||
|
"name": "Tether USD",
|
||||||
|
"ticker": "USDt",
|
||||||
|
"precision": 8,
|
||||||
|
"entity": {
|
||||||
|
"domain": "tether.to"
|
||||||
|
},
|
||||||
|
"version": 0,
|
||||||
|
"issuer_pubkey": "0337cceec0beea0232ebe14cba0197a9fbd45fcf2ec946749de920e71434c2b904"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
33
frontend/cypress/fixtures/assets.minimal.json
Normal file
33
frontend/cypress/fixtures/assets.minimal.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"f59c5f3e8141f322276daa63ed5f307085808aea6d4ef9ba61e28154533fdec7": [
|
||||||
|
"listedreserve.com",
|
||||||
|
"AUDL",
|
||||||
|
"Liquid AUD",
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"0e99c1a6da379d1f4151fb9df90449d40d0608f6cb33a5bcbfc8c265f42bab0a": [
|
||||||
|
"lcad.bullbitcoin.com",
|
||||||
|
"LCAD",
|
||||||
|
"Liquid CAD",
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d": [
|
||||||
|
null,
|
||||||
|
"L-BTC",
|
||||||
|
"Liquid Bitcoin",
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2": [
|
||||||
|
"tether.to",
|
||||||
|
"USDt",
|
||||||
|
"Tether USD",
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"3438ecb49fc45c08e687de4749ed628c511e326460ea4336794e1cf02741329e": [
|
||||||
|
"settlenet.io",
|
||||||
|
"JPYS",
|
||||||
|
"SETTLENET JPY Stablecoin by Crypto Garage",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
1178
frontend/cypress/fixtures/pools.json
Normal file
1178
frontend/cypress/fixtures/pools.json
Normal file
File diff suppressed because it is too large
Load Diff
51
frontend/cypress/integration/bisq/bisq.spec.ts
Normal file
51
frontend/cypress/integration/bisq/bisq.spec.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
describe('Bisq', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
|
||||||
|
cy.intercept('/sockjs-node/info*').as('socket');
|
||||||
|
cy.intercept('/bisq/api/markets/hloc?market=btc_usd&interval=day').as('hloc');
|
||||||
|
cy.intercept('/bisq/api/markets/ticker').as('ticker');
|
||||||
|
cy.intercept('/bisq/api/markets/markets').as('markets');
|
||||||
|
cy.intercept('/bisq/api/markets/volumes/7d').as('7d');
|
||||||
|
cy.intercept('/bisq/api/markets/trades?market=all').as('trades');
|
||||||
|
cy.intercept('/bisq/api/txs/*/*').as('txs');
|
||||||
|
cy.intercept('/bisq/api/blocks/*/*').as('blocks');
|
||||||
|
cy.intercept('/bisq/api/stats').as('stats');
|
||||||
|
});
|
||||||
|
it('loads the dashboard', () => {
|
||||||
|
cy.visit('/bisq');
|
||||||
|
|
||||||
|
cy.wait('@socket');
|
||||||
|
cy.wait('@hloc');
|
||||||
|
cy.wait('@ticker');
|
||||||
|
cy.wait('@markets');
|
||||||
|
cy.wait('@7d');
|
||||||
|
cy.wait('@trades');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the transactions screen', () => {
|
||||||
|
cy.visit('/bisq');
|
||||||
|
cy.get('li:nth-of-type(2) > a').click().then(() => {
|
||||||
|
cy.wait('@txs');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('loads the blocks screen', () => {
|
||||||
|
cy.visit('/bisq');
|
||||||
|
cy.get('li:nth-of-type(3) > a').click().then(() => {
|
||||||
|
cy.wait('@blocks');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('loads the stats screen', () => {
|
||||||
|
cy.visit('/bisq');
|
||||||
|
cy.get('li:nth-of-type(4) > a').click().then(() => {
|
||||||
|
cy.wait('@stats');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the api screen', () => {
|
||||||
|
cy.visit('/bisq');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
81
frontend/cypress/integration/liquid/liquid.spec.ts
Normal file
81
frontend/cypress/integration/liquid/liquid.spec.ts
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
describe('Liquid', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
// TODO: Fix ng serve to deliver these files
|
||||||
|
cy.fixture('assets.minimal').then((json) => {
|
||||||
|
cy.intercept('/resources/assets.minimal.json', json);
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.fixture('assets').then((json) => {
|
||||||
|
cy.intercept('/resources/assets.json', json);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the dashboard', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the blocks page', () => {
|
||||||
|
cy.visit('/liquid/blocks');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads a specific block page', () => {
|
||||||
|
cy.visit('/liquid/blocks');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the graphs page', () => {
|
||||||
|
cy.visit('/liquid/graphs');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the tv page - desktop', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(3) > a').click().then(() => {
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the graphs page - mobile', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(3) > a').click().then(() => {
|
||||||
|
cy.viewport('iphone-6');
|
||||||
|
cy.wait(1000);
|
||||||
|
// TODO: Should we really support TV Mode in Mobile for Bisq?
|
||||||
|
// cy.get('.tv-only').should('be.visible')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('assets', () => {
|
||||||
|
it('shows the assets screen', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
cy.get('table tr').should('have.length', 5);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('allows searching assets', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
cy.get('.container-xl input').click().type('Liquid Bitcoin').then(() => {
|
||||||
|
cy.get('table tr').should('have.length', 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows a specific asset ID', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
cy.get('.container-xl input').click().type('Liquid CAD').then(() => {
|
||||||
|
cy.get('table tr td:nth-of-type(4) a').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows a specific asset issuance TX', () => {
|
||||||
|
cy.visit('/liquid');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
cy.get('.container-xl input').click().type('Liquid CAD').then(() => {
|
||||||
|
cy.get('table tr td:nth-of-type(5) a').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
97
frontend/cypress/integration/mainnet/mainnet.spec.ts
Normal file
97
frontend/cypress/integration/mainnet/mainnet.spec.ts
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
describe('Mainnet', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.intercept('/api/block-height/*').as('block-height');
|
||||||
|
cy.intercept('/api/block/*').as('block');
|
||||||
|
cy.intercept('/api/block/*/txs/0').as('block-txs');
|
||||||
|
cy.intercept('/api/tx/*/outspends').as('tx-outspends');
|
||||||
|
|
||||||
|
// TODO: Fix ng serve to deliver this file
|
||||||
|
cy.fixture('pools').then((json) => {
|
||||||
|
cy.intercept('/resources/pools.json', json);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the dashboard', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the blocks screen', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('li:nth-of-type(2) > a').click().then(() => {
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the graphs screen', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('li:nth-of-type(3) > a').click().then(() => {
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('tv mode', () => {
|
||||||
|
it('loads the tv screen - desktop', () => {
|
||||||
|
cy.viewport('macbook-16');
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('li:nth-of-type(4) > a').click().then(() => {
|
||||||
|
cy.wait(1000);
|
||||||
|
cy.get('.tv-only').should('not.be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads the tv screen - mobile', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('li:nth-of-type(4) > a').click().then(() => {
|
||||||
|
cy.viewport('iphone-6');
|
||||||
|
cy.wait(1000);
|
||||||
|
cy.get('.tv-only').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('loads the api screen', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('li:nth-of-type(5) > a').click().then(() => {
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('blocks', () => {
|
||||||
|
it('shows empty blocks properly', () => {
|
||||||
|
cy.visit('/block/0000000000000000000bd14f744ef2e006e61c32214670de7eb891a5732ee775');
|
||||||
|
cy.get('h2').invoke('text').should('equal', '1 transaction');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('expands and collapses the block details', () => {
|
||||||
|
cy.visit('/block/0');
|
||||||
|
cy.wait('@tx-outspends');
|
||||||
|
cy.get('.btn.btn-outline-info').click().then(() => {
|
||||||
|
cy.get('#details').should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.get('.btn.btn-outline-info').click().then(() => {
|
||||||
|
cy.get('#details').should('not.be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows blocks with no pagination', () => {
|
||||||
|
cy.visit('/block/00000000000000000001ba40caf1ad4cec0ceb77692662315c151953bfd7c4c4');
|
||||||
|
cy.get('h2').invoke('text').should('equal', '19 transactions');
|
||||||
|
cy.get('ul.pagination').first().children().should('have.length', 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('supports pagination on the block screen', () => {
|
||||||
|
// 41 txs
|
||||||
|
cy.visit('/block/00000000000000000009f9b7b0f63ad50053ad12ec3b7f5ca951332f134f83d8');
|
||||||
|
cy.get('.header-bg.box > a').invoke('text').then((text1) => {
|
||||||
|
cy.get('.active + li').first().click().then(() => {
|
||||||
|
cy.get('.header-bg.box > a').invoke('text').then((text2) => {
|
||||||
|
expect(text1).not.to.eq(text2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
10
frontend/cypress/integration/signet/signet.spec.ts
Normal file
10
frontend/cypress/integration/signet/signet.spec.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
describe('Signet', () => {
|
||||||
|
it('loads the dashboard', () => {
|
||||||
|
cy.visit('/signet');
|
||||||
|
});
|
||||||
|
|
||||||
|
it.skip('loads all the pages properly', () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
9
frontend/cypress/integration/testnet/testnet.spec.ts
Normal file
9
frontend/cypress/integration/testnet/testnet.spec.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
describe('Testnet', () => {
|
||||||
|
it('loads the dashboard', () => {
|
||||||
|
cy.visit('/testnet');
|
||||||
|
});
|
||||||
|
|
||||||
|
it.skip('loads all the pages properly', () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
1
frontend/cypress/plugins/index.js
Normal file
1
frontend/cypress/plugins/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = (on, config) => {}
|
||||||
45
frontend/cypress/support/commands.ts
Normal file
45
frontend/cypress/support/commands.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// ***********************************************
|
||||||
|
// This example namespace declaration will help
|
||||||
|
// with Intellisense and code completion in your
|
||||||
|
// IDE or Text Editor.
|
||||||
|
// ***********************************************
|
||||||
|
// declare namespace Cypress {
|
||||||
|
// interface Chainable<Subject = any> {
|
||||||
|
// customCommand(param: any): typeof customCommand;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// function customCommand(param: any): void {
|
||||||
|
// console.warn(param);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// NOTE: You can use it like so:
|
||||||
|
// Cypress.Commands.add('customCommand', customCommand);
|
||||||
|
//
|
||||||
|
// ***********************************************
|
||||||
|
// This example commands.js shows you how to
|
||||||
|
// create various custom commands and overwrite
|
||||||
|
// existing commands.
|
||||||
|
//
|
||||||
|
// For more comprehensive examples of custom
|
||||||
|
// commands please read more here:
|
||||||
|
// https://on.cypress.io/custom-commands
|
||||||
|
// ***********************************************
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This is a parent command --
|
||||||
|
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This is a child command --
|
||||||
|
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This is a dual command --
|
||||||
|
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -- This will overwrite an existing command --
|
||||||
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
|
import 'cypress-wait-until';
|
||||||
17
frontend/cypress/support/index.ts
Normal file
17
frontend/cypress/support/index.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// ***********************************************************
|
||||||
|
// This example support/index.js is processed and
|
||||||
|
// loaded automatically before your test files.
|
||||||
|
//
|
||||||
|
// This is a great place to put global configuration and
|
||||||
|
// behavior that modifies Cypress.
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off
|
||||||
|
// automatically serving support files with the
|
||||||
|
// 'supportFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/configuration
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// When a command from ./commands is ready to use, import with `import './commands'` syntax
|
||||||
|
import './commands';
|
||||||
8
frontend/cypress/tsconfig.json
Normal file
8
frontend/cypress/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"include": ["**/*.ts"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"sourceMap": false,
|
||||||
|
"types": ["cypress"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
// @ts-check
|
|
||||||
// Protractor configuration file, see link for more information
|
|
||||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
|
||||||
|
|
||||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type { import("protractor").Config }
|
|
||||||
*/
|
|
||||||
exports.config = {
|
|
||||||
allScriptsTimeout: 11000,
|
|
||||||
specs: [
|
|
||||||
'./src/**/*.e2e-spec.ts'
|
|
||||||
],
|
|
||||||
capabilities: {
|
|
||||||
'browserName': 'chrome'
|
|
||||||
},
|
|
||||||
directConnect: true,
|
|
||||||
baseUrl: 'http://localhost:4200/',
|
|
||||||
framework: 'jasmine',
|
|
||||||
jasmineNodeOpts: {
|
|
||||||
showColors: true,
|
|
||||||
defaultTimeoutInterval: 30000,
|
|
||||||
print: function() {}
|
|
||||||
},
|
|
||||||
onPrepare() {
|
|
||||||
require('ts-node').register({
|
|
||||||
project: require('path').join(__dirname, './tsconfig.json')
|
|
||||||
});
|
|
||||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { AppPage } from './app.po';
|
|
||||||
import { browser, logging } from 'protractor';
|
|
||||||
|
|
||||||
describe('workspace-project App', () => {
|
|
||||||
let page: AppPage;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
page = new AppPage();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display welcome message', () => {
|
|
||||||
page.navigateTo();
|
|
||||||
expect(page.getTitleText()).toEqual('Welcome to mempool!');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
// Assert that there are no errors emitted from the browser
|
|
||||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
|
||||||
expect(logs).not.toContain(jasmine.objectContaining({
|
|
||||||
level: logging.Level.SEVERE,
|
|
||||||
} as logging.Entry));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { browser, by, element } from 'protractor';
|
|
||||||
|
|
||||||
export class AppPage {
|
|
||||||
navigateTo() {
|
|
||||||
return browser.get(browser.baseUrl) as Promise<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
getTitleText() {
|
|
||||||
return element(by.css('app-root h1')).getText() as Promise<string>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../out-tsc/e2e",
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es2018",
|
|
||||||
"types": [
|
|
||||||
"jasmine",
|
|
||||||
"jasminewd2",
|
|
||||||
"node"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,34 @@
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
const { spawnSync } = require('child_process');
|
||||||
|
|
||||||
const CONFIG_FILE_NAME = 'mempool-frontend-config.json';
|
const CONFIG_FILE_NAME = 'mempool-frontend-config.json';
|
||||||
const GENERATED_CONFIG_FILE_NAME = 'generated-config.js';
|
const GENERATED_CONFIG_FILE_NAME = 'generated-config.js';
|
||||||
|
|
||||||
let settings = [];
|
let settings = [];
|
||||||
let configContent = {};
|
let configContent = {};
|
||||||
|
let gitCommitHash = '';
|
||||||
|
let packetJsonVersion = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const rawConfig = fs.readFileSync(CONFIG_FILE_NAME);
|
const rawConfig = fs.readFileSync(CONFIG_FILE_NAME);
|
||||||
configContent = JSON.parse(rawConfig);
|
configContent = JSON.parse(rawConfig);
|
||||||
|
console.log(`${CONFIG_FILE_NAME} file found, using provided config`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code !== 'ENOENT') {
|
if (e.code !== 'ENOENT') {
|
||||||
throw new Error(e);
|
throw new Error(e);
|
||||||
|
} else {
|
||||||
|
console.log(`${CONFIG_FILE_NAME} file not found, using default config`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const packageJson = fs.readFileSync('package.json');
|
||||||
|
packetJsonVersion = JSON.parse(packageJson).version;
|
||||||
|
console.log(`mempool version ${packetJsonVersion}`);
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
|
||||||
for (setting in configContent) {
|
for (setting in configContent) {
|
||||||
settings.push({
|
settings.push({
|
||||||
key: setting,
|
key: setting,
|
||||||
@@ -22,15 +36,64 @@ for (setting in configContent) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = `(function (window) {
|
if (process.env.DOCKER_COMMIT_HASH) {
|
||||||
window.__env = window.__env || {};${settings.reduce((str, obj) => `${str}
|
gitCommitHash = process.env.DOCKER_COMMIT_HASH;
|
||||||
window.__env.${obj.key} = ${ typeof obj.value === 'string' ? `'${obj.value}'` : obj.value };`, '')}
|
} else {
|
||||||
}(global || this));`;
|
try {
|
||||||
|
const gitRevParse = spawnSync('git', ['rev-parse', '--short', 'HEAD']);
|
||||||
try {
|
|
||||||
fs.writeFileSync(GENERATED_CONFIG_FILE_NAME, code, 'utf8');
|
if (!gitRevParse.error) {
|
||||||
} catch (e) {
|
gitCommitHash = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
|
||||||
throw new Error(e);
|
console.log(`mempool revision ${gitCommitHash}`);
|
||||||
|
} else if (gitRevParse.error.code === 'ENOENT') {
|
||||||
|
console.log('git not found, cannot parse git hash');
|
||||||
|
gitCommitHash = '?';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Could not load git commit info: ' + e.message);
|
||||||
|
gitCommitHash = '?';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Config file generated');
|
const newConfig = `(function (window) {
|
||||||
|
window.__env = window.__env || {};${settings.reduce((str, obj) => `${str}
|
||||||
|
window.__env.${obj.key} = ${ typeof obj.value === 'string' ? `'${obj.value}'` : obj.value };`, '')}
|
||||||
|
window.__env.GIT_COMMIT_HASH = '${gitCommitHash}';
|
||||||
|
window.__env.PACKAGE_JSON_VERSION = '${packetJsonVersion}';
|
||||||
|
}(global || this));`;
|
||||||
|
|
||||||
|
function readConfig(path) {
|
||||||
|
try {
|
||||||
|
const currentConfig = fs.readFileSync(path).toString().trim();
|
||||||
|
return currentConfig;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeConfig(path, config) {
|
||||||
|
try {
|
||||||
|
fs.writeFileSync(path, config, 'utf8');
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentConfig = readConfig(GENERATED_CONFIG_FILE_NAME);
|
||||||
|
|
||||||
|
if (currentConfig && currentConfig === newConfig) {
|
||||||
|
console.log(`No configuration updates, skipping ${GENERATED_CONFIG_FILE_NAME} file update`);
|
||||||
|
return;
|
||||||
|
} else if (!currentConfig) {
|
||||||
|
console.log(`${GENERATED_CONFIG_FILE_NAME} file not found, creating new config file`);
|
||||||
|
console.log('CONFIG: ', newConfig);
|
||||||
|
writeConfig(GENERATED_CONFIG_FILE_NAME, newConfig);
|
||||||
|
console.log(`${GENERATED_CONFIG_FILE_NAME} file saved`);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
console.log(`Configuration changes detected, updating ${GENERATED_CONFIG_FILE_NAME} file`);
|
||||||
|
console.log('OLD CONFIG: ', currentConfig);
|
||||||
|
console.log('NEW CONFIG: ', newConfig);
|
||||||
|
writeConfig(GENERATED_CONFIG_FILE_NAME, newConfig);
|
||||||
|
console.log(`${GENERATED_CONFIG_FILE_NAME} file updated`);
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"TESTNET_ENABLED": false,
|
"TESTNET_ENABLED": false,
|
||||||
|
"SIGNET_ENABLED": false,
|
||||||
"LIQUID_ENABLED": false,
|
"LIQUID_ENABLED": false,
|
||||||
"BISQ_ENABLED": false,
|
"BISQ_ENABLED": false,
|
||||||
"BISQ_SEPARATE_BACKEND": false,
|
"BISQ_SEPARATE_BACKEND": false,
|
||||||
"ITEMS_PER_PAGE": 10,
|
"ITEMS_PER_PAGE": 10,
|
||||||
"KEEP_BLOCKS_AMOUNT": 8,
|
"KEEP_BLOCKS_AMOUNT": 8,
|
||||||
"SPONSORS_ENABLED": false,
|
|
||||||
"NGINX_PROTOCOL": "http",
|
"NGINX_PROTOCOL": "http",
|
||||||
"NGINX_HOSTNAME": "127.0.0.1",
|
"NGINX_HOSTNAME": "127.0.0.1",
|
||||||
"NGINX_PORT": "80"
|
"NGINX_PORT": "80"
|
||||||
|
|||||||
22643
frontend/package-lock.json
generated
22643
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "mempool-frontend",
|
"name": "mempool-frontend",
|
||||||
"version": "2.0.0",
|
"version": "2.2.0-dev",
|
||||||
"description": "Bitcoin mempool visualizer and blockchain explorer backend",
|
"description": "Bitcoin mempool visualizer and blockchain explorer backend",
|
||||||
"license": "MIT",
|
"license": "GNU Affero General Public License v3.0",
|
||||||
"homepage": "https://mempool.space",
|
"homepage": "https://mempool.space",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -24,73 +24,89 @@
|
|||||||
"tsc": "./node_modules/typescript/bin/tsc",
|
"tsc": "./node_modules/typescript/bin/tsc",
|
||||||
"i18n-extract-from-source": "./node_modules/@angular/cli/bin/ng xi18n --ivy --out-file ./src/locale/messages.xlf",
|
"i18n-extract-from-source": "./node_modules/@angular/cli/bin/ng xi18n --ivy --out-file ./src/locale/messages.xlf",
|
||||||
"i18n-pull-from-transifex": "tx pull -a --parallel --minimum-perc 1 --force",
|
"i18n-pull-from-transifex": "tx pull -a --parallel --minimum-perc 1 --force",
|
||||||
"serve": "ng serve --proxy-config proxy.conf.json",
|
"serve": "npm run generate-config && ng serve -c local",
|
||||||
"start": "npm run generate-config && npm run sync-assets-dev && ng serve --proxy-config proxy.conf.json",
|
"serve:stg": "npm run generate-config && ng serve -c staging",
|
||||||
"build": "npm run generate-config && ng build --prod --localize && npm run sync-assets",
|
"serve:local-prod": "npm run generate-config && ng serve -c local-prod",
|
||||||
|
"start": "npm run generate-config && npm run sync-assets-dev && ng serve -c local",
|
||||||
|
"start:stg": "npm run generate-config && npm run sync-assets-dev && ng serve -c staging",
|
||||||
|
"start:local-prod": "npm run generate-config && npm run sync-assets-dev && ng serve -c local-prod",
|
||||||
|
"build": "npm run generate-config && ng build --prod --localize && npm run sync-assets && npm run build-mempool.js",
|
||||||
"sync-assets": "node sync-assets.js && rsync -av ./dist/mempool/browser/en-US/resources ./dist/mempool/browser/resources",
|
"sync-assets": "node sync-assets.js && rsync -av ./dist/mempool/browser/en-US/resources ./dist/mempool/browser/resources",
|
||||||
"sync-assets-dev": "node sync-assets.js dev",
|
"sync-assets-dev": "node sync-assets.js dev",
|
||||||
"generate-config": "node generate-config.js",
|
"generate-config": "node generate-config.js",
|
||||||
|
"build-mempool.js": "tsc | browserify -p tinyify ./node_modules/@mempool/mempool.js/lib/index.js --standalone mempoolJS > ./dist/mempool/browser/en-US/mempool.js",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
"dev:ssr": "npm run generate-config && ng run mempool:serve-ssr",
|
"dev:ssr": "npm run generate-config && ng run mempool:serve-ssr",
|
||||||
"serve:ssr": "node server.run.js",
|
"serve:ssr": "node server.run.js",
|
||||||
"build:ssr": "npm run build && ng run mempool:server:production && ./node_modules/typescript/bin/tsc server.run.ts",
|
"build:ssr": "npm run build && ng run mempool:server:production && ./node_modules/typescript/bin/tsc server.run.ts",
|
||||||
"prerender": "ng run mempool:prerender"
|
"prerender": "ng run mempool:prerender",
|
||||||
|
"cypress:open": "concurrently \"ng serve -c local-prod\" \"cypress open\" --kill-others",
|
||||||
|
"cypress:run": "concurrently \"ng serve -c local-prod\" \"cypress run\" --kill-others"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "~10.2.3",
|
"@angular/animations": "~11.2.8",
|
||||||
"@angular/common": "~10.2.3",
|
"@angular/common": "~11.2.8",
|
||||||
"@angular/compiler": "~10.2.3",
|
"@angular/compiler": "~11.2.8",
|
||||||
"@angular/core": "~10.2.3",
|
"@angular/core": "~11.2.8",
|
||||||
"@angular/forms": "~10.2.3",
|
"@angular/forms": "~11.2.8",
|
||||||
"@angular/localize": "^10.2.3",
|
"@angular/localize": "^11.2.8",
|
||||||
"@angular/platform-browser": "~10.2.3",
|
"@angular/platform-browser": "~11.2.8",
|
||||||
"@angular/platform-browser-dynamic": "~10.2.3",
|
"@angular/platform-browser-dynamic": "~11.2.8",
|
||||||
"@angular/platform-server": "~10.2.2",
|
"@angular/platform-server": "~11.2.8",
|
||||||
"@angular/router": "~10.2.3",
|
"@angular/router": "~11.2.8",
|
||||||
"@fortawesome/angular-fontawesome": "^0.7.0",
|
"@fortawesome/angular-fontawesome": "^0.8.2",
|
||||||
"@fortawesome/fontawesome-common-types": "^0.2.30",
|
"@fortawesome/fontawesome-common-types": "^0.2.35",
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.2.30",
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.14.0",
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||||
"@mempool/chartist": "^0.11.4",
|
"@mempool/chartist": "^0.11.4",
|
||||||
|
"@mempool/mempool.js": "^2.2.2",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
|
||||||
"@nguniversal/express-engine": "10.1.0",
|
"@nguniversal/express-engine": "11.2.1",
|
||||||
"@types/qrcode": "^1.3.4",
|
"@types/qrcode": "^1.3.4",
|
||||||
"bootstrap": "4.5.0",
|
"bootstrap": "4.5.0",
|
||||||
|
"browserify": "^17.0.0",
|
||||||
"clipboard": "^2.0.4",
|
"clipboard": "^2.0.4",
|
||||||
"domino": "^2.1.6",
|
"domino": "^2.1.6",
|
||||||
"express": "^4.15.2",
|
"express": "^4.17.1",
|
||||||
|
"lightweight-charts": "^3.3.0",
|
||||||
"ngx-bootrap-multiselect": "^2.0.0",
|
"ngx-bootrap-multiselect": "^2.0.0",
|
||||||
"ngx-infinite-scroll": "^9.0.0",
|
"ngx-infinite-scroll": "^10.0.1",
|
||||||
"qrcode": "^1.4.4",
|
"qrcode": "^1.4.4",
|
||||||
"rxjs": "^6.6.3",
|
"rxjs": "^6.6.7",
|
||||||
|
"tinyify": "^3.0.0",
|
||||||
"tlite": "^0.1.9",
|
"tlite": "^0.1.9",
|
||||||
"tslib": "^2.0.0",
|
"tslib": "^2.2.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^0.1002.0",
|
"@angular-devkit/build-angular": "^0.1102.7",
|
||||||
"@angular/cli": "~10.2.0",
|
"@angular/cli": "~11.2.7",
|
||||||
"@angular/compiler-cli": "~10.2.2",
|
"@angular/compiler-cli": "~11.2.8",
|
||||||
"@angular/language-service": "~10.2.2",
|
"@angular/language-service": "~11.2.8",
|
||||||
"@nguniversal/builders": "^10.1.0",
|
"@cypress/schematic": "^1.3.0",
|
||||||
|
"@nguniversal/builders": "^11.2.1",
|
||||||
"@types/express": "^4.17.0",
|
"@types/express": "^4.17.0",
|
||||||
"@types/jasmine": "~3.3.8",
|
"@types/jasmine": "~3.6.0",
|
||||||
"@types/jasminewd2": "~2.0.3",
|
"@types/jasminewd2": "~2.0.3",
|
||||||
"@types/node": "^12.11.1",
|
"@types/node": "^12.11.1",
|
||||||
"codelyzer": "^6.0.0",
|
"codelyzer": "^6.0.1",
|
||||||
|
"concurrently": "^6.2.0",
|
||||||
|
"cypress-wait-until": "^1.7.1",
|
||||||
"http-proxy-middleware": "^1.0.5",
|
"http-proxy-middleware": "^1.0.5",
|
||||||
"jasmine-core": "~3.5.0",
|
"jasmine-core": "~3.6.0",
|
||||||
"jasmine-spec-reporter": "~5.0.0",
|
"jasmine-spec-reporter": "~5.0.0",
|
||||||
"karma": "~5.0.0",
|
"karma": "~6.1.0",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
"karma-coverage": "~2.0.3",
|
||||||
"karma-jasmine": "~3.3.0",
|
"karma-jasmine": "~4.0.0",
|
||||||
"karma-jasmine-html-reporter": "^1.5.0",
|
"karma-jasmine-html-reporter": "^1.5.0",
|
||||||
"protractor": "~7.0.0",
|
"ts-node": "~8.3.0",
|
||||||
"ts-node": "~7.0.0",
|
|
||||||
"tslint": "~6.1.0",
|
"tslint": "~6.1.0",
|
||||||
"typescript": "~4.0.5"
|
"typescript": "~4.1.5"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"cypress": "^7.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{
|
||||||
"/api/v1/donations": {
|
|
||||||
"target": "http://localhost:9000/",
|
|
||||||
"secure": false
|
|
||||||
},
|
|
||||||
"/api/v1": {
|
"/api/v1": {
|
||||||
"target": "http://localhost:8999/",
|
"target": "http://localhost:8999/",
|
||||||
"secure": false
|
"secure": false
|
||||||
@@ -41,6 +37,28 @@
|
|||||||
"^/testnet/api": ""
|
"^/testnet/api": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/signet/api/v1": {
|
||||||
|
"target": "http://localhost:8999/",
|
||||||
|
"secure": false,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api/v1": "/api/v1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/signet/api/v1/ws": {
|
||||||
|
"target": "http://localhost:8999/",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/signet/api/": {
|
||||||
|
"target": "http://localhost:50001/",
|
||||||
|
"secure": false,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"/liquid/api/v1/ws": {
|
"/liquid/api/v1/ws": {
|
||||||
"target": "http://localhost:8999/",
|
"target": "http://localhost:8999/",
|
||||||
"secure": false,
|
"secure": false,
|
||||||
@@ -70,5 +88,20 @@
|
|||||||
"pathRewrite": {
|
"pathRewrite": {
|
||||||
"^/bisq/api": "/api/v1/ws"
|
"^/bisq/api": "/api/v1/ws"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/resources/assets.minimal.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/assets.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/pools.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
102
frontend/proxy.prod.conf.json
Normal file
102
frontend/proxy.prod.conf.json
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"/api/v1/ws": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true
|
||||||
|
},
|
||||||
|
"/api/*": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"logLevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/api": "https://mempool.space/api"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/testnet/api/v1/ws": {
|
||||||
|
"target": "https://mempool.space/testnet",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"loglevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/testnet/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/testnet/api/*": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": true,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"loglevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"/testnet/api": "/testnet/api"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/signet/api/v1/ws": {
|
||||||
|
"target": "https://mempool.space/signet",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"loglevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/signet/api/*": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": true,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"loglevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"/signet/api": "/signet/api"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
|
||||||
|
"/bisq/api/v1/ws": {
|
||||||
|
"target": "https://mempool.space/bisq",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/bisq/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/bisq/api/*": {
|
||||||
|
"target": "https://mempool.space/bisq",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/bisq/api/": "/api/v1/bisq/"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/liquid/api/v1/ws": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true
|
||||||
|
},
|
||||||
|
"/liquid/api/*": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/liquid/api/": "/liquid/api/"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/resources/assets.minimal.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/assets.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/pools.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
}
|
||||||
|
}
|
||||||
100
frontend/proxy.stg.conf.json
Normal file
100
frontend/proxy.stg.conf.json
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
{
|
||||||
|
"/api/v1/ws": {
|
||||||
|
"target": "https://mempool.ninja",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true
|
||||||
|
},
|
||||||
|
"/api/*": {
|
||||||
|
"target": "https://mempool.ninja",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"logLevel": "debug",
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/api": "https://mempool.ninja/api"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/testnet/api/v1/ws": {
|
||||||
|
"target": "https://mempool.ninja/testnet",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/testnet/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/testnet/api/v1/*": {
|
||||||
|
"target": "https://mempool.ninja/testnet",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/testnet/api/v1": "/api/v1"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/signet/api/v1/ws": {
|
||||||
|
"target": "https://mempool.ninja/signet",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/signet/api/v1/*": {
|
||||||
|
"target": "https://mempool.ninja/signet",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/signet/api/v1": "/api/v1"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/bisq/api/v1/ws": {
|
||||||
|
"target": "https://mempool.ninja/bisq",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/bisq/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/bisq/api/*": {
|
||||||
|
"target": "https://mempool.ninja/bisq",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/bisq/api/": "/api/v1/bisq/"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/liquid/api/v1/ws": {
|
||||||
|
"target": "https://mempool.ninja/liquid",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/liquid/api": "/api/v1/ws"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/liquid/api/*": {
|
||||||
|
"target": "https://mempool.ninja/liquid",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/liquid/api/": "/api/v1/liquid/"
|
||||||
|
},
|
||||||
|
"timeout": 3600000
|
||||||
|
},
|
||||||
|
"/resources/assets.minimal.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/assets.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
},
|
||||||
|
"/resources/pools.json": {
|
||||||
|
"target": "https://mempool.space",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -91,6 +91,17 @@ export function app(locale: string): express.Express {
|
|||||||
server.get('/testnet/tv', getLocalizedSSR(indexHtml));
|
server.get('/testnet/tv', getLocalizedSSR(indexHtml));
|
||||||
server.get('/testnet/status', getLocalizedSSR(indexHtml));
|
server.get('/testnet/status', getLocalizedSSR(indexHtml));
|
||||||
server.get('/testnet/about', getLocalizedSSR(indexHtml));
|
server.get('/testnet/about', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/tx/*', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/block/*', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/mempool-block/*', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/address/*', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/blocks', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/graphs', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/api', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/tv', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/status', getLocalizedSSR(indexHtml));
|
||||||
|
server.get('/signet/about', getLocalizedSSR(indexHtml));
|
||||||
server.get('/bisq', getLocalizedSSR(indexHtml));
|
server.get('/bisq', getLocalizedSSR(indexHtml));
|
||||||
server.get('/bisq/tx/*', getLocalizedSSR(indexHtml));
|
server.get('/bisq/tx/*', getLocalizedSSR(indexHtml));
|
||||||
server.get('/bisq/blocks', getLocalizedSSR(indexHtml));
|
server.get('/bisq/blocks', getLocalizedSSR(indexHtml));
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ import { DashboardComponent } from './dashboard/dashboard.component';
|
|||||||
import { LatestBlocksComponent } from './components/latest-blocks/latest-blocks.component';
|
import { LatestBlocksComponent } from './components/latest-blocks/latest-blocks.component';
|
||||||
import { ApiDocsComponent } from './components/api-docs/api-docs.component';
|
import { ApiDocsComponent } from './components/api-docs/api-docs.component';
|
||||||
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
||||||
|
import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component';
|
||||||
|
import { SponsorComponent } from './components/sponsor/sponsor.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
let routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: MasterPageComponent,
|
component: MasterPageComponent,
|
||||||
@@ -69,6 +71,10 @@ const routes: Routes = [
|
|||||||
children: [],
|
children: [],
|
||||||
component: AddressComponent
|
component: AddressComponent
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'sponsor',
|
||||||
|
component: SponsorComponent,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -202,6 +208,68 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'signet',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: MasterPageComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: StartComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DashboardComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'tx/:id',
|
||||||
|
component: TransactionComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'block/:id',
|
||||||
|
component: BlockComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'mempool-block/:id',
|
||||||
|
component: MempoolBlockComponent
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'blocks',
|
||||||
|
component: LatestBlocksComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'graphs',
|
||||||
|
component: StatisticsComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'address/:id',
|
||||||
|
children: [],
|
||||||
|
component: AddressComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'api',
|
||||||
|
component: ApiDocsComponent,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'tv',
|
||||||
|
component: TelevisionComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'status',
|
||||||
|
component: StatusViewComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '**',
|
||||||
|
redirectTo: ''
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'bisq',
|
path: 'bisq',
|
||||||
component: MasterPageComponent,
|
component: MasterPageComponent,
|
||||||
@@ -221,9 +289,23 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const browserWindow = window || {};
|
||||||
|
// @ts-ignore
|
||||||
|
const browserWindowEnv = browserWindow.__env || {};
|
||||||
|
|
||||||
|
if (browserWindowEnv && browserWindowEnv.OFFICIAL_BISQ_MARKETS) {
|
||||||
|
routes = [{
|
||||||
|
path: '',
|
||||||
|
component: BisqMasterPageComponent,
|
||||||
|
loadChildren: () => import('./bisq/bisq.module').then(m => m.BisqModule)
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes, {
|
imports: [RouterModule.forRoot(routes, {
|
||||||
initialNavigation: 'enabled'
|
initialNavigation: 'enabled',
|
||||||
|
scrollPositionRestoration: 'enabled',
|
||||||
|
anchorScrolling: 'enabled'
|
||||||
})],
|
})],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export const languages: Language[] = [
|
|||||||
// { code: 'hr', name: 'Hrvatski' }, // Croatian
|
// { code: 'hr', name: 'Hrvatski' }, // Croatian
|
||||||
// { code: 'id', name: 'Bahasa Indonesia' },// Indonesian
|
// { code: 'id', name: 'Bahasa Indonesia' },// Indonesian
|
||||||
{ code: 'it', name: 'Italiano' }, // Italian
|
{ code: 'it', name: 'Italiano' }, // Italian
|
||||||
// { code: 'he', name: 'עברית' }, // Hebrew
|
{ code: 'he', name: 'עברית' }, // Hebrew
|
||||||
{ code: 'ka', name: 'ქართული' }, // Georgian
|
{ code: 'ka', name: 'ქართული' }, // Georgian
|
||||||
// { code: 'lv', name: 'Latviešu' }, // Latvian
|
// { code: 'lv', name: 'Latviešu' }, // Latvian
|
||||||
// { code: 'lt', name: 'Lietuvių' }, // Lithuanian
|
// { code: 'lt', name: 'Lietuvių' }, // Lithuanian
|
||||||
@@ -71,11 +71,11 @@ export const languages: Language[] = [
|
|||||||
{ code: 'ja', name: '日本語' }, // Japanese
|
{ code: 'ja', name: '日本語' }, // Japanese
|
||||||
{ code: 'nb', name: 'Norsk' }, // Norwegian Bokmål
|
{ code: 'nb', name: 'Norsk' }, // Norwegian Bokmål
|
||||||
// { code: 'nn', name: 'Norsk Nynorsk' }, // Norwegian Nynorsk
|
// { code: 'nn', name: 'Norsk Nynorsk' }, // Norwegian Nynorsk
|
||||||
// { code: 'pl', name: 'Polski' }, // Polish
|
{ code: 'pl', name: 'Polski' }, // Polish
|
||||||
{ code: 'pt', name: 'Português' }, // Portuguese
|
{ code: 'pt', name: 'Português' }, // Portuguese
|
||||||
// { code: 'pt-BR', name: 'Português (Brazil)' }, // Portuguese (Brazil)
|
// { code: 'pt-BR', name: 'Português (Brazil)' }, // Portuguese (Brazil)
|
||||||
// { code: 'ro', name: 'Română' }, // Romanian
|
// { code: 'ro', name: 'Română' }, // Romanian
|
||||||
// { code: 'ru', name: 'Русский' }, // Russian
|
{ code: 'ru', name: 'Русский' }, // Russian
|
||||||
// { code: 'sk', name: 'Slovenčina' }, // Slovak
|
// { code: 'sk', name: 'Slovenčina' }, // Slovak
|
||||||
{ code: 'sl', name: 'Slovenščina' }, // Slovenian
|
{ code: 'sl', name: 'Slovenščina' }, // Slovenian
|
||||||
// { code: 'sr', name: 'Српски / srpski' }, // Serbian
|
// { code: 'sr', name: 'Српски / srpski' }, // Serbian
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { WebsocketService } from './services/websocket.service';
|
|||||||
import { AddressLabelsComponent } from './components/address-labels/address-labels.component';
|
import { AddressLabelsComponent } from './components/address-labels/address-labels.component';
|
||||||
import { MempoolBlocksComponent } from './components/mempool-blocks/mempool-blocks.component';
|
import { MempoolBlocksComponent } from './components/mempool-blocks/mempool-blocks.component';
|
||||||
import { MasterPageComponent } from './components/master-page/master-page.component';
|
import { MasterPageComponent } from './components/master-page/master-page.component';
|
||||||
|
import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component';
|
||||||
import { AboutComponent } from './components/about/about.component';
|
import { AboutComponent } from './components/about/about.component';
|
||||||
import { TelevisionComponent } from './components/television/television.component';
|
import { TelevisionComponent } from './components/television/television.component';
|
||||||
import { StatisticsComponent } from './components/statistics/statistics.component';
|
import { StatisticsComponent } from './components/statistics/statistics.component';
|
||||||
@@ -44,17 +45,20 @@ import { FeesBoxComponent } from './components/fees-box/fees-box.component';
|
|||||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||||
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
|
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
|
||||||
import { faAngleDown, faAngleUp, faBolt, faChartArea, faCogs, faCubes, faDatabase, faExchangeAlt, faInfoCircle,
|
import { faAngleDown, faAngleUp, faBolt, faChartArea, faCogs, faCubes, faDatabase, faExchangeAlt, faInfoCircle,
|
||||||
faLink, faList, faSearch, faTachometerAlt, faThList, faTint, faTv } from '@fortawesome/free-solid-svg-icons';
|
faLink, faList, faSearch, faTachometerAlt, faThList, faTint, faTv, faAngleDoubleDown, faAngleDoubleUp, faChevronDown, faFileAlt, faRedoAlt } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { ApiDocsComponent } from './components/api-docs/api-docs.component';
|
import { ApiDocsComponent } from './components/api-docs/api-docs.component';
|
||||||
|
import { CodeTemplateComponent } from './components/api-docs/code-template.component';
|
||||||
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
||||||
import { StorageService } from './services/storage.service';
|
import { StorageService } from './services/storage.service';
|
||||||
import { HttpCacheInterceptor } from './services/http-cache.interceptor';
|
import { HttpCacheInterceptor } from './services/http-cache.interceptor';
|
||||||
|
import { SponsorComponent } from './components/sponsor/sponsor.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
AboutComponent,
|
AboutComponent,
|
||||||
MasterPageComponent,
|
MasterPageComponent,
|
||||||
|
BisqMasterPageComponent,
|
||||||
TelevisionComponent,
|
TelevisionComponent,
|
||||||
BlockchainComponent,
|
BlockchainComponent,
|
||||||
StartComponent,
|
StartComponent,
|
||||||
@@ -82,7 +86,9 @@ import { HttpCacheInterceptor } from './services/http-cache.interceptor';
|
|||||||
FeesBoxComponent,
|
FeesBoxComponent,
|
||||||
DashboardComponent,
|
DashboardComponent,
|
||||||
ApiDocsComponent,
|
ApiDocsComponent,
|
||||||
|
CodeTemplateComponent,
|
||||||
TermsOfServiceComponent,
|
TermsOfServiceComponent,
|
||||||
|
SponsorComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule.withServerTransition({ appId: 'serverApp' }),
|
BrowserModule.withServerTransition({ appId: 'serverApp' }),
|
||||||
@@ -125,5 +131,10 @@ export class AppModule {
|
|||||||
library.addIcons(faAngleDown);
|
library.addIcons(faAngleDown);
|
||||||
library.addIcons(faAngleUp);
|
library.addIcons(faAngleUp);
|
||||||
library.addIcons(faExchangeAlt);
|
library.addIcons(faExchangeAlt);
|
||||||
|
library.addIcons(faAngleDoubleUp);
|
||||||
|
library.addIcons(faAngleDoubleDown);
|
||||||
|
library.addIcons(faChevronDown);
|
||||||
|
library.addIcons(faFileAlt);
|
||||||
|
library.addIcons(faRedoAlt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<h1 style="float: left;" i18n="shared.address">Address</h1>
|
<h1 i18n="shared.address">Address</h1>
|
||||||
<a [routerLink]="['/address/' | relativeUrl, addressString]" style="line-height: 56px; margin-left: 10px;">
|
<span class="address-link">
|
||||||
<span class="d-inline d-lg-none">{{ addressString | shortenString : 24 }}</span>
|
<a [routerLink]="['/address/' | relativeUrl, addressString]">
|
||||||
<span class="d-none d-lg-inline">{{ addressString }}</span>
|
<span class="d-inline d-lg-none">{{ addressString | shortenString : 24 }}</span>
|
||||||
</a>
|
<span class="d-none d-lg-inline">{{ addressString }}</span>
|
||||||
<app-clipboard [text]="addressString"></app-clipboard>
|
</a>
|
||||||
|
<app-clipboard [text]="addressString"></app-clipboard>
|
||||||
|
</span>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@@ -13,26 +15,26 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col-md">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="address.total-received">Total received</td>
|
<td i18n="address.total-received">Total received</td>
|
||||||
<td>{{ totalReceived / 100 | number: '1.2-2' }} BSQ</td>
|
<td>{{ totalReceived / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="address.total-sent">Total sent</td>
|
<td i18n="address.total-sent">Total sent</td>
|
||||||
<td>{{ totalSent / 100 | number: '1.2-2' }} BSQ</td>
|
<td>{{ totalSent / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="address.balance">Balance</td>
|
<td i18n="address.balance">Balance</td>
|
||||||
<td>{{ (totalReceived - totalSent) / 100 | number: '1.2-2' }} BSQ (<app-bsq-amount [bsq]="totalReceived - totalSent" [forceFiat]="true" [green]="true"></app-bsq-amount>)</td>
|
<td>{{ (totalReceived - totalSent) / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span> <span class="fiat"><app-bsq-amount [bsq]="totalReceived - totalSent" [forceFiat]="true" [green]="true"></app-bsq-amount></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-100 d-block d-md-none"></div>
|
<div class="w-100 d-block d-md-none"></div>
|
||||||
<div class="col qrcode-col">
|
<div class="col-md qrcode-col">
|
||||||
<div class="qr-wrapper">
|
<div class="qr-wrapper">
|
||||||
<app-qrcode [data]="addressString"></app-qrcode>
|
<app-qrcode [data]="addressString"></app-qrcode>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,21 +3,73 @@
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 25px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
.qrcode-col {
|
||||||
.qrcode-col {
|
text-align: center;
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@media (max-width: 575.98px) {
|
|
||||||
.qrcode-col {
|
.qrcode-col > div {
|
||||||
|
margin: 20px auto 5px;
|
||||||
|
@media (min-width: 768px) {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.qrcode-col > div {
|
.fiat {
|
||||||
margin-top: 20px;
|
display: block;
|
||||||
margin-right: 0px;
|
font-size: 13px;
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
tr td {
|
||||||
|
&:last-child {
|
||||||
|
text-align: right;
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.address-link {
|
||||||
|
line-height: 26px;
|
||||||
|
margin-left: 0px;
|
||||||
|
top: 14px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
line-height: 38px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.row{
|
||||||
|
flex-direction: column;
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.mobile-bottomcol {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
.details-table td:first-child {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ import { ParamMap, ActivatedRoute } from '@angular/router';
|
|||||||
import { Subscription, of } from 'rxjs';
|
import { Subscription, of } from 'rxjs';
|
||||||
import { BisqTransaction } from '../bisq.interfaces';
|
import { BisqTransaction } from '../bisq.interfaces';
|
||||||
import { BisqApiService } from '../bisq-api.service';
|
import { BisqApiService } from '../bisq-api.service';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-address',
|
selector: 'app-bisq-address',
|
||||||
@@ -22,12 +23,15 @@ export class BisqAddressComponent implements OnInit, OnDestroy {
|
|||||||
totalSent = 0;
|
totalSent = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
private bisqApiService: BisqApiService,
|
private bisqApiService: BisqApiService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
this.mainSubscription = this.route.paramMap
|
this.mainSubscription = this.route.paramMap
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap((params: ParamMap) => {
|
switchMap((params: ParamMap) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpResponse, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpResponse, HttpParams } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { BisqTransaction, BisqBlock, BisqStats } from './bisq.interfaces';
|
import { BisqTransaction, BisqBlock, BisqStats, MarketVolume, Trade, Markets, Tickers, Offers, Currencies, HighLowOpenClose, SummarizedInterval } from './bisq.interfaces';
|
||||||
|
|
||||||
const API_BASE_URL = '/bisq/api';
|
const API_BASE_URL = '/bisq/api';
|
||||||
|
|
||||||
@@ -42,4 +42,37 @@ export class BisqApiService {
|
|||||||
getAddress$(address: string): Observable<BisqTransaction[]> {
|
getAddress$(address: string): Observable<BisqTransaction[]> {
|
||||||
return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + '/address/' + address);
|
return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + '/address/' + address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMarkets$(): Observable<Markets> {
|
||||||
|
return this.httpClient.get<Markets>(API_BASE_URL + '/markets/markets');
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketsTicker$(): Observable<Tickers> {
|
||||||
|
return this.httpClient.get<Tickers>(API_BASE_URL + '/markets/ticker');
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketsCurrencies$(): Observable<Currencies> {
|
||||||
|
return this.httpClient.get<Currencies>(API_BASE_URL + '/markets/currencies');
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketsHloc$(market: string, interval: 'minute' | 'half_hour' | 'hour' | 'half_day' | 'day'
|
||||||
|
| 'week' | 'month' | 'year' | 'auto'): Observable<SummarizedInterval[]> {
|
||||||
|
return this.httpClient.get<SummarizedInterval[]>(API_BASE_URL + '/markets/hloc?market=' + market + '&interval=' + interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketOffers$(market: string): Observable<Offers> {
|
||||||
|
return this.httpClient.get<Offers>(API_BASE_URL + '/markets/offers?market=' + market);
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketTrades$(market: string): Observable<Trade[]> {
|
||||||
|
return this.httpClient.get<Trade[]>(API_BASE_URL + '/markets/trades?market=' + market);
|
||||||
|
}
|
||||||
|
|
||||||
|
getMarketVolumesByTime$(period: string): Observable<HighLowOpenClose[]> {
|
||||||
|
return this.httpClient.get<HighLowOpenClose[]>(API_BASE_URL + '/markets/volumes/' + period);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllVolumesDay$(): Observable<MarketVolume[]> {
|
||||||
|
return this.httpClient.get<MarketVolume[]>(API_BASE_URL + '/markets/volumes?interval=week');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
<ng-template [ngIf]="!isLoading && !error">
|
<ng-template [ngIf]="!isLoading && !error">
|
||||||
|
|
||||||
<div class="box">
|
<div class="box block-container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
<td>
|
<td>
|
||||||
{{ block.time | date:'yyyy-MM-dd HH:mm' }}
|
{{ block.time | date:'yyyy-MM-dd HH:mm' }}
|
||||||
<div class="lg-inline">
|
<div class="lg-inline">
|
||||||
<i>(<app-time-since [time]="block.time / 1000" [fastRender]="true"></app-time-since>)</i>
|
<i class="symbol">(<app-time-since [time]="block.time / 1000" [fastRender]="true"></app-time-since>)</i>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<ng-template [ngIf]="isLoading && !error">
|
<ng-template [ngIf]="isLoading && !error">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,10 +1,44 @@
|
|||||||
|
|
||||||
.td-width {
|
.td-width {
|
||||||
width: 175px;
|
width: 140px;
|
||||||
}
|
@media (min-width: 768px) {
|
||||||
|
width: 175px;
|
||||||
@media (max-width: 767.98px) {
|
|
||||||
.td-width {
|
|
||||||
width: 140px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.row{
|
||||||
|
flex-direction: column;
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.block-container {
|
||||||
|
.table {
|
||||||
|
tr td {
|
||||||
|
&:last-child {
|
||||||
|
text-align: right;
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fiat {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import { switchMap, catchError } from 'rxjs/operators';
|
|||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
import { ElectrsApiService } from 'src/app/services/electrs-api.service';
|
import { ElectrsApiService } from 'src/app/services/electrs-api.service';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-block',
|
selector: 'app-bisq-block',
|
||||||
@@ -23,6 +24,7 @@ export class BisqBlockComponent implements OnInit, OnDestroy {
|
|||||||
error: HttpErrorResponse | null;
|
error: HttpErrorResponse | null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
private bisqApiService: BisqApiService,
|
private bisqApiService: BisqApiService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
@@ -32,6 +34,8 @@ export class BisqBlockComponent implements OnInit, OnDestroy {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
this.subscription = this.route.paramMap
|
this.subscription = this.route.paramMap
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap((params: ParamMap) => {
|
switchMap((params: ParamMap) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<h1 style="float: left;" i18n="Bisq blocks header">Blocks</h1>
|
<h1 style="float: left;" i18n="Bisq blocks header">BSQ Blocks</h1>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<tr *ngFor="let block of blocks.value[0]; trackBy: trackByFn">
|
<tr *ngFor="let block of blocks.value[0]; trackBy: trackByFn">
|
||||||
<td><a [routerLink]="['/block/' | relativeUrl, block.hash]" [state]="{ data: { block: block } }">{{ block.height }}</a></td>
|
<td><a [routerLink]="['/block/' | relativeUrl, block.hash]" [state]="{ data: { block: block } }">{{ block.height }}</a></td>
|
||||||
<td><app-time-since [time]="block.time / 1000" [fastRender]="true"></app-time-since></td>
|
<td><app-time-since [time]="block.time / 1000" [fastRender]="true"></app-time-since></td>
|
||||||
<td>{{ calculateTotalOutput(block) / 100 | number: '1.2-2' }}<span class="d-none d-md-inline"> BSQ</span></td>
|
<td>{{ calculateTotalOutput(block) / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
<td class="d-none d-md-block">{{ block.txs.length }}</td>
|
<td class="d-none d-md-block">{{ block.txs.length }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
<div class="pagination">
|
||||||
<ngb-pagination *ngIf="blocks.value" [size]="paginationSize" [collectionSize]="blocks.value[1]" [rotate]="true" [pageSize]="itemsPerPage" [(page)]="page" (pageChange)="pageChange(page)" [maxSize]="paginationMaxSize" [boundaryLinks]="true"></ngb-pagination>
|
<ngb-pagination *ngIf="blocks.value" [size]="paginationSize" [collectionSize]="blocks.value[1]" [rotate]="true" [pageSize]="itemsPerPage" [(page)]="page" (pageChange)="pageChange(page)" [maxSize]="paginationMaxSize" [boundaryLinks]="true"></ngb-pagination>
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.pagination {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
|
|||||||
import { BisqBlock, BisqOutput, BisqTransaction } from '../bisq.interfaces';
|
import { BisqBlock, BisqOutput, BisqTransaction } from '../bisq.interfaces';
|
||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-blocks',
|
selector: 'app-bisq-blocks',
|
||||||
@@ -22,9 +23,10 @@ export class BisqBlocksComponent implements OnInit {
|
|||||||
isLoading = true;
|
isLoading = true;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
paginationSize: 'sm' | 'lg' = 'md';
|
paginationSize: 'sm' | 'lg' = 'md';
|
||||||
paginationMaxSize = 10;
|
paginationMaxSize = 4;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
private bisqApiService: BisqApiService,
|
private bisqApiService: BisqApiService,
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@@ -32,6 +34,7 @@ export class BisqBlocksComponent implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
this.seoService.setTitle($localize`:@@8a7b4bd44c0ac71b2e72de0398b303257f7d2f54:Blocks`);
|
this.seoService.setTitle($localize`:@@8a7b4bd44c0ac71b2e72de0398b303257f7d2f54:Blocks`);
|
||||||
this.itemsPerPage = Math.max(Math.round(this.contentSpace / this.fiveItemsPxSize) * 5, 10);
|
this.itemsPerPage = Math.max(Math.round(this.contentSpace / this.fiveItemsPxSize) * 5, 10);
|
||||||
this.loadingItems = Array(this.itemsPerPage);
|
this.loadingItems = Array(this.itemsPerPage);
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
|
<h1 i18n="Bisq markets title">Bisq Trading Volume</h1>
|
||||||
|
|
||||||
|
<div id="volumeHolder">
|
||||||
|
<ng-template #loadingVolumes>
|
||||||
|
<div class="text-center loadingVolumes">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<ng-container *ngIf="volumes$ | async as volumes; else loadingVolumes">
|
||||||
|
<app-lightweight-charts-area [data]="volumes.data" [lineData]="volumes.linesData"></app-lightweight-charts-area>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<div class="container-info">
|
||||||
|
<h1>
|
||||||
|
<ng-template [ngIf]="stateService.env.OFFICIAL_BISQ_MARKETS" [ngIfElse]="nonOfficialMarkets" i18n="Bisq All Markets">Markets</ng-template>
|
||||||
|
<ng-template #nonOfficialMarkets i18n="Bisq Bitcoin Markets">Bitcoin Markets</ng-template>
|
||||||
|
</h1>
|
||||||
|
<ng-container *ngIf="{ value: (tickers$ | async) } as tickers">
|
||||||
|
<div class="table-container">
|
||||||
|
<table class="table table-borderless table-striped">
|
||||||
|
<thead>
|
||||||
|
<th><ng-container i18n>Currency</ng-container> <button [disabled]="(sort$ | async) === 'name'" class="btn btn-link btn-sm" (click)="sort('name')"><fa-icon [icon]="['fas', 'chevron-down']" [fixedWidth]="true"></fa-icon></button></th>
|
||||||
|
<th i18n>Price</th>
|
||||||
|
<th><ng-container i18n="Trading volume 7D">Volume (7d)</ng-container> <button [disabled]="(sort$ | async) === 'volumes'" class="btn btn-link btn-sm" (click)="sort('volumes')"><fa-icon [icon]="['fas', 'chevron-down']" [fixedWidth]="true"></fa-icon></button></th>
|
||||||
|
<th><ng-container i18n="Trades amount 7D">Trades (7d)</ng-container> <button [disabled]="(sort$ | async) === 'trades'" class="btn btn-link btn-sm" (click)="sort('trades')"><fa-icon [icon]="['fas', 'chevron-down']" [fixedWidth]="true"></fa-icon></button></th>
|
||||||
|
</thead>
|
||||||
|
<tbody *ngIf="tickers.value; else loadingTmpl">
|
||||||
|
<tr *ngFor="let ticker of tickers.value; trackBy: trackByFn;">
|
||||||
|
<td><a [routerLink]="['/market' | relativeUrl, ticker.pair_url]">{{ ticker.name }})</a></td>
|
||||||
|
<td>
|
||||||
|
<app-fiat *ngIf="ticker.market.rtype === 'crypto'; else fiat" [value]="ticker.last * 100000000"></app-fiat>
|
||||||
|
<ng-template #fiat>
|
||||||
|
<span class="green-color">{{ ticker.last | currency: ticker.market.rsymbol }}</span>
|
||||||
|
</ng-template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<app-fiat [value]="ticker.volume?.volume"></app-fiat>
|
||||||
|
</td>
|
||||||
|
<td>{{ ticker.volume?.num_trades ? ticker.volume?.num_trades : 0 }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<h2 i18n="Latest Trades header">Latest Trades</h2>
|
||||||
|
<app-bisq-trades [trades$]="trades$"></app-bisq-trades>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-template #loadingTmpl>
|
||||||
|
<tr *ngFor="let i of [1,2,3,4,5,6,7,8,9,10]">
|
||||||
|
<td *ngFor="let j of [1, 2, 3, 4]"><span class="skeleton-loader"></span></td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#volumeHolder {
|
||||||
|
height: 500px;
|
||||||
|
background-color: #000;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadingVolumes {
|
||||||
|
position: relative;
|
||||||
|
top: 45%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-container {
|
||||||
|
overflow: scroll;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
scrollbar-width: none;
|
||||||
|
font-size: 13px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-info{
|
||||||
|
overflow-x: scroll;
|
||||||
|
}
|
||||||
131
frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts
Normal file
131
frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||||
|
import { Observable, combineLatest, BehaviorSubject, of } from 'rxjs';
|
||||||
|
import { map, share, switchMap } from 'rxjs/operators';
|
||||||
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
|
import { StateService } from 'src/app/services/state.service';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
import { BisqApiService } from '../bisq-api.service';
|
||||||
|
import { Trade } from '../bisq.interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-bisq-dashboard',
|
||||||
|
templateUrl: './bisq-dashboard.component.html',
|
||||||
|
styleUrls: ['./bisq-dashboard.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class BisqDashboardComponent implements OnInit {
|
||||||
|
tickers$: Observable<any>;
|
||||||
|
volumes$: Observable<any>;
|
||||||
|
trades$: Observable<Trade[]>;
|
||||||
|
sort$ = new BehaviorSubject<string>('trades');
|
||||||
|
|
||||||
|
allowCryptoCoins = ['usdc', 'l-btc', 'bsq'];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
|
private bisqApiService: BisqApiService,
|
||||||
|
public stateService: StateService,
|
||||||
|
private seoService: SeoService,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.seoService.setTitle(`Markets`);
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
|
this.volumes$ = this.bisqApiService.getAllVolumesDay$()
|
||||||
|
.pipe(
|
||||||
|
map((volumes) => {
|
||||||
|
const data = volumes.map((volume) => {
|
||||||
|
return {
|
||||||
|
time: volume.period_start,
|
||||||
|
value: volume.volume,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const linesData = volumes.map((volume) => {
|
||||||
|
return {
|
||||||
|
time: volume.period_start,
|
||||||
|
value: volume.num_trades,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: data,
|
||||||
|
linesData: linesData,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const getMarkets = this.bisqApiService.getMarkets$().pipe(share());
|
||||||
|
|
||||||
|
this.tickers$ = combineLatest([
|
||||||
|
this.bisqApiService.getMarketsTicker$(),
|
||||||
|
getMarkets,
|
||||||
|
this.bisqApiService.getMarketVolumesByTime$('7d'),
|
||||||
|
])
|
||||||
|
.pipe(
|
||||||
|
map(([tickers, markets, volumes]) => {
|
||||||
|
|
||||||
|
const newTickers = [];
|
||||||
|
for (const t in tickers) {
|
||||||
|
|
||||||
|
if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) {
|
||||||
|
const pair = t.split('_');
|
||||||
|
if (pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mappedTicker: any = tickers[t];
|
||||||
|
|
||||||
|
mappedTicker.pair_url = t;
|
||||||
|
mappedTicker.pair = t.replace('_', '/').toUpperCase();
|
||||||
|
mappedTicker.market = markets[t];
|
||||||
|
mappedTicker.volume = volumes[t];
|
||||||
|
mappedTicker.name = `${mappedTicker.market.rtype === 'crypto' ? mappedTicker.market.lname : mappedTicker.market.rname} (${mappedTicker.market.rtype === 'crypto' ? mappedTicker.market.lsymbol : mappedTicker.market.rsymbol}`;
|
||||||
|
newTickers.push(mappedTicker);
|
||||||
|
}
|
||||||
|
return newTickers;
|
||||||
|
}),
|
||||||
|
switchMap((tickers) => combineLatest([this.sort$, of(tickers)])),
|
||||||
|
map(([sort, tickers]) => {
|
||||||
|
if (sort === 'trades') {
|
||||||
|
tickers.sort((a, b) => (b.volume && b.volume.num_trades || 0) - (a.volume && a.volume.num_trades || 0));
|
||||||
|
} else if (sort === 'volumes') {
|
||||||
|
tickers.sort((a, b) => (b.volume && b.volume.volume || 0) - (a.volume && a.volume.volume || 0));
|
||||||
|
} else if (sort === 'name') {
|
||||||
|
tickers.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
}
|
||||||
|
return tickers;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
this.trades$ = combineLatest([
|
||||||
|
this.bisqApiService.getMarketTrades$('all'),
|
||||||
|
getMarkets,
|
||||||
|
])
|
||||||
|
.pipe(
|
||||||
|
map(([trades, markets]) => {
|
||||||
|
if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) {
|
||||||
|
trades = trades.filter((trade) => {
|
||||||
|
const pair = trade.market.split('_');
|
||||||
|
return !(pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return trades.map((trade => {
|
||||||
|
trade._market = markets[trade.market];
|
||||||
|
return trade;
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
trackByFn(index: number) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
sort(by: string) {
|
||||||
|
this.sort$.next(by);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
<router-outlet></router-outlet>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
import { WebsocketService } from 'src/app/services/websocket.service';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-bisq-explorer',
|
|
||||||
templateUrl: './bisq-explorer.component.html',
|
|
||||||
styleUrls: ['./bisq-explorer.component.scss']
|
|
||||||
})
|
|
||||||
export class BisqExplorerComponent implements OnInit {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private websocketService: WebsocketService,
|
|
||||||
) { }
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
this.websocketService.want(['blocks']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div class="row row-cols-1 row-cols-md-2">
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title" i18n="bisq-dashboard.price-index-title">Bisq Price Index</h5>
|
||||||
|
<div class="big-fiat">
|
||||||
|
<span *ngIf="usdPrice$ | async as usdPrice; else loading">
|
||||||
|
<span [appColoredPrice]="usdPrice">{{ usdPrice | currency:'USD':'symbol':'1.2-2' }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title" i18n="bisq-dashboard.market-price-title">Bisq Market Price</h5>
|
||||||
|
<div class="big-fiat">
|
||||||
|
<span class="green-color" *ngIf="bisqMarketPrice; else loading">
|
||||||
|
<span [appColoredPrice]="bisqMarketPrice">{{ bisqMarketPrice | currency:'USD':'symbol':'1.2-2' }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row row-cols-1 row-cols-md-2">
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">US Dollar - BTC/USD</h5>
|
||||||
|
<div class="chart-container">
|
||||||
|
<ng-container *ngIf="hlocData$ | async as hlocData; else loadingSpinner">
|
||||||
|
<app-lightweight-charts [height]="300" [data]="hlocData.hloc" [volumeData]="hlocData.volume" [precision]="2"></app-lightweight-charts>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title" i18n="Bisq markets title">Bisq Trading Volume</h5>
|
||||||
|
<div class="chart-container">
|
||||||
|
<ng-container *ngIf="volumes$ | async as volumes; else loadingSpinner">
|
||||||
|
<app-lightweight-charts-area [height]="300" [data]="volumes.data" [lineData]="volumes.linesData"></app-lightweight-charts-area>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row row-cols-1 row-cols-md-2">
|
||||||
|
<ng-container *ngIf="{ value: (tickers$ | async) } as tickers">
|
||||||
|
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-center">
|
||||||
|
<ng-template [ngIf]="stateService.env.OFFICIAL_BISQ_MARKETS" [ngIfElse]="nonOfficialMarkets" i18n="Bisq All Markets">Markets</ng-template>
|
||||||
|
<ng-template #nonOfficialMarkets i18n="Bisq Bitcoin Markets">Bitcoin Markets</ng-template>
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<div class="table-container">
|
||||||
|
<table class="table table-borderless table-striped">
|
||||||
|
<thead>
|
||||||
|
<th><ng-container i18n>Currency</ng-container> <button [disabled]="(sort$ | async) === 'name'" class="btn btn-link btn-sm" (click)="sort('name')"><fa-icon [icon]="['fas', 'chevron-down']" [fixedWidth]="true"></fa-icon></button></th>
|
||||||
|
<th i18n>Price</th>
|
||||||
|
<th><ng-container i18n="Trades amount 7D">Trades (7d)</ng-container> <button [disabled]="(sort$ | async) === 'trades'" class="btn btn-link btn-sm" (click)="sort('trades')"><fa-icon [icon]="['fas', 'chevron-down']" [fixedWidth]="true"></fa-icon></button></th>
|
||||||
|
</thead>
|
||||||
|
<tbody *ngIf="tickers.value; else loadingTmpl">
|
||||||
|
<tr *ngFor="let ticker of tickers.value; trackBy: trackByFn;">
|
||||||
|
<td><a [routerLink]="['/market' | relativeUrl, ticker.pair_url]">{{ ticker.name }})</a></td>
|
||||||
|
<td>
|
||||||
|
<app-fiat *ngIf="ticker.market.rtype === 'crypto'; else fiat" [value]="ticker.last * 100000000"></app-fiat>
|
||||||
|
<ng-template #fiat>
|
||||||
|
<span class="green-color">{{ ticker.last | currency: ticker.market.rsymbol }}</span>
|
||||||
|
</ng-template>
|
||||||
|
</td>
|
||||||
|
<td>{{ ticker.volume?.num_trades ? ticker.volume?.num_trades : 0 }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center"><a href="" [routerLink]="['/markets' | relativeUrl]" i18n="dashboard.view-all">View all »</a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-center" i18n="Latest Trades header">Latest Trades</h5>
|
||||||
|
<app-bisq-trades [trades$]="trades$" view="small"></app-bisq-trades>
|
||||||
|
<div class="text-center"><a href="" [routerLink]="['/markets' | relativeUrl]" i18n="dashboard.view-all">View all »</a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<app-language-selector *ngIf="!stateService.env.OFFICIAL_BISQ_MARKETS"></app-language-selector>
|
||||||
|
|
||||||
|
<div class="text-small text-center mt-3">
|
||||||
|
<a [routerLink]="['/terms-of-service']" i18n="shared.terms-of-service|Terms of Service">Terms of Service</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-template #loadingTmpl>
|
||||||
|
<tr *ngFor="let i of [1,2,3,4,5,6,7,8,9,10]">
|
||||||
|
<td *ngFor="let j of [1, 2, 3]"><span class="skeleton-loader"></span></td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #loadingSpinner>
|
||||||
|
<div class="text-center loadingGraphs">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #loading>
|
||||||
|
<div class="skeleton-loader shorter"></div>
|
||||||
|
</ng-template>
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
#volumeHolder {
|
||||||
|
height: 500px;
|
||||||
|
background-color: #000;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadingGraphs {
|
||||||
|
position: relative;
|
||||||
|
top: 45%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-container {
|
||||||
|
font-size: 13px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-container {
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.big-fiat {
|
||||||
|
color: #3bcc49;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background-color: #1d1f31;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
color: #4a68b9;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-block {
|
||||||
|
float: left;
|
||||||
|
width: 350px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
display: inline-flex;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #2d3348;
|
||||||
|
height: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-warning {
|
||||||
|
background-color: #b58800 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-loader {
|
||||||
|
max-width: 100%;
|
||||||
|
&.shorter {
|
||||||
|
max-width: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-padding {
|
||||||
|
padding: 1.25rem 2rem 1.25rem 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.graph-card {
|
||||||
|
height: 100%;
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
height: 385px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||||
|
import { Observable, combineLatest, BehaviorSubject, of } from 'rxjs';
|
||||||
|
import { map, share, switchMap } from 'rxjs/operators';
|
||||||
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
|
import { StateService } from 'src/app/services/state.service';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
import { BisqApiService } from '../bisq-api.service';
|
||||||
|
import { Trade } from '../bisq.interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-main-bisq-dashboard',
|
||||||
|
templateUrl: './bisq-main-dashboard.component.html',
|
||||||
|
styleUrls: ['./bisq-main-dashboard.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class BisqMainDashboardComponent implements OnInit {
|
||||||
|
tickers$: Observable<any>;
|
||||||
|
volumes$: Observable<any>;
|
||||||
|
trades$: Observable<Trade[]>;
|
||||||
|
sort$ = new BehaviorSubject<string>('trades');
|
||||||
|
hlocData$: Observable<any>;
|
||||||
|
usdPrice$: Observable<number>;
|
||||||
|
isLoadingGraph = true;
|
||||||
|
bisqMarketPrice = 0;
|
||||||
|
|
||||||
|
allowCryptoCoins = ['usdc', 'l-btc', 'bsq'];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
|
private bisqApiService: BisqApiService,
|
||||||
|
public stateService: StateService,
|
||||||
|
private seoService: SeoService,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.seoService.setTitle(`Markets`);
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
|
this.usdPrice$ = this.stateService.conversions$.asObservable().pipe(
|
||||||
|
map((conversions) => conversions.USD)
|
||||||
|
);
|
||||||
|
|
||||||
|
this.volumes$ = this.bisqApiService.getAllVolumesDay$()
|
||||||
|
.pipe(
|
||||||
|
map((volumes) => {
|
||||||
|
const data = volumes.map((volume) => {
|
||||||
|
return {
|
||||||
|
time: volume.period_start,
|
||||||
|
value: volume.volume,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const linesData = volumes.map((volume) => {
|
||||||
|
return {
|
||||||
|
time: volume.period_start,
|
||||||
|
value: volume.num_trades,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: data,
|
||||||
|
linesData: linesData,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const getMarkets = this.bisqApiService.getMarkets$().pipe(share());
|
||||||
|
|
||||||
|
this.tickers$ = combineLatest([
|
||||||
|
this.bisqApiService.getMarketsTicker$(),
|
||||||
|
getMarkets,
|
||||||
|
this.bisqApiService.getMarketVolumesByTime$('7d'),
|
||||||
|
])
|
||||||
|
.pipe(
|
||||||
|
map(([tickers, markets, volumes]) => {
|
||||||
|
|
||||||
|
const newTickers = [];
|
||||||
|
for (const t in tickers) {
|
||||||
|
|
||||||
|
if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) {
|
||||||
|
const pair = t.split('_');
|
||||||
|
if (pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mappedTicker: any = tickers[t];
|
||||||
|
|
||||||
|
mappedTicker.pair_url = t;
|
||||||
|
mappedTicker.pair = t.replace('_', '/').toUpperCase();
|
||||||
|
mappedTicker.market = markets[t];
|
||||||
|
mappedTicker.volume = volumes[t];
|
||||||
|
mappedTicker.name = `${mappedTicker.market.rtype === 'crypto' ? mappedTicker.market.lname : mappedTicker.market.rname} (${mappedTicker.market.rtype === 'crypto' ? mappedTicker.market.lsymbol : mappedTicker.market.rsymbol}`;
|
||||||
|
newTickers.push(mappedTicker);
|
||||||
|
}
|
||||||
|
return newTickers;
|
||||||
|
}),
|
||||||
|
switchMap((tickers) => combineLatest([this.sort$, of(tickers)])),
|
||||||
|
map(([sort, tickers]) => {
|
||||||
|
if (sort === 'trades') {
|
||||||
|
tickers.sort((a, b) => (b.volume && b.volume.num_trades || 0) - (a.volume && a.volume.num_trades || 0));
|
||||||
|
} else if (sort === 'volumes') {
|
||||||
|
tickers.sort((a, b) => (b.volume && b.volume.volume || 0) - (a.volume && a.volume.volume || 0));
|
||||||
|
} else if (sort === 'name') {
|
||||||
|
tickers.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
}
|
||||||
|
return tickers.slice(0, 10);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
this.trades$ = combineLatest([
|
||||||
|
this.bisqApiService.getMarketTrades$('all'),
|
||||||
|
getMarkets,
|
||||||
|
])
|
||||||
|
.pipe(
|
||||||
|
map(([trades, markets]) => {
|
||||||
|
if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) {
|
||||||
|
trades = trades.filter((trade) => {
|
||||||
|
const pair = trade.market.split('_');
|
||||||
|
return !(pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return trades.map((trade => {
|
||||||
|
trade._market = markets[trade.market];
|
||||||
|
return trade;
|
||||||
|
})).slice(0, 10);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
this.hlocData$ = this.bisqApiService.getMarketsHloc$('btc_usd', 'day')
|
||||||
|
.pipe(
|
||||||
|
map((hlocData) => {
|
||||||
|
this.isLoadingGraph = false;
|
||||||
|
|
||||||
|
hlocData = hlocData.map((h) => {
|
||||||
|
h.time = h.period_start;
|
||||||
|
return h;
|
||||||
|
});
|
||||||
|
|
||||||
|
const hlocVolume = hlocData.map((h) => {
|
||||||
|
return {
|
||||||
|
time: h.time,
|
||||||
|
value: h.volume_right,
|
||||||
|
color: h.close > h.avg ? 'rgba(0, 41, 74, 0.7)' : 'rgba(0, 41, 74, 1)',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add whitespace
|
||||||
|
if (hlocData.length > 1) {
|
||||||
|
const newHloc = [];
|
||||||
|
newHloc.push(hlocData[0]);
|
||||||
|
|
||||||
|
const period = 86400;
|
||||||
|
let periods = 0;
|
||||||
|
const startingDate = hlocData[0].period_start;
|
||||||
|
let index = 1;
|
||||||
|
while (true) {
|
||||||
|
periods++;
|
||||||
|
if (hlocData[index].period_start > startingDate + period * periods) {
|
||||||
|
newHloc.push({
|
||||||
|
time: startingDate + period * periods,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
newHloc.push(hlocData[index]);
|
||||||
|
index++;
|
||||||
|
if (!hlocData[index]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hlocData = newHloc;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bisqMarketPrice = hlocData[hlocData.length - 1].close;
|
||||||
|
|
||||||
|
return {
|
||||||
|
hloc: hlocData,
|
||||||
|
volume: hlocVolume,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
trackByFn(index: number) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
sort(by: string) {
|
||||||
|
this.sort$.next(by);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
112
frontend/src/app/bisq/bisq-market/bisq-market.component.html
Normal file
112
frontend/src/app/bisq/bisq-market/bisq-market.component.html
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
|
<ng-container *ngIf="hlocData$ | async as hlocData; else loadingSpinner">
|
||||||
|
|
||||||
|
<ng-container *ngIf="currency$ | async as currency; else loadingSpinner">
|
||||||
|
<h1>{{ currency.market.rtype === 'crypto' ? currency.market.lname : currency.market.rname }} - {{ currency.pair }}</h1>
|
||||||
|
<div class="priceheader">
|
||||||
|
<ng-container *ngIf="currency.market.rtype === 'fiat'; else headerPriceCrypto"><span class="green-color">{{ hlocData.hloc[hlocData.hloc.length - 1].close | currency: currency.market.rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #headerPriceCrypto>{{ hlocData.hloc[hlocData.hloc.length - 1].close | number: '1.' + currency.market.rprecision + '-' + currency.market.rprecision }} {{ currency.market.rsymbol }}</ng-template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form [formGroup]="radioGroupForm" class="mb-3 radio-form">
|
||||||
|
<div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="interval">
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'half_hour'" (click)="setFragment('half_hour')"> 30M
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'hour'" (click)="setFragment('hour')"> 1H
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'half_day'" (click)="setFragment('half_day')"> 12H
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'day'" (click)="setFragment('day')"> 1D
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'week'" (click)="setFragment('week')"> 1W
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'month'" (click)="setFragment('month')"> 1M
|
||||||
|
</label>
|
||||||
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||||
|
<input ngbButton type="radio" [value]="'year'" (click)="setFragment('year')"> 1Y
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
<div id="graphHolder">
|
||||||
|
<div class="text-center loadingChart" [hidden]="!isLoadingGraph">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
<app-lightweight-charts [data]="hlocData.hloc" [volumeData]="hlocData.volume" [precision]="currency.market.rtype === 'crypto' ? currency.market.lprecision : currency.market.rprecision"></app-lightweight-charts>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<ng-container *ngIf="offers$ | async as offers; else loadingSpinner">
|
||||||
|
<div class="row row-cols-1 row-cols-md-2">
|
||||||
|
<ng-container *ngTemplateOutlet="offersList; context: { offers: offers.buys, direction: 'BUY', market: currency.market }"></ng-container>
|
||||||
|
<ng-container *ngTemplateOutlet="offersList; context: { offers: offers.sells, direction: 'SELL', market: currency.market }"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<ng-container *ngIf="trades$ | async as trades; else loadingSpinner">
|
||||||
|
<h2 i18n="Latest Trades header">Latest Trades</h2>
|
||||||
|
|
||||||
|
<app-bisq-trades [trades$]="trades$" [market]="currency.market"></app-bisq-trades>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<ng-template #offersList let-offers="offers" let-direction="direction", let-market="market">
|
||||||
|
<div class="col">
|
||||||
|
<h2>
|
||||||
|
<ng-template [ngIf]="direction === 'BUY'" [ngIfElse]="sellOffers" i18n="Bisq Buy Offers">Buy Offers</ng-template>
|
||||||
|
<ng-template #sellOffers i18n="Bisq Sell Offers">Sell Offers</ng-template>
|
||||||
|
</h2>
|
||||||
|
<div class="table-container">
|
||||||
|
<table class="table table-borderless table-striped">
|
||||||
|
<thead>
|
||||||
|
<th i18n>Price</th>
|
||||||
|
<th><ng-container *ngTemplateOutlet="amount; context: {$implicit: market.lsymbol }"></ng-container></th>
|
||||||
|
<th><ng-container *ngTemplateOutlet="amount; context: {$implicit: market.rsymbol }"></ng-container></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let offer of offers">
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="market.rtype === 'fiat'; else priceCrypto"><span class="green-color">{{ offer.price | currency: market.rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #priceCrypto>{{ offer.price | number: '1.2-' + market.rprecision }} <span class="symbol">{{ market.rsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="market.ltype === 'fiat'; else amountCrypto"><span class="green-color">{{ offer.amount | currency: market.rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #amountCrypto>{{ offer.amount | number: '1.2-' + market.lprecision }} <span class="symbol">{{ market.lsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="market.rtype === 'fiat'; else volumeCrypto"><span class="green-color">{{ offer.volume | currency: market.rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #volumeCrypto>{{ offer.volume | number: '1.2-' + market.rprecision }} <span class="symbol">{{ market.rsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #loadingSpinner>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #amount let-i i18n="Trade amount (Symbol)">Amount ({{ i }})</ng-template>
|
||||||
46
frontend/src/app/bisq/bisq-market/bisq-market.component.scss
Normal file
46
frontend/src/app/bisq/bisq-market/bisq-market.component.scss
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
.priceheader {
|
||||||
|
font-size: 24px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-form {
|
||||||
|
@media(min-width: 576px){
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadingChart {
|
||||||
|
z-index: 100;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#graphHolder {
|
||||||
|
height: 550px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col {
|
||||||
|
&:last-child{
|
||||||
|
margin-top: 50px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-container {
|
||||||
|
overflow: scroll;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
scrollbar-width: none;
|
||||||
|
font-size: 13px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
158
frontend/src/app/bisq/bisq-market/bisq-market.component.ts
Normal file
158
frontend/src/app/bisq/bisq-market/bisq-market.component.ts
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { combineLatest, merge, Observable, of } from 'rxjs';
|
||||||
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
import { BisqApiService } from '../bisq-api.service';
|
||||||
|
import { OffersMarket, Trade } from '../bisq.interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-bisq-market',
|
||||||
|
templateUrl: './bisq-market.component.html',
|
||||||
|
styleUrls: ['./bisq-market.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class BisqMarketComponent implements OnInit, OnDestroy {
|
||||||
|
hlocData$: Observable<any>;
|
||||||
|
currency$: Observable<any>;
|
||||||
|
offers$: Observable<OffersMarket>;
|
||||||
|
trades$: Observable<Trade[]>;
|
||||||
|
radioGroupForm: FormGroup;
|
||||||
|
defaultInterval = 'day';
|
||||||
|
|
||||||
|
isLoadingGraph = false;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private bisqApiService: BisqApiService,
|
||||||
|
private formBuilder: FormBuilder,
|
||||||
|
private seoService: SeoService,
|
||||||
|
private router: Router,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.radioGroupForm = this.formBuilder.group({
|
||||||
|
interval: [this.defaultInterval],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (['half_hour', 'hour', 'half_day', 'day', 'week', 'month', 'year', 'auto'].indexOf(this.route.snapshot.fragment) > -1) {
|
||||||
|
this.radioGroupForm.controls.interval.setValue(this.route.snapshot.fragment, { emitEvent: false });
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currency$ = this.bisqApiService.getMarkets$()
|
||||||
|
.pipe(
|
||||||
|
switchMap((markets) => combineLatest([of(markets), this.route.paramMap])),
|
||||||
|
map(([markets, routeParams]) => {
|
||||||
|
const pair = routeParams.get('pair');
|
||||||
|
const pairUpperCase = pair.replace('_', '/').toUpperCase();
|
||||||
|
this.seoService.setTitle(`Bisq market: ${pairUpperCase}`);
|
||||||
|
|
||||||
|
return {
|
||||||
|
pair: pairUpperCase,
|
||||||
|
market: markets[pair],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
this.trades$ = this.route.paramMap
|
||||||
|
.pipe(
|
||||||
|
map(routeParams => routeParams.get('pair')),
|
||||||
|
switchMap((marketPair) => this.bisqApiService.getMarketTrades$(marketPair)),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.offers$ = this.route.paramMap
|
||||||
|
.pipe(
|
||||||
|
map(routeParams => routeParams.get('pair')),
|
||||||
|
switchMap((marketPair) => this.bisqApiService.getMarketOffers$(marketPair)),
|
||||||
|
map((offers) => offers[Object.keys(offers)[0]])
|
||||||
|
);
|
||||||
|
|
||||||
|
this.hlocData$ = combineLatest([
|
||||||
|
this.route.paramMap,
|
||||||
|
merge(this.radioGroupForm.get('interval').valueChanges, of(this.radioGroupForm.get('interval').value)),
|
||||||
|
])
|
||||||
|
.pipe(
|
||||||
|
switchMap(([routeParams, interval]) => {
|
||||||
|
this.isLoadingGraph = true;
|
||||||
|
const pair = routeParams.get('pair');
|
||||||
|
return this.bisqApiService.getMarketsHloc$(pair, interval);
|
||||||
|
}),
|
||||||
|
map((hlocData) => {
|
||||||
|
this.isLoadingGraph = false;
|
||||||
|
|
||||||
|
hlocData = hlocData.map((h) => {
|
||||||
|
h.time = h.period_start;
|
||||||
|
return h;
|
||||||
|
});
|
||||||
|
|
||||||
|
const hlocVolume = hlocData.map((h) => {
|
||||||
|
return {
|
||||||
|
time: h.time,
|
||||||
|
value: h.volume_right,
|
||||||
|
color: h.close > h.avg ? 'rgba(0, 41, 74, 0.7)' : 'rgba(0, 41, 74, 1)',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add whitespace
|
||||||
|
if (hlocData.length > 1) {
|
||||||
|
const newHloc = [];
|
||||||
|
newHloc.push(hlocData[0]);
|
||||||
|
|
||||||
|
const period = this.getUnixTimestampFromInterval(this.radioGroupForm.get('interval').value); // temp
|
||||||
|
let periods = 0;
|
||||||
|
const startingDate = hlocData[0].period_start;
|
||||||
|
let index = 1;
|
||||||
|
while (true) {
|
||||||
|
periods++;
|
||||||
|
if (hlocData[index].period_start > startingDate + period * periods) {
|
||||||
|
newHloc.push({
|
||||||
|
time: startingDate + period * periods,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
newHloc.push(hlocData[index]);
|
||||||
|
index++;
|
||||||
|
if (!hlocData[index]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hlocData = newHloc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
hloc: hlocData,
|
||||||
|
volume: hlocVolume,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
setFragment(fragment: string) {
|
||||||
|
this.router.navigate([], {
|
||||||
|
relativeTo: this.route,
|
||||||
|
queryParamsHandling: 'merge',
|
||||||
|
fragment: fragment
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.websocketService.stopTrackingBisqMarket();
|
||||||
|
}
|
||||||
|
|
||||||
|
getUnixTimestampFromInterval(interval: string): number {
|
||||||
|
switch (interval) {
|
||||||
|
case 'minute': return 60;
|
||||||
|
case 'half_hour': return 1800;
|
||||||
|
case 'hour': return 3600;
|
||||||
|
case 'half_day': return 43200;
|
||||||
|
case 'day': return 86400;
|
||||||
|
case 'week': return 604800;
|
||||||
|
case 'month': return 2592000;
|
||||||
|
case 'year': return 31579200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,20 +5,20 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-md">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody *ngIf="!isLoading; else loadingTemplate">
|
<tbody *ngIf="!isLoading; else loadingTemplate">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td-width" i18n="BSQ existing amount">Existing amount</td>
|
<td class="td-width" i18n="BSQ existing amount">Existing amount</td>
|
||||||
<td>{{ (stats.minted - stats.burnt) | number: '1.2-2' }} BSQ</td>
|
<td>{{ (stats.minted - stats.burnt) | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="BSQ minted amount">Minted amount</td>
|
<td i18n="BSQ minted amount">Minted amount</td>
|
||||||
<td>{{ stats.minted | number: '1.2-2' }} BSQ</td>
|
<td>{{ stats.minted | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="BSQ burnt amount">Burnt amount</td>
|
<td i18n="BSQ burnt amount">Burnt amount</td>
|
||||||
<td>{{ stats.burnt | number: '1.2-2' }} BSQ</td>
|
<td>{{ stats.burnt | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="BSQ addresses">Addresses</td>
|
<td i18n="BSQ addresses">Addresses</td>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<td>{{ stats.spent_txos | number }}</td>
|
<td>{{ stats.spent_txos | number }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="BSQ token price">Price</td>
|
<td i18n>Price</td>
|
||||||
<td><app-fiat [value]="price"></app-fiat></td>
|
<td><app-fiat [value]="price"></app-fiat></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm"></div>
|
<div class="col-md"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,12 @@
|
|||||||
width: 175px;
|
width: 175px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fiat {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
font-size: 14px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ import { BisqApiService } from '../bisq-api.service';
|
|||||||
import { BisqStats } from '../bisq.interfaces';
|
import { BisqStats } from '../bisq.interfaces';
|
||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
import { StateService } from 'src/app/services/state.service';
|
import { StateService } from 'src/app/services/state.service';
|
||||||
|
import { WebsocketService } from 'src/app/services/websocket.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-stats',
|
selector: 'app-bisq-stats',
|
||||||
@@ -15,12 +16,15 @@ export class BisqStatsComponent implements OnInit {
|
|||||||
price: number;
|
price: number;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private websocketService: WebsocketService,
|
||||||
private bisqApiService: BisqApiService,
|
private bisqApiService: BisqApiService,
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
this.seoService.setTitle($localize`:@@2a30a4cdb123a03facc5ab8c5b3e6d8b8dbbc3d4:BSQ statistics`);
|
this.seoService.setTitle($localize`:@@2a30a4cdb123a03facc5ab8c5b3e6d8b8dbbc3d4:BSQ statistics`);
|
||||||
this.stateService.bsqPrice$
|
this.stateService.bsqPrice$
|
||||||
.subscribe((bsqPrice) => {
|
.subscribe((bsqPrice) => {
|
||||||
|
|||||||
46
frontend/src/app/bisq/bisq-trades/bisq-trades.component.html
Normal file
46
frontend/src/app/bisq/bisq-trades/bisq-trades.component.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<div class="table-container">
|
||||||
|
<table class="table table-borderless table-striped">
|
||||||
|
<thead>
|
||||||
|
<th i18n>Date</th>
|
||||||
|
<th *ngIf="view === 'all'" i18n>Price</th>
|
||||||
|
<th><ng-container *ngTemplateOutlet="amount; context: {$implicit: 'BTC' }"></ng-container></th>
|
||||||
|
<th>
|
||||||
|
<ng-template [ngIf]="market" [ngIfElse]="noMarket"><ng-container *ngTemplateOutlet="amount; context: {$implicit: market.lsymbol === 'BTC' ? market.rsymbol : market.lsymbol }"></ng-container></ng-template>
|
||||||
|
<ng-template #noMarket i18n>Amount</ng-template>
|
||||||
|
</th>
|
||||||
|
</thead>
|
||||||
|
<tbody *ngIf="(trades$ | async) as trades; else loadingTmpl">
|
||||||
|
<tr *ngFor="let trade of trades;">
|
||||||
|
<td>
|
||||||
|
{{ trade.trade_date | date:'yyyy-MM-dd HH:mm' }}
|
||||||
|
</td>
|
||||||
|
<td *ngIf="view === 'all'">
|
||||||
|
<ng-container *ngIf="(trade._market || market).rtype === 'fiat'; else priceCrypto"><span class="green-color">{{ trade.price | currency: (trade._market || market).rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #priceCrypto>{{ trade.price | number: '1.2-' + (trade._market || market).rprecision }} <span class="symbol">{{ (trade._market || market).rsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
<ng-container *ngTemplateOutlet="(trade._market || market).rsymbol === 'BTC' ? tradeVolume : tradeAmount"></ng-container>
|
||||||
|
<ng-container *ngTemplateOutlet="(trade._market || market).rsymbol === 'BTC' ? tradeAmount : tradeVolume"></ng-container>
|
||||||
|
<ng-template #tradeAmount>
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="(trade._market || market).ltype === 'fiat'; else amountCrypto"><span class="green-color">{{ trade.amount | currency: (trade._market || market).rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #amountCrypto>{{ trade.amount | number: '1.2-' + (trade._market || market).lprecision }} <span class="symbol">{{ (trade._market || market).lsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template #tradeVolume>
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="(trade._market || market).rtype === 'fiat'; else volumeCrypto"><span class="green-color">{{ trade.volume | currency: (trade._market || market).rsymbol }}</span></ng-container>
|
||||||
|
<ng-template #volumeCrypto>{{ trade.volume | number: '1.2-' + (trade._market || market).rprecision }} <span class="symbol">{{ (trade._market || market).rsymbol }}</span></ng-template>
|
||||||
|
</td>
|
||||||
|
</ng-template>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-template #loadingTmpl>
|
||||||
|
<tr *ngFor="let i of [1,2,3,4,5,6,7,8,9,10]">
|
||||||
|
<td *ngFor="let j of loadingColumns"><span class="skeleton-loader"></span></td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #amount let-i i18n="Trade amount (Symbol)">Amount ({{ i }})</ng-template>
|
||||||
12
frontend/src/app/bisq/bisq-trades/bisq-trades.component.scss
Normal file
12
frontend/src/app/bisq/bisq-trades/bisq-trades.component.scss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.table-container {
|
||||||
|
overflow: scroll;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
scrollbar-width: none;
|
||||||
|
font-size: 13px;
|
||||||
|
@media(min-width: 576px){
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
frontend/src/app/bisq/bisq-trades/bisq-trades.component.ts
Normal file
22
frontend/src/app/bisq/bisq-trades/bisq-trades.component.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-bisq-trades',
|
||||||
|
templateUrl: './bisq-trades.component.html',
|
||||||
|
styleUrls: ['./bisq-trades.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
})
|
||||||
|
export class BisqTradesComponent implements OnChanges {
|
||||||
|
@Input() trades$: Observable<any>;
|
||||||
|
@Input() market: any;
|
||||||
|
@Input() view: 'all' | 'small' = 'all';
|
||||||
|
|
||||||
|
loadingColumns = [1, 2, 3, 4];
|
||||||
|
|
||||||
|
ngOnChanges() {
|
||||||
|
if (this.view === 'small') {
|
||||||
|
this.loadingColumns = [1, 2, 3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-md">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td-width" i18n="transaction.inputs">Inputs</td>
|
<td class="td-width" i18n="transaction.inputs">Inputs</td>
|
||||||
<td>{{ totalInput / 100 | number: '1.2-2' }} BSQ</td>
|
<td>{{ totalInput / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="transaction.outputs">Outputs</td>
|
<td i18n="transaction.outputs">Outputs</td>
|
||||||
<td>{{ totalOutput / 100 | number: '1.2-2' }} BSQ</td>
|
<td>{{ totalOutput / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="asset.issued-amount|Liquid Asset issued amount">Issued amount</td>
|
<td i18n="asset.issued-amount|Liquid Asset issued amount">Issued amount</td>
|
||||||
<td>{{ totalIssued / 100 | number: '1.2-2' }} BSQ</td>
|
<td>{{ totalIssued / 100 | number: '1.2-2' }} <span class="symbol">BSQ</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-md">
|
||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody class="mobile-even">
|
<tbody class="mobile-even">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user