Skip to content

Latest commit

 

History

History
105 lines (77 loc) · 2.92 KB

File metadata and controls

105 lines (77 loc) · 2.92 KB

Qbit ElectrumX

This fork adds Qbit support to ElectrumX 2.0. It indexes Qbit scripts and transactions and serves the standard Electrum protocol used by luxor-qbit-explorer for address balances and transaction history.

Supported networks

NET Qbit RPC Genesis hash
mainnet 8352 0000000000004d60aa5d46013991d0a0e2995d89ee98e53068ae196d763e79f2
testnet 18352 0000c20791706c6940a43d75db44d1ae9dadeb637cedfbaa5cf293435eeaab3c
testnet4 48352 000000000000796fe86bbc0bf1b66a07e4b4c0676f74b54cf7e5ce8b3f1a0090
signet 38352 0000000a5698c727f05cbdaeaff3e48b48ab187aeb03414e783ea81fed14d65c
regtest 18452 0ee96aa77c4b600850e349344fa21b107e805f5370ddc7a6189db12cf69acce6

All networks use the Qbit AuxPoW-aware SegWit deserializer. Mainnet uses P2PKH version 0x3a and P2SH version 0x3f; non-mainnet networks use 0x78 and 0x7d.

Node requirements

The Qbit node must be unpruned and started with txindex=1. ElectrumX checks for this index at startup and will refuse to run if it is missing.

Example Qbit arguments:

-server=1
-txindex=1
-rpcbind=0.0.0.0
-rpcallowip=<electrumx network>
-rpcport=8352

Local Qbit, ElectrumX, and Explorer

Start Qbit and ElectrumX:

docker compose -f docker-compose.qbit.yml up --build -d qbit electrumx
docker compose -f docker-compose.qbit.yml logs -f electrumx

ElectrumX binds port 50001 only after its initial synchronization finishes. Run the included protocol smoke test:

python3 scripts/qbit-smoke.py

Start the Qbit Explorer profile after ElectrumX is healthy:

docker compose -f docker-compose.qbit.yml --profile explorer up -d explorer
open http://127.0.0.1:3002

If port 3002 is already in use, set QBIT_EXPLORER_PORT, for example:

QBIT_EXPLORER_PORT=3003 docker compose -f docker-compose.qbit.yml --profile explorer up -d explorer

Override the local RPC password if needed:

QBIT_RPC_PASSWORD='replace-me' docker compose -f docker-compose.qbit.yml up -d

Connect to an existing Qbit node

docker run --rm \
  --platform linux/amd64 \
  -p 50001:50001 \
  -v qbit-electrumx-data:/var/lib/electrumx \
  -e COIN=Qbit \
  -e NET=mainnet \
  -e DAEMON_URL='http://rpc-user:rpc-password@qbit-host:8352/' \
  -e SERVICES='tcp://0.0.0.0:50001' \
  gcr.io/analog-stage-198105/luxor-qbit-electrumx:latest

Do not expose port 50001 publicly unless the Electrum service is intended for public wallet clients. The Explorer only needs an internal connection.

Explorer configuration

BTCEXP_ADDRESS_API=electrum
BTCEXP_ELECTRUM_SERVERS=tcp://qbit-electrumx:50001
BTCEXP_ELECTRUM_TXINDEX=true

Image publishing

GitHub Actions tests Qbit block parsing and builds only linux/amd64. Images are published to:

gcr.io/analog-stage-198105/luxor-qbit-electrumx

Every published build receives an immutable sha-<7-character commit> tag.