iexec / Exports / IExecStorageModule
module exposing storage methods
-
↳
IExecStorageModule
• new IExecStorageModule(configOrArgs
, options?
): IExecStorageModule
Create an IExecModule instance
Name | Type |
---|---|
configOrArgs |
IExecConfig | IExecConfigArgs |
options? |
IExecConfigOptions |
• 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);
Name | Type |
---|---|
beneficiaryAddress |
string |
options? |
Object |
options.provider? |
string |
options.teeFramework? |
TeeFramework |
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: 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);
Name | Type |
---|---|
token |
string |
options? |
Object |
options.forceUpdate? |
boolean |
options.provider? |
string |
options.teeFramework? |
TeeFramework |
Promise
<{ isPushed
: boolean
; isUpdated
: boolean
}>
▸ fromConfig(config
): IExecStorageModule
Create an IExecStorageModule instance using an IExecConfig instance
Name | Type |
---|---|
config |
IExecConfig |