sxguan / fabric-go-sdk

89 stars 28 forks source link

多组织架构 SaveChannel 错误 #4

Closed JovanniChen closed 1 year ago

JovanniChen commented 1 year ago
fmt.Println(">>>> 使用每个org的管理员身份更新锚节点配置...")
    //do the same get ch client and create channel for each anchor peer as well (first for Org1MSP)
    for i, org := range info.Orgs {
        req = resmgmt.SaveChannelRequest{ChannelID: info.ChannelID,
            ChannelConfigPath: org.OrgAnchorFile,
            SigningIdentities: []msp.SigningIdentity{signIDs[i]}}

        if _, err = org.OrgResMgmt.SaveChannel(req, resmgmt.WithRetry(retry.DefaultResMgmtOpts), resmgmt.WithOrdererEndpoint("orderer.example.com")); err != nil {
            return fmt.Errorf("SaveChannel for anchor org %s error: %v", org.OrgName, err)
        }
    }
    fmt.Println(">>>> 使用每个org的管理员身份更新锚节点配置完成")

关于这段代码,我看示例中是单组织架构,本人配置多组织架构,第一个组织更新成功,后续报错如下:

create channel failed, error: Create channel error: SaveChannel for anchor org Org2 error: create channel failed: create channel failed: SendEnvelope failed: calling orderer 'orderer0.example.com:7050' failed: Orderer Server Status Code: (400) BAD_REQUEST. Description: error applying config update to existing channel 'businesschannel': 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

根据查阅,显示已经更新过通道了,所以报错了,请问怎么回事?