Prepare to deploy the smart contract

Basic Concepts of Fabric network

Channels

In a Fabric network, we have multiple channels. Inside a channel, the participated peer nodes can interact with one another, and they can install and instantiate smart contracts.

Also, nodes outside the channel cannot read and write messages of that channel.

Orderer Nodes

In a distributed system, such as a Fabric network, the order nodes run a consensus protocol to order all the put/get operations.

Peer Nodes

Peers are those nodes who actually keep the ledger of a channel. Also, they would endorse, verify, and commit the transactions.

More...?

If you want to know more details, you can read the official documents about Fabric's blockchain network.

Hyperledger Fabric Network of our demo cluster

We have already set up a Hyperledger Fabric v2.3.0 Network with - 1 orderer in node-1 - 3 peers on node-1, node-2, node-3.

To stimulate different organizations (Smart Insurance, Great Insurance, Police), the peer of : - node-1 represents Great Insurance - node-2 represents Police - node-3 represents Smart Insurance

In the following section, we are going to create your own Fabric Channel and deploy the written smart contract to the existing Hyperledger Fabric Network.

Prepare the terminal environment

To simulate the operation carried out by different organizations (Smart Insurance, Great Insurance, Police), we open 3 terminals.

In terminal 1 (as Great Insurance) :

ssh node-1
source /home/fabric_lab/scripts/common.sh
export CORE_PEER_ADDRESS=node-1:7051
export CORE_PEER_MSPCONFIGPATH=${BASE_PATH_CERT_OUTPUT}/peerOrganizations/greatinsurance.com/users/Admin@greatinsurance.com/msp
export CORE_PEER_LOCALMSPID=greatinsurance

In terminal 2 (as Police):

ssh node-2
source /home/fabric_lab/scripts/common.sh
export CORE_PEER_ADDRESS=node-2:7051
export CORE_PEER_MSPCONFIGPATH=${BASE_PATH_CERT_OUTPUT}/peerOrganizations/police.com/users/Admin@police.com/msp
export CORE_PEER_LOCALMSPID=police

In terminal 3 (as Smart Insurance):

ssh node-3
source /home/fabric_lab/scripts/common.sh
export CORE_PEER_ADDRESS=node-3:7051
export CORE_PEER_MSPCONFIGPATH=${BASE_PATH_CERT_OUTPUT}/peerOrganizations/smartinsurance.com/users/Admin@smartinsurance.com/msp
export CORE_PEER_LOCALMSPID=smartinsurance

Last updated