This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
storage: v1.0.0
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 classSpheronClient
, which takes a configuration object in its constructor with one propertytoken
. SpheronClient
has one method,upload(filePath, configuration)
, which takes the file or directory from thefilePath
, 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 uploadbucketId
- the id of the bucketprotocolLink
- is the protocol link of the uploaddynamicLinks
- 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.