config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

	TemplateLoadGenOnlyOrderer              = templateLoadGenOnlyOrdererClient + templateLoadGenCommon
	TemplateLoadGenOrderer                  = templateLoadGenOrdererClient + templateLoadGenCommon
	TemplateLoadGenCommitter                = templateLoadGenCommitterClient + templateLoadGenCommon
	TemplateLoadGenCoordinator              = templateLoadGenCoordinatorClient + templateLoadGenCommon
	TemplateLoadGenVC                       = templateLoadGenVCClient + templateLoadGenCommon
	TemplateLoadGenVerifier                 = templateLoadGenVerifierClient + templateLoadGenCommon
	TemplateLoadGenDistributedLoadGenClient = templateLoadGenDistributedLoadGenClient + templateLoadGenCommon
)

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() *viper.Viper

NewViperWithLoggingDefault returns a viper instance with the logging 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, error)

ReadCoordinatorYamlAndSetupLogging reading the YAML config file of the coordinator.

func ReadLoadGenYamlAndSetupLogging

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

ReadLoadGenYamlAndSetupLogging reading the YAML config file of the load generator.

func ReadMockOrdererYamlAndSetupLogging

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

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

func ReadQueryYamlAndSetupLogging

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

ReadQueryYamlAndSetupLogging reading the YAML config file of the query service.

func ReadSidecarYamlAndSetupLogging

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

ReadSidecarYamlAndSetupLogging reading the YAML config file of the sidecar.

func ReadVCYamlAndSetupLogging

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

ReadVCYamlAndSetupLogging reading the YAML config file of the VC.

func ReadVerifierYamlAndSetupLogging

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

ReadVerifierYamlAndSetupLogging reading the YAML config file of the verifier.

func ReadYamlAndSetupLogging

func ReadYamlAndSetupLogging(v *viper.Viper, configPath, servicePrefix string, c any) error

ReadYamlAndSetupLogging reading the YAML config file of a service.

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
	MetricsEndpoint *connection.Endpoint
	GrpcTLS         connection.TLSConfig
	MetricsTLS      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            *connection.RateLimitConfig // query, sidecar
	MaxRequestKeys       int                         // 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