Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

storage: v1.0.0

Compare
Choose a tag to compare
@shomix shomix released this 12 Feb 12:41
· 92 commits to main since this release
7c9bf43

Feature

Created a package named @spheron/storage. This package provides support for uploading files and directories to a specified protocol.

  • The @spheron/storage package exports a class SpheronClient, which takes a configuration object in its constructor with one property token.
  • SpheronClient has one method, upload(filePath, configuration), which takes the file or directory from the filePath, chunks it into multiple payloads, and uploads them in parallel.
    • filePath - parameter is the path to the file or directory that is being uploaded.
    • configuration object has two properties:
      • protocol - the protocol on which the file or directory should be uploaded. Valid values are [ ARWEAVE, IPFS, FILECOIN].
      • name - the name of the bucket for which the data should be uploaded.
    • The response of the upload function is an object with the parameters:
      • uploadId - the id of the upload
      • bucketId - the id of the bucket
      • protocolLink - is the protocol link of the upload
      • dynamicLinks - are domains that you have set up for your bucket. When you upload new data to the same bucket, the domains will point to the new uploaded data.