首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Hyperledger v1.4上,需要为所有组织使用一个中央证书颁发机构吗?

在Hyperledger v1.4上,需要为所有组织使用一个中央证书颁发机构吗?
EN

Stack Overflow用户
提问于 2021-02-22 11:23:53
回答 1查看 78关注 0票数 0

在Hyperldeger的基础上创建了一个网络,其中包括:1名订购者、1名ca、1名couchdb、1名cli、1名对等者。

之后,添加了一个新的组织结构,包括:1 peer、1 couchdb和1 cli。

在此阶段之前,没有任何错误。所有的集装箱都在运行。然后注册为ca管理员。还是没问题。管理员没有任何问题。我想为新的组织创建管理。

enrollandregisterNewAdmin.js

代码语言:javascript
运行
复制
        const gateway = new Gateway();
        await gateway.connect(ccpPath, { wallet, identity: 'admin', discovery: { enabled: true, asLocalhost: true } });

        const ca = gateway.getClient().getCertificateAuthority();
        const adminIdentity = gateway.getCurrentIdentity();       
        const secret = await ca.register({
            affiliation: 'org1.department1',
            enrollmentID: 'adminOrg3',
            role: 'client',
            attrs: [ {"name": "hf.Registrar.Roles", "value": "client"}, 
                {"name": "hf.Registrar.DelegateRoles", "value": "client"}, 
                {"name": "hf.Revoker", "value": "true"},
                {"name": "hf.IntermediateCA", "value": "true"}, 
                {"name": "hf.GenCRL", "value": "true"}, 
                {"name": "hf.AffiliationMgr", "value": "true"}, 
                {"name": "hf.Registrar.Attributes", "value": "hf.Registrar.Roles,hf.Registrar.DelegateRoles,hf.Revoker,hf.IntermediateCA,hf.GenCRL,hf.Registrar.Attributes,hf.AffiliationMgr"} ] }
        , adminIdentity);

        const enrollment = await ca.enroll({ enrollmentID: 'adminOrg3', enrollmentSecret: secret});    
        const userIdentity = X509WalletMixin.createIdentity('Org3MSP', enrollment.certificate, enrollment.key.toBytes());
        await wallet.import('adminOrg3', userIdentity);

最后,将“adminOrg3”的证书导入到钱包中,没有错误。但是,当我试图使用‘adminOrg3 3’调用/查询时。我收到这个错误:

Channel.js: Channel:byfn接收到发现错误:访问被拒绝Channel.js: Channel.js: Channel:byfn发现错误:访问拒绝错误:网络:_initializeInternalChannel:无法初始化信道。试图与1个同行联系。最后一个错误是错误:通道:byfn发现错误:拒绝访问

当钱包存在于上一次部署时,这是常见的错误。但是,每次网络重新启动时,钱包都会被删除。

docker日志peer0.org3.example.com

代码语言:javascript
运行
复制
2021-02-22 10:21:09.588 UTC [cauthdsl] deduplicate -> ERRO 082 Principal deserialization failure (the supplied identity is not valid: x509: certificate signed by unknown authority) for identity 0

我为新组织的配置文件编写-org3.yaml

代码语言:javascript
运行
复制
version: '2'

volumes:
  peer0.org3.example.com:

networks:
  byfn:

services:

  peer0.org3.example.com:
    container_name: peer0.org3.example.com
    extends:
      file: base/peer-base.yaml
      service: peer-base
    environment:
      - CORE_PEER_ID=peer0.org3.example.com
      - CORE_PEER_ADDRESS=peer0.org3.example.com:11051
      - CORE_PEER_LISTENADDRESS=0.0.0.0:11051
      - CORE_PEER_CHAINCODEADDRESS=peer0.org3.example.com:11052
      - CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052
      - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:11051
      - CORE_PEER_LOCALMSPID=Org3MSP
    volumes:
        - /var/run/:/host/var/run/
        - ./org3-artifacts/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp
        - ./org3-artifacts/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
        - peer0.org3.example.com:/var/hyperledger/production
    ports:
      - 11051:11051
    networks:
      - byfn

  Org3cli:
    container_name: Org3cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - FABRIC_LOGGING_SPEC=INFO
      #- FABRIC_LOGGING_SPEC=DEBUG
      - CORE_PEER_ID=Org3cli
      - CORE_PEER_ADDRESS=peer0.org3.example.com:11051
      - CORE_PEER_LOCALMSPID=Org3MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - /var/run/:/host/var/run/
        - ./../chaincode/:/opt/gopath/src/github.com/chaincode
        - ./org3-artifacts/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - ./crypto-config/peerOrganizations/org1.example.com:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com
         -./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
    depends_on:
      - peer0.org3.example.com
    networks:
      - byfn

是否有可能在相同的隶属关系下存在不同的MSP?

是否需要对配置文件进行任何更改?

EN

Stack Overflow用户

发布于 2021-02-28 22:01:49

只是为了澄清一些事情..。

  • :在尝试与新的org用户连接之前,您在通道上添加了新的组织吗?
  • 您是在码头容器中运行对等体并使用卷来进行对等文件系统映射吗?--可能会发生对等点仍然加载旧通道的内容.

-Tsvetan

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66314770

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档