testutils

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const MB = 1024 * 1024

Variables

This section is empty.

Functions

func AddConsortiumToConfig

func AddConsortiumToConfig(channelConfig *cb.Config, request AddConsortiumRequest) (*cb.Config, error)

func GetChannelProfileConfig

func GetChannelProfileConfig(
	ordService OrdererOrganization,
	members []PeerOrganization,
	consortiumName string,
	adminPolicy string,
) (*genesisconfig.Profile, error)

func GetConfigEnvelopeBytes

func GetConfigEnvelopeBytes(configUpdate *cb.ConfigUpdate) ([]byte, error)

func GetProfileConfig

func GetProfileConfig(
	ordOrgs []OrdererOrganization,
	config GenesisConfig,
) (*genesisconfig.Profile, error)

Types

type AddConsortiumRequest

type AddConsortiumRequest struct {
	Name          string
	Organizations []PeerOrganization
}

type ApplicationCapabilities

type ApplicationCapabilities struct {
	V2_0 bool
}

type ChannelCapabilities

type ChannelCapabilities struct {
	V2_0 bool
}

type Consortium

type Consortium struct {
	Name          string
	Organizations []*ConsortiumMember
}

type ConsortiumMember

type ConsortiumMember struct {
	MSPID string
}

type GenesisConfig

type GenesisConfig struct {
	BatchTimeout            time.Duration // 2 seconds
	MaxMessageCount         int           // 500
	AbsoluteMaxBytes        int           // 10 * 1024 * 1024 = 10MB
	PreferredMaxBytes       int           // 2 * 1024 * 1024 = 2MB
	OrdererCapabilities     OrdererCapabilities
	ApplicationCapabilities ApplicationCapabilities
	ChannelCapabilities     ChannelCapabilities
	SnapshotIntervalSize    int    // 19
	TickInterval            string // 500ms
	ElectionTick            int    // 10
	HeartbeatTick           int    // 1
	MaxInflightBlocks       int    // 5
}

type OrdererCapabilities

type OrdererCapabilities struct {
	V2_0 bool
}

type OrdererNode

type OrdererNode struct {
	TLSCert string
	Host    string
	Port    int
}

type OrdererOrganization

type OrdererOrganization struct {
	Nodes        []OrdererNode
	RootTLSCert  string
	RootSignCert string
	MspID        string
}

type PeerNode

type PeerNode struct {
	Host string
	Port int
}

type PeerOrganization

type PeerOrganization struct {
	RootCert    string
	TLSRootCert string
	MspID       string
	Peers       []PeerNode
}

Jump to

Keyboard shortcuts

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