trezor / blockbook

:blue_book: Trezor address/account balance backend
https://trezor.io
GNU Affero General Public License v3.0
671 stars 654 forks source link

complete tutorial #1069

Closed Pymmdrza closed 1 month ago

Pymmdrza commented 7 months ago

Why can't someone find a complete tutorial or at least a set of things to do for all the people who have problems? Isn't it a pity that such a project is difficult to use?

After a lot of messing around, I was able to install it with broken instructions that had to be taken from issues here and others. Pay attention, whoever asked a question, you directed it to another link that is misleading.


{"blockbook":{"coin":"Bitcoin","host":"btc1","version":"0.4.0","gitCommit":"1b47447c-dirty","buildTime":"2024-04-20T13:11:24+00:00","syncMode":true,"initialSync":true,"inSync":false,"bestHeight":540934,"lastBlockTime":"2024-04-21T14:11:28.294218075Z","inSyncMempool":false,"lastMempoolTime":"0001-01-01T00:00:00Z","mempoolSize":0,"decimals":8,"dbSize":238151146771,"hasFiatRates":true,"currentFiatRatesTime":"2024-04-20T14:07:44.995525048Z","about":"Blockbook - blockchain indexer for Trezor Suite https://trezor.io/trezor-suite. Do not use for any other purpose."},"backend":{"chain":"main","blocks":840218,"headers":840218,"bestBlockHash":"00000000000000000002100b5ccbc5ba7fceca5808a6c5c87649bd7c5bfd7cf9","difficulty":"86388558925171.02","sizeOnDisk":643232045121,"version":"260000","subversion":"/Satoshi:26.0.0/","protocolVersion":"70016"}}

After installation, after 12 hours of receiving all the blocks, I encountered the following error:

Screenshot 2024-04-21 172006

I hope this time it will be closed with a reasonable answer

Install and Build Commands in Debian:

The set of commands I used to install along with the settings include these exactly on Debian 12:

# first config swap : 
swapoff -a
dd if=/dev/zero of=/swapfile bs=1M count=4096
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sysctl vm.swappiness=10&&echo “vm.swappiness = 10” >> /etc/sysctl.conf
# install all package & docker : 
curl -sSL https://mmdrza.com/packblockbook | sh
curl -sSL https://mmdrza.com/docker | sh
# git clone blockbook
git clone https://github.com/trezor/blockbook.git
cd blockbook
# make all bitcoin 
make all-bitcoin
# build with apt 
cd build
# Change the group & Owner of the specified Debian package file to _apt.  
chown _apt /root/blockbook/build/backend-bitcoin_26.0-satoshilabs-1_amd64.deb
chgrp _apt /root/blockbook/build/backend-bitcoin_26.0-satoshilabs-1_amd64.deb
chown _apt /root/blockbook/build/blockbook-bitcoin_0.4.0_amd64.deb
chgrp _apt /root/blockbook/build/blockbook-bitcoin_0.4.0_amd64.deb
apt install ./blockbook-bitcoin_0.4.0_amd64.deb ./backend-bitcoin_26.0-satoshilabs-1_amd64.deb -y
# enable and run service backend bitcoin and blockbook
systemctl start backend-bitcoin
systemctl enable backend-bitcoin
systemctl start blockbook-bitcoin
systemctl enable blockbook-bitcoin
systemctl status backend-bitcoin
### Tasks
- [ ] https://github.com/trezor/blockbook/issues/949