cryptogen
Cryptogen명령어는 Organization의 키를 생성해 Hyperledger Fabric에서 네트워크 사전 구성
cryptogen — hyperledger-fabricdocs main documentation
Docs » Commands Reference » cryptogen Edit on GitHub cryptogen cryptogen is an utility for generating Hyperledger Fabric key material. It is provided as a means of preconfiguring a network for testing purposes. It would normally not be used in the operat
hyperledger-fabric.readthedocs.io
사전준비
cd fabric-samples
mkdir -p my-network/{organizations,configtx,docker}
mkdir -p my-network/organizations/cryptogen
cp -r bin/ config/ ./my-network
cd ./my-network
export PATH=$PATH:${PWD}/bin
cryptogen generate
1. Crypto-config.yaml 생성
# Fabric-samples에서 새로운 디렉토리(my-network)를 생성해 진행
cd fabric-samples/my-network
touch ./organizations/cryptogen/crypto-config-orderer.yaml
touch ./organizations/cryptogen/crypto-config-cau.yaml
2. nano Crypto-config .yaml 파일 수정
# ./organizations/cryptogen/crypto-config-orderer.yaml
OrdererOrgs:
- Name: Orderer
Domain: example.com
EnableNodeOUs: true
Specs:
- Hostname: orderer
SANS:
- localhost
# ./organizations/cryptogen/crypto-config-cau.yaml
PeerOrgs:
- Name: cau
Domain: cau.example.com
EnableNodeOUs: true
Template:
Count: 1
SANS:
- localhost
Users:
Count: 1
3. Org Key생성
- cryptogen -- help
usage: cryptogen generate [<flags>]
Generate key material
Flags:
--help Show context-sensitive help (also try --help-long
and --help-man).
--output="crypto-config" The output directory in which to place artifacts
--config=CONFIG The configuration template to use
- 키 생성
# 생성한 config파일 경로로지정
cryptogen generate \
--config=./organizations/cryptogen/crypto-config-orderer.yaml \
--output="organizations"
cryptogen generate \
--config=./organizations/cryptogen/crypto-config-cau.yaml \
--output="organizations"
4. 결과
- Orderer 생성
- CAU Organization 생성
cryptogen 다른 명령어
1. cryptogen extend
기존의 네트워크에 새로운 조직을 추가하는 방식
usage: cryptogen extend [<flags>]
Extend existing network
Flags:
--help Show context-sensitive help (also try --help-long and
--help-man).
--input="crypto-config" The input directory in which existing network place
--config=CONFIG The configuration template to use
아래와 같은 식으로 사용하면 될듯
cryptogen extend \
--config=./organizations/cryptogen/crypto-config-neworg.yaml \
--input="organizations"
2. cryptogen showtemplate
키생성 기본 설정을 보여줌
usage: cryptogen showtemplate
Show the default configuration template
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
'보안 및 블록체인 > 블록체인' 카테고리의 다른 글
하이퍼레저 패브릭(Hyperledger Fabric) v2.2 - 채널에 Org 추가 (0) | 2022.07.16 |
---|---|
하이퍼레저 패브릭(Hyperledger Fabric) v2.2 - #3 Docker-compose.yaml 네트워크 설정 & 채널생성 (0) | 2022.07.13 |
하이퍼레저 패브릭(Hyperledger Fabric) v2.2 구축 - #2 채널구성 및 제네시스 블록 생성 (0) | 2022.07.11 |
GO언어 필요한 내용 정리 (0) | 2022.06.27 |
하이퍼레저 패브릭(Hyperledger Fabric) v2.2 Tutorials - First Application by using Golang (0) | 2022.06.17 |