Put Content

The .PutContentToStorageEngine() function:

  • serializes or saves the content object of the message to either ipfs or storage server

  • adds the item_hash from the content to the message object.

All parameters are required.

inlineRequested can be either true or false. If true, the content will be serialized otherwise the content is saved to:

  • ipfs if "IPFS" is passed as storage_engine

  • storage otherwise.

import { PutContentToStorageEngine } from "aleph-sdk-ts/messages/create/publish"
import { StorageEngine } from "aleph-sdk-ts/messages/message"

(async() => {
  await PutContentToStorageEngine({
    message: message,
    content: content,
    inlineRequested: true,
    storageEngine: StorageEngine.STORAGE,
    APIServer: "https://api2.aleph.im"
  })
})()
ParameterDescription

message - Message

Message the item_hash will be added to.

content - object

Content to save to storage.

inlineRequested - boolean

Whether to serialize the content or not.

storageEngine - StorageEngine

Storage engine to use, either Aleph storage or IPFS.

Possible values: StorageEngine.STORAGE or StorageEngine.IPFS

APIServer - string

Target API server

Last updated