美文网首页
2020-01-16

2020-01-16

作者: 小丹子1o1 | 来源:发表于2020-01-17 15:37 被阅读0次

    手动end-2-end测试

    1.定义who is who,谁是谁
    在fabric-sample里创建文件夹my-network

    mkdir my-network
    
    创建文件夹my-network

    2.在my-network里创建文件crypto-config.yaml

    touch crypto-config.yaml
    

    vi crypto-config.yaml 键入下面的代码,然后按Esc按钮,再输入 “:wq”,保存退出

    OrdererOrgs:
      - Name: Orderer
        Domain: example.com
        Specs:
          - Hostname: orderer
    PeerOrgs:
      - Name: Org1
        Domain: Org1.example.com
        Template:
          Count: 2
        Users:
          Count: 1
      - Name: Org2
        Domain: Org2.example.com
        Template:
          Count: 2
        Users:
          Count: 1
    
    image.png
    image.png
    export PATH=${PWD}/../bin:${PWD}:$PATH
    
    cryptogen generate --config=./crypto-config.yaml
    
    image.png
    image.png

    安装树

    yum install tree
    
    安装树
    以树的形式查看文件

    修改crypto-config.yaml,等下重新执行看看效果

    OrdererOrgs:
      - Name: Orderer
        Domain: example.com
        Specs:
          - Hostname: orderer
      - Name: Orderer2
        Domain: example.com
        Specs:
          - Hostname: orderer2
    PeerOrgs:
      - Name: Org1
        Domain: Org1.example.com
        Template:
          Count: 5
        Users:
          Count: 2
      - Name: Org2
        Domain: Org2.example.com
        Template:
          Count: 2
        Users:
          Count: 1
    
    修改crypto-config.yaml文件

    因为修改crypto-config.yaml文件,避免等下生成证书产生冲突,所以要提前删除crypto-config文件夹

    rm -rf crypto-config
    
    删除之前生成的crypto-config文件夹
    image.png

    3.创世区块创建和生成(Generating Orderer Genesis block)

    cp configtx.yaml ../my-network/
    
    把文件configtx.yaml拷贝到上级文件夹my-network

    相关文章

      网友评论

          本文标题:2020-01-16

          本文链接:https://www.haomeiwen.com/subject/baxqzctx.html