Skip to content

Latest commit

 

History

History
181 lines (102 loc) · 3.43 KB

File metadata and controls

181 lines (102 loc) · 3.43 KB

iexec


iexec / IExecStorageModule

Class: IExecStorageModule

module exposing storage methods

Extends

Constructors

Constructor

new IExecStorageModule(configOrArgs, options?): IExecStorageModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecStorageModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

checkStorageTokenExists()

checkStorageTokenExists(beneficiaryAddress, options?): Promise<boolean>

check if a storage token exists for the beneficiary in the Secret Management Service

NB: specify the storage provider with the option provider (supported values 'ipfs'|'dropbox' default 'ipfs')

example:

const isIpfsStorageInitialized = await checkStorageTokenExists(userAddress);
console.log('IPFS storage initialized:', isIpfsStorageInitialized);

Parameters

beneficiaryAddress

string

options?
provider?

string

teeFramework?

TeeFramework

Returns

Promise<boolean>


defaultStorageLogin()

defaultStorageLogin(): Promise<string>

SIGNER REQUIRED, ONLY BENEFICIARY

get an authorization token from the default IPFS based remote storage

example:

const token = await defaultStorageLogin();
const { isPushed } = await pushStorageToken(token);
console.log('default storage initialized:', isPushed);

Returns

Promise<string>


pushStorageToken()

pushStorageToken(token, options?): Promise<{ isPushed: boolean; isUpdated: boolean; }>

SIGNER REQUIRED, ONLY BENEFICIARY

push a personal storage token to the Secret Management Service to allow result archive upload

NB:

  • specify the storage provider with the option provider (supported values 'ipfs'|'dropbox' default 'ipfs')
  • this method will throw an error if a token already exists for the target storage provider in the Secret Management Service unless the option forceUpdate: true is used.

example:

  • init default storage
const token = await defaultStorageLogin();
const { isPushed } = await pushStorageToken(token);
console.log('default storage initialized:', isPushed);
  • init dropbox storage
const { isPushed } = await pushStorageToken(dropboxApiToken, {provider: 'dropbox'});
console.log('dropbox storage initialized:', isPushed);

Parameters

token

string

options?
forceUpdate?

boolean

provider?

string

teeFramework?

TeeFramework

Returns

Promise<{ isPushed: boolean; isUpdated: boolean; }>


fromConfig()

static fromConfig(config): IExecStorageModule

Create an IExecStorageModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecStorageModule

Overrides

IExecModule.fromConfig