代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package channelconfig
import (
"github.com/hyperledger/fabric/common/policies"
)
func LogSanityChecks(res Resources) {
pm := res.PolicyManager()
for _, policyName := range []string{policies.ChannelReaders, policies.ChannelWriters} {
_, ok := pm.GetPolicy(policyName)
if !ok {
logger.Warningf("Current configuration has no policy '%s', this will likely cause problems in production systems", policyName)
} else {
logger.Debugf("As expected, current configuration has policy '%s'", policyName)
}
}
if _, ok := pm.Manager([]string{policies.ApplicationPrefix}); ok {
// Check for default application policies if the application component is defined
for _, policyName := range []string{
policies.ChannelApplicationReaders,
policies.ChannelApplicationWriters,
policies.ChannelApplicationAdmins} {
_, ok := pm.GetPolicy(policyName)
if !ok {
logger.Warningf("Current configuration has no policy '%s', this will likely cause problems in production systems", policyName)
} else {
logger.Debugf("As expected, current configuration has policy '%s'", policyName)
}
}
}
if _, ok := pm.Manager([]string{policies.OrdererPrefix}); ok {
for _, policyName := range []string{policies.BlockValidation} {
_, ok := pm.GetPolicy(policyName)
if !ok {
logger.Warningf("Current configuration has no policy '%s', this will likely cause problems in production systems", policyName)
} else {
logger.Debugf("As expected, current configuration has policy '%s'", policyName)
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。