Documentation
¶
Index ¶
- Constants
- func CreateDefaultConfigBlockWithCrypto(conf ConfigBlockParameters) (*common.Block, error)
- func Extend(rootDir string, config *Config) error
- func Generate(rootDir string, config *Config) error
- func LoadSampleConfig(profile string) (*configtxgen.Profile, error)
- type Config
- type ConfigBlockParameters
- type ECDSASignature
- type ECDSASigner
- type ED25519Signer
- type Node
- type NodeSpec
- type NodeTemplate
- type OrdererEndpoint
- type OrgSpec
- type OrganizationParameters
- type UserSpec
- type UsersSpec
Constants ¶
const ( ECDSA = "ecdsa" ED25519 = "ed25519" CertType = "CERTIFICATE" PrivateKeyType = "PRIVATE KEY" PrivateKeySuffix = "_sk" PrivateKeyFile = "priv" + PrivateKeySuffix CertFileExt = ".pem" CertSuffix = "-cert" + CertFileExt )
Common constants.
const ( MSPDir = "msp" TLSDir = "tls" CACertsDir = "cacerts" TLSCaCertsDir = "tlscacerts" KeyStoreDir = "keystore" AdminCertsDir = "admincerts" SignCertsDir = "signcerts" KnownCertsDir = "knowncerts" )
Directories.
const ( ConfigFile = "config.yaml" CaCertFile = "ca.crt" ServerPrefix = "server" ClientPrefix = "client" )
Files.
const ( AdminOU = "admin" ClientOU = "client" OrdererOU = "orderer" PeerOU = "peer" )
Organizational units.
const ( CaDir = "ca" UsersDir = "users" TLSCaDir = "tlsca" PeerNodesDir = "peers" OrdererNodesDir = "orderers" OrdererOrganizationsDir = "ordererOrganizations" PeerOrganizationsDir = "peerOrganizations" GenericOrganizationsDir = "organizations" TLSCaPrefix = "tls" DefaultCaHostname = "ca" )
Tree names.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultConfigBlockWithCrypto ¶
func CreateDefaultConfigBlockWithCrypto(conf ConfigBlockParameters) (*common.Block, error)
CreateDefaultConfigBlockWithCrypto creates a config block with default values and a crypto material. It uses the first orderer organization as a template and creates the given organizations. It uses the same organizations for the orderer and the application.
func LoadSampleConfig ¶
func LoadSampleConfig(profile string) (*configtxgen.Profile, error)
LoadSampleConfig returns the orderer/application config combination that corresponds to a given profile.
Types ¶
type Config ¶
type Config struct {
OrdererOrgs []OrgSpec `yaml:"OrdererOrgs"`
PeerOrgs []OrgSpec `yaml:"PeerOrgs"`
GenericOrgs []OrgSpec `yaml:"GenericOrgs"`
}
Config represents the orderer/peer organization to be generated.
func ParseConfig ¶
ParseConfig parses config data from string.
type ConfigBlockParameters ¶
type ConfigBlockParameters struct {
TargetPath string
BaseProfile string
ChannelID string
Organizations []OrganizationParameters
MetaNamespaceVerificationKey []byte
ArmaMetaBytes []byte
}
ConfigBlockParameters represents the configuration of the config block.
type ECDSASignature ¶
ECDSASignature represents a signature.
type ECDSASigner ¶
type ECDSASigner struct {
PrivateKey *ecdsa.PrivateKey
}
ECDSASigner ECDSA signer implements the crypto.Signer interface for ECDSA keys. The Sign method ensures signatures are created with Low S values since Fabric normalizes all signatures to Low S. See https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki#low_s for more detail.
func (*ECDSASigner) Public ¶
func (e *ECDSASigner) Public() crypto.PublicKey
Public returns the ecdsa.PublicKey associated with PrivateKey.
func (*ECDSASigner) Sign ¶
func (e *ECDSASigner) Sign(randReader io.Reader, digest []byte, _ crypto.SignerOpts) ([]byte, error)
Sign signs the digest and ensures that signatures use the Low S value.
type ED25519Signer ¶
type ED25519Signer struct {
PrivateKey ed25519.PrivateKey
}
ED25519Signer represents the signer.
func (*ED25519Signer) Public ¶
func (e *ED25519Signer) Public() crypto.PublicKey
Public returns the ed25519.PublicKey associated with PrivateKey.
func (*ED25519Signer) Sign ¶
func (e *ED25519Signer) Sign(_ io.Reader, msg []byte, _ crypto.SignerOpts) ([]byte, error)
Sign signs the digest.
type NodeSpec ¶
type NodeSpec struct {
Hostname string `yaml:"Hostname"`
CommonName string `yaml:"CommonName"`
Country string `yaml:"Country"`
Province string `yaml:"Province"`
Locality string `yaml:"Locality"`
OrganizationalUnit string `yaml:"OrganizationalUnit"`
StreetAddress string `yaml:"StreetAddress"`
PostalCode string `yaml:"PostalCode"`
SANS []string `yaml:"SANS"`
PublicKeyAlgorithm string `yaml:"PublicKeyAlgorithm"`
Party string `yaml:"Party"`
}
NodeSpec represents a certificate specification for a node.
type NodeTemplate ¶
type NodeTemplate struct {
Count int `yaml:"Count"`
Start int `yaml:"Start"`
Hostname string `yaml:"Hostname"`
SANS []string `yaml:"SANS"`
PublicKeyAlgorithm string `yaml:"PublicKeyAlgorithm"`
}
NodeTemplate represents a template to generate node(s).
type OrdererEndpoint ¶
OrdererEndpoint address should be in the format of <host>:<port>, not the full types.OrdererEndpoint format.
type OrgSpec ¶
type OrgSpec struct {
Name string `yaml:"Name"`
Domain string `yaml:"Domain"`
EnableNodeOUs bool `yaml:"EnableNodeOUs"`
CA NodeSpec `yaml:"CA"`
Template NodeTemplate `yaml:"Template"`
Specs []NodeSpec `yaml:"Specs"`
Users UsersSpec `yaml:"Users"`
}
OrgSpec represents the organization specification.
type OrganizationParameters ¶
type OrganizationParameters struct {
Name string
Domain string
OrdererEndpoints []OrdererEndpoint
ConsenterNodes []Node
OrdererNodes []Node
PeerNodes []Node
}
OrganizationParameters represents the properties of an organization. The Name field will also be used for MspID and organization ID.