romanz / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
1.02k stars 373 forks source link

Config: confused by skip_block_download_wait #1049

Open jotapea opened 3 weeks ago

jotapea commented 3 weeks ago

Hello, newbie user here.

After some time researching, I don't know if I am missing some step using the skip_block_download_wait = true configuration. If not, and is just not possible to use electrs during initial block download, then I'll be curious about the main use cases for such configuration.

Edit: Maybe is for the non-initial block downloads? Also found out that the "proxy" calls, like blockchain.transaction.get, do work.


Have you read the documentation? Yes.

How did you configure electrs?

Running it with docker compose for local tests:

config.toml ``` daemon_rpc_addr = "bitcoind:8332" daemon_p2p_addr = "bitcoind:8333" auth = "rpc:rpc" db_dir = "/data" electrum_rpc_addr = "0.0.0.0:50001" skip_block_download_wait = true ```

Environment variables: ENV RUST_BACKTRACE=1, ENV RUST_LOG=info Arguments: target/release/electrs --conf config.toml

Debug output of configuration

Starting electrs 0.10.5 on x86_64 linux with Config { network: Bitcoin, db_path: "/data/bitcoin", db_log_dir: None, daemon_dir: "/root/.bitcoin", daemon_auth: UserPass("rpc", ""), daemon_rpc_addr: 172.21.0.3:8332, daemon_p2p_addr: 172.21.0.3:8333, electrum_rpc_addr: 0.0.0.0:50001, monitoring_addr: 127.0.0.1:4224, wait_duration: 10s, jsonrpc_timeout: 15s, index_batch_size: 10, index_lookup_limit: None, reindex_last_blocks: 0, auto_reindex: true, ignore_mempool: false, sync_once: false, skip_block_download_wait: true, disable_electrum_rpc: false, server_banner: "Welcome to electrs 0.10.5 (Electrum Rust Server)!", signet_magic: f9beb4d9, args: [] }

Expected behavior I expected calls like blockchain.headers.subscribe and blockchain.block.header to return results for blocks that have already been synced by bitcoind.

Actual behavior blockchain.headers.subscribe returns height 0 and blockchain.block.header with height 2 returns error 'no header at 2'.


The same setup without the skip_block_download_wait = true worked, electrs synced after bitcoin and I was able to make successful calls. So, I am now focused on learning about this specific configuration.

Tried to find an answer in this repo, the docs and searching the web. Finally tried reading the code, but I can't figure it out with my limited rust knowledge.

Thank you for your work and time.

Kixunil commented 1 week ago

I don't know what's wrong but FYI it got added in https://github.com/romanz/electrs/issues/410 and it supposedly worked at the time.