config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//go:embed templates/coordinator.yaml.tmpl
	TemplateCoordinator string
	//go:embed templates/mock-orderer.yaml.tmpl
	TemplateMockOrderer string
	//go:embed templates/query.yaml.tmpl
	TemplateQueryService string
	//go:embed templates/sidecar.yaml.tmpl
	TemplateSidecar string
	//go:embed templates/vc.yaml.tmpl
	TemplateVC string
	//go:embed templates/verifier.yaml.tmpl
	TemplateVerifier string

	//go:embed templates/loadgen_only_orderer.yaml.tmpl
	TemplateLoadGenOnlyOrderer string
	//go:embed templates/loadgen_orderer.yaml.tmpl
	TemplateLoadGenOrderer string
	//go:embed templates/loadgen_committer.yaml.tmpl
	TemplateLoadGenCommitter string
	//go:embed templates/loadgen_coordinator.yaml.tmpl
	TemplateLoadGenCoordinator string
	//go:embed templates/loadgen_vc.yaml.tmpl
	TemplateLoadGenVC string
	//go:embed templates/loadgen_verifier.yaml.tmpl
	TemplateLoadGenVerifier string
	//go:embed templates/loadgen_distributed.yaml.tmpl
	TemplateLoadGenDistributedLoadGenClient string
)

Config templates.

Functions

func CreateTempConfigFromTemplate

func CreateTempConfigFromTemplate(t *testing.T, cmdTemplate string, conf *SystemConfig) string

CreateTempConfigFromTemplate creates a temporary config file and returning the temporary output config path.

func NewViperWithCoordinatorDefaults

func NewViperWithCoordinatorDefaults() *viper.Viper

NewViperWithCoordinatorDefaults returns a viper instance with the coordinator default values.

func NewViperWithLoadGenDefaults

func NewViperWithLoadGenDefaults() *viper.Viper

NewViperWithLoadGenDefaults returns a viper instance with the load generator default values.

func NewViperWithLoggingDefault

func NewViperWithLoggingDefault(serviceName string) *viper.Viper

NewViperWithLoggingDefault returns a viper instance with the logging default values.

func NewViperWithOrdererDefaults added in v1.0.0

func NewViperWithOrdererDefaults() *viper.Viper

NewViperWithOrdererDefaults returns a viper instance with the mock-orderer service default values.

func NewViperWithQueryDefaults

func NewViperWithQueryDefaults() *viper.Viper

NewViperWithQueryDefaults returns a viper instance with the query-service default values.

func NewViperWithSidecarDefaults

func NewViperWithSidecarDefaults() *viper.Viper

NewViperWithSidecarDefaults returns a viper instance with the sidecar default values.

func NewViperWithVCDefaults

func NewViperWithVCDefaults() *viper.Viper

NewViperWithVCDefaults returns a viper instance with the VC default values.

func NewViperWithVerifierDefaults

func NewViperWithVerifierDefaults() *viper.Viper

NewViperWithVerifierDefaults returns a viper instance with the verifier default values.

func ReadCoordinatorYamlAndSetupLogging

func ReadCoordinatorYamlAndSetupLogging(
	v *viper.Viper, configPath string,
) (*coordinator.Config, *serve.Config, error)

ReadCoordinatorYamlAndSetupLogging reading the YAML config file of the coordinator.

func ReadLoadGenYamlAndSetupLogging

func ReadLoadGenYamlAndSetupLogging(
	v *viper.Viper, configPath string,
) (*loadgen.ClientConfig, *serve.Config, error)

ReadLoadGenYamlAndSetupLogging reading the YAML config file of the load generator.

func ReadMockOrdererYamlAndSetupLogging

func ReadMockOrdererYamlAndSetupLogging(
	v *viper.Viper, configPath string,
) (*mock.OrdererConfig, *serve.Config, error)

ReadMockOrdererYamlAndSetupLogging reading the YAML config file of the mock ordering service.

func ReadQueryYamlAndSetupLogging

func ReadQueryYamlAndSetupLogging(v *viper.Viper, configPath string) (*query.Config, *serve.Config, error)

ReadQueryYamlAndSetupLogging reading the YAML config file of the query service.

func ReadSidecarYamlAndSetupLogging

func ReadSidecarYamlAndSetupLogging(
	v *viper.Viper, configPath string,
) (*sidecar.Config, *serve.Config, error)

ReadSidecarYamlAndSetupLogging reading the YAML config file of the sidecar.

func ReadVCYamlAndSetupLogging

func ReadVCYamlAndSetupLogging(v *viper.Viper, configPath string) (*vc.Config, *serve.Config, error)

ReadVCYamlAndSetupLogging reading the YAML config file of the VC.

func ReadVerifierYamlAndSetupLogging

func ReadVerifierYamlAndSetupLogging(
	v *viper.Viper, configPath string,
) (*verifier.Config, *serve.Config, error)

ReadVerifierYamlAndSetupLogging reading the YAML config file of the verifier.

Types

type DatabaseConfig

type DatabaseConfig struct {
	Name        string
	Username    string
	Password    string
	LoadBalance bool
	Endpoints   []*connection.Endpoint
	TLS         dbconn.DatabaseTLSConfig
}

DatabaseConfig represents the used DB.

type ServiceConfig added in v0.1.9

type ServiceConfig struct {
	GrpcEndpoint *connection.Endpoint
	HTTPEndpoint *connection.Endpoint
	GrpcTLS      connection.TLSConfig
	HTTPTLS      connection.TLSConfig
}

ServiceConfig stores the service's server and metrics endpoints, along with their TLS configuration.

type SystemConfig

type SystemConfig struct {
	// ThisService holds the configuration for the current service instance being configured.
	// This is populated at runtime with the specific service's endpoints and TLS settings.
	ThisService ServiceConfig

	// ClientTLS holds the TLS configuration used by a service when acting as a client to other services.
	ClientTLS connection.TLSConfig

	// System's resources.
	Services SystemServices
	DB       DatabaseConfig

	// Per service configurations.
	BlockSize               uint64                  // orderer, loadgen
	BlockTimeout            time.Duration           // orderer
	LedgerPath              string                  // sidecar
	Policy                  *workload.PolicyProfile // loadgen
	LoadGenBlockLimit       uint64                  // loadgen
	LoadGenTXLimit          uint64                  // loadgen
	LoadGenWorkers          uint64                  // loadgen
	Logging                 flogging.Config         // for all
	RateLimit               *serve.RateLimitConfig  // query, sidecar
	MaxRequestKeys          int                     // query
	QueryTLSRefreshInterval time.Duration           // query
	MaxConcurrentStreams    int                     // sidecar

	// VC service batching configuration (for testing).
	VCMinTransactionBatchSize           int           // vc
	VCTimeoutForMinTransactionBatchSize time.Duration // vc

	// Verifier batching configuration (for testing).
	VerifierBatchTimeCutoff time.Duration // verifier
	VerifierBatchSizeCutoff int           // verifier
}

SystemConfig represents the configuration of the one of the committer's components.

type SystemServices added in v0.1.9

type SystemServices struct {
	Verifier    []ServiceConfig
	VCService   []ServiceConfig
	Orderer     []ServiceConfig
	Coordinator ServiceConfig
	Sidecar     ServiceConfig
	Query       ServiceConfig
	LoadGen     ServiceConfig
}

SystemServices holds all configurations for the system services.

Jump to

Keyboard shortcuts

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