Welcome to the Linux Foundation Forum!

KAFKA to RAFT Migration Error

This error occur when i try to update channel configuration to normal mode to maintenance mode and idea why this error occur

Follow are the commend which are used to sign and update the channel.

  1. # peer channel join -b ./channel-artifacts/$CHANNEL_NAME.block
    # peer channel create -o orderer0.dxb.com:7050 -c avanzachannel --ordererTLSHostnameOverride orderer0.dxb.com -f channel-artifacts/channel.tx --outputBlock channel-artifacts/${CHANNEL_NAME}.block --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA

export all needed env vars

export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/dxb.com/orderers/orderer0.dxb.com/msp/tlscacerts/tlsca.dxb.com-cert.pem
export CHANNEL_NAME=avanzachannel # make sure channel name is correct

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 first-system-channel --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_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/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/example.com/orderers/orderer.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/users/[email protected]/msp/
export CORE_PEER_ADDRESS=peer0.org1.example.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

Comments

Sign In or Register to comment.