第一步 启动 configtxlator 服务
```bash
# /opt/fabric/bin/configtxlator start > log.log 2>&1 &
# export CONFIGTXLATOR_URL=http://127.0.0.1:7059
# export CHANNEL_NAME=mychannel
```
第二步 读取配置 config_block.pb
```bash
# /opt/fabric/bin/peer channel fetch config config_block.pb -o orderer2.baoquan.com:7050 -c $CHANNEL_NAME --tls --cafile $ordererCa
```
第三步 将 config_block.pb 解码为 json文件
```bash
# curl -X POST --data-binary @config_block.pb "$CONFIGTXLATOR_URL/protolator/decode/common.Block" | jq . > config_block.json
```
```bash
# jq .data.data[0].payload.data.config config_block.json > config.json
# config.json文件中目标节点删除,并生成新的文件 updated_config.json
# curl -X POST --data-binary @config.json "$CONFIGTXLATOR_URL/protolator/encode/common.Config" > config.pb
# curl -X POST --data-binary @updated_config.json "$CONFIGTXLATOR_URL/protolator/encode/common.Config" > updated_config.pb
# curl -X POST -F channel=$CHANNEL_NAME -F "original=@config.pb" -F "updated=@updated_config.pb" "${CONFIGTXLATOR_URL}/configtxlator/compute/update-from-configs" > config_update.pb
# curl -X POST --data-binary @config_update.pb "$CONFIGTXLATOR_URL/protolator/decode/common.ConfigUpdate" | jq . > config_update.json
# echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel","type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' |jq . > config_update_in_envelope.json
# curl -X POST --data-binary @config_update_in_envelope.json "$CONFIGTXLATOR_URL/protolator/encode/common.Envelope" > config_update_in_envelope.pb
Sign using the Org1 admin identity
# peer version 1.1.0
# peer channel signconfigtx -f config_update_in_envelope.pb
```
```bash
# peer channel update -f config_update_in_envelope.pb -c $CHANNEL_NAME -o orderer1.baoquan.com:7050 --tls true --cafile $ordererCa
```