📘 Trezor address/account balance backend
Go to file
2024-05-02 17:08:25 +02:00
api Disable get balance history for contract addresses 2024-03-11 10:22:31 +01:00
bchain Workaround of InitializeMempool issue in Holesky 2024-04-10 09:50:29 +02:00
build polygon-bor 1.2.8 → 1.3.1 2024-05-02 17:08:25 +02:00
common Update histogram buckets for websocket metrics 2024-03-11 10:22:31 +01:00
configs polygon-bor 1.2.8 → 1.3.1 2024-05-02 17:08:25 +02:00
contrib/scripts Tune up generation of the port registry 2023-07-02 10:45:41 +02:00
db Ignore Ordinals in Golomb filters (#967) 2023-11-08 10:21:18 +01:00
docs Remove Goerli 2024-03-27 13:16:20 +01:00
fiat Handle Coingecko Throttled error 2024-03-11 10:22:31 +01:00
fourbyte Upgrade to go 1.19 and rocksdb 7.5.3 2023-02-01 17:58:37 +01:00
server Fix internal admin styles 2023-12-08 18:30:21 +01:00
static Staking pools - remove unused pendingRestakedReward 2024-01-31 23:45:43 +01:00
tests Remove Goerli 2024-03-27 13:16:20 +01:00
.gitignore Update display of contracts in explorer 2023-02-01 17:58:37 +01:00
.gitlab-ci.yml Remove Goerli 2024-03-27 13:16:20 +01:00
.prettierrc Generate typescript documentation from golang types 2023-03-09 13:56:11 +01:00
blockbook-api.ts Update type for gasPrice 2024-02-21 15:07:40 +01:00
blockbook.go Disconnect ws connections exceeding limit of requests 2023-11-29 09:49:59 +01:00
CONTRIBUTING.md Fix linting issues 2021-11-28 21:27:16 +01:00
COPYING Add license file 2018-05-31 12:53:27 +02:00
go.mod Workaround of InitializeMempool issue in Holesky 2024-04-10 09:50:29 +02:00
go.sum Workaround of InitializeMempool issue in Holesky 2024-04-10 09:50:29 +02:00
Makefile [feature] add option to build portable binaries (#685) 2022-04-08 22:21:51 +02:00
README.md Remove Goerli 2024-03-27 13:16:20 +01:00
shell.nix Add gcc into shell.nix 2023-07-13 23:58:46 +02:00

Go Report Card

Blockbook

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

Build and installation instructions

Officially supported platform is Debian Linux and AMD64 architecture.

Memory and disk requirements for initial synchronization of Bitcoin mainnet are around 32 GB RAM and over 180 GB of disk space. After initial synchronization, fully synchronized instance uses about 10 GB RAM. 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.

Developer build guide is here.

Contribution guide is here.

Implemented coins

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

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 Testnets (Sepolia, Holesky)

List of all implemented coins is in the registry of ports.

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:

  • 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.

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.

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

Check this or this issue for more info.

Running on Ubuntu

This issue discusses how to run Blockbook on Ubuntu. If you have some additional experience with Blockbook on Ubuntu, please add it to this issue.

My coin implementation is reporting parse errors when importing blockchain

Your coin's block/transaction data may not be compatible with BitcoinParser ParseBlock/ParseTx, which is used by default. In that case, implement your coin in a similar way we used in case of zcash and some other coins. The principle is not to parse the block/transaction data in Blockbook but instead to get parsed transactions as json from the backend.

Data storage in RocksDB

Blockbook stores data the key-value store RocksDB. Database format is described here.

API

Blockbook API is described here.