This tool enables automated generation of Hyperledger Fabric chaincode based on BMerode models. BMerode is an extension and adaptation of the Merode approach for the design and implementation of enterprise information systems.
The principles behind the BMerode approach are described in the paper below:
Demonstration available in video.
- Download
BMerode-Generator.zip
from the latest release. - Unzip the file, open a terminal and get into the
bin
subdirectory. - Run the following command to generate the chaincode:
./BMerode-Generator -m path_to_mxp_file -e path_to_extension_file -o path_to_destination_directory
- (Optional) Compilation Check: once the command is successfully executed, the chaincode source code (ready to be compiled, packaged and deployed) is in the destination directory. To make sure that the chaincode is compilable, you can get into the destination folder in your terminal, and run:
./gradlew build
If the build is successful, you should be able to deploy the chaincode onto a Hyperledger Fabric network.
To test the produced chaincode (based on the BMerode model), the ChaincodeTestr tool can be used.
The path_to_mxp_file
is the (relative or absolute) path to the Merode model (.mxp file).
To design a Merode model, the Merlin tool can be used. When exporting a model from Merlin, the file available for download is a .mxp file, which is actually a .zip archive. Before being able to run the code generator, follow the following steps:
- Change the extension of the exported file from .mxp to .zip.
- Unzip the file.
- In the unzipped folder, there will be a file called
model.mxp
. This is the file that should be used as thepath_to_mxp_file
. - Open the file with the text/code editor of your choice, and remove the
masterrole
anddependentrole
tags in the file.
The path_to_extension_file
is the (relative or absolute) path to the BMerode extension (.mxpx file). Currently, this file must be written manually. Below is a minimal example of extension file:
<?xml version="1.0" encoding="UTF-8"?>
<MerodeExtension>
<ParticipantTypes>
<ParticipantType objectTypeId="1"/>
</ParticipantTypes>
<EPT></EPT>
<IARS></IARS>
</MerodeExtension>
This file is mandatory for a successful chaincode generation.
The ParticipantTypes
tag is used specify which business object types (defined in the .mxp file) are representing participant types (or roles) in the process to support with the chaincode.
The objectTypeId
of the existing business object types can be found in the .mxp file.
The EPT
and IARS
tags are used to specify permissions at the participant type and instance level. They are however undocumented as of now and can be left empty.