HomePhabricator

[Chronik] Add script subscription functionality to websocket.rs in bitcoinsuite…

Description

[Chronik] Add script subscription functionality to websocket.rs in bitcoinsuite-chronik-client

Summary:
The code adds WebSocket functionality for a Bitcoin blockchain explorer (Chronik), specifically the subscription and unsubscription to scripts:

Creates subscriptions to different script types (P2PKH, P2SH, P2PK, Other) with subscribe_to_script()

Verifies subscription status with assert_eq!(ep.subs.scripts, subscriptions)

Tests unsubscribing with unsubscribe_from_script()

Validates error handling for invalid/non-existent script subscriptions

Receives real-time notifications for transactions affecting subscribed scripts (mempool, confirmed, finalized events)

Test Plan:
Please set BUILD_DIR env to export BUILD_DIR="/path/to/build_dir
UNIX: ./contrib/teamcity/build-configurations.py build-bitcoinsuite-chronik-client

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18142

Details

Provenance
hazzarustAuthored on May 12 2025, 14:11
hazzarustPushed on May 28 2025, 16:25
Reviewer
Restricted Owners Package
Differential Revision
D18142: [Chronik] Add script subscription functionality to websocket.rs in bitcoinsuite-chronik-client
Parents
rABC3da6b53fee10: Revert "gui: Do not exit and re-enter main event loop during shutdown"
Branches
Unknown
Tags
Unknown