Crypto Generator in HyperLedger Fabric

Security is the one of the major aspect of any network. Each of the node must have some identity and on the basis of this identity corresponding accesses are granted.

The same approach is follow by the Fabric network as well. Fabric CA generates the identity or artifacts file for each of the node that can be the part of the cluster but for generating these artifacts files we also need to specify some property . Well these properties can be specified in crypto-config.yaml file.

Crypto Configuration file:-
crypto-config file contains the following information:-

OrdererOrgs – Definition of organizations managing orderer nodes.
PeerOrgs – Definition of organizations managing peer nodes.

OrdererOrgs:-
OrdererOrgs contains the following Information about the Ordered Node in the Cluster.

Name:- Name of the Orderer
Domain:- Domain URL for Orderer
Hostname:- Host name for the Orderer. This came under the Specs section.

Sample Ordered Configuration:-


OrdererOrgs:
 # ---------------------------------------------------------------------------
 # Orderer
 # ---------------------------------------------------------------------------
 - Name: Orderer
 Domain: example.com
 # ---------------------------------------------------------------------------
 # "Specs" - See PeerOrgs below for complete description
 # ---------------------------------------------------------------------------
 Specs:
 - Hostname: orderer

PeerOrgs:-
PeerOrgs contains the following Information about the Peer Node in the Cluster.
Name:- Name of the Organization
Domain:- Domain URL for Organization
Hostname:- Host name for the Peer. This came under the Specs section. This is mandatory.
CommandName:- Use to override the common name.
Template Count:- Number of Peer nodes for an organization.
Users Count:- Number of users for an organization.

Sample Peer Configuration:-


- Name: Org2
  Domain: org2.example.com
  Template:
       Count: 2
  Users:
       Count: 1

Note:- By Default name peer name is “{{.Hostname}}.{{.Domain}}” format. If we don’t want to specify the count for users then set the value as zero in that case fabric ca server will dynamically generate the artifacts and other necessary file.

After creating the crypto-config.yaml file as per the requirement we can generate the artifacts and other necessary file for creating and maintaining the cluster.
Generating the crypto artifact files :-

We will use the cryptogen tool to generate the artifacts. Lets use the tool place inside the bin directory of fabric-sample and feed the crypto-config.yaml to the same.

../bin/cryptogen generate –config=./crypto-config.yaml

The output of the this command is the names of all the organizations. You will notice that a crypto-config directory is created that contains the all the required artifacts. This directory mainly contains the two sub directory i.e. ordererOrganizations and peerOrganizations that contains the artifacts for both ordered and the peers node.

For more information you can refer to Crypto Generator Documentation. In the next blog we will discuss Configuration Transaction Generator.

Till Then Stay Tuned!! 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: