Crate ic_file_uploader

Source
Expand description

This crate provides functionality for uploading files to Internet Computer canisters.

It includes utilities for splitting files into chunks, converting data to blob strings, and interfacing with the dfx command-line tool to upload data to canisters.

Modules§

parallel
Parallel chunk uploader for Internet Computer canisters

Structs§

UploadConfig
Configuration for upload operations with retry and resume capabilities.
UploadParams
Parameters for uploading file chunks to a canister

Enums§

ChunkUploadResult
Result of a chunk upload operation

Constants§

MAX_CANISTER_HTTP_PAYLOAD_SIZE
The maximum size of the HTTP payload for canister updates, set to 2 MiB.

Functions§

create_error_string
Creates a formatted error string.
dfx
Executes a dfx command with the specified arguments.
split_into_chunks
Splits the data into chunks.
upload_chunk
Uploads a chunk of data to the specified canister method.
upload_chunk_with_config
Uploads a single chunk with retry logic based on the provided configuration.
upload_chunks_with_resume
Uploads multiple chunks with comprehensive error handling and resume capability.
vec_u8_to_blob_string
Converts a vector of bytes to a blob string.