Hyperledger Fabric-Core.yaml [英] Hyperledger Fabric - Core.yaml

查看:175
本文介绍了Hyperledger Fabric-Core.yaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了Hyperledger Fabric的许多示例,但在所有示例中都没有找到core.yaml文件.我看到很多其他文件.在许多地方,都引用了core.yaml.还有其他对应的文件吗? 从哪里,选择core.yaml配置?我应该如何使用它?

I see a lot of examples for Hyperledger Fabric where I don't find core.yaml file in all examples. I see a lot of other files. And at many places, core.yaml is referred. Is there any other file, that corresponds to it? From where this, core.yaml config is picked? How should I use it?

推荐答案

core.yaml文件为各种对等模块提供了基本的配置选项.例如,它能够配置日志记录级别,例如:

core.yaml file provides basic configuration option for various peer modules. For example it is capable of configuring logging level, e.g.:

###############################################################################
logging:

    cauthdsl:   warning
    gossip:     warning
    ledger:     info
    msp:        warning
    policies:   warning
    grpc:       error

现在,您之所以无法在fabric-sample中看到此文件的原因是因为该文件已经打包到对等docker容器中,因此很简单.接下来,由于Hyperledger Fabric使用 viper 来读取以以下内容开头的配置和viper:

Now, the reason you do not see this file within fabric-sample, because it has been already packed into peer docker container and therefore simple a part of it. Next, since Hyperledger Fabric uses viper to read the configuration and viper initialed with:

// For environment variables.
viper.SetEnvPrefix("core")
viper.AutomaticEnv()
replacer := strings.NewReplacer(".", "_")
viper.SetEnvKeyReplacer(replacer)

通过以CORE为前缀的环境变量导出配置参数,可以覆盖和控制配置参数.

Which make it possible to override and control configuration parameters by exporting them via environment variables prefixed with CORE.

这篇关于Hyperledger Fabric-Core.yaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆