Hyperledger fabric 2.5 網(wǎng)絡(luò)通道創(chuàng)建常見錯誤及解決方法
在使用 Hyperledger Fabric 2.5 創(chuàng)建網(wǎng)絡(luò)通道時,經(jīng)常會遇到Error: got unexpected status: BAD_REQUEST — Attempted to include member Org1MSP which is not in the consortium 錯誤,提示成員未在聯(lián)盟中。即使configtx.yaml 文件已正確定義了組織成員(例如 Org1 和 Org2),此錯誤仍然可能出現(xiàn)。 原因在于生成創(chuàng)世塊或創(chuàng)建通道時使用的配置文件沒有正確引用這些組織成員。
解決方法:
- 仔細檢查配置文件 (Profile): 確保Profiles 部分的 TwoOrgsOrdererGenesis 和 TwoOrgschannel 等配置文件正確引用了 Org1 和 Org2。
- 核對組織名稱: 確認生成創(chuàng)世塊和創(chuàng)建通道時使用的組織名稱與 configtx.yaml 文件中的名稱完全一致,大小寫也要匹配。
- 重新生成配置: 使用正確的配置文件重新生成創(chuàng)世塊和通道配置文件,確保配置文件準確反映 configtx.yaml 文件中的組織設(shè)置。
另一個常見錯誤是:error Validating channel creation transaction for new channel ‘mychannel’, could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group] /Channel/Application not satisfied: implicit policy evaluation failed – 0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins’ sub-policies to be satisfied。 此錯誤表示/Channel/Application 組的管理員策略未滿足,通常是因為缺少有效的管理員簽名或管理員策略定義錯誤。
解決方法:
- 檢查管理員策略: 仔細檢查 configtx.yaml 文件中定義的管理員策略(例如 Admins 策略),確保其正確且符合組織結(jié)構(gòu)。
- 驗證管理員身份: 創(chuàng)建通道時,務(wù)必使用正確配置的管理員身份,確保提供了有效的管理員簽名。
- 重新生成和更新配置: 如果修改了策略定義,必須重新生成創(chuàng)世塊和更新通道配置文件,使更改生效。
遇到 Hyperledger Fabric 問題時,建議加入相關(guān)的技術(shù)社區(qū)或論壇尋求幫助,獲取更多信息和社區(qū)支持。 希望以上信息能夠幫助您順利創(chuàng)建 Hyperledger Fabric 2.5 網(wǎng)絡(luò)通道。