secret-admirer

Secret admirer is a demo dapp to TL;DR new features in v7 for developers already familiar with the iExec stack, Please refer to the technical documentation and SDK Documentation to see the full feature details as this is only a short summary.

This application requires an mailjet API key (topped up $), therefore the code here is to be read rather than be deployed as a dapp. Secret-admirer makes am http call to send an SMS that hides the originating address, all while preserving the privacy of the sender and the contents of the text message (if you trust mailjet not to make a copy of it).

Make sure to edit your chain.json file to set up the bellecour SMS address :

...
"bellecour": {
"sms": "https://v7.sms.debug-tee-services.bellecour.iex.ec"
},
...

multisecret

Rather than using a dataset for confidential data, the application uses two requester secrets and one application secret :

application secret

The application secret (env var IEXEC_APP_DEVELOPER_SECRET) is used to store the API key, it is tied to the application itself and not modifiable by the requester.

To register the application secret, the application must be previously deployed (as confirmed in your deployed.json file, then you must execute :

iexec app push-secret

a prompt will ask you to set the value of the secret and to sign it, so that it can be pushed to the SMS.

requester secret

The requester secrets (env vars IEXEC_REQUESTER_SECRET_N) are used to store the recipient's address and the message to be sent. In this example two secrets are used but in reality one json key-value secret would be enough for it to work.

Requester secrets are tied to the requester, they are t obe set before launching the execution.

iexec requester push-secret number
iexec requester push-secret secretmsg

a prompt will ask you to set the value of the secret and to sign it, so that it can be pushed to the SMS.

ens registry

Assets can now be registered in the domains apps|users|pools|datasets.iexec.eth:

iexec ens register secretadmirer --domain apps.iexec.eth --for <app_address>

A lookup feature as well as domain resolution are also available in the documentation.

task feedback

It is now possible to get rich information concerning a task by using the task debug command :

iexec task debug <task_id> --logs

If no stdout logs are found is because they don't exist yet (the app is just starting), logs can only be read by the app developer.

The output constist of three parts :

On-chain data:

✔ Task 0xe44f271d6cd3598c57d3e0fb91cbc45016e00057ff4094fbc46a21c1f9fd809f:

ℹ On-chain data:

taskid:               0xe44f271d6cd3598c57d3e0fb91cbc45016e00057ff4094fbc46a21c1f9fd809f
status:               3
dealid:               0x4e0b5e36ad13ce93f3366da4a18cd0c22446a7ca77c3abc66beaba8f87da66f0
idx:                  0
timeref:              300
...

Off-chain data :

ℹ Off-chain data:

chainTaskId:                  0xe44f271d6cd3598c57d3e0fb91cbc45016e00057ff4094fbc46a21c1f9fd809f
replicates: 
  - 
    self:             http://v7.core.debug-main-pool.bellecour.iex.ec/tasks/0xe44f271d6cd3598c57d3e0fb91cbc45016e00057ff4094fbc46a21c1f9fd809f/replicates/0x1b5b7c601c3231a97efd80abba3538bfe5062c96
    chainTaskId:      0xe44f271d6cd3598c57d3e0fb91cbc45016e00057ff4094fbc46a21c1f9fd809f
    walletAddress:    0x1b5b7c601c3231a97efd80abba3538bfe5062c96
    currentStatus:    COMPLETED
    statusUpdateList: 
      - 
        status: CREATED
        date:   2022-07-20T08:31:12.799+00:00
      - 
      ...

App logs (stderr, stdout) :

ℹ App logs:

- 
  worker: 0x1b5b7c601c3231a97efd80abba3538bfe5062c96
  stderr: 
    """
      [SCONE|INFO] src/enclave/dispatch.c:135:print_version(): Logging level set to INFO due to variable SCONE_LOG from untrusted environment

Wrap up : launching with the iExec CLI

iexec app run secretadmirer.users.iexec.eth \ 
--secret 1=number 2=secretmsg \
--tag tee \
--workerpool v7-debug.main.pools.iexec.eth

It is very likely that no remaining request orders are left by the time you are reading this :)