StoreObject

This is the interface for uploading objects to the gateway.

// StoreObject stores object to the gateway
//
// Receive parameter:
//   - url: gateway url
//   - territory: territory name
//   - mnemonic: polkadot account mnemonic
//   - reader: strings, byte data, file streams, network streams, etc
//
// Return parameter:
//   - string: [fid] unique identifier for the file
//   - error: error message
//
// Preconditions:
//  1. Account requires purchasing space, refer to [BuySpace] interface.
//  2. Authorize the space usage rights of the account to the gateway account,
//     refer to the [AuthorizeSpace] interface.
//
// Explanation:
//   - Account refers to the account where you configured mnemonic when creating an SDK.
func StoreObject(url string, territory, mnemonic string, reader io.Reader) (string, error)

Example code:

Last updated

Was this helpful?