Skip to content

Advanced Configuration ​

The IExecDataProtector constructor accepts additional configuration parameters. As these parameters are very specific, they are not needed for a standard usage of @iexec/dataprotector.

Similarly, not all functionalities need to be instantiated at once in the SDK, as described in the getting started section.

Parameters ​

ts
import { type 
DataProtectorConfigOptions
} from '@iexec/dataprotector';

dataprotectorContractAddress ​

Address

The Ethereum contract address for dataProtector smart contract. If not provided, the default dataProtector contract address will be used.

ts
const 
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
dataprotectorContractAddress
: '0x123abc...',
});

subgraphUrl ​

string

The subgraph URL for querying data.

If not provided, the default data protector subgraph provided by iExec will be used.

ts
const 
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
subgraphUrl
: 'subgraph-url',
});

ipfsNode ​

string

The IPFS node URL for content uploads. Use this option if you want to use your own IPFS node to upload content.

If not provided, the default IPFS node provided by iExec will be used.

ts
const 
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
ipfsNode
: 'ipfs-node-url',
});

ipfsGateway ​

string

The IPFS gateway URL used for content downloads. Mainly used for checking content uploaded on the IPFS network. Use this option if you want to use your own IPFS node for content downloads.

If not provided, the default IPFS gateway provided by iExec will be used.

ts
const 
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
ipfsGateway
: 'ipfs-gateway-url',
});

iexecOptions ​

Low level configuration options for iexec SDK, see iexec SDK documentation IExecConfigOptions for more details.

ts
const 
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
iexecOptions
: {
smsURL
: 'sms-url' },
});

INFO

@iexec/dataprotector uses Intel TDX to process protected data. Connect to the TDX SMS and use the TDX workerpool to configure the SDK:

Browser
ts
import { 
IExecDataProtector
} from '@iexec/dataprotector';
const
web3Provider
=
window
.
ethereum
;
// Instantiate dataProtector connected to the TDX SMS const
dataProtector
= new
IExecDataProtector
(
web3Provider
, {
iexecOptions
: {
smsURL
: 'https://sms.labs.iex.ec',
}, });