티스토리 뷰

반응형

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

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


cryptogen commands

Cryptogen은 Hyperledger Fabric의 key 자료를 생성하는 유틸리티입니다.

주로 테스트 환경에서 사용하기위한 것입니다.


Syntax

cryptogen명령은 그 안에 다른 하위 명령이 있습니다.

cryptogen [subcommand]

다음과 같습니다.

cryptogen generate 
cryptogen showtemplate 
cryptogen version 
cryptogen extend 
cryptogen help 
cryptogen

이러한 하위 명령은 유틸리티가 제공하는 여러 기능을 분리합니다.

각 하위 명령에는 사용할 수 있는 다양한 옵션들이 있고, 그로인해 각 항목에 대한 설명은 본 글의 각 section에 있습니다.

별다른 명령 옵션을 지정하지 않으면 다소 높은 수준의 도움말 텍스트가 반환됩니다.


cryptogen flags

cryptogen 명령은 관련 플래그 세트가 있습니다 :

cryptogen [flags]

다음과 같습니다.

cryptogen --help 
cryptogen generate --help

이 플래그는 cryptogen에 대한 자세한 정보를 제공하며 모든 명령 수준에서 사용할 수 있기 때문에 전역으로 지정 됩니다. 예를들어 --help 플래그는 cryptogen 명령어 및 cryptogen generate명령 및 각 옵션에 대한 도움말을 제공합니다.


Flag details

--help

help를 사용하여 cryptogen 명령에 대한 간단한 도움말 텍스트를 확인해보세요. help 플래그는 종종 개별 명령의 도움말을 얻기위해 다른 수준에서 사용된다, 심지어 명령 옵션에 관한 도움까지도 가능하다. 자세한 내용은 개별 명령을 참조하세요.


Usage

다음은 peer 명령에서 사용 가능한 여러 플래그를 사용하는 몇 가지 예제 입니다.

--help flag

cryptogen --help

usage: cryptogen [<flags>] <command> [<args> ...]

Utility for generating Hyperledger Fabric key material

Flags:
  --help  Show context-sensitive help (also try --help-long and --help-man).

Commands:
  help [<command>...]
    Show help.

  generate [<flags>]
    Generate key material

  showtemplate
    Show the default configuration template

  version
    Show version information

  extend [<flags>]
    Extend existing network



The cryptogen generate Command

The cryptogen generate Command 명령을 사용하여 키 재료를 생성 할 수 있습니다.


Syntax

cryptogen generate 명령은 다음과 같습니다.

cryptogen generate [<flags>]


cryptogen generate

cryptogen generate 플래그는 다른 플래그를 가지고 있기에, 각 플래그는 관련 명령 주제에 설명되어 있습니다.

cryptogen generate [flags]

다음과 같습니다.

cryptogen generate --output="crypto-config" 
cryptogen generate --config=CONFIG

전역 cryptogen명령 플래그는 cryptogen 명령 플래그에 설명 된대로 적용됩니다.

--help


Flag details

--output="crypto-config"

아티팩트를 배치 할 출력 경로

--config=CONFIG

사용할 구성 템플릿


Usage

cryptogen generate 명령에서 사용 가능한 여러 플래그를 사용하는 몇 가지 예제입니다.

./cryptogen generate --output="crypto-config"

org1.example.com
org2.example.com



The cryptogen showtemplate Command

cryptogen showtemplate 명령은 기본 구성 템플릿을 표시합니다.


Syntax

cryptogen showtemplate 명령 구문은 다음과 같습니다.

cryptogen showtemplate


Usage

cryptogen showtemplate 명령의 출력은 다음과 같습니다.

cryptogen showtemplate

# ---------------------------------------------------------------------------
# "OrdererOrgs" - Definition of organizations managing orderer nodes
# ---------------------------------------------------------------------------
OrdererOrgs:
  # ---------------------------------------------------------------------------
  # Orderer
  # ---------------------------------------------------------------------------
  - Name: Orderer
    Domain: example.com

    # ---------------------------------------------------------------------------
    # "Specs" - See PeerOrgs below for complete description
    # ---------------------------------------------------------------------------
    Specs:
      - Hostname: orderer

# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
  # ---------------------------------------------------------------------------
  # Org1
  # ---------------------------------------------------------------------------
  - Name: Org1
    Domain: org1.example.com
    EnableNodeOUs: false

    # ---------------------------------------------------------------------------
    # "CA"
    # ---------------------------------------------------------------------------
    # Uncomment this section to enable the explicit definition of the CA for this
    # organization.  This entry is a Spec.  See "Specs" section below for details.
    # ---------------------------------------------------------------------------
    # CA:
    #    Hostname: ca # implicitly ca.org1.example.com
    #    Country: US
    #    Province: California
    #    Locality: San Francisco
    #    OrganizationalUnit: Hyperledger Fabric
    #    StreetAddress: address for org # default nil
    #    PostalCode: postalCode for org # default nil

    # ---------------------------------------------------------------------------
    # "Specs"
    # ---------------------------------------------------------------------------
    # Uncomment this section to enable the explicit definition of hosts in your
    # configuration.  Most users will want to use Template, below
    #
    # Specs is an array of Spec entries.  Each Spec entry consists of two fields:
    #   - Hostname:   (Required) The desired hostname, sans the domain.
    #   - CommonName: (Optional) Specifies the template or explicit override for
    #                 the CN.  By default, this is the template:
    #
    #                              "{{.Hostname}}.{{.Domain}}"
    #
    #                 which obtains its values from the Spec.Hostname and
    #                 Org.Domain, respectively.
    #   - SANS:       (Optional) Specifies one or more Subject Alternative Names
    #                 to be set in the resulting x509. Accepts template
    #                 variables {{.Hostname}}, {{.Domain}}, {{.CommonName}}. IP
    #                 addresses provided here will be properly recognized. Other
    #                 values will be taken as DNS names.
    #                 NOTE: Two implicit entries are created for you:
    #                     - {{ .CommonName }}
    #                     - {{ .Hostname }}
    # ---------------------------------------------------------------------------
    # Specs:
    #   - Hostname: foo # implicitly "foo.org1.example.com"
    #     CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above
    #     SANS:
    #       - "bar.{{.Domain}}"
    #       - "altfoo.{{.Domain}}"
    #       - "{{.Hostname}}.org6.net"
    #       - 172.16.10.31
    #   - Hostname: bar
    #   - Hostname: baz

    # ---------------------------------------------------------------------------
    # "Template"
    # ---------------------------------------------------------------------------
    # Allows for the definition of 1 or more hosts that are created sequentially
    # from a template. By default, this looks like "peer%d" from 0 to Count-1.
    # You may override the number of nodes (Count), the starting index (Start)
    # or the template used to construct the name (Hostname).
    #
    # Note: Template and Specs are not mutually exclusive.  You may define both
    # sections and the aggregate nodes will be created for you.  Take care with
    # name collisions
    # ---------------------------------------------------------------------------
    Template:
      Count: 1
      # Start: 5
      # Hostname: {{.Prefix}}{{.Index}} # default
      # SANS:
      #   - "{{.Hostname}}.alt.{{.Domain}}"

    # ---------------------------------------------------------------------------
    # "Users"
    # ---------------------------------------------------------------------------
    # Count: The number of user accounts _in addition_ to Admin
    # ---------------------------------------------------------------------------
    Users:
      Count: 1

  # ---------------------------------------------------------------------------
  # Org2: See "Org1" for full specification
  # ---------------------------------------------------------------------------
  - Name: Org2
    Domain: org2.example.com
    EnableNodeOUs: false
    Template:
      Count: 1
    Users:
      Count: 1



The cryptogen extend Command

cryptogen extend 명령을 사용하면 기존의 네트워크를 확장할 수 있습니다. 즉, 새로 추가된 엔티티가 필요로하는 모든 추가적인 key 자료의 생성을 의미합니다.


Syntax

cryptogen extend 명령의 문법은 다음과 같습니다.

cryptogen extend [<flags>]


crpytogen extend flags

cryptogen extend 플래그는 사용할 수 있는 다른 플래그를 가지고 있기에, 각 플래그는 관련 명령 주제에 설명되어 있습니다.

crpytogen extend [flag]

다음과 같습니다.

cryptogen extend --input="crypto-config" 
cryptogen extend --config=CONFIG

전역 cryptogen명령 플래그는 cryptogen 명령 플래그에 설명 된대로 적용됩니다.

--help


flag details

--output="crypto-config"

아티팩트를 배치 할 출력 경로

--config=CONFIG

사용할 구성 템플릿.


Usage

cryptogen extend 명령에서 사용 가능한 여러 플래그를 사용하는 몇 가지 예제 입니다.

cryptogen extend --input="crypto-config" --config=config.yaml

org3.example.com

config.yaml은 org3.example.com 라는 새로운 peer 조직을 추가합니다.

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
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
글 보관함