-
Notifications
You must be signed in to change notification settings - Fork 0
Test CONFETTY locally
This Wiki page contains the steps required to test CONFETTY locally through the frontend web application.
We explain how to execute the Running Example presented in the paper.
Please ensure that you have completed the steps in the Requirements, installation, and preliminary operations section before proceeding with the tests.
If your CONFETTY container is not running, execute:
docker start confetty_container
Then enter the container:
docker exec -it confetty_container bash
At this stage, you should see a terminal prompt as root inside the container.
Now execute:
./web_init.sh
This script automatically performs the following operations:
- Starts the local blockchain Ganache with predefined accounts.
- Starts MongoDB to store server information.
- Deploys the CONFETTY smart contracts on the blockchain.
- Starts IPFS.
- Builds and starts the frontend server Tomcat.
- Starts the APIs required to communicate with the Confidentiality Interface.
- Install the MetaMask browser extension:
https://metamask.io/download
- After the installation:
- Pin the MetaMask extension to the browser toolbar to facilitate its use.
- Open MetaMask.
- Click I have an existing wallet.
- Select Import using Secret Recovery Phrase.
- Use the following Secret Recovery Phrase:
control pulse code indoor off imitate uncover lesson fragile isolate fault blast
Note:
Ganache is started using the same Secret Recovery Phrase.
This ensures that the accounts generated in MetaMask match those funded with ETH in the local blockchain.
- Set up a password, complete the setup, and open the wallet.
You will see a list of generated accounts. In the CONFETTY framework, they are used as follows:
- Account 0: Default CONFETTY account.
- Accounts 1–4: Used as Certifiers.
- Account 5 onward: can be used as process participants.
In this setup, based on the Running Example described in the paper, the following accounts are used (as indicated by the MetaMask labels in parentheses):
- Account 6 → Radiology
- Account 7 → Patient
- Account 8 → Ward
- Account 9 → Insurance
-
Open the MetaMask extension in your browser.
-
Open the network menu:
- Click the menu icon (top right).
- Go to Networks.
- Click Add a custom network.
- Configure the network with the following parameters:
Network name: Ganache
RPC URL: http://0.0.0.0:7545
Chain ID: 1337
Currency symbol: ETH
- Click Save.
MetaMask will now include the local network provided by Ganache.
Once the framework has been initialized and MetaMask is set up, you can interact with CONFETTY through the frontend.
- Open the CONFETTY frontend at:
http://localhost:8081/ChorChain/
-
MetaMask will display a connection request popup.
Click Connect. -
From the account selector in MetaMask (top left), choose Account 6 (Radiology).
-
MetaMask will display a confirmation popup at the bottom asking to connect Account 6 to
localhost:8081. Confirm the connection. -
Copy the Ethereum address of Account 6 (Radiology).
-
On the CONFETTY webpage:
- Go to the Sign up or Create account section.
- Paste the copied Ethereum address and sign up.
- Then go to the Login section and log in.
After logging in, you will see three main sections at the top of the interface:
- Home Page: for the Configure and Instantiate functionalities.
- Modeler: for creating or importing BPMN choreographies to execute.
- Execution Page: for the Transact and Inspect functionalities.
To execute the running example described in the paper, go to:
https://github.com/Process-in-Chains/CONFETTY/tree/main/Evaluation%20Tool/data/models
and download the BPMN choreography model:
x-ray.xml
Go to the Modeler page in the frontend.
- Click Import Model.
- Select the downloaded
x-ray.xmlfile. - Assign it a name.
- Click Save Model to store it in the CONFETTY database.
- Go to the Home Page.
- On the left side, you will see the name of your model.
- Click on the model.
- Click Create instance.
- Then click Create instances again to confirm.
A new process instance is now created.
Each participant must subscribe to their role in the process.
Since you are currently logged in as Radiology:
- Subscribe to the Radiology role.
- Sign the MetaMask transaction when prompted.
To assign the remaining roles, you must switch MetaMask accounts and log in again with the new account.
- Go back to:
http://localhost:8081/ChorChain/
-
In MetaMask, select the account corresponding to the participant you want to register (for example Account 7 (Patient)).
-
MetaMask will display a confirmation popup at the bottom asking to connect Account 7 to
localhost:8081. Confirm the connection. -
Perform Sign up again using the new Ethereum address.
-
Log in to the frontend.
-
Open the previously created model instance.
-
Subscribe to the Patient role.
-
Sign the MetaMask transaction.
Repeat the same account switching procedure for the remaining roles:
- Account 8 → Ward
- Account 9 → Insurance
After all roles have subscribed, a new button will appear:
Complete instance
- Click Complete instance.
- A table will appear.
- Click Instantiate on-chain.
You will be asked to sign two blockchain transactions in MetaMask.
Note:
In this table it is also possible to add additional auditors (for example the Ministry of Health) by clicking Add reader.
After these steps, the process instance is deployed on chain.
The process can now be executed.
- Switch to Account 7 (Patient) by going back to
http://localhost:8081/ChorChain/
and logging in with the correct account.
- Go to the Execution Page.
- Select the correct BPMN instance.
You will see the BPMN choreography and the currently enabled action.
The Patient can send the message:
medicalPrescription
To do this:
- Insert the message data in the input box.
- Select Encrypted so that only Radiology can read the message.
- Click Send message.
- Sign the MetaMask transaction.
- Switch to Account 6 (Radiology) by going back to
http://localhost:8081/ChorChain/
and logging in with the correct account.
- Go to the Execution Page.
- Select the correct instance.
Radiology can now read the encrypted medicalPrescription.
- Click Read message.
- Sign the MetaMask transaction.
On the right side of the interface you will see the decrypted payload.
Radiology can now continue the execution by sending the next message:
requestId
Remember to select Encrypted before sending the message to limit the number of readers.
- Switch to Account 8 (Ward) by going back to
http://localhost:8081/ChorChain/
and logging in with the correct account.
- Go to the Execution Page.
- Select the correct instance.
The Ward can read the requestId message.
Then, it can send the accepted message. The Encrypted checkbox must be left unchecked.
Since this message is evaluated by an XOR gateway, it should not be encrypted.
Note:
The messages that should be evaluated by the gateways should be non-encrypted.
By repeating the same pattern (switching accounts and executing the enabled actions), the entire process can be executed until completion.
The scenario presented here illustrates the Running Example described in the paper.
Feel free to test CONFETTY with any BPMN choreography of your choice by importing or drawing different models.