Hyperledger Fabric Documentation指出我们可以添加其他参数,即组织的规格和CA。该示例显示可以注释掉其他代码以提供值。
我要做什么:
以下是crypto-config.yaml文件中组织的摘录:
-&Org1
Name: Org1MSP
ID: Org1MSP
MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
CA:
Hostname: ca
Country: Westros
Province: North
Locality: Winterfell
OrganizationalUnit: HouseStark
StreetAddress: NorthernStreet
PostalCode: 30000
Policies:
Readers:
Type: Signature
Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org1MSP.admin')"
AnchorPeers:
- Host: peer0.org1.example.com
Port: 7051
我在生成证书时遇到的错误:
2019-01-09 13:44:50.557 IST [common / tools / configtxgen / localconfig]加载-> PANI 003将配置文件编组到结构中时出错:3错误 (s)解码:
- “组织[1]”的密钥无效:CA
- 'Profiles [TwoOrgsChannel] .Application.Organizations [0]'具有无效的密钥:CA
- “个人资料[TwoOrgsOrdererGenesis]。财团[SampleConsortium]。组织[0]”具有无效的密钥:CA
我尝试过的事情:
cryptogen showtemplate
检查用于生成证书的模板。它的格式与我的crypto-config.yaml文件类似。fabric-ca-server-config.yaml
以提供CA值。这导致了其他错误。我以为这是因为我使用加密货币使用某些X CA配置生成了证书,而在运行时我正在放置一些Y CA配置。我是否缺少某些东西或做错了?
答案 0 :(得分:0)
我重新安装了结构1.4的二进制文件,并在crypto-config.yaml中定义了以下内容:
# Setting up orderer of the network
OrdererOrgs:
- Name: Orderer
Domain: example.com
CA:
Country: IN
Province: Karnataka
Locality: Bengaluru
Specs:
- Hostname: orderer
# Setting up peer orgs of the network
PeerOrgs:
- Name: Org1
Domain: org1.example.com
EnableNodeOUs: true
CA:
Country: IN
Province: Karnataka
Locality: Bengaluru
# Template count is the number of peer nodes for this organization
Template:
Count: 2
Users:
Count: 1
我为用于CSR的SubjectDN提供了错误的值。