Skip to content

Test CONFETTY locally

IReallyLikeYourPants edited this page Mar 11, 2026 · 31 revisions

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.


Initialize the framework

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.

MetaMask installation

  1. Install the MetaMask browser extension:
https://metamask.io/download
  1. 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.
  1. 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.

  1. 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

Add Ganache network to MetaMask

  1. Open the MetaMask extension in your browser.

  2. Open the network menu:

  • Click the menu icon (top right).
  • Go to Networks.
  • Click Add a custom network.
  1. Configure the network with the following parameters:
Network name: Ganache
RPC URL: http://0.0.0.0:7545
Chain ID: 1337
Currency symbol: ETH
  1. Click Save.

MetaMask will now include the local network provided by Ganache.


Frontend execution

Once the framework has been initialized and MetaMask is set up, you can interact with CONFETTY through the frontend.

Login as Radiology

  1. Open the CONFETTY frontend at:
http://localhost:8081/ChorChain/
  1. MetaMask will display a connection request popup.
    Click Connect.

  2. From the account selector in MetaMask (top left), choose Account 6 (Radiology).

  3. MetaMask will display a confirmation popup at the bottom asking to connect Account 6 to localhost:8081. Confirm the connection.

  4. Copy the Ethereum address of Account 6 (Radiology).

  5. 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.

Import the running example model

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.

  1. Click Import Model.
  2. Select the downloaded x-ray.xml file.
  3. Assign it a name.
  4. Click Save Model to store it in the CONFETTY database.

Create a process instance

  1. Go to the Home Page.
  2. On the left side, you will see the name of your model.
  3. Click on the model.
  4. Click Create instance.
  5. Then click Create instances again to confirm.

A new process instance is now created.


Subscribe participants to roles

Each participant must subscribe to their role in the process.

Radiology

Since you are currently logged in as Radiology:

  1. Subscribe to the Radiology role.
  2. Sign the MetaMask transaction when prompted.

Switching accounts in MetaMask

To assign the remaining roles, you must switch MetaMask accounts and log in again with the new account.

  1. Go back to:
http://localhost:8081/ChorChain/
  1. In MetaMask, select the account corresponding to the participant you want to register (for example Account 7 (Patient)).

  2. MetaMask will display a confirmation popup at the bottom asking to connect Account 7 to localhost:8081. Confirm the connection.

  3. Perform Sign up again using the new Ethereum address.

  4. Log in to the frontend.

  5. Open the previously created model instance.

  6. Subscribe to the Patient role.

  7. Sign the MetaMask transaction.


Ward and insurance

Repeat the same account switching procedure for the remaining roles:

  • Account 8 → Ward
  • Account 9 → Insurance

Complete the instance

After all roles have subscribed, a new button will appear:

Complete instance
  1. Click Complete instance.
  2. A table will appear.
  3. 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.


Execute the process

The process can now be executed.


Step 1: Patient sends the medical prescription

  1. Switch to Account 7 (Patient) by going back to
http://localhost:8081/ChorChain/

and logging in with the correct account.

  1. Go to the Execution Page.
  2. 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:

  1. Insert the message data in the input box.
  2. Select Encrypted so that only Radiology can read the message.
  3. Click Send message.
  4. Sign the MetaMask transaction.

Step 2: Radiology reads the message

  1. Switch to Account 6 (Radiology) by going back to
http://localhost:8081/ChorChain/

and logging in with the correct account.

  1. Go to the Execution Page.
  2. Select the correct instance.

Radiology can now read the encrypted medicalPrescription.

  1. Click Read message.
  2. 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.


Step 3: Ward processes the request

  1. Switch to Account 8 (Ward) by going back to
http://localhost:8081/ChorChain/

and logging in with the correct account.

  1. Go to the Execution Page.
  2. 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.


Continue the execution

By repeating the same pattern (switching accounts and executing the enabled actions), the entire process can be executed until completion.


Experiment with other BPMN choreographies

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.