更新通道配置的过程有 03 个主要阶段:
- (1) 从 Orderer 获取最新的配置。
- (2) 修改配置。
- (3) 签署并发送交易给 Orderer 以更新通道配置。
我在尝试调用updateChannel()
函数时在步骤 (3) 遇到错误:
{状态:'BAD_REQUEST',
信息:'错误授权更新:错误验证 DeltaSet:不满足 [Value] /Channel/Orderer/BatchSize 的策略:未能达到 1 个子策略的隐式阈值,需要剩余 1 个'}
我按照hyperledger-sdk-node repo 中关于 Channel update的代码here
网络订购者的政策看起来像这样(我不确定我在这里遇到的问题)
# Policies defines the set of policies at this level of the config tree
# For Orderer policies, their canonical path is
# /Channel/Orderer/<PolicyName>
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
# BlockValidation specifies what signatures must be included in the block
# from the orderer for the peer to validate it.
BlockValidation:
Type: ImplicitMeta
Rule: "ANY Writers"
有关相关代码的更多信息:
let signatures = [];
signatures.push(client.signChannelConfig(config_proto));
let request = {
name: channelName,
// orderer: channel.getOrderer("orderer.example.com"), // Do I really need this?
config: config_proto, // response from requesting configtxlator/compute
txId: client.newTransactionID(),
signatures: signatures
};
try {
let result = await client.updateChannel(request); // ERROR HERE
console.log("result", result);
} catch (error) {
console.log(error);
}
如果您需要更多信息,请告诉我!任何想法都应该有帮助