Fabric v2.0 in kubernetes(minikube)- error Peer channel - error validation proposal:拒绝访问:channel [] creator org [Org1MSP]

wa7juj8i  于 2023-08-03  发布在  Kubernetes
关注(0)|答案(3)|浏览(162)

我正在尝试在kubernetes(minikube本地)上设置Fabric v2.0测试网络(https://hyperledger-fabric.readthedocs.io/en/release-2.0/test_network.html)。我在加入对等通道时出错。
我基于test-network的docker-compose-test-net.yaml创建了kubernetes文件。我成功部署了以下pod:

  • 订购者(筏)
  • 2个对等点(peer 0-org 1-example-com和peer 0-org 2-example-com)
  • 一个纺织工具箱

我成功地用cryptogen和configtxgen生成了加密材料,并成功地创建了通道。
但当我尝试让第一个对等点加入通道时,出现以下错误。您的帮助将不胜感激!!
在fabric-tools pod中:

$ peer channel join -b $CHANNEL_NAME.block
2020-02-11 15:57:59.177 CET [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: proposal failed (err: rpc error: code = Unknown desc = error validating proposal: access denied: channel [] creator org [Org1MSP])

字符串
我在peer 0-org 1-example-com pod日志中看到的内容:

instance for cert -----BEGIN CERTIFICATE-----
MIICKjCCAdCgAwIBAgIRAOoNq1h+5Q60dQxXKomXeQ0wCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEtZXhhbXBsZS1jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEtZXhhbXBsZS1jb20wHhcNMjAwMjExMTQ0OTAwWhcNMzAwMjA4MTQ0OTAw
WjBrMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEOMAwGA1UECxMFYWRtaW4xHzAdBgNVBAMMFkFkbWluQG9y
ZzEtZXhhbXBsZS1jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASW4Gce7yTD
oxA8CurdKrIRIG+o4To9MLfsys6AF67SWQfpa6H2GtKd9rglAseEFaAIPshb9M0J
tD1e8Q/m88ppo00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNV
HSMEJDAigCBSssprjgYyOPgdSIea4BLt8+8o0ISgVKxaIPHm/L5LTDAKBggqhkjO
PQQDAgNIADBFAiEAodJpGaOCX1hBse/un1SuLr97Y3vXiHOn/ncy1uwgt6MCIA7N
I7QfotnWGi2Rr5bRom5bWTup//IJI2ObsKx6SOfA
-----END CERTIFICATE-----
[33m2020-02-11 15:57:59.180 CET [endorser] Validate -> WARN 294[0m access denied: channel the supplied identity is not valid: x509: certificate signed by unknown authority channel= txID=bf62e100
[34m2020-02-11 15:57:59.180 CET [comm.grpc.server] 1 -> INFO 295[0m unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.6:50230 error="error validating proposal: access denied: channel [] creator org [Org1MSP]" grpc.code=Unknown grpc.call_duration=916.68µs
[36m2020-02-11 15:57:59.182 CET [grpc] infof -> DEBU 296[0m transport: loopyWriter.run returning. connection error: desc = "transport is closing"
[36m2020-02-11 15:58:00.791 CET [gossip.discovery] periodicalReconnectToDead -> DEBU 297[0m


我明白这似乎是证书的问题,但我不明白错误在哪里。
这些是我在创建和尝试加入通道之前设置的env变量。我有一种感觉,我的问题一定是来自那里的某个地方。

export CORE_PEER_TLS_ENABLED=true
export DIR_CRYPTO_MATERIAL="/fabric/crypto-config"
export CHANNEL_NAME=mychannel

export ORDERER_CA=$DIR_CRYPTO_MATERIAL/ordererOrganizations/example-com/orderers/orderer-example-com/msp/tlscacerts/tlsca.example-com-cert.pem
export PEER0_ORG1_CA=$DIR_CRYPTO_MATERIAL/peerOrganizations/org1-example-com/peers/peer0-org1-example-com/tls/ca.crt
export PEER0_ORG2_CA=$DIR_CRYPTO_MATERIAL/peerOrganizations/org2-example-com/peers/peer0-org2-example-com/tls/ca.crt

export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_MSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG1_CA
export CORE_PEER_TLS_CERT_FILE=$DIR_CRYPTO_MATERIAL/peerOrganizations/org1-example-com/peers/peer0-org1-example-com/tls/server.crt
export CORE_PEER_TLS_KEY_FILE=$DIR_CRYPTO_MATERIAL/peerOrganizations/org1-example-com/peers/peer0-org1-example-com/tls/server.key
export CORE_PEER_MSPCONFIGPATH=$DIR_CRYPTO_MATERIAL/peerOrganizations/org1-example-com/users/Admin@org1-example-com/msp
export CORE_PEER_ADDRESS=peer0-org1-example-com:7051

export FABRIC_CFG_PATH="/etc/hyperledger/fabric"

export CORE_PEER_ADDRESSAUTODETECT="true"


非常感谢您!

kh212irz

kh212irz1#

我解决了我的问题!
我在yaml文件的env中缺少CORE_PEER_MSPCONFIGPATH,用于部署对等点。
只是添加了这个,我就成功加入了这个频道。

- name: CORE_PEER_MSPCONFIGPATH
  value: /fabric/crypto-config/peerOrganizations/org1-example-com/peers/peer0-org1-example-com/msp/

字符串

gcmastyq

gcmastyq2#

这通常是由于环境对等配置不好造成的。例如使用坏

export CORE_PEER_LOCALMSPID="Org1MSP" // instead of org1MSP

字符串
一般来说,对等日志会给予您提示

access denied: channel expected MSP ID org1MSP, received Org1MSP channel= txID=de2e9354

h6my8fg2

h6my8fg23#

我为没有环境变量的人提供了解决方案,因为在我的情况下,它是docker peer端口和主机端口的端口Map。确保所有端口都在scripts文件夹中的setGlobal()函数中正确附加到docker compose文件上Map到host的任何内容
我可以用这种方法修复我的错误

相关问题