Fabric 2.2 network.sh process record

Fabric network.sh processing flow

Mainly record the process of running ./network.sh up -ca

Each organization operates a CA (or multiple intermediate CAs) to create their own organizational identity. All identities created by CAs run by that organization share the same organizational root of trust. While taking more time than using cryptogen, using a CA to set up a test network provides guidance for deploying the network in production. Deploying a CA also allows you to register client identities with the Fabric SDK and create certificates and private keys for your applications.

1. Clear leftovers

  1. Clear dev-peer container, image
  2. Verify that the version of the host peer command is consistent with that of the container
  3. Verify that the version of the host ca-client command is consistent with that of the container

2. Start the network

  1. networkUp starts the network
  2. Check the organizations/peerOrganizations directory, if it exists, continue
  3. Start createOrgs; createConsortium (both script functions)
  4. createOrgs according to different parameters, cryptogen creates encryption material (generated according to the password generator by default) we specify the -ca parameter here
  5. Create cryptographic material based on CA certificate
  • Call the organizations/fabric-ca/registerEnroll.sh script
  • registerEnroll.sh script processing flow
  • Create org1 organization
  • Create an organization directory
  • Log in to the admin user and specify tls.certfiles
  • Manually generate the org1 msp configuration file
  • register peer0
  • register user
  • Register org1 admin
  • Generate peer0 msp encryption material
  • generate peer0 tls certificate
  • Generate user msp encryption material
  • Generate org1 admin encryption material
  • Create the org2 organization
  • Create an orderer organization
  • Check whether rganizations/fabric-ca/org1/tls-cert.pem is successfully generated, and continue to the next step after success
  1. Continue to generate ccp (chain code) of org1 and org2 according to 5
  • Call ./organizations/ccp-generate.sh
  • Replace ccp-template.json
  • Replace ccp-template.yaml
  1. createConsortium (create consortium)
  • Find the configtxgen command
  • generate block file
  • configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel-outputBlock ./system-genesis-block/genesis.block
  1. Start the container according to compose
  • COMPOSE_FILE_BASE=docker/docker-compose-test-net.yaml
  • COMPOSE_FILES=“ -f docker/docker-compose-test-net.yaml”
  • IMAGE_TAG=latest
  • docker-compose -f docker/docker-compose-test-net.yaml up -d 2>&1

Guess you like

Origin blog.csdn.net/weixin_44157851/article/details/127118803