Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'24 sync #19

Open
wants to merge 216 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
a200f5c
Refactor html template handling
martinboehm Mar 25, 2023
d7e548e
Get errors of fetching internal data from DB
martinboehm Mar 26, 2023
7b068e0
Add admin page for refetching internal data
martinboehm Mar 26, 2023
fabad15
Refetch failed ethereum internal data
martinboehm Mar 29, 2023
36c744b
perf: leverage binary search for managing for Ids and MultiTokenValue…
kaladinlight Apr 13, 2023
fdc2b86
prysm 4.0.0 → 4.0.2
Dehumanizer77 Apr 13, 2023
2207bfc
dash (+testnet) 18.2.2 → 19.0.0
Dehumanizer77 Apr 17, 2023
1f10bd2
Fix Ethereum backend version in configs
martinboehm Apr 21, 2023
b1c6b33
prysm 4.0.2 → 4.0.3
Dehumanizer77 Apr 24, 2023
3b19e01
eth (+testnets) 1.11.5 → 1.11.6
Dehumanizer77 Apr 24, 2023
ad50758
bsc 1.1.21 → 1.1.23, increase bsc blockbook db cache
martinboehm Apr 24, 2023
d856618
Refactor fiat rates handler
martinboehm Apr 17, 2023
a4f7f5b
Get hourly and five minutes fiat rates
martinboehm Apr 24, 2023
210ec75
Refactor fiat rates usage
martinboehm Apr 26, 2023
85112a2
Enable coingecko pro API endpoint, count coingecko requests in metrics
martinboehm Apr 26, 2023
c4fff10
Disable secondary currency if fiat rates disabled
martinboehm May 2, 2023
a77f615
Return addrTxCount for get xpub endpoint
martinboehm Apr 20, 2023
9256a13
Bump eCash node to Bitcoin ABC 0.27.3
PiRK Apr 19, 2023
d83d501
Adopt sats standard to show amounts (for Bitcoin) #924
martinboehm May 10, 2023
c8c7e08
Golomb filter of scriptPubKeys for mempool txs
martinboehm May 8, 2023
3ab5e63
Use only taproot scripts for mempool golomb filter
martinboehm May 9, 2023
4c41b41
Add getMempoolFilters websocket method
martinboehm May 9, 2023
f59a32d
Remove duplicate scripts from golomb filter
martinboehm May 10, 2023
b929ead
etc 1.12.10 → 1.12.11
Dehumanizer77 May 16, 2023
cc73e28
zec (+testnet) 5.4.2 → 5.5.1
Dehumanizer77 May 22, 2023
48dcebe
btc (+testnet) 24.0.1 → 24.1
Dehumanizer77 May 22, 2023
187ff26
btc signet+regtest + arm binaries 24.0.1 → 24.1
martinboehm May 22, 2023
cc20271
Configure larger mempool and mempool expiry for BTC backend
martinboehm May 22, 2023
38ad251
dash (+testnet) 19.0.0 → 19.1.0
Dehumanizer77 May 23, 2023
d3a3b02
prysm 4.0.3 → 4.0.5
Dehumanizer77 May 23, 2023
2f3090c
btc (+testnet) 24.1 → 25.0
Dehumanizer77 May 26, 2023
1322a91
eth (+testnets) 1.11.6 → 1.12.0
Dehumanizer77 May 26, 2023
20f44bc
zcash (+testnet) 5.5.1 → 5.6.0
Dehumanizer77 Jun 20, 2023
f1a851d
bch (+testnet) 26.0.0 → 26.1.0
Dehumanizer77 Jun 13, 2023
a4dbb54
Bump GRS to 25.0
gruve-p Jun 7, 2023
32a17b7
prysm 4.0.5 → 4.0.6
Dehumanizer77 Jun 19, 2023
e64b8ce
dash (+testnet) 19.1.0 → 19.2.0
Dehumanizer77 Jun 20, 2023
61c1e0d
Drop removed estimatefee requests from zcash integration tests
martinboehm Jun 20, 2023
fa24878
Remove ethereum ropsten configs
martinboehm Jun 20, 2023
b7f7b29
Fix port registry generation, regenerate ports table
martinboehm Jun 20, 2023
fc52acb
Update README
martinboehm Jun 20, 2023
c30d2f7
zcash (+testnet) 5.6.0 → 5.6.1
Dehumanizer77 Jun 26, 2023
9f0286c
Add Polygon (#872)
kaladinlight Jul 1, 2023
d1ffa7b
Fix internal data processing for Polygon
martinboehm Jul 1, 2023
fcd88b3
Tune up generation of the port registry
martinboehm Jul 2, 2023
083285f
PIVX (+testnet) 4.0.0 → 5.5.0 (#945)
miguilimzero Jul 7, 2023
6b022bb
Fix PIVX parser after update v5.0 (#946)
miguilimzero Jul 7, 2023
65cd73d
Add gcc into shell.nix
grdddj Jul 13, 2023
a139dd5
Fix typos/grammar in docs
grdddj Jul 13, 2023
04fa1df
etc 1.12.11 → 1.12.13
Dehumanizer77 Jul 10, 2023
11ed72b
prysm 4.0.6 → 4.0.7
Dehumanizer77 Jul 18, 2023
4f7d8f0
polygon bor prysm 0.3.9 → 0.4.0
martinboehm Jul 21, 2023
6e51bde
Fix bulk import of ethereum internal data
martinboehm Aug 1, 2023
915f492
dash (+testnet) 19.2.0 → 19.3.0
Dehumanizer77 Aug 1, 2023
95ee9b5
Change symbol for Sepolia
AdamSchinzel Aug 7, 2023
85e5b22
Fix missing postinst script for PIVX
XK4MiLX Sep 3, 2023
c902332
prysm 4.0.7 → 4.0.8
Dehumanizer77 Sep 6, 2023
b91b36e
Remove Ropsten
AdamSchinzel Sep 19, 2023
d8c3253
Remove test data for Ropsten
AdamSchinzel Sep 19, 2023
c314a64
etc 1.12.13 → 1.12.14
Dehumanizer77 Sep 25, 2023
682b62f
Update README
AdamSchinzel Sep 19, 2023
52f86d2
Update README
AdamSchinzel Sep 25, 2023
9c5ae95
zec (+testnet) 5.6.1 → 5.7.0
Dehumanizer77 Oct 12, 2023
5f53f3b
btc (+testnet) 25.0 → 25.1
fanquake Oct 23, 2023
6ccfa19
update flux to v6.2.0
TheTrunk Oct 22, 2023
137d6b2
Bump polygon bor to 1.0.6, heimdall to 1.0.2
martinboehm Oct 16, 2023
059c60d
Use Erigon for Ethereum Goerli backend
martinboehm Jul 23, 2023
1c71a69
Use Erigon for Ethereum mainnet archive backend
martinboehm Aug 20, 2023
3d93da0
Bump erigon to v2.53.2
martinboehm Oct 29, 2023
61eeeed
non-archive ethereum bump to erigon 2.53.2
Dehumanizer77 Nov 6, 2023
bc8ce22
prysm 4.0.8 → 4.1.1
Dehumanizer77 Nov 6, 2023
911454f
Implement Golomb block filters for each block
grdddj Aug 10, 2023
96dbc8c
Add configuration for block golomb filters
martinboehm Aug 13, 2023
83d411b
Use golomb config in block sync, refactor
martinboehm Aug 14, 2023
4b6f196
Enable websocket per message compression
martinboehm Aug 21, 2023
a1a17b4
Add getBlockFiltersBatch websocket method
martinboehm Aug 22, 2023
7d0c424
Ignore Ordinals in Golomb filters (#967)
grdddj Sep 1, 2023
8ef09d1
Fix tests
martinboehm Sep 1, 2023
80afffa
Set block and mempool filter params for bitcoin and testnet
martinboehm Sep 5, 2023
78f0be0
Set block and mempool filter params for regtest
martinboehm Sep 12, 2023
3b0e108
Add tests for Ordinals filtering in block Golomb filters
grdddj Sep 18, 2023
35dec9e
Add tests for Ordinals filtering in mempool Golomb filters
grdddj Sep 18, 2023
856c85e
Add public interface block filter tests
martinboehm Sep 25, 2023
56ba302
vtc (+testnet) 22.1 -> 23.2
vertiond Oct 2, 2023
9c04322
etc 1.12.14 → 1.12.15
Dehumanizer77 Nov 6, 2023
8d4dd5d
Use Erigon for Ethereum Sepolia archive backend (#986)
AdamSchinzel Nov 8, 2023
a5bbb7d
Fix ethereum config files
martinboehm Nov 12, 2023
a2ab9da
Add Holesky (#977)
AdamSchinzel Nov 12, 2023
8646c99
Fix holesky shortcut
AdamSchinzel Nov 14, 2023
8fa0612
Polygon Heimdall bump to 1.0.3
martinboehm Nov 15, 2023
b9fee43
dash(+testnet): 19.3.0→20.0.1
marek-liska Nov 21, 2023
2eebd7a
Bump erigon to 2.54.0
martinboehm Nov 21, 2023
6992be6
Fix linting errors
martinboehm Nov 21, 2023
08389b5
Bump polygon bor to v1.1.0
martinboehm Nov 24, 2023
3c29b07
Disconnect ws connections exceeding limit of requests
martinboehm Nov 19, 2023
f4d06ab
Load bootstrap css and js from local server
martinboehm Dec 3, 2023
e67bb31
update flux to v7.0.0
TheTrunk Dec 3, 2023
22de7e5
update firo binary 0.14.13
XK4MiLX Nov 28, 2023
f4b340f
bump Qtum 24.1
icodeface Sep 13, 2023
0c95abe
eth(+testnets) 2.54.0 → 2.55.1
Dehumanizer77 Dec 6, 2023
8c2a59a
perf: add contract info cache for spam token/nft transactions (#994)
kaladinlight Dec 8, 2023
3d1a3ff
etc 1.12.15 → 1.12.17
Dehumanizer77 Dec 8, 2023
f28a747
Upgrade go-ethereum dependency to v1.13.5
martinboehm Dec 2, 2023
61bdb8a
Fix internal admin styles
martinboehm Dec 8, 2023
474d41c
Bump Polygon Bor to v1.2.0
martinboehm Dec 10, 2023
05737ec
Set mempoolfullrbf=1 for Bitcoin
martinboehm Dec 11, 2023
33b885d
Groestlcoin: Bump to 26.0
gruve-p Dec 13, 2023
6a1c8ad
Viacoin 0.16.3 binary upgrade
romanornr Dec 9, 2023
a24afcb
dash (+testnet) 20.0.1 → 20.0.2
Dehumanizer77 Dec 17, 2023
f6edc06
btc (+testnet) 25.1 → 26.0
Dehumanizer77 Dec 17, 2023
e7ee4a9
Refactor in initialization NewCoinGeckoDownloader
romanornr Dec 18, 2023
e464e16
Stop notifications of duplicate insertions into ethereum type mempool
martinboehm Dec 20, 2023
24e08ec
Add a custom node for Bitcoin
martinboehm Dec 26, 2023
ca41c4a
ethereum (+testnets) 2.55.1 → 2.56.0
Dehumanizer77 Jan 6, 2024
7d2a4ef
firo 0.14.13.0 -> 0.14.13.1
justanwar Dec 24, 2023
aa13c06
dash (+testnet) 20.0.2 → 20.0.3
Dehumanizer77 Jan 2, 2024
c1c44b1
PIVX: fix postinst_script_template (#1016)
XK4MiLX Jan 6, 2024
c2b2f10
Ethereum: fix ws.port after upgrade to Erigon 2.56.0
martinboehm Jan 7, 2024
12de050
zcash (+testnet) 5.7.0 → 5.8.0
Dehumanizer77 Jan 8, 2024
9ea7fb2
etc 1.12.17 → 1.12.18
Dehumanizer77 Jan 10, 2024
23314e5
Update typescriptify library and typescript types
martinboehm Jan 14, 2024
bfc3c71
dash (+testnet) 20.0.3 → 20.0.4
Dehumanizer77 Jan 16, 2024
536a470
ethereum (+testnets) 2.56.0 → 2.56.2
Dehumanizer77 Jan 17, 2024
a8fbfd2
prysm 4.1.1 → 4.2.0
Dehumanizer77 Jan 17, 2024
b10b790
eth (+testnets) 2.56.2 → 2.57.0
Dehumanizer77 Jan 22, 2024
c43bcb2
Get current fiat rates: disable reading from DB for tokens without cu…
martinboehm Jan 22, 2024
3e1f456
Bump Polygon Bor to v1.2.3
martinboehm Jan 28, 2024
c2cb648
Use Erigon for Goerli and Holesky non archive backends
martinboehm Jan 29, 2024
f03c625
eth (+testnets) 2.57.0 → 2.57.2
Dehumanizer77 Jan 29, 2024
ac46385
Add support of staking pools
martinboehm Jan 19, 2024
1d95413
Staking pools - remove unused pendingRestakedReward
martinboehm Jan 31, 2024
55860c0
prysm 4.2.0 → 4.2.1
Dehumanizer77 Feb 6, 2024
11ad814
Disable CI deploy of Goerli on config change
martinboehm Feb 11, 2024
0ed95dc
Upgrade go-ethereum dependency to v1.13.12
martinboehm Feb 10, 2024
5f47f3c
Add mempool.space alternative blockchain fees provider
martinboehm Feb 4, 2024
4e3ba20
eth (+testnets) 2.57.2 → 2.58.0
Dehumanizer77 Feb 19, 2024
a13feac
Update ethereum_testnet_goerli_consensus.json
AlexanderPavlenko Feb 19, 2024
8d78397
Update ethereum_testnet_holesky_consensus.json
martinboehm Feb 19, 2024
8780151
Update type for `gasPrice`
AdamSchinzel Feb 21, 2024
b4249ab
update daemon to v7.1.0
XK4MiLX Feb 6, 2024
8802a73
eth (+testnets) 2.58.0 → 2.58.1
Dehumanizer77 Feb 26, 2024
da34069
prysm 4.2.1 → 5.0.0
Dehumanizer77 Feb 26, 2024
ca3a023
Fix xpub addresses path for non standard descriptors
martinboehm Mar 5, 2024
f05159a
dogecoin (+testnet) 1.14.6 → 1.14.7
Dehumanizer77 Mar 7, 2024
4d60edc
dash (+testnet) 20.0.4 → 20.1.0
Dehumanizer77 Mar 7, 2024
913c0e5
Bump Polygon Bor to v1.2.7, Heimdall to v1.0.4
martinboehm Mar 10, 2024
2c84ed4
Handle Coingecko Throttled error
martinboehm Feb 21, 2024
d8cd7b4
Update histogram buckets for websocket metrics
martinboehm Feb 22, 2024
847c40a
Disable get balance history for contract addresses
martinboehm Feb 22, 2024
5256132
PIVX (+testnet) 5.5.0 → 5.6.1 (#1046)
miguilimzero Mar 11, 2024
60fb37d
prysm 5.0.0 → 5.0.1
Dehumanizer77 Mar 11, 2024
1df02d9
eth (+testnets) 2.58.1 → 2.58.2
Dehumanizer77 Mar 11, 2024
9a2fe4d
Increase file limit for backend services
martinboehm Mar 13, 2024
b5cfbdf
Adjust mempool.space fee mappings
martinboehm Mar 15, 2024
3c57a0c
Remove Goerli
Mar 22, 2024
e9a0858
eth (+testnets) 2.58.2 → 2.59.1
Dehumanizer77 Mar 28, 2024
0277c2a
litecoin (+testnet) 0.21.2.2 → 0.21.3
Dehumanizer77 Apr 1, 2024
ab5235b
prysm 5.0.1 → 5.0.2
Dehumanizer77 Apr 3, 2024
7541699
polygon-bor 1.2.7 → 1.2.8
Dehumanizer77 Apr 9, 2024
9b5c79c
polygon-heimdall 1.0.4 → 1.0.5
Dehumanizer77 Apr 9, 2024
1b47447
Workaround of InitializeMempool issue in Holesky
martinboehm Apr 7, 2024
87652aa
dash (+testnet) 20.1.0 → 20.1.1
Dehumanizer77 Apr 10, 2024
beaadf1
Update dash GPG signing key
Dehumanizer77 Apr 10, 2024
b5bbf8c
zec (+testnet) 5.8.0 → 5.9.0
Dehumanizer77 Apr 22, 2024
b0bec47
btc (+testnet) 26.0 → 27.0
Dehumanizer77 Apr 22, 2024
c16143f
Groestlcoin: Bump to 27.0
gruve-p Apr 23, 2024
067a2da
polygon-bor 1.2.8 → 1.3.1
Dehumanizer77 May 1, 2024
f5cb71d
bch (+testnet) 26.1.0 → 27.0.0
Dehumanizer77 May 6, 2024
0d418de
polygon-bor 1.3.1 → 1.3.2
Dehumanizer77 May 13, 2024
21780d4
Bump Ravencoin backend to 4.6.1.0
Scotty0448 May 7, 2024
c0dbeee
Update typescript API types
martinboehm May 13, 2024
eaf8f48
Decrease fiat rates download period to 60s for BTC
martinboehm May 7, 2024
2751a9b
zcash (+testnet) 5.9.0 → 5.9.1
Dehumanizer77 May 28, 2024
35ab7a3
Set unlimited size of ETH RPC message
martinboehm Jun 4, 2024
78b4ec1
Increase polygon bor maxpeers and add bootnodes
martinboehm Jun 8, 2024
d20379a
backend mandatory update 0.14.13.3
XK4MiLX Jun 19, 2024
6a7c4e9
btc (+testnet) 27.0 → 27.1
Dehumanizer77 Jun 18, 2024
8ac418b
Use coin specific coingecko api key
martinboehm Jun 25, 2024
8d22752
prysm 5.0.2 → 5.0.4
Dehumanizer77 Jul 1, 2024
6f170e0
Delay loading 5minute and hourly tickers to avoid unnecessary calls t…
martinboehm Jun 7, 2024
f0dd0e8
add optimism support
kaladinlight Mar 22, 2023
d814aba
use eth.OpenRPC
kaladinlight Jun 12, 2024
2e3ac06
update op-node config
kaladinlight Jun 12, 2024
80f0572
run op_node from backend for local file store
kaladinlight Jun 18, 2024
3ce286f
pull out exec command into script and add path flags
kaladinlight Jun 25, 2024
7e5be48
move go build into extract command
kaladinlight Jun 26, 2024
4b9a0a9
extract snapshot url from metadata html
kaladinlight Jul 1, 2024
0afcb3a
bch (+testnet) 27.0.0 → 27.1.0
Dehumanizer77 Jul 16, 2024
f6899a7
eth (+testnets) 2.59.3 → 2.60.5
Dehumanizer77 Jul 29, 2024
c1f2e62
Show Nonce for ethereum type transactions in explorer
martinboehm Jul 11, 2024
a0960c8
Add network parameter to getInfo ws request
martinboehm Aug 6, 2024
424055d
polygon-bor 1.3.2 → 1.3.7
Dehumanizer77 Aug 12, 2024
3cb815b
prysm 5.0.4 → 5.1.0
Dehumanizer77 Aug 27, 2024
345ea17
zcash 5.9.1 → 5.10.0
Dehumanizer77 Aug 30, 2024
a143497
polygon-bor 1.3.7 → 1.4.0
Dehumanizer77 Sep 24, 2024
3cf7e6a
Add ethCall websocket request
martinboehm Sep 6, 2024
996fa2d
polygon-bor 1.4.0 → 1.4.1
Dehumanizer77 Sep 25, 2024
a93a011
eth (+testnets) 2.60.5 → 2.60.8
Dehumanizer77 Sep 25, 2024
a2aa489
chore: add .editorconfig and style api.md
grdddj Sep 10, 2024
1c70a26
chore: update and enrich API docs
grdddj Sep 24, 2024
059086c
zec (+testnet) 5.10.0 → 6.0.0
Dehumanizer77 Oct 9, 2024
76664cd
Refactor ethCall method to rpcCall
martinboehm Oct 9, 2024
0cc953f
btc (+testnet) 27.1 -> 28.0
martinboehm Oct 11, 2024
d8c68f2
Add Bitcoin Testnet4
martinboehm Oct 9, 2024
c3cd444
polygon-heimdall 1.0.5 → 1.0.10
Dehumanizer77 Oct 15, 2024
572d7e5
Update Firo daemon 0.14.14.0 (mandatory)
XK4MiLX Sep 17, 2024
fe676b3
prysm 5.1.0 → 5.1.2
Dehumanizer77 Oct 21, 2024
f373a73
add tests for bitcoin testnet4
wakiyamap Sep 6, 2024
132bd77
ltc (+testnet) 0.21.3 → 0.21.4
Dehumanizer77 Nov 12, 2024
afe4749
eth (+testnets) 2.60.8 → 2.60.10
Dehumanizer77 Nov 12, 2024
d6aaa09
Add Arbitrum One and Arbitrum Nova Support (#1112)
kaladinlight Nov 25, 2024
04a5d8d
chore: add make style target for gofmt formatting
grdddj Oct 15, 2024
66b4ddb
chore: apply make style gofmt formatting
grdddj Oct 15, 2024
4ba04f1
Groestlcoin: Bump to 28.0 (#1139)
gruve-p Nov 25, 2024
6eb3ba2
bump Qtum 27.1
icodeface Nov 4, 2024
1fe4ee0
Migration from MATIC to POL
martinboehm Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false
max_line_length = 80
insert_final_newline = true
charset = utf-8
end_of_line = lf
13 changes: 1 addition & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,4 @@ backend-deploy-and-test-zcash_testnet:
- configs/coins/zcash_testnet.json
tags:
- blockbook
script: ./contrib/scripts/backend-deploy-and-test.sh zcash_testnet zcash-testnet zcash=test testnet3/debug.log

backend-deploy-and-test-goerli-archive:
stage: backend-deploy-and-test
only:
refs:
- master
changes:
- configs/coins/ethereum_testnet_goerli_archive.json
tags:
- blockbook
script: ./contrib/scripts/backend-deploy-and-test.sh ethereum_testnet_goerli_archive ethereum-testnet-goerli-archive ethereum=test ethereum_testnet_goerli_archive.log
script: ./contrib/scripts/backend-deploy-and-test.sh zcash_testnet zcash-testnet zcash=test testnet3/debug.log
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
BIN_IMAGE = blockbook-build
DEB_IMAGE = blockbook-build-deb
PACKAGER = $(shell id -u):$(shell id -g)
DOCKER_VERSION = $(shell docker version --format '{{.Client.Version}}')
BASE_IMAGE = $$(awk -F= '$$1=="ID" { print $$2 ;}' /etc/os-release):$$(awk -F= '$$1=="VERSION_ID" { print $$2 ;}' /etc/os-release | tr -d '"')
NO_CACHE = false
TCMALLOC =
TCMALLOC =
PORTABLE = 0
ARGS ?=

Expand All @@ -27,7 +28,7 @@ test-all: .bin-image
docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" --network="host" $(BIN_IMAGE) make test-all ARGS="$(ARGS)"

deb-backend-%: .deb-image
docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh backend $* $(ARGS)
docker run -t --rm -e PACKAGER=$(PACKAGER) -v /var/run/docker.sock:/var/run/docker.sock -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh backend $* $(ARGS)

deb-blockbook-%: .deb-image
docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh blockbook $* $(ARGS)
Expand Down Expand Up @@ -55,7 +56,7 @@ build-images: clean-images
.deb-image: .bin-image
@if [ $$(build/tools/image_status.sh $(DEB_IMAGE):latest build/docker) != "ok" ]; then \
echo "Building image $(DEB_IMAGE)..."; \
docker build --no-cache=$(NO_CACHE) -t $(DEB_IMAGE) build/docker/deb; \
docker build --no-cache=$(NO_CACHE) --build-arg DOCKER_VERSION=$(DOCKER_VERSION) -t $(DEB_IMAGE) build/docker/deb; \
else \
echo "Image $(DEB_IMAGE) is up to date"; \
fi
Expand All @@ -79,3 +80,6 @@ clean-bin-image:

clean-deb-image:
- docker rmi $(DEB_IMAGE)

style:
find . -name "*.go" -exec gofmt -w {} \;
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# Blockbook

**Blockbook** is back-end service for Trezor wallet. Main features of **Blockbook** are:
**Blockbook** is a back-end service for Trezor Suite. The main features of **Blockbook** are:

- index of addresses and address balances of the connected block chain
- fast index search
- simple blockchain explorer
- websocket, API and legacy Bitcore Insight compatible socket.io interfaces
- support of multiple coins (Bitcoin and Ethereum type) with easy extensibility to other coins
- scripts for easy creation of debian packages for backend and blockbook
- index of addresses and address balances of the connected block chain
- fast index search
- simple blockchain explorer
- websocket, API and legacy Bitcore Insight compatible socket.io interfaces
- support of multiple coins (Bitcoin and Ethereum type) with easy extensibility to other coins
- scripts for easy creation of debian packages for backend and blockbook

## Build and installation instructions

Expand All @@ -19,42 +19,43 @@ Memory and disk requirements for initial synchronization of **Bitcoin mainnet**
Other coins should have lower requirements, depending on the size of their block chain. Note that fast SSD disks are highly
recommended.

User installation guide is [here](https://wiki.trezor.io/User_manual:Running_a_local_instance_of_Trezor_Wallet_backend_(Blockbook)).
User installation guide is [here](<https://wiki.trezor.io/User_manual:Running_a_local_instance_of_Trezor_Wallet_backend_(Blockbook)>).

Developer build guide is [here](/docs/build.md).

Contribution guide is [here](CONTRIBUTING.md).

## Implemented coins

Blockbook currently supports over 30 coins. The Trezor team implemented
Blockbook currently supports over 30 coins. The Trezor team implemented

- Bitcoin, Bitcoin Cash, Zcash, Dash, Litecoin, Bitcoin Gold, Ethereum, Ethereum Classic, Dogecoin, Namecoin, Vertcoin, DigiByte, Liquid
- Bitcoin, Bitcoin Cash, Zcash, Dash, Litecoin, Bitcoin Gold, Ethereum, Ethereum Classic, Dogecoin, Namecoin, Vertcoin, DigiByte, Liquid

the rest of coins were implemented by the community.

Testnets for some coins are also supported, for example:
- Bitcoin Testnet, Bitcoin Cash Testnet, ZCash Testnet, Ethereum Testnet Ropsten

- Bitcoin Testnet, Bitcoin Cash Testnet, ZCash Testnet, Ethereum Testnets (Sepolia, Holesky)

List of all implemented coins is in [the registry of ports](/docs/ports.md).

## Common issues when running Blockbook or implementing additional coins

#### Out of memory when doing initial synchronization

How to reduce memory footprint of the initial sync:
How to reduce memory footprint of the initial sync:

- disable rocksdb cache by parameter `-dbcache=0`, the default size is 500MB
- run blockbook with parameter `-workers=1`. This disables bulk import mode, which caches a lot of data in memory (not in rocksdb cache). It will run about twice as slowly but especially for smaller blockchains it is no problem at all.
- disable rocksdb cache by parameter `-dbcache=0`, the default size is 500MB
- run blockbook with parameter `-workers=1`. This disables bulk import mode, which caches a lot of data in memory (not in rocksdb cache). It will run about twice as slowly but especially for smaller blockchains it is no problem at all.

Please add your experience to this [issue](https://github.com/trezor/blockbook/issues/43).

#### Error `internalState: database is in inconsistent state and cannot be used`

Blockbook was killed during the initial import, most commonly by OOM killer.
By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all data immediately to the database. If Blockbook is killed during this phase, the database is left in an inconsistent state.
Blockbook was killed during the initial import, most commonly by OOM killer.
By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all data immediately to the database. If Blockbook is killed during this phase, the database is left in an inconsistent state.

See above how to reduce the memory footprint, delete the database files and run the import again.
See above how to reduce the memory footprint, delete the database files and run the import again.

Check [this](https://github.com/trezor/blockbook/issues/89) or [this](https://github.com/trezor/blockbook/issues/147) issue for more info.

Expand All @@ -73,3 +74,7 @@ Blockbook stores data the key-value store RocksDB. Database format is described
## API

Blockbook API is described [here](/docs/api.md).

## Environment variables

List of environment variables that affect Blockbook's behavior is [here](/docs/env.md).
92 changes: 92 additions & 0 deletions api/ethereumtype.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package api

import (
"sync"

"github.com/golang/glog"
"github.com/linxGnu/grocksdb"
"github.com/trezor/blockbook/bchain"
"github.com/trezor/blockbook/db"
)

// refetch internal data
var refetchingInternalData = false
var refetchInternalDataMux sync.Mutex

func (w *Worker) IsRefetchingInternalData() bool {
refetchInternalDataMux.Lock()
defer refetchInternalDataMux.Unlock()
return refetchingInternalData
}

func (w *Worker) RefetchInternalData() error {
refetchInternalDataMux.Lock()
defer refetchInternalDataMux.Unlock()
if !refetchingInternalData {
refetchingInternalData = true
go w.RefetchInternalDataRoutine()
}
return nil
}

const maxNumberOfRetires = 25

func (w *Worker) incrementRefetchInternalDataRetryCount(ie *db.BlockInternalDataError) {
wb := grocksdb.NewWriteBatch()
defer wb.Destroy()
err := w.db.StoreBlockInternalDataErrorEthereumType(wb, &bchain.Block{
BlockHeader: bchain.BlockHeader{
Hash: ie.Hash,
Height: ie.Height,
},
}, ie.ErrorMessage, ie.Retries+1)
if err != nil {
glog.Errorf("StoreBlockInternalDataErrorEthereumType %d %s, error %v", ie.Height, ie.Hash, err)
} else {
w.db.WriteBatch(wb)
}
}

func (w *Worker) RefetchInternalDataRoutine() {
internalErrors, err := w.db.GetBlockInternalDataErrorsEthereumType()
if err == nil {
for i := range internalErrors {
ie := &internalErrors[i]
if ie.Retries >= maxNumberOfRetires {
glog.Infof("Refetching internal data for %d %s, retries exceeded", ie.Height, ie.Hash)
continue
}
glog.Infof("Refetching internal data for %d %s, retries %d", ie.Height, ie.Hash, ie.Retries)
block, err := w.chain.GetBlock(ie.Hash, ie.Height)
var blockSpecificData *bchain.EthereumBlockSpecificData
if block != nil {
blockSpecificData, _ = block.CoinSpecificData.(*bchain.EthereumBlockSpecificData)
}
if err != nil || block == nil || blockSpecificData == nil || blockSpecificData.InternalDataError != "" {
glog.Errorf("Refetching internal data for %d %s, error %v, retrying", ie.Height, ie.Hash, err)
// try for second time to fetch the data - the 2nd attempt after the first unsuccessful has many times higher probability of success
// probably something to do with data preloaded to cache on the backend
block, err = w.chain.GetBlock(ie.Hash, ie.Height)
if err != nil || block == nil {
glog.Errorf("Refetching internal data for %d %s, error %v", ie.Height, ie.Hash, err)
continue
}
}
blockSpecificData, _ = block.CoinSpecificData.(*bchain.EthereumBlockSpecificData)
if blockSpecificData != nil && blockSpecificData.InternalDataError != "" {
glog.Errorf("Refetching internal data for %d %s, internal data error %v", ie.Height, ie.Hash, blockSpecificData.InternalDataError)
w.incrementRefetchInternalDataRetryCount(ie)
} else {
err = w.db.ReconnectInternalDataToBlockEthereumType(block)
if err != nil {
glog.Errorf("ReconnectInternalDataToBlockEthereumType %d %s, error %v", ie.Height, ie.Hash, err)
} else {
glog.Infof("Refetching internal data for %d %s, success", ie.Height, ie.Hash)
}
}
}
}
refetchInternalDataMux.Lock()
refetchingInternalData = false
refetchInternalDataMux.Unlock()
}
29 changes: 25 additions & 4 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ type TokenTransfer struct {
From string `json:"from"`
To string `json:"to"`
Contract string `json:"contract"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int `json:"decimals"`
Name string `json:"name,omitempty"`
Symbol string `json:"symbol,omitempty"`
Decimals int `json:"decimals,omitempty"`
Value *Amount `json:"value,omitempty"`
MultiTokenValues []MultiTokenValue `json:"multiTokenValues,omitempty"`
}
Expand All @@ -231,7 +231,11 @@ type EthereumSpecific struct {
Nonce uint64 `json:"nonce"`
GasLimit *big.Int `json:"gasLimit"`
GasUsed *big.Int `json:"gasUsed,omitempty"`
GasPrice *Amount `json:"gasPrice"`
GasPrice *Amount `json:"gasPrice,omitempty"`
L1Fee *big.Int `json:"l1Fee,omitempty"`
L1FeeScalar string `json:"l1FeeScalar,omitempty"`
L1GasPrice *Amount `json:"l1GasPrice,omitempty"`
L1GasUsed *big.Int `json:"l1GasUsed,omitempty"`
Data string `json:"data,omitempty"`
ParsedData *bchain.EthereumParsedInputData `json:"parsedData,omitempty"`
InternalTransfers []EthereumInternalTransfer `json:"internalTransfers,omitempty"`
Expand Down Expand Up @@ -316,6 +320,19 @@ type AddressFilter struct {
OnlyConfirmed bool
}

// StakingPool holds data about address participation in a staking pool contract
type StakingPool struct {
Contract string `json:"contract"`
Name string `json:"name"`
PendingBalance *Amount `json:"pendingBalance"`
PendingDepositedBalance *Amount `json:"pendingDepositedBalance"`
DepositedBalance *Amount `json:"depositedBalance"`
WithdrawTotalAmount *Amount `json:"withdrawTotalAmount"`
ClaimableAmount *Amount `json:"claimableAmount"`
RestakedReward *Amount `json:"restakedReward"`
AutocompoundBalance *Amount `json:"autocompoundBalance"`
}

// Address holds information about address and its transactions
type Address struct {
Paging
Expand All @@ -326,6 +343,7 @@ type Address struct {
UnconfirmedBalanceSat *Amount `json:"unconfirmedBalance"`
UnconfirmedTxs int `json:"unconfirmedTxs"`
Txs int `json:"txs"`
AddrTxCount int `json:"addrTxCount,omitempty"`
NonTokenTxs int `json:"nonTokenTxs,omitempty"`
InternalTxs int `json:"internalTxs,omitempty"`
Transactions []*Tx `json:"transactions,omitempty"`
Expand All @@ -341,6 +359,7 @@ type Address struct {
ContractInfo *bchain.ContractInfo `json:"contractInfo,omitempty"`
Erc20Contract *bchain.ContractInfo `json:"erc20Contract,omitempty"` // deprecated
AddressAliases AddressAliasesMap `json:"addressAliases,omitempty"`
StakingPools []StakingPool `json:"stakingPools,omitempty"`
// helpers for explorer
Filter string `json:"-"`
XPubAddresses map[string]struct{} `json:"-"`
Expand Down Expand Up @@ -484,6 +503,7 @@ type BlockRaw struct {
// BlockbookInfo contains information about the running blockbook instance
type BlockbookInfo struct {
Coin string `json:"coin"`
Network string `json:"network"`
Host string `json:"host"`
Version string `json:"version"`
GitCommit string `json:"gitCommit"`
Expand All @@ -503,6 +523,7 @@ type BlockbookInfo struct {
CurrentFiatRatesTime *time.Time `json:"currentFiatRatesTime,omitempty"`
HistoricalFiatRatesTime *time.Time `json:"historicalFiatRatesTime,omitempty"`
HistoricalTokenFiatRatesTime *time.Time `json:"historicalTokenFiatRatesTime,omitempty"`
SupportedStakingPools []string `json:"supportedStakingPools,omitempty"`
DbSizeFromColumns int64 `json:"dbSizeFromColumns,omitempty"`
DbColumns []common.InternalStateColumn `json:"dbColumns,omitempty"`
About string `json:"about"`
Expand Down
Loading