File Upload

Before uploading files, you need to buy storage space, please refer to Purchase Space

use cess_rust_sdk::chain::{ChainSdk, file::File};

// The account mnemonic that will be used to sign transactions.
const MNEMONIC: &str = "dragon pool symptom mandate ill expand sibling feature inhale melt envelope essay";

const BUCKET_NAME: &str = "Bucket_For_Docs";

async fn main() {
    let sdk = ChainSdk::new(MNEMONIC, "service_name");

    let result = sdk.store_file("", BUCKET_NAME).await;
    match result {
        Ok(r) => {
            println!("File upload successful: {:?}", r);
        Err(e) => {
            println!("File upload failed: {:?}", e);


Last updated