Leafhopper is an implementation of the process channel approach: it transforms a BPMN choreography in a state channel network. Leafhopper is the research prototype to the paper Process Channels: A New Layer for Process Enactment Based on Blockchain State Channels, submitteed to BPM 2023. See Replicate the Case Studies below.
Leafhopper uses Chorpiler for code generation and additionally implements the static trigger component capabilities, e.g., routing, signature verification etc. Leafhopper provides a set of automated script to assist in the deployment of the channel. It implements two case studies, for which correctness and gas cost benchmarks can be executed.
- The channel trigger is a node.js server and holds the current state of the process and maintains a connection to each other trigger in the network.
It can receive requests from outside over the
/enact/:taskid
route to advance the state of the process. The triggers can be configured for different identities depending on the participants of the channel. Each trigger is run in a docker container and Leafhopper deploys them through Docker compose. - The channel contract is a solidty state channel smart contract generated by Chorpiler, Leafhopper assists in the configuration and deployment of it.
Here, we describe how to repliacte the evaluation section of Process Channels: A New Layer for Process Enactment Based on Blockchain State Channels, submitteed to BPM 2023.
The project is built using node. For the correctness benchmark, additionally, Docker is required. Leafhopper has been developed for node version 19.6.
- Install node.js.
- Install Docker.
- Clone the repository.
- In the project directory run
npm install
.
To replicate the correctness benchmarks, make sure Docker is running and run npm run case/0 correctness
for the incident management case
and npm run case/1 correctness
for the supply chain case in the project directory. The console output will also report interim results (Part of the process can take a while, for example, booting up the docker compose network). In the end, the script must report
All conforming traces accepted!
All non-conforming traces caught!
If you force close out of the script, make sure to stop deployed docker containers and delete their images before starting another run. If the script runs through it will clean up by itself.
To replicate the gas cost benchmark run npm run case/0 gas
for the incident management case
and npm run case/1 gas
for the supply chain case in the project directory. The console output will summarise the measured gas cost in a table and will also report on interim results. At the end of the run a table labelled Total Case Cost is output to the console.
- Install node.js.
- Install Docker.
- Clone the repository.
- In the project directory run
npm install
.
The configuration is performed in the folder src/configruation/'. The BPMN model of the case should be placed in
src/config/model/case.bpmn'. Then it will be automatically picked up by the generate scripts.
Participants identities must be configured accordingly in `src/configruation/participants.config.ts.'
npm run ...
build
: Build the project and compile the contract. Requires a generate run before.chain
: simulates Ethereum through ganache.generate
: generates the enactment components from the config folder.deploy
: deploys the channel contract to the insrc/configruation/deployment.config.ts
configured blockchain environmentcase/0
: Run the incident management case study either with 'correctness' or 'gas'.case/1
: Run the supply chain case study either with 'correctness' or 'gas'.