Documentation ¶
Index ¶
Constants ¶
View Source
const ( //testchainid是用于测试的通道名,当 // TestChainID = "testchainid" // // SampleInsecureSoloProfile = "SampleInsecureSolo" // //只有管理员权限的基本成员资格,并且使用SOLO进行订购。 SampleDevModeSoloProfile = "SampleDevModeSolo" //samplesinglemspssoloprofile引用示例配置文件,其中包括 //只有示例MSP和使用SOLO进行订购。 SampleSingleMSPSoloProfile = "SampleSingleMSPSolo" //sampleinsecurekafkaprofile引用的示例配置文件不是 // SampleInsecureKafkaProfile = "SampleInsecureKafka" // //管理特权的基本成员身份,并使用Kafka进行订购。 SampleDevModeKafkaProfile = "SampleDevModeKafka" //samplesinglemspkafkaprofile引用示例配置文件,其中包括 // SampleSingleMSPKafkaProfile = "SampleSingleMSPKafka" //sampledevmodeetcdraftprofile引用用于测试的样本配置文件 //基于ETCD/RAFT的订购服务。 SampleDevModeEtcdRaftProfile = "SampleDevModeEtcdRaft" //samplesinglemschannelprofile引用示例配置文件, //仅包括示例MSP,用于创建通道 SampleSingleMSPChannelProfile = "SampleSingleMSPChannel" // // SampleConsortiumName = "SampleConsortium" // SampleOrgName = "SampleOrg" //adminroleadminprincipal设置为adminrole,以使 //键入要用作管理主体默认值的admin AdminRoleAdminPrincipal = "Role.ADMIN" //MemberRoleADMinPrincipal设置为AdminRole,以导致的MSP角色 //要用作管理主体默认值的类型成员 MemberRoleAdminPrincipal = "Role.MEMBER" )
View Source
const ( // Prefix string = "CONFIGTX" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnchorPeer ¶
anchor peer对必要字段进行编码,以标识锚定对等。
type Application ¶
type Application struct { Organizations []*Organization `yaml:"Organizations"` Capabilities map[string]bool `yaml:"Capabilities"` Resources *Resources `yaml:"Resources"` Policies map[string]*Policy `yaml:"Policies"` ACLs map[string]string `yaml:"ACLs"` }
应用程序编码配置中所需的应用程序级配置 交易。
type Consortium ¶
type Consortium struct {
Organizations []*Organization `yaml:"Organizations"`
}
联合体代表一组可能创造渠道的组织。 彼此
type Orderer ¶
type Orderer struct { OrdererType string `yaml:"OrdererType"` Addresses []string `yaml:"Addresses"` BatchTimeout time.Duration `yaml:"BatchTimeout"` BatchSize BatchSize `yaml:"BatchSize"` Kafka Kafka `yaml:"Kafka"` EtcdRaft *etcdraft.Metadata `yaml:"EtcdRaft"` Organizations []*Organization `yaml:"Organizations"` MaxChannels uint64 `yaml:"MaxChannels"` Capabilities map[string]bool `yaml:"Capabilities"` Policies map[string]*Policy `yaml:"Policies"` }
临时引导程序引导订购程序。
type Organization ¶
type Organization struct { Name string `yaml:"Name"` ID string `yaml:"ID"` MSPDir string `yaml:"MSPDir"` MSPType string `yaml:"MSPType"` Policies map[string]*Policy `yaml:"Policies"` //注意:Viper反序列化似乎不关心 //嵌入类型,因此我们使用一个组织结构 //对于订购者和应用程序。 AnchorPeers []*AnchorPeer `yaml:"AnchorPeers"` // //它用于修改默认策略生成,但是策略 //现在可以显式指定,因此它是多余的和不必要的 AdminPrincipal string `yaml:"AdminPrincipal"` }
组织编码中所需的组织级配置 配置事务。
type Profile ¶
type Profile struct { Consortium string `yaml:"Consortium"` Application *Application `yaml:"Application"` Orderer *Orderer `yaml:"Orderer"` Consortiums map[string]*Consortium `yaml:"Consortiums"` Capabilities map[string]bool `yaml:"Capabilities"` Policies map[string]*Policy `yaml:"Policies"` }
配置文件编码订购者/应用程序配置组合
type TopLevel ¶
type TopLevel struct { Profiles map[string]*Profile `yaml:"Profiles"` Organizations []*Organization `yaml:"Organizations"` Channel *Profile `yaml:"Channel"` Application *Application `yaml:"Application"` Orderer *Orderer `yaml:"Orderer"` Capabilities map[string]map[string]bool `yaml:"Capabilities"` Resources *Resources `yaml:"Resources"` }
顶层由configtxgen工具使用的结构组成。
func LoadTopLevel ¶
loadtoplevel只需将configtx.yaml文件加载到上面的结构中,然后 完成初始化。可以选择提供配置路径,并且 将用于替代结构的路径env变量。
注意,要使环境覆盖在配置文件中正常工作,请加载
Click to show internal directories.
Click to hide internal directories.