-
Notifications
You must be signed in to change notification settings - Fork 6
feat: rust algod client #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Had to work around this bug in maturin: PyO3/maturin#2459 This fix is relatively simple but requires you to modify the packages post-installation. A fix (more like feature) can be added to maturin and I think it should be fairly straightforward
There is something weird going on with the env package though. For now you need to bun rm env, run the build script, and then bun i env before running the tests
Mutex works in WASM and only adds a few nanos of overhead, so just easier to use Mutex for both uniffi and wasm
It works, but there seems to be some closure that isn't getting cleaned up properly in the async call
Bun prefers main over module for some reason at runtime. See oven-sh/bun#13430 (comment)
…g for new rust client gen
81aad13
to
10f4f80
Compare
10f4f80
to
f20b6f5
Compare
f20b6f5
to
9f0b579
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the autogenerated Python/TypeScript Algod clients with a custom Jinja2-based Rust client generator, consolidating all endpoints into a new algod_client
crate and removing the old algod_api
crate.
- Introduced a unified Rust client in
crates/algod_client
with full endpoint coverage and message-pack support - Removed Python/TypeScript clients and legacy
crates/algod_api
- Updated workspace to use
algokit_http_client
and streamlined client instantiation
Reviewed Changes
Copilot reviewed 174 out of 604 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
crates/algod_client/src/apis/mod.rs | Added consolidated API modules and error mapping |
crates/algod_client/src/apis/*.rs | Implemented each endpoint with JSON/MsgPack support |
crates/algod_client/src/apis/client.rs | Exposed ergonomic AlgodClient interface |
crates/algod_client/README.md | Updated crate README for Rust client usage |
crates/algod_client/Cargo.toml | Defined algod_client package and dependencies |
crates/algod_api/src/lib.rs & Cargo.toml | Removed legacy Python/TS client code |
Comments suppressed due to low confidence (2)
crates/algod_client/src/apis/health_check.rs:25
- The variant
Statusdefault
does not follow Rust’s PascalCase convention. Consider renaming it toStatusDefault
for consistency.
Statusdefault(),
crates/algod_client/README.md:22
- The usage example references
configuration
anddefault_api
, which no longer exist. Update this snippet to show instantiation ofAlgodClient
(e.g.,let client = AlgodClient::testnet();
).
use algod_client::apis::{configuration, default_api};
Self::new(http_client) | ||
} | ||
|
||
/// Create a new AlgodClient for a local localnet environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The phrase "local localnet" is redundant. Consider simplifying to "Create a new AlgodClient for a localnet environment."
/// Create a new AlgodClient for a local localnet environment. | |
/// Create a new AlgodClient for a localnet environment. |
Copilot uses AI. Check for mistakes.
PR Description
This PR migrates from OpenAPI code generation to a custom Jinja2-based Rust client generator, removing Python/TypeScript clients for a unified Rust ecosystem.
Key Changes
Custom Rust OAS Generator
api/oas_generator/
x-algokit-signed-txn
for transaction endpointsNew Rust Client Architecture
algod_api
crate with generatedalgod_client
cratereqwest
to customalgokit_http_client
for better abstractionCleanup & Consolidation
packages/
directory containing Python/TypeScript clientsEnhanced Documentation
Client Interface Improvements
Breaking Changes
algod_api
crate replaced withalgod_client
Next steps
Exposing AlgodClient via ffi is out of scope of this pr given # number of changes it introduces. Initial integration with changes from #166 are in place though