Skip to content

Config: remote Bitcoin Core RPC address not used by bindex REST client #1315

Description

@dskudi

Config: remote Bitcoin Core RPC address not used by bindex REST client

Have you read the documentation?
Yes. (Please, read usage.md first if you did not.)

How did you configure electrs?

electrs.toml
daemon_p2p_addr = "10.0.0.140:8333"

jsonrpc_import = false

auth = "electrs:<redacted>"

daemon_rpc_addr = "10.0.0.140:8332"

db_dir = "/var/lib/electrs/db"

network = "bitcoin"

electrum_rpc_addr = "0.0.0.0:50001"

log_filters = "INFO"

Environment variables: none

Arguments:

--conf /etc/electrs/config.toml
--daemon-rpc-addr 10.0.0.140:8332
--daemon-dir /var/lib/electrs/bitcoin

Debug output of configuration

Starting electrs 0.11.1 on x86_64 linux with Config {
    network: Bitcoin,
    db_dir: "/var/lib/electrs/db",
    db_log_dir: None,
    db_parallelism: 1,
    daemon_auth: UserPass("electrs", "<sensitive>"),
    daemon_rpc_addr: 10.0.0.140:8332,
    electrum_rpc_addr: 0.0.0.0:50001,
    monitoring_addr: 127.0.0.1:4224,
    wait_duration: 10s,
    jsonrpc_timeout: 15s,
    index_lookup_limit: None,
    reindex_last_blocks: 0,
    auto_reindex: true,
    ignore_mempool: false,
    sync_once: false,
    skip_block_download_wait: false,
    disable_electrum_rpc: false
}

[INFO  bindex::chain] index: Config {
    db_path: "/var/lib/electrs/db/bitcoin",
    url: "http://localhost:8332"
}

Expected behavior

I expected electrs to use the configured Bitcoin Core address:

daemon_rpc_addr = "10.0.0.140:8332"

for all Bitcoin Core communication, including the REST requests used by bindex.

Actual behavior

The JSON-RPC configuration is parsed correctly, but the bindex client uses:

http://localhost:8332

instead.

The resulting requests fail because Bitcoin Core is running on another host:

unavailable http://localhost:8332/rest/blockhashbyheight/0.bin:
Io(Custom { kind: ConnectionRefused, error: "Connection refused" })

I verified that the REST endpoint is available remotely:

curl http://10.0.0.140:8332/rest/blockhashbyheight/0.bin

returns binary output successfully.

I could not find a configuration option in electrs --help for changing the bindex REST URL separately from daemon_rpc_addr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions