The design and implementation of a blockchain application are quite challenging. With BANCO, we propose a tool to simplify this step to the point that you can generate your own application with a few clicks! The generated product includes state-of-the-art blockchain design patterns and good practices, and its modularity will allow you to build new features over this solid code ground!
Want to try it? Click here to access the tool.
This repository holds the codebase of BANCO, a tool to create a blockchain product following a software product line approach. The configurator allows the user to select the desired features for the product to build. Each feature is present in the feature model, which describes how one feature can be combined with others. The configurator is in charge of verifying that the configuration made by the user complies with the feature model.
After the selection of features, a generator is able to assemble a working blockchain product based on the configuration and predefined templates.
This first project iteration will allow the creation of blockchain products for on-chain traceability of assets and processes. Future works will consist in extending this approach to other domains and address further aspects of software product line engineering, such as product updates when modifying the software product line.
A publication, currently in review, will be referenced here in the future. It describes in-depth the method used to build a software product line for blockchain applications (the feature model and the web platform introduced in this repository) and evaluates the relevancy of the approach by assessing the cost, the code quality, and the generalizability of the approach to other traceability applications. It also gives insights into the benefits of applying SPLE for blockchain applications.
There are two ways to run BANCO: from the sources or the prebuilt docker image.
The following list enumerates the important folders of this repository.
- /evaluation - contains the source code generated by BANCO to serve the evaluation part of our contribution. They are shared on this repository for reproducibility and transparency purposes, following open science principles.
- /src - contains the source code of BANCO
- /artifacts - contains the template application and smart contracts that are used by the generator to create new blockchain products, based on the user configuration.
- /feature_model - contains the SPL feature model. Can be opened in Eclipse, if FeatureIDE is installed.
- /contracts - contains the smart contracts templates.
- /manual_generation - contains a script to generate a product without requiring the deployment of the web platform.
- /artifacts - contains the template application and smart contracts that are used by the generator to create new blockchain products, based on the user configuration.
To use our prebuilt docker image, type the following command in your terminal.
docker run -p 3000:3000 bladesorbonne/banco:splc2022
After a few seconds, you'll see the message You can now view banco in the browser
. You can go to http://localhost:3000 and use the tool.
To build the docker image locally (for example, if you have changed the source code and want to see your patch running on docker), you can use the following command at the root of the repository.
docker build -f ./docker/Dockerfile . -t bladesorbonne/banco
Make sure that Node.js and NPM are installed on your computer. If it is not the case, install the latest version of Node.js here. Then, type the following commands:
npm install
npm start
Once the application has started, you can access it locally in your browser: localhost:3000.
If you want to modify this software product line, you have to:
- Change the feature model in Eclipse with FeatureIDE. You can find this feature model in /src/artifacts/feature_model.
- Update or add new templates in the /src/artifacts/contracts folder, to reflect the changes you made in the feature model. Make sure that your changes do not conflict with existing features. To better understand the process of creating templates, please read our publication (to be added).
- Update the /src/lib/generator/templates.js and the /src/manual_generation/templates.js to include your features in the generation process or modify the existing ones.
- Execute the following script while being located in /src to export your templates and feature models to the /public folder of BANCO, allowing the web platform to access the templates for generation purposes:
node export-assets
- (optional) If you wish to modify the parameters provided to existing smart contract templates, make sure to also modify the generated template web application accordingly (can be found in src/artifacts/src.).
We are aware that modifying the existing software product line is still a burdensome process, notably the generated frontend application. Future works will be carried out to simplify this process.