Crates.io | ic_object_store |
lib.rs | ic_object_store |
version | 1.2.1 |
created_at | 2025-01-07 12:34:58.021456+00 |
updated_at | 2025-08-26 03:47:07.706706+00 |
description | The Rust version of the client SDK for the IC Object Store canister. |
homepage | |
repository | https://github.com/ldclabs/ic-oss/tree/main/src/ic_object_store |
max_upload_size | |
id | 1507037 |
size | 136,881 |
ic_object_store
IC Object Store is a native Rust implementation of Apache Arrow object store on the Internet Computer.
ic_object_store
is the Rust version of the client SDK for the IC Object Store canister.
This library provides a Rust client SDK for interacting with the IC Object Store canister, which implements the Apache Object Store interface on the Internet Computer. It allows developers to seamlessly integrate with the decentralized storage capabilities of the Internet Computer using familiar Apache Object Store APIs.
Add this to your Cargo.toml
:
[dependencies]
ic_object_store = "1.1"
use ic_object_store::{Client, ObjectStoreClient, build_agent};
use object_store::ObjectStore;
let secret = [8u8; 32];
// backend: IC Object Store Canister
let canister = Principal::from_text("6at64-oyaaa-aaaap-anvza-cai").unwrap();
let sk = SigningKey::from(secret);
let id = BasicIdentity::from_signing_key(sk);
println!("id: {:?}", id.sender().unwrap().to_text());
// jjn6g-sh75l-r3cxb-wxrkl-frqld-6p6qq-d4ato-wske5-op7s5-n566f-bqe
let agent = build_agent("https://ic0.app", Arc::new(id))
.await
.unwrap();
let client = Arc::new(Client::new(Arc::new(agent), canister, Some(secret)));
let storage = ObjectStoreClient::new(client);
let path = Path::from("test/hello.txt");
let payload = "Hello Anda!".as_bytes().to_vec();
let res = storage
.put_opts(&path, payload.into(), Default::default())
.await
.unwrap();
println!("put result: {:?}", res);
let res = storage.get_opts(&path, Default::default()).await.unwrap();
println!("get result: {:?}", res);
For detailed documentation, please visit: https://docs.rs/ic_object_store
Copyright © 2024-2025 LDC Labs.
Licensed under the MIT License. See LICENSE for details.