Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mpwsh/chia-client
Wrapper to work with Chia node RPC endpoints
https://github.com/mpwsh/chia-client
blockchain chia chia-blockchain chia-network cryptocurrency rpc rust
Last synced: 10 days ago
JSON representation
Wrapper to work with Chia node RPC endpoints
- Host: GitHub
- URL: https://github.com/mpwsh/chia-client
- Owner: mpwsh
- License: mit
- Created: 2023-03-16T16:09:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T17:12:36.000Z (10 months ago)
- Last Synced: 2024-10-12T01:33:11.864Z (about 1 month ago)
- Topics: blockchain, chia, chia-blockchain, chia-network, cryptocurrency, rpc, rust
- Language: Rust
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Description
`chia-client` is a simple Rust library to interact with the Chia RPC API (fullnode/wallet/harvester). Currently, most of the RPC endpoints are available and some utility functions to encode and decode puzzle hashes.
## Installation
To use `chia-client` in your Rust project, add the following to your Cargo.toml:
```toml
[dependencies]
chia-client = { git = "https://github.com/mpwsh/chia-client" }
```## Usage
Please checkout a basic example at [./examples/get_balance.rs](examples/get_balance.rs)
Run the example:
```bash
cargo run --example get_balance
#output
Balance: 0.000000000001 XCH
```There's another example to create a simple `CLI` called `chiactl` to get balance as well, that you can expand with more useful commands.
## Using example project `chiactl`
Update the contents of [./examples/ctlconfig.yaml](./examples/ctlconfig.yaml) to suit your needs, and then run the following to fetch the balance for a wallet address:
```bash
cargo run --example chiactl -- get balance --config examples/ctlconfig.yaml
```Get 'transactions' for a given wallet
```bash
cargo run --example chiactl -- get transactions --config examples/ctlconfig.yaml
```> You could also provide these values using command arguments, or specify the path of the config file in an arg as well. Use --help to get all available arguments.
More commands:
```bash
cargo run --example chiactl -- get blockchain --config examples/ctlconfig.yaml
cargo run --example chiactl -- get network --config examples/ctlconfig.yaml
cargo run --example chiactl -- get blockmetrics --config examples/ctlconfig.yaml
cargo run --example chiactl -- get block 3392968 --config examples/ctlconfig.yaml
```All `get` commands
```bash
SUBCOMMANDS:
balance
block
blockchain
blockmetrics
coin
network
transactions
```# Contributing
If you'd like to contribute to the development of `chia-client`, feel free to submit a pull request or create an issue on the GitHub repository.
License> This project is licensed under the MIT License. See the LICENSE file for more information.
# Credits
This is a fork of crate `chia-node-rs` from Mike Cronce: https://gitlab.cronce.io/foss/`chia-client`
# Disclaimer
Please note that this library is provided "as-is" and the author is not responsible for any harm or misuse that may arise from the use of this library. Users are advised to use this library at their own risk and are encouraged to review the source code and understand the workings of the library before using it in any application or project.