Abhisek Das
Abhisek Das

Reputation: 41

What are "Policies" in configtx yaml in hyperledger fabric?

I am trying to create my own fabric network by taking reference of "basic network" and "First Network" provided in "fabric-samples"

I have came across section called "Policies" in "configtx" yaml file.

Kindly help me to understand significance of this section.

Upvotes: 3

Views: 1628

Answers (1)

Policies are basically rules/definations that govern access control within a channel. They are of two types

  1. Signature - You may have seen policies of this sort (using terms like AND,OR etc. and is more flexible than Implicit Meta Policies)
  2. Implicit Meta - Less Flexible (Using terms like ANY,MAJORITY etc.)

Examples 1. Signature Organizations:

- &Orderer
    Name: Orderer

    # ID to load the MSP definition as
    ID: OrdererMSP
    MSPDir: crypto-config/ordererOrganizations/example.com/msp
    Policies:
       #THIS IS WHERE YOU DEFINE THEM
       # SIGNATURE POLICIES USE TERMS LIKE OR,AND,NOutOf etc.
        Readers:
            Type: Signature
            Rule: "OR('OrdererMSP.member')"
        Writers:
            Type: Signature
            Rule: "OR('OrdererMSP.member')"
        Admins:
            Type: Signature
            Rule: "OR('OrdererMSP.admin')"
  1. Implicit Meta

Application: &ApplicationDefaults

# Organizations is the list of orgs which are defined as participants on
# the application side of the network
Organizations:

# Policies defines the set of policies at this level of the config tree
# For Application policies, their canonical path is
#   /Channel/Application/<PolicyName>
# ImplicitMeta Policy types use ANY,Majority etc.
Policies:
    Readers:
        Type: ImplicitMeta
        Rule: "ANY Readers"
    Writers:
        Type: ImplicitMeta
        Rule: "ANY Writers"
    Admins:
        Type: ImplicitMeta
        Rule: "MAJORITY Admins"

You can read more about them here on the hyperledger fabric read the docs :- https://hyperledger-fabric.readthedocs.io/en/release-1.3/policies.html

Upvotes: 3

Related Questions