Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dapp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
environment: ['bellecour-dev', 'arbitrum-sepolia-dev']
environment: ['arbitrum-sepolia-dev']
environment: ${{ matrix.environment }}
defaults:
run:
Expand Down
110 changes: 0 additions & 110 deletions .github/workflows/dapp-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ on:
type: choice
options:
# dev environments
- bellecour-dev
- arbitrum-sepolia-dev
# prod environments (requires a tag starting with dapp-v)
- bellecour-prod
- arbitrum-sepolia-prod
- arbitrum-prod

Expand Down Expand Up @@ -73,34 +71,6 @@ jobs:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKERHUB_PAT }}

sconify:
if: startsWith(github.event.inputs.environment, 'bellecour-')
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/sconify.yml@sconify-v2.0.0
needs: [docker-publish, extract-tag]
with:
image-name: 'iexechub/web3mail-dapp'
image-tag: ${{ needs.extract-tag.outputs.clean_tag }}
sconify-debug: false
sconify-prod: true
docker-registry: docker.io
sconify-version: ${{ vars.SCONIFY_VERSION }}
binary: /usr/local/bin/node
command: node
host-path: |
/etc/hosts
/etc/resolv.conf
binary-fs: true
fs-dir: /app
heap: 1G
dlopen: 1
mprotect: 0
secrets:
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-password: ${{ secrets.DOCKERHUB_PAT }}
scontain-username: ${{ secrets.SCONTAIN_REGISTRY_USERNAME }}
scontain-password: ${{ secrets.SCONTAIN_REGISTRY_PAT }}
scone-signing-key: ${{ secrets.SCONIFY_SIGNING_PRIVATE_KEY }}

deploy-tdx-dapp:
if: startsWith(github.event.inputs.environment, 'arbitrum-')
needs: [extract-tag, docker-publish]
Expand Down Expand Up @@ -168,83 +138,3 @@ jobs:
cd node_modules/whitelist-smart-contract
export ADDRESS_TO_ADD=$(cat ../../deployment-dapp/.app-address)
npm run addResourceToWhitelist -- --network ${{ vars.WHITELIST_NETWORK_NAME }}

deploy-scone-dapp:
if: startsWith(github.event.inputs.environment, 'bellecour-')
needs: [extract-tag, sconify]
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.19.0'
cache: 'npm'

- name: Install dependencies
run: |
npm ci
cd node_modules/whitelist-smart-contract
npm install --save-dev ts-node
cd ../../deployment-dapp
npm ci

- name: Deploy SCONE dapp contract
env:
WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
DOCKER_IMAGE_TAG: ${{ needs.sconify.outputs.prod-image-tag }}
CHECKSUM: ${{ needs.sconify.outputs.prod-checksum }}
FINGERPRINT: ${{ needs.sconify.outputs.prod-mrenclave }}
RPC_URL: ${{ secrets.RPC_URL }}
SCONIFY_VERSION: ${{ vars.SCONIFY_VERSION }}
run: |
cd deployment-dapp
npm run deploy-dapp

- name: Push dapp secret
env:
WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
MJ_APIKEY_PUBLIC: ${{ secrets.MAILJET_APIKEY_PUBLIC }}
MJ_APIKEY_PRIVATE: ${{ secrets.MAILJET_APIKEY_PRIVATE }}
MJ_SENDER: ${{ secrets.MAILJET_SENDER }}
MAILGUN_APIKEY: ${{ secrets.MAILGUN_APIKEY }}
WEB3MAIL_WHITELISTED_APPS: ${{ vars.WEB3MAIL_WHITELISTED_APPS }}
POCO_SUBGRAPH_URL: ${{ vars.POCO_SUBGRAPH_URL }}
RPC_URL: ${{ secrets.RPC_URL }}
SCONIFY_VERSION: ${{ vars.SCONIFY_VERSION }}
run: |
cd deployment-dapp
npm run push-dapp-secret

- name: Publish free sell order
env:
WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
PRICE: ${{ vars.SELL_ORDER_PRICE }}
VOLUME: ${{ vars.SELL_ORDER_VOLUME }}
RPC_URL: ${{ secrets.RPC_URL }}
TEE_FRAMEWORK: ${{ vars.TEE_FRAMEWORK }}
run: |
cd deployment-dapp
npm run publish-sell-order

- name: Add resource to whitelist
env:
CONTRACT_ADDRESS: ${{ vars.WEB3MAIL_WHITELIST_CONTRACT_ADDRESS }}
PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
RPC_URL: ${{ secrets.RPC_URL }}
run: |
cd node_modules/whitelist-smart-contract
export ADDRESS_TO_ADD=$(cat ../../deployment-dapp/.app-address)
npm run addResourceToWhitelist -- --network ${{ vars.WHITELIST_NETWORK_NAME }}

- name: Configure ENS
if: ${{ vars.DAPP_ENS_NAME }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
DAPP_ENS_NAME: ${{ vars.DAPP_ENS_NAME }}
run: |
cd deployment-dapp
npm run configure-ens
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ yarn add @iexec/web3mail
### Browser

```ts
import { IExecWeb3mail } from "@iexec/web3mail";
import { IExecWeb3mail } from '@iexec/web3mail';

const web3Provider = window.ethereum;
const web3mail = new IExecWeb3mail(web3Provider);
const web3Provider = window.ethereum;
const web3mail = new IExecWeb3mail(web3Provider);
```

### NodeJS

```ts
import { IExecWeb3mail, getWeb3Provider } from "@iexec/web3mail";
import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';

const { PRIVATE_KEY } = process.env;
const { PRIVATE_KEY } = process.env;

const web3Provider = getWeb3Provider(PRIVATE_KEY);
const web3mail = new IExecWeb3mail(web3Provider);
const web3Provider = getWeb3Provider(PRIVATE_KEY, 421614);
const web3mail = new IExecWeb3mail(web3Provider);
```

## Documentation
Expand Down
8 changes: 4 additions & 4 deletions dapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-sonarjs": "^0.21.0",
"iexec": "^8.24.0",
"iexec": "^9.0.0",
"jest": "^29.7.0",
"prettier": "^2.8.8"
}
Expand Down
38 changes: 0 additions & 38 deletions dapp/sconify.sh

This file was deleted.

2 changes: 1 addition & 1 deletion dapp/tests/e2e/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('sendEmail', () => {
beforeEach(async () => {
// worker env setup
process.env.WEB3MAIL_IPFS_GATEWAY =
'https://ipfs-gateway.v8-bellecour.iex.ec';
'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec';
process.env.IEXEC_IN = './tests/_test_inputs_';
process.env.IEXEC_OUT = './tests/_test_outputs_/iexec_out';
// clean IEXEC_OUT
Expand Down
5 changes: 3 additions & 2 deletions dapp/tests/unit/decryptEmailContent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('decryptContent', () => {
const { IExec } = await import('iexec');

const iexec = new IExec({
ethProvider: 'bellecour',
ethProvider: 'arbitrum-sepolia-testnet',
});

const encryptionKey = iexec.dataset.generateEncryptionKey();
Expand All @@ -26,7 +26,8 @@ describe('decryptContent', () => {
});

describe('downloadEncryptedContent', () => {
const DEFAULT_IPFS_GATEWAY = 'https://ipfs-gateway.v8-bellecour.iex.ec';
const DEFAULT_IPFS_GATEWAY =
'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec';

beforeEach(() => {
process.env.WEB3MAIL_IPFS_GATEWAY = DEFAULT_IPFS_GATEWAY;
Expand Down
5 changes: 4 additions & 1 deletion demo/node-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';
import { Wallet } from 'ethers';

const test = async () => {
const ethProvider = getWeb3Provider(Wallet.createRandom().privateKey);
const ethProvider = getWeb3Provider(
Wallet.createRandom().privateKey,
421614
);

const web3mail = new IExecWeb3mail(ethProvider);

Expand Down
5 changes: 4 additions & 1 deletion demo/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';
import { Wallet } from 'ethers';

const test = async () => {
const ethProvider = getWeb3Provider(Wallet.createRandom().privateKey);
const ethProvider = getWeb3Provider(
Wallet.createRandom().privateKey,
421614
);

const web3mail = new IExecWeb3mail(ethProvider);

Expand Down
8 changes: 4 additions & 4 deletions deployment-dapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions deployment-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"push-dapp-secret": "tsx ./src/pushSecretScript.ts",
"publish-sell-order": "tsx ./src/publishSellOrderScript.ts",
"revoke-sell-order": "tsx ./src/revokeSellOrderScript.ts",
"configure-ens": "tsx ./src/configureEnsNameScript.ts",
"lint": "eslint .",
"format": "prettier --write \"src/**/*.ts\"",
"check-format": "prettier --check \"src/**/*.ts\""
Expand All @@ -18,7 +17,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"iexec": "^8.24.0",
"iexec": "^9.0.0",
"typescript": "^5.0.4",
"yup": "^1.2.0"
},
Expand Down
22 changes: 0 additions & 22 deletions deployment-dapp/src/configureEnsNameScript.ts

This file was deleted.

2 changes: 1 addition & 1 deletion deployment-dapp/src/revokeSellOrderScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const main = async () => {
// validate params
const orderHash = await orderHashSchema().validate(ORDER_HASH);

//revoke sell order for Tee app (scone)
//revoke sell order for Tee app
const txHash = await revokeSellOrder(iexec, orderHash);
if (!txHash) throw Error(`Failed to revoke app sell order: ${orderHash}`);
};
Expand Down
11 changes: 0 additions & 11 deletions deployment-dapp/src/singleFunction/configureEnsName.ts

This file was deleted.

Loading
Loading