configtx

package
v0.0.0-...-41c7706 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendChannelIntoSystemChannel

func AppendChannelIntoSystemChannel(configtx *ConfigTx, channelName string, organizations []*Organization)

Types

type Application

type Application struct {
	// Organizations interface{}              `yaml:"Organizations"`
	Polices      *ApplicationPolicies `yaml:"Polices"`
	Capabilities *Capabilities        `yaml:"Capabilities"`
}

func GenerateDefaultApplication

func GenerateDefaultApplication(capabilities *Capabilities) *Application

type ApplicationPolicies

type ApplicationPolicies struct {
	Readers              *ApplicationPoliciesRole `yaml:"Reader"`
	Writers              *ApplicationPoliciesRole `yaml:"Writers"`
	Admins               *ApplicationPoliciesRole `yaml:"Admins"`
	LifecycleEndorsement *ApplicationPoliciesRole `yaml:"LifecycleEndorsement"`
	Endorsement          *ApplicationPoliciesRole `yaml:"Endorsement"`
}

func GenerateDefaultApplicationPolicies

func GenerateDefaultApplicationPolicies() *ApplicationPolicies

type ApplicationPoliciesRole

type ApplicationPoliciesRole struct {
	Type string `yaml:"Type"`
	Rule string `yaml:"Rule"`
}

type Capabilities

type Capabilities struct {
	Channel     *CapabilitiesV2 `yaml:"Channel"`
	Orderer     *CapabilitiesV2 `yaml:"Orderer"`
	Application *CapabilitiesV2 `yaml:"Application"`
}

func GenerateDefaultCapabilities

func GenerateDefaultCapabilities() *Capabilities

type CapabilitiesV2

type CapabilitiesV2 struct {
	V2_0 bool `yaml:"V2_0"`
}

type Channel

type Channel struct {
	Policies     *ChannelPolicies `yaml:"Policies"`
	Capabilities *Capabilities    `yaml:"Capabilities"`
}

func GenerateDefaultChannel

func GenerateDefaultChannel(capabilities *Capabilities) *Channel

type ChannelPolicies

type ChannelPolicies struct {
	Readers *ChannelPoliciesRole `yaml:"Readers"`
	Writers *ChannelPoliciesRole `yaml:"Writers"`
	Admins  *ChannelPoliciesRole `yaml:"Admins"`
}

func GenerateDefaultChannelPolicies

func GenerateDefaultChannelPolicies() *ChannelPolicies

type ChannelPoliciesRole

type ChannelPoliciesRole struct {
	Type string `yaml:"Type"`
	Rule string `yaml:"Rule"`
}

type ConfigTx

type ConfigTx struct {
	// Organizations []map[string]Organizations `yaml:"Organizations"`
	Organizations []*Organization                 `yaml:"Organizations"`
	Capabilities  *Capabilities                   `yaml:"Capabilities"`
	Application   *Application                    `yaml:"Application"`
	Orderer       *OrdererEtcd                    `yaml:"Orderer"`
	Channel       *Channel                        `yaml:"Channel"`
	Profiles      map[string]*ProfilesChannelEtcd `yaml:"Profiles"`
}

func GenerateConfigTx

func GenerateConfigTx() *ConfigTx

func (*ConfigTx) AddChannel

func (that *ConfigTx) AddChannel(name string, consortium string)

func (*ConfigTx) AddOrdererToOrg

func (that *ConfigTx) AddOrdererToOrg(org *Organization, peerName string, orgName string, domainRoot string, port uint, ClientTLSCertPath string, ServerTLSCertPath string)

func (*ConfigTx) AddOrganization

func (that *ConfigTx) AddOrganization(org *Organization)

func (*ConfigTx) CreateOrganization

func (that *ConfigTx) CreateOrganization(orgName string, mspPath string) *Organization

func (*ConfigTx) Export

func (that *ConfigTx) Export(folder string)

func (*ConfigTx) FindOrganization

func (that *ConfigTx) FindOrganization(orgName string) *Organization

type OrdererBatchSize

type OrdererBatchSize struct {
	MaxMessageCount   uint   `yaml:"MaxMessageCount"`
	AbsoluteMaxBytes  string `yaml:"AbsoluteMaxBytes"`
	PreferredMaxBytes string `yaml:"PreferredMaxBytes"`
}

func GenerateDefaultOrdererBatchSize

func GenerateDefaultOrdererBatchSize() *OrdererBatchSize

type OrdererEtcd

type OrdererEtcd struct {
	OrdererType  string            `yaml:"OrdererType"`
	Addresses    []string          `yaml:"Addresses"`
	EtcdRaft     *OrdererEtcdRaft  `yaml:"EtcdRaft"`
	BatchTimeout string            `yaml:"BatchTimeout"`
	BatchSize    *OrdererBatchSize `yaml:"BatchSize"`
	Policies     *OrdererPolicies  `yaml:"Policies"`
	Capabilities *Capabilities     `yaml:"Capabilities"`
}

func GenerateDefaultOrdererEtcd

func GenerateDefaultOrdererEtcd(capabilities *Capabilities) *OrdererEtcd

func (*OrdererEtcd) AddConsenter

func (that *OrdererEtcd) AddConsenter(peerName string, orgName string, domainRoot string, port uint, ClientTLSCertPath string, ServerTLSCertPath string)

func (*OrdererEtcd) AddOrderer

func (that *OrdererEtcd) AddOrderer(peerName string, orgName string, domainRoot string, port uint)

func (*OrdererEtcd) AddOrdererAndConsenter

func (that *OrdererEtcd) AddOrdererAndConsenter(peerName string, orgName string, domainRoot string, port uint, ClientTLSCertPath string, ServerTLSCertPath string)

type OrdererEtcdRaft

type OrdererEtcdRaft struct {
	Consenters []*OrdererEtcdRaftConsenters `yaml:"Consenters"`
}

type OrdererEtcdRaftConsenters

type OrdererEtcdRaftConsenters struct {
	Host          string `yaml:"Host"`
	Port          uint   `yaml:"Port"`
	ClientTLSCert string `yaml:"ClientTlsCert"`
	ServerTLSCert string `yaml:"ServerTlsCert"`
}

type OrdererPolicies

type OrdererPolicies struct {
	Readers         *OrdererPoliciesRole `yaml:"Readers"`
	Writers         *OrdererPoliciesRole `yaml:"Writers"`
	Admins          *OrdererPoliciesRole `yaml:"Admins"`
	BlockValidation *OrdererPoliciesRole `yaml:"BlockValidation"`
}

func GenerateDefaultOrdererPolicies

func GenerateDefaultOrdererPolicies() *OrdererPolicies

type OrdererPoliciesRole

type OrdererPoliciesRole struct {
	Type string `yaml:"Type"`
	Rule string `yaml:"Rule"`
}

type Organization

type Organization struct {
	Name             string                    `yaml:"Name"`             // 组织名称
	ID               string                    `yaml:"ID"`               // 组织ID
	MSPDir           string                    `yaml:"MSPDir"`           // 组织MSP文件夹路径
	Policies         *OrganizationPolicies     `yaml:"Policies"`         // 组织策略
	OrdererEndpoints []string                  `yaml:"OrdererEndpoints"` // 排序节点列表
	AnchorPeers      []*OrganizationAnchorPeer `yaml:"AnchorPeers"`      // 锚节点 对外代表本组织通信
}

func GenerateEmptyOrganization

func GenerateEmptyOrganization(orgName string, msp string) *Organization

func (*Organization) AddAnchorPeer

func (that *Organization) AddAnchorPeer(peerName string, orgName string, domainRoot string, port uint)

func (*Organization) AddOrderer

func (that *Organization) AddOrderer(peerName string, orgName string, domainRoot string, port uint)

func (*Organization) SetPolicies

func (that *Organization) SetPolicies(policies *OrganizationPolicies)

type OrganizationAnchorPeer

type OrganizationAnchorPeer struct {
	Host string `yaml:"Host"`
	Port uint   `yaml:"Port"`
}

type OrganizationPolicies

type OrganizationPolicies struct {
	Readers *OrganizationsPoliciesRole `yaml:"Readers"`
	Writers *OrganizationsPoliciesRole `yaml:"Writers"`
	Admins  *OrganizationsPoliciesRole `yaml:"Admins"`
}

func GenerateDefaultPolicies

func GenerateDefaultPolicies(orgName string) *OrganizationPolicies

type OrganizationsPoliciesRole

type OrganizationsPoliciesRole struct {
	Type string `yaml:"Type"` // Signature
	Rule string `yaml:"Rule"` // 'OR('org.member')' or 'OR('org.admin')'
}

type ProfilesChannelApplication

type ProfilesChannelApplication struct {
	Application   *Application    `yaml:"Application"`
	Organizations []*Organization `yaml:"Organizations"`
	Capabilities  *Capabilities   `yaml:"Capabilities"`
}

func GenerateDefaultProfilesChannelApplication

func GenerateDefaultProfilesChannelApplication(application *Application, orgs []*Organization, capabilities *Capabilities) *ProfilesChannelApplication

type ProfilesChannelEtcd

type ProfilesChannelEtcd struct {
	Consortium  string                              `yaml:"Consortium"`
	Consortiums map[string]*SystemChannelConsortium `yaml:"Consortiums"`
	Channel     *Channel                            `yaml:"Channel"`
	Orderer     *ProfilesChannelOrdererEtcd         `yaml:"Orderer"`
	Application *ProfilesChannelApplication         `yaml:"Application"`
}

func GenerateDefaultProfilesChannelWithEtcdOrderer

func GenerateDefaultProfilesChannelWithEtcdOrderer(consortium string, channel *Channel,

	orderer *OrdererEtcd, ordererOrgs []*Organization, ordererCapabilities *Capabilities,
	application *Application, applicationOrgs []*Organization, applicationCapabilities *Capabilities,
) *ProfilesChannelEtcd

func GenerateSystemProfilesChannelWithEtcdOrderer

func GenerateSystemProfilesChannelWithEtcdOrderer(channel *Channel, orderer *OrdererEtcd, ordererOrgs []*Organization, ordererCapabilities *Capabilities,
	application *Application, applicationOrgs []*Organization, applicationCapabilities *Capabilities,
) *ProfilesChannelEtcd

type ProfilesChannelOrdererEtcd

type ProfilesChannelOrdererEtcd struct {
	Orderer       *OrdererEtcd    `yaml:"Orderer"`
	Organizations []*Organization `yaml:"Organizations"`
	Capabilities  *Capabilities   `yaml:"Capabilities"`
}

func GenerateDefaultProfilesChannelOrdererEtcd

func GenerateDefaultProfilesChannelOrdererEtcd(orderer *OrdererEtcd, orgs []*Organization, capabilities *Capabilities) *ProfilesChannelOrdererEtcd

type SystemChannelConsortium

type SystemChannelConsortium struct {
	Organization []*Organization `yaml:"Organization"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL