我已经使用Hyperledger Farbic创建了网络。加密-证书是使用configtxgen工具创建的,因此,我使用以下方法创建了频道tx:
configtxgen -profile SampleChannel -outputCreateChannelTx ./config/SampleChannel.tx -channelID SampleChannel
因此,默认为管理员
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
}
如何将mod_policy
更改为
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY", // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
"sub_policy": "Admins"
}
},
"version": "0"
}
我的下一步是
configtxgen -profile SampleChannel -outputAnchorPeersUpdate ./config/SampleChannel.tx -channelID SampleChannel -asOrg Org1MSP
但是如何使用手动更改的SampleChannel.tx将其应用于网络?
非常感谢您的帮助
创建config.tx时,请进行以下更改
Channel: &ChannelDefaults
Policies:
# Who may invoke the 'Deliver' API
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
# Who may invoke the 'Broadcast' API
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
# By default, who may modify elements at this config level
Admins:
Type: ImplicitMeta
Rule: "ANY Writers"
[如果您想更具体而不是NAY Writers,并且只想指定特定的组织管理员,在以下代码段中使用
Channel: &ChannelDefaults
Policies:
# Who may invoke the 'Deliver' API
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
# Who may invoke the 'Broadcast' API
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
# By default, who may modify elements at this config level
Admins:
Type: Signature
Rule: "OR('Org1.admin')"