After installing electrs according to the instruction.
Launching electrs gives an error:
DEBUG - opening DB at "data/electrs-db/regtest"
thread 'main' panicked at 'missing tip: 0000000000000000000000000000000000000000000000000000000000000000', src/util.rs:158:40
Way to reproduce:
launch in one terminal: start-bitcoind.sh , wait 5 sec, then in other start-electrs.sh
Small investigation shows that commit bf68461e8f3f8cc7631bc64311927316f35de93f introduces the bug because
commit bb62df8793948b88cb2bc61580ca727cbbae9d31 works.
OS: Ubuntu Linux BitcoinM 4.15.0-48-generic
rust: rustc 1.36.0-nightly (08bfe1612 2019-05-02) and rustc 1.34.1 (fc50f328b 2019-04-24)
bitcoind: Bitcoin Core Daemon version v0.17.1.0-gef70f9b52b851c7997a9f1a0834714e3eebc1fd8
electrs: 94e139934f89576daa1b4a49f38c0435598aa561 (v.0.6)
start-bitcoind.sh
#!/bin/bash -e
mkdir -p data/bitcoind
bitcoind \
-blocknotify="echo New block %s" \
-datadir=data/bitcoind \
-txindex \
-debug=1 \
-printtoconsole \
-server \
-regtest \
-rpcport=18443 \
-rpcuser=user \
-rpcpassword=password \
-zmqpubrawblock=tcp://127.0.0.1:18501 \
-zmqpubrawtx=tcp://127.0.0.1:18502 &
sleep 4
bitcoin-cli \
-datadir=data/bitcoind \
-regtest \
-rpcport=18443 \
-rpcuser=user \
-rpcpassword=password \
generate 500
start-electrs.sh
#!/usr/bin/env bash
electrs \
-vvv \
--network=regtest \
--jsonrpc-import \
--daemon-dir=data/bitcoind \
--db-dir=data/electrs-db \
--cookie=user:password \
--daemon-rpc-addr=127.0.0.1:18443
Many thanks for reporting this issue!
It should be fixed by https://github.com/romanz/electrs/commit/ce93edcc1557bf5e3b4b74639c121372ab96aa32.
Thanks for the fast response! I've checked it the latest master and it works.
Great :)
Released 0.6.1 on https://crates.io/crates/electrs
Experienced the same issue, thanks for the fix.