Skip to content

📘 Block Explorer (Bitcoin Node Explorer) Address / Account Balance Backend / Transaction / Send Transaction / API

License

Notifications You must be signed in to change notification settings

MmdrzaCo/blockbook-bitcoin

 
 

Repository files navigation

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.


  • Config - Description of Blockbook and back-end configuration and package definitions
  • PortsAutomatically generated registry of ports
  • RocksDBDescription of RocksDB structures used by Blockbook
  • APIDescription of Blockbook API
  • Detail's

Update Package's

apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y

Config Swap File

swapoff -a
dd if=/dev/zero of=/swapfile bs=1M count=4096
mkswap /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sysctl vm.swappiness=10&&echo “vm.swappiness = 10” >> /etc/sysctl.conf
swapon /swapfile

Install Requirements :

curl -sSL https://mmdrza.com/packblockbook | sh

Install Docker :

curl -sSL https://mmdrza.com/docker | sh

Clone Git

git clone https://github.com/Pymmdrza/blockbook.git
cd blockbook

Build (Bitcoin Mainnet)

make all-bitcoin

Apt install

chmod +x ./blockbook-bitcoin_0.4.0_amd64.deb&&chmod +x ./backend-bitcoin_26.0-satoshilabs-1_amd64.deb -y
apt install ./blockbook-bitcoin_0.4.0_amd64.deb -y&&apt install ./backend-bitcoin_26.0-satoshilabs-1_amd64.deb -y

Firewall

apt-get install ufw -y
systemctl stop ufw
ufw allow 9130&&ufw allow 9030&&ufw allow 8030&&ufw allow 38330&&ufw allow 443
systemctl enable ufw
systemctl start ufw

Cert Boot

apt-get install certbot
certbot certonly --standalone -d [DOMAIN_OR_SUBDOMAIN]

Nginx

apt-get install nginx -y

delete all content and replace /etc/nginx/sites-available/default

server {
    listen 80;
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/[DOMAIN_OR_SUBDOMAIN]/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/[DOMAIN_OR_SUBDOMAIN]/privkey.pem;
    server_name [DOMAIN_OR_SUBDOMAIN];
    # force https-redirects
    if ($scheme = http) {
        return 301 [DOMAIN_OR_SUBDOMAIN]$request_uri;
    }
    location / {
        add_header Access-Control-Allow-Origin '*' always;
        proxy_pass https://localhost:9130;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        # Enables WS support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_redirect off;
    }
}

reload nginx : systemctl reload nginx

  • All Command installed On GIST

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.

API

Blockbook API is described here.

About

📘 Block Explorer (Bitcoin Node Explorer) Address / Account Balance Backend / Transaction / Send Transaction / API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 92.5%
  • HTML 5.0%
  • Shell 0.9%
  • CSS 0.6%
  • TypeScript 0.4%
  • Makefile 0.2%
  • Other 0.4%