Subscribe to get the new header when a block is connected.
This requires karyon version 0.2.2 so we can inject our own custom notification encoding function.
The format has been fixed since D18068.
Differential D18080
[chronik] Electrum: add the blockchain.headers.subscribe endpoint Authored by Fabien on May 12 2025, 15:40.
Details
Subscribe to get the new header when a block is connected. This requires karyon version 0.2.2 so we can inject our own custom notification encoding function. ./test/functional/test_runner.py chronik_electrum_* In terminal 1: ./src/bitcoind -regtest -debug=chronik -chronik -chronikscripthashindex -chronikelectrumbind="127.0.0.1:50001" In terminal 2 (can be done in several terminals): echo '{"jsonrpc": "2.0", "method": "blockchain.headers.subscribe", "params": [], "id": "test"}' | nc 127.0.0.1 50001 | jqin terminal 3: ./src/bitcoin-cli -regtest createwallet regtest ./src/bitcoin-cli -regtest -generate 1
Diff Detail
Event TimelineComment Actions Tail of the build log: groups: "a"
data: "abc"
}
}
}
time_first_seen: 1747065062
size: 178
])
2025-05-12T15:51:03.059000Z TestFramework (INFO): Stopping nodes
2025-05-12T15:51:03.163000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_โฟโต_๐_20250512_155101_7290/setup_scripts/chronik-client_plugins_0
2025-05-12T15:51:03.163000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_โฟโต_๐_20250512_155101_7290/setup_scripts/chronik-client_plugins_0/test_framework.log
2025-05-12T15:51:03.163000Z TestFramework (ERROR):
2025-05-12T15:51:03.164000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_โฟโต_๐_20250512_155101_7290/setup_scripts/chronik-client_plugins_0' to consolidate all logs
2025-05-12T15:51:03.164000Z TestFramework (ERROR):
2025-05-12T15:51:03.165000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-05-12T15:51:03.165000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-05-12T15:51:03.166000Z TestFramework (ERROR):
Running Unit Tests for Test Framework Modules
[1msetup_scripts/chronik-client_plugins.py[0m started
[1msetup_scripts/chronik-client_plugins.py[0m failed, Duration: 2 s
[1mstdout:[0m
[1mstderr:[0m
[1m
TEST | STATUS | DURATION
[0m[0;31msetup_scripts/chronik-client_plugins.py | โ Failed | 2 s
[0m[0;31m[1m
ALL | โ Failed | 2 s (accumulated)
[0m[0mRuntime: 2 s
Test runner for chronik-client_plugins completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------|---------|----------|---------|---------|------------------------------------
All files | 30.98 | 12.36 | 27.88 | 30.98 |
chronik-client | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
chronik-client/proto | 23.53 | 9.16 | 17.05 | 23.74 |
chronik.ts | 23.53 | 9.16 | 17.05 | 23.74 | ...4,6520-6523,6529-6571,6607-6616
chronik-client/src | 63.59 | 48.82 | 59.86 | 63.16 |
ChronikClient.ts | 55.77 | 47.54 | 56.63 | 56.18 | ...2,1463-1471,1479-1544,1552-1557
failoverProxy.ts | 79.09 | 58.06 | 69.23 | 78.5 | ...282-285,288,301,308,312,317,321
hex.ts | 89.47 | 50 | 75 | 87.87 | 58,66-68
validation.ts | 75.6 | 40 | 75 | 72.97 | 17,21,33,38-49,62-63
----------------------|---------|----------|---------|---------|------------------------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='996']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3214']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='260']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2102']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='162']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='581']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='984']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3176']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1 |