【问题标题】:Error to update orderermsp in Hyperledger fabric在 Hyperledger 结构中更新 orderermsp 时出错
【发布时间】:2021-02-20 14:34:58
【问题描述】:

我尝试将 kafka 迁移到 raft 并尝试更新其中 EnableNodeOUs 为真的通道配置,当我使用 orderermsp 签署更新文件时它给出错误

结果错误:已满足子策略,但此策略需要满足 1 个“管理员”子策略

这是我遵循的命令


# change work directories
mkdir maintenance_on_$CHANNEL_NAME && cd maintenance_on_$CHANNEL_NAME

# fetch current channel config
peer channel fetch config config_block.pb -o orderer0.dxb.com:7050 -c avanzachannel --tls --cafile $ORDERER_CA

# decode fetched channel config
configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json
jq .data.data[0].payload.data.config config_block.json > config.json

# save old config, to calculate delta in the future
cp config.json config_mod.json

cat config.json | grep name


# set maintenance mode in configs
sed -i 's/NORMAL/MAINTENANCE/g' config_mod.json

# encode old config to protopuf
configtxlator proto_encode --input config.json --type common.Config --output config.pb

# encode new config to protopuf
configtxlator proto_encode --input config_mod.json --type common.Config --output modified_config.pb

# compute delta between configs
configtxlator compute_update --channel_id $CHANNEL_NAME --original config.pb --updated modified_config.pb --output config_update.pb

# decode delta config
configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate | jq . > config_update.json

# wrap delta config with a header
echo '{"payload":{"header":{"channel_header":{"channel_id":"avanzachannel", "type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' | jq . > config_update_envelope.json

# encode wrapped config to protopuf
configtxlator proto_encode --input config_update_envelope.json --type common.Envelope --output config_update_in_envelope.pb

# sign channel update config


export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/crypto/ordererOrganizations/dxb.com/orderers/orderer0.dxb.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/dxb.com/users/Admin@dxb.com/msp
export CORE_PEER_LOCALMSPID=OrdererMSP


peer channel signconfigtx -f config_update_in_envelope.pb


# # export all needed env vars
# export CORE_PEER_LOCALMSPID="OrdererMSP"
# export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/crypto/ordererOrganizations/dxb.com/orderers/orderer.dxb.com/tls/ca.crt
# export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/dxb.com/users/Admin@dxb.com/msp/
# export CORE_PEER_ADDRESS=peer0.org1.dxb.com:7051

# submit new channel config
peer channel update -f config_update_in_envelope.pb -c $CHANNEL_NAME -o orderer0.dxb.com:7050 --tls --cafile $ORDERER_CA


【问题讨论】:

    标签: hyperledger-fabric


    【解决方案1】:

    我觉得问题和this link一样。

    问题是您的订购者管理员证书没有正确的“OU”。

    您可以按照答案重新尝试所有步骤。

    【讨论】:

    • 感谢您的回答,但问题是我们创建新网络时的解决方案,但在我的情况下,网络已经在运行并且有大量数据。如果我再次创建证书,网络将是销毁,所有数据都将丢失
    • 我认为不创建新网络就不容易解决问题。因为genesis.block是ordererMSP签名的,已经保存在blockfiles中了。
    猜你喜欢
    • 1970-01-01
    • 2020-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-10
    • 2019-05-01
    相关资源
    最近更新 更多