Documentation ¶
Index ¶
- type AnchorPeer
- type Application
- type ApplicationCapabilities
- type Capabilities
- type Channel
- type ChannelArtifacts
- type ChannelCapabilities
- type ConfigBuilder
- type Configtx
- type ConnectConfig
- type Consenter
- type Consortiums
- type CryptoConfig
- type FabricConfig
- func (f FabricConfig) BuildCryptoFile()
- func (f FabricConfig) BuildTxFile()
- func (f FabricConfig) SetApplication() FabricConfig
- func (f FabricConfig) SetCapabilities() FabricConfig
- func (f FabricConfig) SetChannel() FabricConfig
- func (f FabricConfig) SetOrderer() FabricConfig
- func (f FabricConfig) SetOrdererOrgs() FabricConfig
- func (f FabricConfig) SetOrganizations() FabricConfig
- func (f FabricConfig) SetPeerOrgs() FabricConfig
- func (f FabricConfig) SetProfiles() FabricConfig
- type FabricK8s
- type OcApplication
- type OgOrderer
- type Orderer
- type OrdererCapabilities
- type OrdererGenesis
- type OrdererOrg
- type OrdererPolicies
- type Organization
- type OrgsChannel
- type PeerOrg
- type Policies
- type Profiles
- type ProjectDir
- type TypeRule
- type UserChainPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnchorPeer ¶
type Application ¶
type Application struct { Organizations string `yaml:"Organizations"` Policies Policies `yaml:"Policies"` Capabilities ApplicationCapabilities `yaml:"Capabilities"` }
type ApplicationCapabilities ¶
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) 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) 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-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) SetApplication ¶
func (f FabricConfig) SetApplication() FabricConfig
设置Application
func (FabricConfig) SetCapabilities ¶
func (f FabricConfig) SetCapabilities() FabricConfig
设置capabilitie
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
type FabricK8s ¶
type FabricK8s struct {
// contains filtered or unexported fields
}
func NewFabricK8s ¶
func NewFabricK8s(chain model.FabricChain, path UserChainPath) FabricK8s
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 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 ¶
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 UserChainPath ¶
type UserChainPath struct { ArtifactPath string K8sConfigPath string DataPath string TemplatePath string }
用户chain路径
func NewUserChainPath ¶
func NewUserChainPath(artifactPath, k8sConfig, dataPath, templatePath string) UserChainPath
Click to show internal directories.
Click to hide internal directories.