Docker compose 关于注册用户时无法获取从属关系的错误
我有六个组织和两个渠道。我正在尝试设置fabric ca服务器并注册管理员和用户。 当我尝试注册用户时,出现以下错误“注册用户失败”用户患者:错误:fabric ca请求注册失败,出现错误[[{“代码”:0,“消息”:在从属关系验证中注册“用户患者”失败:无法获取从属关系“患者.科室1”::scode:404,代码:63,消息:无法获取从属关系:sql:结果集中没有行“}]] 我已经在fabri-ca-server-config.yaml文件中设置了从属关系Docker compose 关于注册用户时无法获取从属关系的错误,docker-compose,hyperledger-fabric,hyperledger,hyperledger-fabric-ca,Docker Compose,Hyperledger Fabric,Hyperledger,Hyperledger Fabric Ca,我有六个组织和两个渠道。我正在尝试设置fabric ca服务器并注册管理员和用户。 当我尝试注册用户时,出现以下错误“注册用户失败”用户患者:错误:fabric ca请求注册失败,出现错误[[{“代码”:0,“消息”:在从属关系验证中注册“用户患者”失败:无法获取从属关系“患者.科室1”::scode:404,代码:63,消息:无法获取从属关系:sql:结果集中没有行“}]] 我已经在fabri-ca-server-config.yaml文件中设置了从属关系 version: 1.4.2 po
version: 1.4.2
port: 7054
cors:
enabled: false
origins:
- "*"
debug: false
crlsizelimit: 512000
tls:
enabled: false
certfile:
keyfile:
clientauth:
type: noclientcert
certfiles:
ca:
name:
keyfile:
certfile:
chainfile:
crl:
expiry: 24h
registry:
maxenrollments: -1
identities:
- name: admin
pass: adminpw
type: client
affiliation: ""
attrs:
hf.Registrar.Roles: "*"
hf.Registrar.DelegateRoles: "*"
hf.Revoker: true
hf.IntermediateCA: true
hf.GenCRL: true
hf.Registrar.Attributes: "*"
hf.AffiliationMgr: true
db:
type: sqlite3
datasource: fabric-ca-server.db
tls:
enabled: false
certfiles:
client:
certfile:
keyfile:
ldap:
enabled: false
url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>
tls:
certfiles:
client:
certfile:
keyfile:
attribute:
names: ['uid','member']
converters:
- name:
value:
maps:
groups:
- name:
value:
affiliations:
Patient:
- department1
# - department2
GovtHos:
- department1
PHC:
- department1
PvtHos:
- department1
Research:
- department1
Insurance:
- department1
signing:
default:
usage:
- digital signature
expiry: 8760h
profiles:
ca:
usage:
- cert sign
- crl sign
expiry: 43800h
caconstraint:
isca: true
maxpathlen: 0
tls:
usage:
- signing
- key encipherment
- server auth
- client auth
- key agreement
expiry: 8760h
csr:
cn: fabric-ca-server
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: "North Carolina"
L:
O: Hyperledger
OU: Fabric
hosts:
- d09fe8ba31b4 ### Dont know
- localhost
ca:
expiry: 131400h
pathlength: 1
idemix:
rhpoolsize: 1000
nonceexpiration: 15s
noncesweepinterval: 15m
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
keystore: msp/keystore
cacount:
cafiles:
intermediate:
parentserver:
url:
caname:
enrollment:
hosts:
profile:
label:
tls:
certfiles:
client:
certfile:
keyfile:
cfg:
identities:
passwordattempts: 10
operations:
listenAddress: 127.0.0.1:9443
tls:
enabled: false
cert:
file:
key:
file:
clientAuthRequired: false
clientRootCAs:
files: []
metrics:
provider: disabled
statsd:
network: udp
address: 127.0.0.1:8125
writeInterval: 10s
prefix: server
我不知道怎么了。我是新来的hypeldger面料。请帮帮我。
我使用的是布料1.4.2。
提前谢谢。
要测试CA,可以下载结构二进制文件,如中所述 您可以使用来试验fabric ca客户端。(有用于添加和列出从属关系的子命令。) 你可以从注册管理员开始,比如
fabric ca客户端注册-uhttp://admin:adminpw@本地主机:7054
(您可能会发现禁用TLS进行测试更容易开始。)
然后你可以试试:
fabric ca客户从属关系列表
您是否尝试列出从属关系,以查看它们是否按预期设置?可能是bin/fabric ca客户从属关系列表
Sir,我收到的命令找不到Sir。我该怎么办?先生,我刚刚写了docker-compose-ca.yaml和Fabric-ca-server-config.yaml文件。然后我做了这个“docker compose-f docker-compose.yaml-f docker-compose-ca.yaml-up-d”。我想注册管理员和用户,就像他们在Fabcar示例中所做的那样。先生,我该怎么办?
version: '2'
networks:
byfn:
services:
ca0: #Patient
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-Patient
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.Patient.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA1_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=7054
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.Patient.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA1_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/Patient.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
#######gfgfgrfg
container_name: ca_peerPatient
networks:
- byfn
ca1: #GovtHos
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-GovtHos
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.GovtHos.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA2_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=8054
ports:
- "8054:8054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.GovtHos.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA2_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/GovtHos.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerGovtHos
networks:
- byfn
ca3: # PHC
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-PHC
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.PHC.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA3_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=9054
ports:
- "9054:9054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.PHC.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA3_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/PHC.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerPHC
networks:
- byfn
ca4: #PvtHos
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-PvtHos
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.PvtHos.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA4_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=10054
ports:
- "10054:10054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.PvtHos.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA4_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/PvtHos.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerPvtHos
networks:
- byfn
ca5: #Research
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-Research
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.Research.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA5_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=11054
ports:
- "11054:11054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.Research.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA5_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/Research.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerResearch
networks:
- byfn
ca6: #Insurance
image: hyperledger/fabric-ca:$IMAGE_TAG
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-Insurance
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.Insurance.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${BYFN_CA6_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=12054
ports:
- "12054:12054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.Insurance.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${BYFN_CA6_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/Insurance.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
- ./fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerInsurance
networks:
- byfn