Page MenuHomePhabricator

[chronik-client] Add subscribeToTxs and unsubscribeFromTxs to ChronikWs
DraftPublic

Authored by tobias_ruck on Mon, Nov 24, 18:46.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

Subscribe to all txs using the new WsSubTxs message.

Test Plan

npm run integration-tests

Event Timeline

Tail of the build log:

setup_scripts/chronik-client_token_slp_nft1.py started
setup_scripts/chronik-client_token_slp_nft1.py passed, Duration: 2 s

TEST                                           | STATUS    | DURATION

setup_scripts/chronik-client_token_slp_nft1.py | ✓ Passed  | 2 s

ALL                                            | ✓ Passed  | 2 s (accumulated) 
Runtime: 2 s

testRunner complete in token_slp_nft1.ts
Starting test_runner for chronik-client_websocket
Test runner for chronik-client_websocket started
2025-11-24T18:55:02.137000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20251124_185501_28943/setup_scripts/chronik-client_websocket_0
2025-11-24T18:55:03.150000Z TestFramework (INFO): Passed test setup data to mocha
chronikUrl set to ["http://127.0.0.1:26000"]
Mocha timeout set to 240 seconds
2025-11-24T18:55:03.150000Z TestFramework (INFO): Step 1: Initialized regtest chain
2025-11-24T18:55:10.346000Z TestFramework (INFO): Step 2: Avalanche finalize a block
2025-11-24T18:55:13.109000Z TestFramework (INFO): Step 3: Broadcast 1 tx to a p2pk, p2pkh, and p2sh address
2025-11-24T18:56:13.145000Z TestFramework (INFO): Step 4: Mine a block with these txs
2025-11-24T18:56:14.163000Z TestFramework (INFO): Step 5: Finalize the block containing these txs with Avalanche
2025-11-24T18:57:17.961000Z TestFramework (INFO): Step 6: Park the block containing those txs
2025-11-24T18:57:18.982000Z TestFramework (INFO): Step 7: Unpark the block containing those txs
2025-11-24T18:57:18.995000Z TestFramework (INFO): Step 8: Manually invalidate the block containing those txs
2025-11-24T18:57:18.998000Z TestFramework (INFO): Step 9: Reconsider the block containing those txs
2025-11-24T18:57:19.004000Z TestFramework (INFO): Step 10: Broadcast a tx with mixed outputs
2025-11-24T18:57:19.012000Z TestFramework (INFO): Step 11: Mine another block
2025-11-24T18:57:19.017000Z TestFramework (INFO): Step 12: Avalanche rejects the block
2025-11-24T18:57:19.923000Z TestFramework (INFO): Step 13: Avalanche invalidates the block
2025-11-24T18:57:22.051000Z TestFramework (INFO): Step 14: Mine another block
2025-11-24T18:57:24.380000Z TestFramework (INFO): Step 15: Finalize a tx via preconsensus
2025-11-24T18:58:26.702000Z TestFramework (INFO): Step 16: Invalidate a tx via preconsensus
Exited websocket.ts test setup after exceeding mocha timeout.
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   41.56 |    17.96 |   37.54 |   41.65 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   31.61 |    13.04 |   21.83 |   31.88 |                                    
  chronik.ts          |   31.61 |    13.04 |   21.83 |   31.88 | ...1,6847-6850,6856-6898,6934-6943 
 chronik-client/src   |   83.59 |     71.5 |    82.5 |   83.65 |                                    
  ChronikClient.ts    |   82.92 |    72.26 |   85.48 |   83.48 | ...9,1579,1604,1616,1631,1643,1649 
  failoverProxy.ts    |   79.46 |    61.29 |   66.66 |   78.89 | ...282-285,288,301,308,312,316,325 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   95.55 |     87.5 |     100 |      95 | 33,39                              
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1406']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3383']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='397']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2210']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='232']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='618']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1393']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3344']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1

Tail of the build log:

setup_scripts/chronik-client_token_slp_nft1.py started
setup_scripts/chronik-client_token_slp_nft1.py passed, Duration: 2 s

TEST                                           | STATUS    | DURATION

setup_scripts/chronik-client_token_slp_nft1.py | ✓ Passed  | 2 s

ALL                                            | ✓ Passed  | 2 s (accumulated) 
Runtime: 2 s

testRunner complete in token_slp_nft1.ts
Starting test_runner for chronik-client_websocket
Test runner for chronik-client_websocket started
2025-11-24T20:02:19.784000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20251124_200219_15608/setup_scripts/chronik-client_websocket_0
2025-11-24T20:02:21.068000Z TestFramework (INFO): Passed test setup data to mocha
chronikUrl set to ["http://127.0.0.1:26000"]
Mocha timeout set to 240 seconds
2025-11-24T20:02:21.069000Z TestFramework (INFO): Step 1: Initialized regtest chain
2025-11-24T20:02:28.548000Z TestFramework (INFO): Step 2: Avalanche finalize a block
2025-11-24T20:02:31.806000Z TestFramework (INFO): Step 3: Broadcast 1 tx to a p2pk, p2pkh, and p2sh address
2025-11-24T20:03:31.843000Z TestFramework (INFO): Step 4: Mine a block with these txs
2025-11-24T20:03:32.862000Z TestFramework (INFO): Step 5: Finalize the block containing these txs with Avalanche
2025-11-24T20:04:37.196000Z TestFramework (INFO): Step 6: Park the block containing those txs
2025-11-24T20:04:38.216000Z TestFramework (INFO): Step 7: Unpark the block containing those txs
2025-11-24T20:04:38.227000Z TestFramework (INFO): Step 8: Manually invalidate the block containing those txs
2025-11-24T20:04:38.231000Z TestFramework (INFO): Step 9: Reconsider the block containing those txs
2025-11-24T20:04:38.238000Z TestFramework (INFO): Step 10: Broadcast a tx with mixed outputs
2025-11-24T20:04:38.247000Z TestFramework (INFO): Step 11: Mine another block
2025-11-24T20:04:38.252000Z TestFramework (INFO): Step 12: Avalanche rejects the block
2025-11-24T20:04:39.238000Z TestFramework (INFO): Step 13: Avalanche invalidates the block
2025-11-24T20:04:41.410000Z TestFramework (INFO): Step 14: Mine another block
2025-11-24T20:04:43.670000Z TestFramework (INFO): Step 15: Finalize a tx via preconsensus
2025-11-24T20:05:45.582000Z TestFramework (INFO): Step 16: Invalidate a tx via preconsensus
Exited websocket.ts test setup after exceeding mocha timeout.
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   41.56 |    17.96 |   37.54 |   41.65 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   31.61 |    13.04 |   21.83 |   31.88 |                                    
  chronik.ts          |   31.61 |    13.04 |   21.83 |   31.88 | ...1,6847-6850,6856-6898,6934-6943 
 chronik-client/src   |   83.59 |     71.5 |    82.5 |   83.65 |                                    
  ChronikClient.ts    |   82.92 |    72.26 |   85.48 |   83.48 | ...9,1579,1604,1616,1631,1643,1649 
  failoverProxy.ts    |   79.46 |    61.29 |   66.66 |   78.89 | ...282-285,288,301,308,312,316,325 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   95.55 |     87.5 |     100 |      95 | 33,39                              
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1406']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3383']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='397']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2210']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='232']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='618']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1393']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3344']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1