iexec / IExecStorageModule
module exposing storage methods
new IExecStorageModule(
configOrArgs,options?):IExecStorageModule
Create an IExecModule instance
IExecStorageModule
config:
IExecConfig
current IExecConfig
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);string
string
Promise<boolean>
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);Promise<string>
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: trueis 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);string
boolean
string
Promise<{ isPushed: boolean; isUpdated: boolean; }>
staticfromConfig(config):IExecStorageModule
Create an IExecStorageModule instance using an IExecConfig instance
IExecStorageModule