Skip to content
📘 TREZOR address/account balance backend
Go HTML Makefile Shell CSS Dockerfile Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api Fix invalid BlockHeight for unconfirmed transactions #301 Oct 9, 2019
bchain Fix formatting/linting issues Nov 19, 2019
build Add DeepOnion (#298) Nov 18, 2019
common Fix coding style and formatting issues Jan 24, 2019
configs doge: Bump backend 0.14.0 -> 0.14.2 Nov 18, 2019
contrib/scripts Use "#!/usr/bin/env bash" in shebangs instead of "#!/bin/bash" Jun 17, 2019
db Fix invalid BlockHeight for unconfirmed transactions #301 Oct 9, 2019
docs Add DeepOnion (#298) Nov 18, 2019
server Fix error message informing about missing Ethereum xpub support #314 Nov 19, 2019
static Detect RBF transactions in explorer and API #237 Jul 30, 2019
tests Add DeepOnion (#298) Nov 18, 2019
.gitignore Support Polis (#118) Apr 8, 2019
.gitlab-ci.yml
CONTRIBUTING.md Update documentation to match version 0.2.0 Jan 24, 2019
COPYING Add license file May 31, 2018
Gopkg.lock Fix litecoin address parsing issue #254 Oct 23, 2019
Gopkg.toml Fix go dependencies Jan 9, 2019
Makefile Build makes sure that images are rebuilt after change of docker defs Oct 17, 2018
README.md Update documentation May 27, 2019
blockbook.go Catch and log panic in blockbook main Jun 11, 2019

README.md

Go Report Card

Blockbook

Blockbook is back-end service for Trezor wallet. Main features of Blockbook are:

  • index of addresses and address balances of the connected block chain
  • fast searches in the indexes
  • simple blockchain explorer
  • websocket, API and legacy Bitcore Insight compatible socket.io interfaces
  • support of multiple coins (Bitcoin and Ethereum type), with easy extensibility for 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 Testnet Ropsten

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

You can’t perform that action at this time.