

使用命令，获取通道信息出错，提示“无效chain id“　，错误信息如下：
 peer channel getinfo -c           mychannel


    {
      "Addr": "peer1-org1:7051",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Type": 0,
      "Metadata": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 008 [core] [Channel #1] Channel switches to new LB policy "pick_first"
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 009 [core] [Channel #1 SubChannel #2] Subchannel created
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 00a [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 00b [core] [Channel #1 SubChannel #2] Subchannel picks a new address "peer1-org1:7051" to connect
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 00c [core] pickfirstBalancer: UpdateSubConnState: 0xc00039dbe0, {CONNECTING <nil>}
2024-01-08 07:50:32.559 UTC [grpc] InfoDepth -> DEBU 00d [core] [Channel #1] Channel Connectivity change to CONNECTING
2024-01-08 07:50:32.560 UTC 001b DEBU [comm.tls] ClientHandshake -> Client TLS handshake completed in 874.583µs remoteaddress=10.1.0.3:7051
2024-01-08 07:50:32.560 UTC [grpc] InfoDepth -> DEBU 00e [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2024-01-08 07:50:32.560 UTC [grpc] InfoDepth -> DEBU 00f [core] pickfirstBalancer: UpdateSubConnState: 0xc00039dbe0, {READY <nil>}
2024-01-08 07:50:32.560 UTC [grpc] InfoDepth -> DEBU 010 [core] [Channel #1] Channel Connectivity change to READY
2024-01-08 07:50:32.561 UTC 001c INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-01-08 07:50:32.561 UTC 001d DEBU [msp.identity] Sign -> Sign: plaintext: 0AD3080A5C08031A0C08C8D2EEAC0610...6E496E666F0A096D796368616E6E656C
2024-01-08 07:50:32.561 UTC 001e DEBU [msp.identity] Sign -> Sign: digest: 5FC9A77E91FBF3E48D1D9F8625811C240A78DD1C708C3BB71442E39E6F6DDDB2
Error: received bad response, status 500: Invalid chain ID, mychannel

解决方案：
此时我以为是peer文件被删了，所以要重新建一个mychannel通道，但执行新建通道命令后，出错信息为“你要建的通道id已存在”
原因，peer节点文件被删了，重启动后，peer这个节点需要重新加入指定通道，登录peer-cli后执行加入命令如下：
peer channel join -b /tmp/hyperledger/org1/peer1/assets/mychannel.block


额外参考:(新建通道命令)
peer channel create -c mychannel -f ./channel.tx -o orderer1-org0:7050 --outputBlock mychannel.2.block --tls --cafile /tmp/hyperledger/org1/peer1/tls-msp/tlscacerts/tls-0-0-0-0-17052.pem

新建通道时，返回的出错信息如下：
2024-01-08 08:02:43.349 UTC [grpc] InfoDepth -> DEBU 020 [core] [Channel #4 SubChannel #5] Subchannel Connectivity change to READY
2024-01-08 08:02:43.349 UTC [grpc] InfoDepth -> DEBU 021 [core] pickfirstBalancer: UpdateSubConnState: 0xc0004f8bd0, {READY <nil>}
2024-01-08 08:02:43.349 UTC [grpc] InfoDepth -> DEBU 022 [core] [Channel #4] Channel Connectivity change to READY
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group]  /Channel/Application be at version 0, but it is currently at version 1


