Page MenuHomePhabricator

[Chronik] Add general-purpose python `ChronikClient`
ClosedPublic

Authored by tobias_ruck on Apr 7 2023, 11:41.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3696c93da65f: [Chronik] Add general-purpose python `ChronikClient`
Summary

A simple client for querying the different Chronik endpoints in a nice flowing interface.

While it's currently placed in test_framework, in the future it is intended to be published on pip so people who want to access Chronik can use this client. For this reason we place it in its own directory.

We also update all the chronik tests to use this new client now.

Test Plan

ninja check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-python-client
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23069
Build 45758: Build Diffbuild-without-wallet · build-clang · build-diff · build-clang-tidy · build-debug
Build 45757: arc lint + arc unit

Event Timeline

remove pagination from unconfirmed_txs

Fabien requested changes to this revision.Apr 7 2023, 16:47

no need for a subdir, just call the file chronik.py

I very much like the solution of the attributes describing the endpoint, it's worth investigating

test/functional/test_framework/chronik/client.py
72 ↗(On Diff #39390)

It will always be a client, could be simply called Chronik

This revision now requires changes to proceed.Apr 7 2023, 16:47
tobias_ruck edited the summary of this revision. (Show Details)
Fabien requested changes to this revision.Apr 9 2023, 06:21
Fabien added inline comments.
test/functional/test_framework/chronik/client.py
75 ↗(On Diff #39390)

It is better to have some sensible default timeout value (even if it's a bit longer than what you actually have in the tests, like 30s) instead of no timeout by default. For the tests having a longer timeout is no problem, and for a library it avoids running forever with no output nor error message.

This revision now requires changes to proceed.Apr 9 2023, 06:21

Add 30s timeout to chronik/client.py

Remove timeout=4 from usages of ChronikClient

This revision is now accepted and ready to land.Apr 12 2023, 15:02