Crates.io | rivalz_client |
lib.rs | rivalz_client |
version | 0.1.2 |
source | src |
created_at | 2024-06-20 03:36:54.956636 |
updated_at | 2024-06-20 03:41:21.853467 |
description | A Rust client for interacting with the Rivalz API, allowing file uploads and retrieval of IPFS hashes. |
homepage | https://github.com/ngocbd/rivalz-client |
repository | https://github.com/ngocbd/rivalz-client |
max_upload_size | |
id | 1277539 |
size | 39,134 |
RivalzClient is a Rust client for interacting with the Rivalz API. This client allows you to upload files to IPFS and retrieve their IPFS hash.
To use the RivalzClient
library in your project, add the following to your Cargo.toml
:
[dependencies]
rivalz_client = "0.1.0"
Set your Rivalz API secret token as an environment variable:
export SECRET_TOKEN="your_secret_token"
Create an instance of RivalzClient
and use it to upload a file:
use rivalz_client::RivalzClient;
fn main() {
let client = RivalzClient::new(None);
let file_path = "path/to/your/file.txt";
match client.upload_file(file_path) {
Ok(ipfs_hash) => println!("File uploaded successfully! IPFS hash: {}", ipfs_hash),
Err(e) => eprintln!("Failed to upload file: {}", e),
}
}
To build RivalzClient from source, follow these steps:
Clone the repository:
git clone https://github.com/yourusername/rivalz-client.git
cd rivalz-client
Build the project:
cargo build
Run tests:
cargo test
To publish a new version of RivalzClient to crates.io, follow these steps:
Update the version number in Cargo.toml
.
Login to crates.io:
cargo login
Publish the package:
cargo publish
We welcome contributions to RivalzClient! To contribute:
Fork the repository.
Create a new branch for your feature or bugfix:
git checkout -b my-feature-branch
Make your changes and commit them:
git commit -am 'Add new feature'
Push to the branch:
git push origin my-feature-branch
Create a new Pull Request on GitHub.
If you find a bug or have a feature request, please create an issue on GitHub.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
This project is licensed under the MIT License. See the LICENSE file for details.