trezor / blockbook

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

Addresses begin with bc1 while running with bitcoin testnet4 #1154

Open ertenmehmet opened 20 hours ago

ertenmehmet commented 20 hours ago

Running couple of different instances of blockbook while managing our migration to testnet4, We have noticed that in the explorer interface it shows addresses as begin with bc1 style e.g bc1qgrcex95y6mdankp5t5uz6wlwve6333pjdt4v4m; instead of tb1qhjxlhw07m9tcm07tjzufjxt47m26qqq2gmsdtg

But when it comes to resolving them it is ok, when requested testnet4-blockbook-url/api/v2/address/tb1qhjxlhw07m9tcm07tjzufjxt47m26qqq2gmsdtg it responds successfully, but with "address": "bc1qhjxlhw07m9tcm07tjzufjxt47m26qqq2zat7sm"

also noticed in the logs: 1 bitcoinrpc.go:146] rpc: block chain mainnet

Environment is as follows: newly built from https://github.com/trezor/blockbook/commit/fe676b35 and running with the following config

{
    "network": "test",
    "coin_name": "Testnet4",
    "coin_shortcut": "TEST",
    "coin_label": "Bitcoin Testnet4",
    "coin_alias": "bitcoin_testnet4",
    "rpc_url": "http://bitcoind:18030",
    "rpc_user": "rpc",
    "rpc_pass": "rpc",
    "rpc_timeout": 25,
    "parse": true,
    "message_queue_binding": "tcp://bitcoind:48332",
    "subversion": "",
    "address_format": "",
    "xpub_magic": 70617039,
    "xpub_magic_segwit_p2sh": 71979618,
    "xpub_magic_segwit_native": 73342198,
    "slip44": 1,
    "mempool_workers": 1,
    "mempool_sub_workers": 1,
    "block_addresses_to_keep": 300
}

and running with the following parameters blockbook -blockchaincfg=/opt/etc/blockchaincfg.json -datadir=/opt/data -workers=1 -sync -internal=:19030 -public=:19130 -explorer= -logtostderr

We also have our own bitcoin node, running with the 28.0.0 official release from https://bitcoincore.org

Not sure if we miss something with the configuration or something we miss while building blockbook; or an actual issue.

wakiyamap commented 20 hours ago

https://github.com/trezor/blockbook/issues/1130#issuecomment-2413348490 Maybe this will fix it.

ertenmehmet commented 19 hours ago

so @wakiyamap, would it be running as expected (by showing actual wallet addresses with tb1) if we build and run from your fork?