Documentation
¶
Index ¶
- func CreateOrExtendConfigBlockWithCrypto(targetPath string, conf *ConfigBlock) (*common.Block, error)
- func GetConsenterIdentities(artifactsPath string) ([]msp.SigningIdentity, error)
- func GetConsenterMspDirs(artifactsPath string) []*msp.DirLoadParameters
- func GetPeersIdentities(artifactsPath string) ([]msp.SigningIdentity, error)
- func GetPeersMspDirs(artifactsPath string) []*msp.DirLoadParameters
- func GetSigningIdentities(mspDirs ...*msp.DirLoadParameters) ([]msp.SigningIdentity, error)
- func PrepareBlockHeaderAndMetadata(block *common.Block, p BlockPrepareParameters) *common.Block
- type BlockPrepareParameters
- type ConfigBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrExtendConfigBlockWithCrypto ¶
func CreateOrExtendConfigBlockWithCrypto(targetPath string, conf *ConfigBlock) (*common.Block, error)
CreateOrExtendConfigBlockWithCrypto creates a config block with crypto material. This will generate a new config block, overwriting the existing config block if it already exists. For each of the given ID in the OrdererEndpoint, we create an orderer organization "orderer-org-<ID>" with one consenter node "consenter-org-<ID>", and for each endpoint, an orderer node "orderer-<endpoint-index>-<ID>". For the given PeerOrganizationCount, we create that many peer organizations "peer-org-<index>" with one peer node each "sidecar-peer-org-<index>".
func GetConsenterIdentities ¶
func GetConsenterIdentities(artifactsPath string) ([]msp.SigningIdentity, error)
GetConsenterIdentities returns the orderer consenters identities from a crypto path.
func GetConsenterMspDirs ¶
func GetConsenterMspDirs(artifactsPath string) []*msp.DirLoadParameters
GetConsenterMspDirs returns the orderers' MSP directory path.
func GetPeersIdentities ¶
func GetPeersIdentities(artifactsPath string) ([]msp.SigningIdentity, error)
GetPeersIdentities returns the peers' identities from a crypto path.
func GetPeersMspDirs ¶
func GetPeersMspDirs(artifactsPath string) []*msp.DirLoadParameters
GetPeersMspDirs returns the peers' MSP directory path. It discovers the client user directory by scanning the users/ directory for an entry matching "client@*", rather than assuming a specific domain suffix.
func GetSigningIdentities ¶
func GetSigningIdentities(mspDirs ...*msp.DirLoadParameters) ([]msp.SigningIdentity, error)
GetSigningIdentities loads signing identities from the given MSP directories.
func PrepareBlockHeaderAndMetadata ¶
func PrepareBlockHeaderAndMetadata(block *common.Block, p BlockPrepareParameters) *common.Block
PrepareBlockHeaderAndMetadata adds a valid header and metadata to the block.
Types ¶
type BlockPrepareParameters ¶
type BlockPrepareParameters struct {
PrevBlock *common.Block
LastConfigBlockIndex uint64
ConsenterMetadata []byte
ConsenterSigners []msp.SigningIdentity
// If UseIdentifierHeader==true, use IdentifierHeader instead of SignatureHeader.
UseIdentifierHeader bool
// ConsenterIDs for UseIdentifierHeader (must match ConsenterSigners length).
ConsenterIDs []uint32
}
BlockPrepareParameters describe the parameters needed to prepare a valid block. Each field is optional, however missing fields may create an invalid block, depending on the verification level.
type ConfigBlock ¶
type ConfigBlock struct {
ChannelID string
OrdererEndpoints []*types.OrdererEndpoint
PeerOrganizationCount uint32
}
ConfigBlock represents the configuration of the config block.