testcrypto

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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(cryptoPath string) ([]msp.SigningIdentity, error)

GetConsenterIdentities returns the orderer consenters identities from a crypto path.

func GetMspDirs

func GetMspDirs(targetPath string) []*msp.DirLoadParameters

GetMspDirs returns the MSP dir parameter per organization in the path.

func GetOrdererMspDirs

func GetOrdererMspDirs(cryptoPath string) []*msp.DirLoadParameters

GetOrdererMspDirs returns the orderers' MSP directory path.

func GetPeersIdentities

func GetPeersIdentities(cryptoPath string) ([]msp.SigningIdentity, error)

GetPeersIdentities returns the peers' identities from a crypto path.

func GetPeersMspDirs

func GetPeersMspDirs(cryptoPath string) []*msp.DirLoadParameters

GetPeersMspDirs returns the peers' MSP directory path.

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)

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
}

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.

Jump to

Keyboard shortcuts

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