<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>FabNet: an Automatic Hyperledger Fabric Network Wizard</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessandro Marcelletti</string-name>
          <email>alessand.marcelletti@unicam.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Barbara Re</string-name>
          <email>barbara.re@unicam.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Camerino</institution>
          ,
          <addr-line>Via Madonna delle Carceri 7</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <fpage>59</fpage>
      <lpage>67</lpage>
      <abstract>
        <p>Hyperledger Fabric is continually evolving technology, thanks to its active community providing new features and functionalities. However, it still lacks a user-friendly interface that makes its adoption immediate and straightforward. In particular, one of the main barriers for non-expert users is the comprehension and creation of a network. In this paper, we present FabNet, a user-friendly wizard reducing the e ort for the con guration and deployment of the Fabric blockchain network.</p>
      </abstract>
      <kwd-group>
        <kwd>Blockchain</kwd>
        <kwd>Hyperledger Fabric</kwd>
        <kwd>Network</kwd>
        <kwd>Con guration</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        The rapidly growing of interest in blockchain technologies made IT specialists
(es. developers and system administrators) approach this new topic. However,
also due to its novelty, they often nd this technology hard to learn and master
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The scenario is slightly di erent considering di erent blockchain platforms.
Indeed, in cases of consolidated permissionless blockchains such as Bitcoin [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]
and Ethereum [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], the community has been working for many years. This has
led to the creation of documentation and also of tools for automatic generation
of developing environments. Di erently, the permissioned Hyperledger Fabric
blockchain is continuously changing with new versions that sometimes modify
the core of the technology signi cantly. Also, for this reason, high-level
interfaces still miss, creating an initial obstacle for new people approaching Fabric.
Although Fabric has a deep documentation with theory and tutorials, sometimes
it is hard to understand concepts without a signi cant e ort from the user. In
particular, one of the most challenging technological approaches is the one
concerning Fabric network. Indeed the complexity and the amount of les required
to create a customised network is very complicated to understand in the rst
moment. Hyperledger itself provides a con gured test network with precon
gured commands; however, it is not easy to customise, and it aims to be only an
initial example for developers.
      </p>
      <p>Fabric Composer1 instead, was born with the idea of providing a high-level
environment abstracting from all the low-level details to focus, for example, only
on smart contracts implementation. However, the way used in Composer to write
chaincodes and to interact with the network through the Software Development
Kit (SDK) changed with the new Fabric versions, making the application
deprecated since 2019. With our work, we focus only on the network le system,
without involving chaincode or APIs, that could make obsolete the entire system
with the rst change.</p>
      <p>Our objective is to address technological di culties for developers and system
administrators. The rsts are end-users that want to create a network for various
purposes, without entering in low-level operations, like the creation and the
execution of scripts and les. The seconds are developers that instead need to
learn how to build a network, in this case, we provide an easy way to accelerate
this process, saving a lot of time in the initial approach that, otherwise, can
result very complicated.</p>
      <p>Already existing payable solutions, such as Blockchain-as-a-Service (BaaS)
provided by companies like Oracle2, Microsoft3 or Amazon4 not always provide
a Fabric solution, in addition, the network is deployed directly in their cloud.
What we want, is to abstract the con guration and the deployment phase giving
also the possibility for developers to enter directly inside the system, modifying
les or moving the infrastructure on another space, without remaining close to
the bought service.</p>
      <p>For these reasons, we present FabNet, a free tool useful to con gure all the
network components just using a high-level interface. This makes the creation of
a customised network easy also for those developers and system administrators
that does not have experiences in this topic. An easy network con guration is
useful especially for starting a project without losing time in undesired con
gurations. Indeed, sometimes they are not even needed when the main objective is
to work on other components like smart contracts and applications. Moreover,
having under a unique interface the required parameters can help new developers
to understand better the theory and the correlations between the con gurations
and the generated les. What we provide is a tool capable of deploying both a
test and a production network, that automatically creates all the con guration
les and the scripts needed to deploy the nal network.</p>
      <p>
        The rest of the paper is organised as follows. Section 2 gives an overview
of blockchain technology and in particular of Hyperledger Fabric. Section 3
describes the project structure while section 4 shows a short demo of FabNet tool.
Finally, Section 5 concludes recapping the motivation.
1 https://hyperledger.github.io/composer/latest/
2 https://www.oracle.com/it/application-development/cloud-services/
blockchain-platform/
3 https://azure.microsoft.com/it-it/services/blockchain-service/
4 https://aws.amazon.com/it/blockchain/
Blockchain technology was born in the rst years with the concept of
cooperation between dislocated entities, ensuring a high level of trust between the
parties, and provides an immutable way of storing data. With the rst
permissionless blockchains (Bitcoin, Ethereum) it is possible to make exchanges of
assets between its network members. These interactions take place by means of
transactions, stored in the form of blocks in a chain along with a timestamp.
Each block contains a limited number of transactions and, among other
information, the hash of the current block and the hash of the previous block. Data
are maintained within a distributed network of mutually untrusted peers, that
will be in sync with data changes request, thanks to the consensus mechanism.
In the last years, blockchains have adapted to other contexts, with the support
of features provided by the so-called smart contracts. These can be considered
special programs equipped on each node of the blockchain, which de ne a
transaction protocol that applies the terms of an agreement, between one or more
parties involved, enabling auditability between parties [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Finally, the
execution of smart contracts produces the transactions whose e ects are stored in the
blockchain. In particular, these kind of systems use an order-execute
architecture and requires all peers to execute every transaction and all transactions
to be deterministic.
      </p>
      <p>
        Hyperledger Fabric [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] di ers from the previous described blockchains, due
to its permissioned nature. It is a modular system more versatile for enterprise
applications, providing features such as consensus management, private channels
and contracts, full-featured programming languages in smart contracts and
access control policies. It introduces the execute-order-validate architecture, that
allows distributed execution of untrusted code in an untrusted environment.
Indeed, Fabric executes transactions before reaching nal agreement on their order,
then all peers validate transactions in the same order with a deterministic
validation. Execute-order-validate paradigm, represents the main innovation in Fabric
architecture, making Fabric a scalable system for permissioned blockchains
supporting exible trust assumption.
      </p>
      <p>This kind of system allows to provide exibility, scalability and privacy in
contexts that require these features. The absence of a mining mechanism enables
a fast validation and con rmation of transactions. This is achieved thanks to the
consensus management system, that allows con guring an arbitrary consensus
algorithm, taking into account the requirements of the system intended to
implement. Indeed, the arbitrary consensus and the permissioned nature of Fabric
guarantee a faster protocol respecting to the Ethereum Proof of Work.</p>
      <p>The privacy aspect concerns the con dentiality of transaction and data. This
is achieved in Fabric by using its channel architecture and membership service
to restrict the distribution of con dential information exclusively to authorised
nodes. This is achieved de ning channels inside the network in which only a set
of chosen nodes can participate. Nodes and channels are also regulated through
policies. Consequently, channel's ledger is only accessible to its members and
the channel's organisations must approve each peer's membership to the
channel. Authentication and identity management are guaranteed through a exible
infrastructure based on the PKI cryptographic scheme and Certi cate
Authority, which facilitates the joining of a new organisation in the private network.
Also, Transport Layer Security cryptographic protocol is used to provide
communications security over the network nodes.</p>
      <p>The Fabric network is made by di erent components5, reported in Fig. 1 and
described below.</p>
      <p>Peers are the nodes grouped into organisations, de ned as trust domain in
which a peer trusts all peers only within its organisation. Peers execute and/or
validate transactions, and maintain the ledger. The group of de ned
organisations participating in a channel is called consortium. The ordering service,
composed by a set of Ordering Service Nodes (OSNs), establishes consensus
and atomically broadcast state updates. The ordering is stateless and decoupled
from the peers, it does not take part in the transaction execution and validation
process. The Membership Service Provider (MSP), maintains the identities
5 https://hyperledger-fabric.readthedocs.io/en/release-2.2/key_concepts.
html
of all the nodes (clients, peers, OSNs) inside an organisation. It comprises
mechanisms for authenticate transactions, verify the integrity of transactions, sign and
validate endorsements, key management and registration of nodes. Smart
contracts with system chaincodes de ne the transaction logic and the blockchain
settings. They are de ned in the channel and stored in each organisation peer.
The ledger maintains the transactions history, there is one ledger for channel
which copies are stored in the organisations peers. In addition, a snapshot of the
most recent state is stored in a key-value world state. Finally, the
administrators have permissions for di erent operations, like creating and assigning peers,
creating network con gurations les and modifying policies through system les.</p>
    </sec>
    <sec id="sec-2">
      <title>3 FabNet settings</title>
      <p>In this section we present the FabNet tool focusing on its architecture and
interface. The tool is composed by a SpringBoot back-end in Kotlin and an Angular
front-end, available to everyone at http://pros.unicam.it/FabNet/. The main
task of the interface is to take inputs from the user and to pass them to the
server. These inputs are described in Tab. 3, that contains all the parameters
that the user has to ll in order to generate a con guration. From these
parameters, the server automatically creates the les needed to create a network.
In particular, these les are 51, counting les, scripts and sub-folders; they are
related to:
1. Certi cations and keys;
2. Peers and orderers containers;
3. Channel pro le, de ned by di erent sections:
a) orderer;
b) consortium, de ning the one creating the network;
c) consortiums, de ning all the consortiums in the network;
d) application;
e) capabilities and policies.</p>
      <p>These les are lled up with the information passed through di erent
parameters in the interface, listed in Tab. 3.</p>
      <p>Once the con guration has been de ned, the client will send it as a JSON
le to the server, which will generate the related les, returning a zip folder
containing them. The sequence ow in Fig. 2 recaps the steps regarding network
creation.</p>
      <p>It is important to notice that with our approach the user does not have to
create manually all the described infrastructure. However, once downloaded, the
user is free to modify all the desired parts without any restriction.</p>
      <sec id="sec-2-1">
        <title>3.1 Netowrk deployment</title>
        <p>Once the system folder is generated, to deploy the network is necessary to launch
the autorun le. This le contains and automatically executes all the commands
Network name
required to deploy the nal network, lifting the user from other operations.
In particular, the automatised operations for a total of 14 commands can be
synthesised in:
1. Download required binaries
2. Start CAs and creates artefacts for each organisation;
3. Create genesis block and channels txs;
4. Start Docker containers for each org;
5. Link the started containers so that they can communicate;
6. Create the channel;
7. Join peers to the channel.</p>
        <p>Notably, the single le is used to deploy a local network, for remote peers,
some additional steps are required. Indeed, in a distributed context, each
organisation should extract, from the generated le system, the folder regarding its
org. After this, it is also necessary to run the CA script generating the artefacts.
However, we are currently working on a FabNet extension to provide the GUI
also for the creation of a distributed network.
In this section we show a demo of FabNet using a basic testing con guration,
describing the ow and the tool functionalities linked with some screens. All the
steps described in the following subsection can be replicated using the links at
http://pros.unicam.it/FabNet.</p>
      </sec>
      <sec id="sec-2-2">
        <title>4.1 Network scenario</title>
        <p>The tool is composed by 4 main panels, the rst one, reported in Fig. 3, allows
to specify the network name and the organisations involved (name, domain);
it is also possible to add other organisations and to import/export JSON
conguration. We introduce a brief scenario involving two organisations, org1 and
org2, that want to collaborate in their network. The con guration used in this
example is available at http://pros.unicam.it/test-network.</p>
        <p>In the tool there is also a panel related to organisations, where for each of
them the user has to insert certi cation authority information and can handle
members. In particular, it is possible to add or remove peers, clients, admins and
orderers. Depending on the member type, di erent information is required, like
host IP and ports. As soon organisations and network are de ned, the consortium
must be created. It is possible to create 1 or more consortiums, de ning the
participating organisations. Finally, it is possible to specify the channel in the
network, requiring a consortium and, optionally, external organisations.</p>
        <p>If the network con guration is made with local peers, to deploy the entire
network is necessary to run only the start.sh le (download at
http://pros.unicam.it/start/). Instead, if the organisation's members are
dislocated at remote addresses, each user has to take his related folder and run the
inside scripts. The main focus of our future extension aims at removing also
these steps, automatically generating one folder and one start script for each
organisation. Fig. 4 shows the network participants once deployed, in particular,
Fabric network uses Docker containers to run organisation members. In Fig. 5
instead, the status, addresses and names of members are displayed.</p>
      </sec>
      <sec id="sec-2-3">
        <title>4.2 FabNet applications</title>
        <p>The previous network scenario showed a simple scenario with two collaborating
organisations but, more in general, FabNet can be used in more contexts. Firstly,
it can be used by di erent type of users with di erent purposes, like developers
that want to approach this new technology or for users that want only to create
already usable artefacts.</p>
        <p>
          Also in inter-organisational environments, like the ones analysed in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ],
FabNet can be a core element. It helps to have a fast generation of networks with
di erent con gurations, very useful for performance and scalability analysis.
Indeed, the easy con guration allows to increment the peers and organisations
number having more and more networks to test.
        </p>
        <p>Think about companies that decide to work together, creating also a blockchain
infrastructure, in this case FabNet suits also the need of prototyping networks.
Indeed, in the rst phases, designers have to collaborate, modelling the
organisations communication and thinking about structuring the network, handling
peers and all the other components. In that moment, a tool allowing the creation
of more networks for testing di erent con gurations could be very useful.</p>
        <p>In this context, developers can work together in a sandbox environment,
changing con gurations if needed without e ort only by creating and running
new networks.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>5 Conclusions</title>
      <p>In this work, we presented FabNet, a tool that aims to help IT specialists to
automatise the con guration and the deployment of an Hyperledger Fabric
network, thanks to the user-friendly interface that allow con guring les without
manually entering into each of them. Our contribution mainly targets novices in
the blockchain technology, in particular when they have to deal with the creation
of a Fabric network. Indeed, FabNet doesn't require any e ort for con gurations,
delegating the creation and the lling of les to the interface, and automating
the generation of artefacts. We also contribute, providing a tool capable of
creating and deploying advanced production-ready networks without involving the
user with additional tasks. FabNet supports a large scale of usages, starting from
benchmarking applications until development ones.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          :
          <article-title>A small java application for learning blockchain</article-title>
          .
          <source>In: 2018 IEEE 9th Annual Information Technology, Electronics and Mobile Communication Conference (IEMCON)</source>
          ,
          <source>IEEE</source>
          (
          <year>2018</year>
          )
          <volume>1271</volume>
          {
          <fpage>1275</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Nakamoto</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Bitcoin: A peer-to-peer electronic cash system</article-title>
          .
          <source>Technical report, Manubot</source>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Wood</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , et al.:
          <article-title>Ethereum: A secure decentralised generalised transaction ledger</article-title>
          .
          <source>Ethereum project yellow paper 151</source>
          (
          <year>2014</year>
          ) (
          <year>2014</year>
          )
          <volume>1</volume>
          {
          <fpage>32</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Corradini</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marcantoni</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morichetta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Re</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sampaolo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Enabling auditing of smart contracts through process mining</article-title>
          . In: From Software Engineering to Formal Methods and Tools, and Back. Springer (
          <year>2019</year>
          )
          <volume>467</volume>
          {
          <fpage>480</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Androulaki</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barger</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bortnikov</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cachin</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Christidis</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Caro</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Enyeart</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ferris</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Laventman</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manevich</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          , et al.:
          <article-title>Hyperledger fabric: a distributed operating system for permissioned blockchains</article-title>
          .
          <source>In: Proceedings of the thirteenth EuroSys conference</source>
          . (
          <year>2018</year>
          )
          <volume>1</volume>
          {
          <fpage>15</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Corradini</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marcelletti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morichetta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Re</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tiezzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Engineering trustable choreography-based systems using blockchain</article-title>
          .
          <source>In: Proceedings of the 35th Annual ACM Symposium on Applied Computing</source>
          . (
          <year>2020</year>
          )
          <volume>1470</volume>
          {
          <fpage>1479</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>