Storage Kit

Storage Manager Service (IPFS)

The Storage Manager Service provides methods for uploading and retrieving files using IPFS.

Table of Contents

  • uploadFile

  • getFileDetails

uploadFile

Uploads a file to IPFS.

Parameters:

  • fileStream (Buffer): The file stream or data to upload.

Usage:

const fileStream = fs.readFileSync("./resources/test.jpeg");
const uploadFileStatus = await StorageMgrService.uploadFile(fileStream);
console.log(uploadFileStatus);

getFileDetails

Retrieves details of files stored in IPFS.

Parameters:

  • page (number): The page number of the file list (optional, default: 1).

  • limit (number): The maximum number of files to retrieve per page (optional, default: 10).

Usage:

const getFileDetailsStatus = await StorageMgrService.getFileDetails(1, 5);
console.log(JSON.stringify(getFileDetailsStatus));

These methods allow you to upload files to IPFS and retrieve file details stored in IPFS. Provide the necessary parameters based on your requirements and utilize the returned data as needed.

Last updated