generate

package
v0.0.0-...-3986ddd Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorPeer

type AnchorPeer struct {
	Host string `yaml:"Host"`
	Port int    `yaml:"Port"`
}

type Application

type Application struct {
	Organizations string                  `yaml:"Organizations"`
	Policies      Policies                `yaml:"Policies"`
	Capabilities  ApplicationCapabilities `yaml:"Capabilities"`
}

type ApplicationCapabilities

type ApplicationCapabilities struct {
	V1_3 bool `yaml:"V1_3"`
	V1_2 bool `yaml:"V1_2"`
	V1_1 bool `yaml:"V1_1"`
}

type Capabilities

type Capabilities struct {
	Channel     ChannelCapabilities     `yaml:"Channel"`
	Orderer     OrdererCapabilities     `yaml:"Orderer"`
	Application ApplicationCapabilities `yaml:"Application"`
}

type Channel

type Channel struct {
	Policies     Policies            `yaml:"Policies"`
	Capabilities ChannelCapabilities `yaml:"Capabilities"`
}

type ChannelArtifacts

type ChannelArtifacts struct {
	// contains filtered or unexported fields
}

func NewChannelArtifacts

func NewChannelArtifacts(chain models.FabricChain, rootPath string) *ChannelArtifacts

func (*ChannelArtifacts) GenerateAnchorPeers

func (c *ChannelArtifacts) GenerateAnchorPeers()

func (*ChannelArtifacts) GenerateCerts

func (c *ChannelArtifacts) GenerateCerts()

func (*ChannelArtifacts) GenerateOrdererGenesis

func (c *ChannelArtifacts) GenerateOrdererGenesis()

func (*ChannelArtifacts) GenerateOrgsChannel

func (c *ChannelArtifacts) GenerateOrgsChannel()

type ChannelCapabilities

type ChannelCapabilities struct {
	V1_3 bool `yaml:"V1_3"`
}

type ConfigBuilder

type ConfigBuilder interface {
	//configtx.yaml
	SetOrganizations() FabricConfig
	SetCapabilities() FabricConfig
	SetApplication() FabricConfig
	SetOrderer() FabricConfig
	SetChannel() FabricConfig
	SetProfiles() FabricConfig
	BuildTxFile()
	//crypto-config.yaml
	SetOrdererOrgs() FabricConfig
	SetPeerOrgs() FabricConfig
	BuildCryptoFile()
}

func NewConfigBuilder

func NewConfigBuilder(chain models.FabricChain, rootPath string) ConfigBuilder

type Configtx

type Configtx struct {
	Organizations []Organization `yaml:"-"`
	Capabilities  Capabilities   `yaml:"-"`
	Application   Application    `yaml:"-"`
	Orderer       Orderer        `yaml:"-"`
	Channel       Channel        `yaml:"-"`
	Profiles      Profiles       `yaml:"Profiles"`
}

type ConnectConfig

type ConnectConfig struct {
	models.FabricChain
	// contains filtered or unexported fields
}

func NewConnectConfig

func NewConnectConfig(chain models.FabricChain, rootPath string) *ConnectConfig

func (*ConnectConfig) Build

func (c *ConnectConfig) Build() []byte

func (*ConnectConfig) GetBytes

func (c *ConnectConfig) GetBytes(maps map[string]interface{}) []byte

type Consortiums

type Consortiums struct {
	SampleConsortium struct {
		Organizations []Organization `yaml:"Organizations"`
	} `yaml:"SampleConsortium"`
}

type CryptoConfig

type CryptoConfig struct {
	OrdererOrgs []OrdererOrg `yaml:"OrdererOrgs"`
	PeerOrgs    []PeerOrg    `yaml:"PeerOrgs"`
}

crypto-config.yaml

type FabricConfig

type FabricConfig struct {
	models.FabricChain

	CryptoConfigDir  string
	ConfigtxFile     string
	CryptoConfigFile string

	//共识配置
	OrdererBatchTimeout      string //2s
	OrdererMaxMessageCount   int    //500
	OrdererAbsoluteMaxBytes  string //99 MB
	OrdererPreferredMaxBytes string //512 KB
	// contains filtered or unexported fields
}

fabric 配置

func (FabricConfig) BuildCryptoFile

func (f FabricConfig) BuildCryptoFile()

func (FabricConfig) BuildTxFile

func (f FabricConfig) BuildTxFile()

func (FabricConfig) SetApplication

func (f FabricConfig) SetApplication() FabricConfig

func (FabricConfig) SetCapabilities

func (f FabricConfig) SetCapabilities() FabricConfig

func (FabricConfig) SetChannel

func (f FabricConfig) SetChannel() FabricConfig

func (FabricConfig) SetOrderer

func (f FabricConfig) SetOrderer() FabricConfig

func (FabricConfig) SetOrdererOrgs

func (f FabricConfig) SetOrdererOrgs() FabricConfig

func (FabricConfig) SetOrganizations

func (f FabricConfig) SetOrganizations() FabricConfig

func (FabricConfig) SetPeerOrgs

func (f FabricConfig) SetPeerOrgs() FabricConfig

func (FabricConfig) SetProfiles

func (f FabricConfig) SetProfiles() FabricConfig

type FabricK8s

type FabricK8s struct {
	// contains filtered or unexported fields
}

func NewFabricK8s

func NewFabricK8s(chain models.FabricChain, conf config.UserBaasConfig) FabricK8s

func (FabricK8s) Build

func (f FabricK8s) Build()

type OcApplication

type OcApplication struct {
	Policies      Policies                `yaml:"Policies"`
	Organizations []Organization          `yaml:"Organizations"`
	Capabilities  ApplicationCapabilities `yaml:"Capabilities"`
}

type OgOrderer

type OgOrderer struct {
	OrdererType  string   `yaml:"OrdererType"`
	Addresses    []string `yaml:"Addresses"`
	BatchTimeout string   `yaml:"BatchTimeout"`
	BatchSize    struct {
		MaxMessageCount   int    `yaml:"MaxMessageCount"`
		AbsoluteMaxBytes  string `yaml:"AbsoluteMaxBytes"`
		PreferredMaxBytes string `yaml:"PreferredMaxBytes"`
	} `yaml:"BatchSize"`
	Kafka struct {
		Brokers []string `yaml:"Brokers"`
	} `yaml:"Kafka"`
	Policies      OrdererPolicies     `yaml:"Policies"`
	Organizations []Organization      `yaml:"Organizations"`
	Capabilities  OrdererCapabilities `yaml:"Capabilities"`
}

type Orderer

type Orderer struct {
	OrdererType  string   `yaml:"OrdererType"`
	Addresses    []string `yaml:"Addresses"`
	BatchTimeout string   `yaml:"BatchTimeout"`
	BatchSize    struct {
		MaxMessageCount   int    `yaml:"MaxMessageCount"`
		AbsoluteMaxBytes  string `yaml:"AbsoluteMaxBytes"`
		PreferredMaxBytes string `yaml:"PreferredMaxBytes"`
	} `yaml:"BatchSize"`
	Kafka struct {
		Brokers []string `yaml:"Brokers"`
	} `yaml:"Kafka"`

	Organizations string          `yaml:"Organizations"`
	Policies      OrdererPolicies `yaml:"Policies"`
}

type OrdererCapabilities

type OrdererCapabilities struct {
	V1_1 bool `yaml:"V1_1"`
}

type OrdererGenesis

type OrdererGenesis struct {
	Policies     Policies            `yaml:"Policies"`
	Capabilities ChannelCapabilities `yaml:"Capabilities"`
	Orderer      OgOrderer           `yaml:"Orderer"`
	Consortiums  Consortiums         `yaml:"Consortiums"`
}

type OrdererOrg

type OrdererOrg struct {
	Name   string `yaml:"Name"`
	Domain string `yaml:"Domain"`
	CA     struct {
		Country  string `yaml:"Country"`
		Province string `yaml:"Province"`
		Locality string `yaml:"Locality"`
	} `yaml:"CA"`
	Template struct {
		Count int `yaml:"Count"`
	} `yaml:"Template"`
}

func NewOrdererOrg

func NewOrdererOrg(domain string, ordererCount int) OrdererOrg

type OrdererPolicies

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

type Organization

type Organization struct {
	Name        string       `yaml:"Name"`
	ID          string       `yaml:"ID"`
	MSPDir      string       `yaml:"MSPDir"`
	Policies    Policies     `yaml:"Policies"`
	AnchorPeers []AnchorPeer `yaml:"AnchorPeers"`
}

type OrgsChannel

type OrgsChannel struct {
	Consortium  string        `yaml:"Consortium"`
	Application OcApplication `yaml:"Application"`
}

type PeerOrg

type PeerOrg struct {
	Name   string `yaml:"Name"`
	Domain string `yaml:"Domain"`
	CA     struct {
		Country  string `yaml:"Country"`
		Province string `yaml:"Province"`
		Locality string `yaml:"Locality"`
	} `yaml:"CA"`
	Template struct {
		Count int `yaml:"Count"`
	} `yaml:"Template"`
	Users struct {
		Count int `yaml:"Count"`
	} `yaml:"Users"`
	EnableNodeOUs bool `yaml:"EnableNodeOUs"`
}

func NewPeerOrg

func NewPeerOrg(name, domain string, peerCount int) PeerOrg

type Policies

type Policies struct {
	Readers TypeRule `yaml:"Readers"`
	Writers TypeRule `yaml:"Writers"`
	Admins  TypeRule `yaml:"Admins"`
}

type Profiles

type Profiles struct {
	OrdererGenesis OrdererGenesis `yaml:"OrdererGenesis"`
	OrgsChannel    OrgsChannel    `yaml:"OrgsChannel"`
}

type ProjectDir

type ProjectDir struct {
}

func NewProjetc

func NewProjetc() ProjectDir

func (ProjectDir) BuildProjectDir

func (p ProjectDir) BuildProjectDir(chain models.FabricChain) config.UserBaasConfig

func (ProjectDir) RemoveProjectDir

func (p ProjectDir) RemoveProjectDir(chain models.FabricChain) error

type TypeRule

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

Jump to

Keyboard shortcuts

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