generate

package
v0.0.0-...-2926152 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

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 model.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()

生成channel交易

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-feconfig.yaml
	SetOrdererOrgs() FabricConfig
	SetPeerOrgs() FabricConfig
	BuildCryptoFile()
}

builder

func NewConfigBuilder

func NewConfigBuilder(chain model.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"`
}

tx实体

type ConnectConfig

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

fasdk链接文件

func NewConnectConfig

func NewConnectConfig(chain model.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 Consenter

type Consenter struct {
	Host          string `yaml:"Host"`
	Port          int    `yaml:"Port"`
	ClientTLSCert string `yaml:"ClientTLSCert"`
	ServerTLSCert string `yaml:"ServerTLSCert"`
}

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-feconfig.yaml

type FabricConfig

type FabricConfig struct {
	model.FabricChain

	CryptoConfigDir  string //证书目录
	ConfigtxFile     string //tx文件
	CryptoConfigFile string //crypto-config文件

	//共识配置
	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()

建tx文件

func (FabricConfig) SetApplication

func (f FabricConfig) SetApplication() FabricConfig

设置Application

func (FabricConfig) SetCapabilities

func (f FabricConfig) SetCapabilities() FabricConfig

设置capabilitie

func (FabricConfig) SetChannel

func (f FabricConfig) SetChannel() FabricConfig

设置channel

func (FabricConfig) SetOrderer

func (f FabricConfig) SetOrderer() FabricConfig

设置Orderer

func (FabricConfig) SetOrdererOrgs

func (f FabricConfig) SetOrdererOrgs() FabricConfig

func (FabricConfig) SetOrganizations

func (f FabricConfig) SetOrganizations() FabricConfig

设置organization

func (FabricConfig) SetPeerOrgs

func (f FabricConfig) SetPeerOrgs() FabricConfig

func (FabricConfig) SetProfiles

func (f FabricConfig) SetProfiles() FabricConfig

设置Profile

type FabricK8s

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

func NewFabricK8s

func NewFabricK8s(chain model.FabricChain, path UserChainPath) 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"`
	EtcdRaft struct {
		Consenters []Consenter `yaml:"Consenters"`
	} `yaml:"EtcdRaft"`
	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"`
	EtcdRaft struct {
		Consenters []Consenter `yaml:"Consenters"`
	} `yaml:"EtcdRaft"`
	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 {
	BaasArtifactsDir       string
	BaasK8sFabricConfigDir string
	BaasFabricDataDir      string
}

工程目录

func NewProjetc

func NewProjetc() ProjectDir

func (ProjectDir) BuildProjectDir

func (p ProjectDir) BuildProjectDir(chain model.FabricChain) UserChainPath

func (ProjectDir) RemoveProjectDir

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

type TypeRule

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

type UserChainPath

type UserChainPath struct {
	ArtifactPath  string
	K8sConfigPath string
	DataPath      string
	TemplatePath  string
}

用户chain路径

func NewUserChainPath

func NewUserChainPath(artifactPath, k8sConfig, dataPath, templatePath string) UserChainPath

Jump to

Keyboard shortcuts

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