About the project
This project was made as a study of permissioned blockchains with Hyperledger Fabric. We opt to use Fablo to configure our network topology, combined with Fablo REST to make invocations using REST protocol, along with Hyperledger Explorer to visualize ou blockchain blocks and transactions.
The Blockchain
Our blockchain configuration stays all into fabric-config.json
. We opt to set our blockchain in the following way:
- 2 channels
channel-org1
andchannel-org2
- 2 organizations
Org1
andOrg2
, each one on your own channel - 2 chaincodes, a simple key-value store and the fabric fabcar example, running on
channel-org1
andchannel-org2
, respectivaly
So, with that topology, Org1
is responsible for creating blockings that sets a new key-value on the blockchain.
While Org2
can manage a full list of cars, creating new cars and querying them.
Running
After configuring our fablo-config.json
to follow our topology pattern, we can run the follow command generate our docker images configurations (make sure that you already have installed Fablo on our machine)
fablo generate
This command creates the folder fablo-target/
, which contains all our docker images configurations, with our network environment variables and certificates.
Now, we can start our network (you need Docker to be installed)
fablo up
After that, you can run
docker ps
to check if your blockchain containers are running
The Hyperledger Explorer
With your network properly running, you can start the Hyperledger Explorer service to visualize your blockchain channels, blocks and transactions.
If you changes the Fablo network configuration, you need to re-configure the files:
blockchain-explorer.yaml
,connection-profile/*
andconfig.json
. You can always check the Explorer documentation.
To start the Explorer service, first make sure that you have Docker Compose installed, then run
docker-compose -f blockchain-explorer.yaml up -d
Now you can go to your localhost:8080
, insert your explorer admin credentials and visualize your entire blockchain!
More
You can read our text (pt-BR) about the Hyperledger Fabric technology, along with printscreens presenting how we used this code in the practice.