티스토리 뷰

반응형

해당 글은 Hyperledger Fabric 페이지의 게시글을 번역 및 정리한 자료입니다.

원본 사이트 : http://hyperledger-fabric.readthedocs.io/en/release-1.1/commands/configtxgen.html


Description

configtxgen 명령을 통해 사용자는 채널 config와 관련된 아티팩트를 작성하고 검사 할 수 있습니다. 생성 된 아티팩트의 내용은 configtx.yaml의 내용에 의해 결정됩니다.


Syntax

configtxgen 명령은 하위 명령은 없지만 다양한 작업을 수행하기 위해 설정할 수 있는 플래그가 지원됩니다.

Usage of configtxgen:
  -asOrg string
        Performs the config generation as a particular organization (by name), only including values in the write set that org (likely) has privilege to set
  -channelID string
        The channel ID to use in the configtx (default "testchainid")
  -inspectBlock string
        Prints the configuration contained in the block at the specified path
  -inspectChannelCreateTx string
        Prints the configuration contained in the transaction at the specified path
  -outputAnchorPeersUpdate string
        Creates an config update to update an anchor peer (works only with the default channel creation, and only for the first update)
  -outputBlock string
        The path to write the genesis block to (if set)
  -outputCreateChannelTx string
        The path to write a channel creation configtx to (if set)
  -printOrg string
        Prints the definition of an organization as JSON. (useful for adding an org to a channel manually)
  -profile string
        The profile from configtx.yaml to use for generation. (default "SampleInsecureSolo")
  -version
        Show version information


Usage

초기 블록 생성

genesis_block.pb에 채널을 위한 genesis 블록을 작성하세요. orderer-system-channelSampleSingleMSPSoloV1_1 관해 작성하세요.

configtxgen -outputBlock genesis_block.pb -profile SampleSingleMSPSoloV1_1 -channelID orderer-system-channel

채널 생성 tx

SampleSingleMSPChannerlV1_1create_chan_tx.pb 에 대한 채널 생성 트랜잭션에 관해 작성하십시오.

configtxgen -outputCreateChannelTx create_chan_tx.pb -profile SampleSingleMSPChannelV1_1 -channelID application-channel-1

Inspect a genesis block

genesis_block.pb라는 이름의 genesis 블록의 내용을 JSON 형태로 화면에 출력하세요.

configtxgen -inspectBlock genesis_block.pb

Inspect a channel creation tx

create_chan_tx.pb라는 이름의 채널 생성 tx의 내용을 JSON 형태로 화면에 출력하세요.

configtxgen -inspectChannelCreateTx create_chan_tx.pb

configtx.yaml로부터 MSPDir과 같은 파라미터의 기반해서 조직을 정의하고 JSON형태로 화면에 출력하세요.(이 출력은 구성원 추가와 같은 채널 재구성 워크 플로우에 유용합니다)

 configtxgen  - printOrg  Org1

Output anchor peer tx

configtx.yaml를 기반으로 SampleSingleMShannelV1_1프로필에 정의되어 있는 조직 Org1의 앵커 피어들이 설정된 anchor_peer_tx.pb에 구성 업데이트 트랜잭션을 출력합니다.

configtxgen -outputAnchorPeersUpdate anchor_peer_tx.pb -profile SampleSingleMSPChannelV1_1 -asOrg Org1


configuration

configtxgen tool의 output은 대부분의 configtx.yaml의 내용에 의해 제어됩니다. 이 파일은 FABRIC_CFG_PATH에서 검색되며 반드시 configtxgen이 존재해야합니다. 이 configuration 파일은 편집 할 수 도 있고, CONFIGTX_ORDERER_ORDERERTYPE=kafka 와 같은 환경 변수를 성정하여 개별 특성을 겹쳐 쓸 수 있습니다. 많은 configtxgen 작업에서 프로필 이름을 제공해야합니다. 프로필은 단일 파일에서 여러 유사한 configuration을 표현하는 방법입니다. 예를 들어, 하나의 프로필은 3 개의 조직으로 된 채널을 정의 할 수 있고, 다른 프로필은 4 개의 조직으로 구성된 하나의 조직을 정의 할 수 있습니다. 파일의 길이에 부담을 주지 않고 이 작업을 수행하려면, configtx.yaml 앵커 및 참조 표준 YAML 기능에 따라 달라집니다. configuration의 기본 부분은 &OrdererDefaults 같은 앵커와 태그가 붙여져있으며 다음과 같은 참조가있는 프로필로 병합됩니다. 참고:configtxgen이 프로필 아래에서 작동하는 경우 환경 변수 재정의에 프로필 접두사를 포함할 필요가 없으며 프로필의 루트 요소에 대해 참조할 수 있습니다. 예를들어, <<: *OrdererDefaultsconfigtxgenCONFIGTX_PROFILE_SAMPLEINSECURESOLO_ORDERER_ORDERERTYPECONFIGTX를 지정하지 않고 단순히 프로필 세부 사항을 생략하고 접두어 다음에 CONFIGTX_ORDERER_ORDERERTYPE라는 프로필 이름과 관련된 요소가옵니다. 모든 가능한 구성 옵션에 대해서는 Fabric과 함께 제공된 configtx.yaml샘플을 참조하십시오 . 이 파일은 release artifacts tar 디렉토리의 config 안에서 찾을 수 있습니다. 또는 소스에서 빌드하는 경우이 sampleconfig폴더 아래에 이 파일이 있을 수 있습니다 .

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함