config

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config defines configuration used by coconut server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   *Server
	Logging  *Logging
	Issuer   *Issuer
	Provider *Provider
	Debug    *Debug
}

Config is the top level Coconut IA server configuration.

func LoadBinary

func LoadBinary(b []byte) (*Config, error)

LoadBinary loads, parses and validates the provided buffer b (as a config) and returns the Config.

func LoadFile

func LoadFile(f string) (*Config, error)

LoadFile loads, parses and validates the provided file and returns the Config.

type Debug

type Debug struct {
	// NumJobWorkers specifies the number of worker instances to use for jobpacket processing.
	NumJobWorkers int

	// NumServerWorkers specifies the number of worker instances to use for client job requests.
	NumServerWorkers int

	// NumProcessors specifies the number of processor instances attached to the blockchain monitor.
	NumProcessors int

	// ConnectTimeout specifies the maximum time a connection can take to establish a TCP/IP connection in milliseconds.
	ConnectTimeout int

	// RequestTimeout specifies the maximum time a client job request can take to process.
	RequestTimeout int

	// ProviderStartupTimeout specifies how long the provider is going to keep retrying to start up before giving up.
	// Useful when all the servers are started at different orders.
	ProviderStartupTimeout int

	// ProviderStartupRetryInterval specifies retry interval for the provider during the start up.
	// Currently it involves retrying to obtain verification keys of all IAs.
	ProviderStartupRetryInterval int

	// MaxRequests defines maximum number of concurrent requests each provider can make.
	// only applicable to obtain verification keys of all IAs
	// -1 indicates no limit
	ProviderMaxRequests int

	// RegenerateKeys specifies whether to generate new Coconut keypair and overwrite existing files.
	RegenerateKeys bool

	// DisableAllBlockchainCommunication allows to disable startup of blockchain client, monitor and processor.
	// Not to be set in production environment. Only really applicable in tests.
	DisableAllBlockchainCommunication bool

	// DisableBlockchainMonitoring allows to disable startup of blockchain monitor and processor.
	// However, it does not disable a blockchain client so that server can still send transactions to the chain.
	// Not to be set in production environment. Only really applicable in tests.
	DisableBlockchainMonitoring bool
}

Debug is the Coconut IA server debug configuration.

type Issuer

type Issuer struct {
	// VerificationKeyFile specifies the file containing the Coconut Verification Key.
	VerificationKeyFile string

	// SecretKeyFile specifies the file containing the Coconut Secret Key.
	SecretKeyFile string
}

Issuer is the Coconut issuing authority server configuration. It is responsible for signing attributes it receives and providing its public verification key upon request.

type Logging

type Logging struct {
	// Disable disables logging entirely.
	Disable bool

	// File specifies the log file, if omitted stdout will be used.
	File string

	// Level specifies the log level.
	Level string
}

Logging is the Coconut IA server logging configuration.

type Provider

type Provider struct {
	// IAAddresses are the IP address:port combinations of all Authority Servers.
	// Only required if IAVerificationKeys is not specified.
	IAAddresses []string

	// IAVerificationKeys specifies files containing Coconut Verification keys of all Issuing Authorities.
	IAVerificationKeys []string

	// Threshold defines minimum number of verification keys provider needs to obtain.
	// Default = len(IAAddresses).
	// 0 = no threshold
	Threshold int

	// BlockchainKeyFile specifies the file containing the Blockchain relevant keys.
	BlockchainKeyFile string

	// DisableLocalCredentialsChecks specifies whether the provider should check the credentials and proofs it receives
	// or just send everything to the chain and wait for the verifier nodes to check it.
	DisableLocalCredentialsChecks bool
}

Provider is the Coconut provider server configuration. At this point it is only responsible for verifying credentials it receives.

type Server

type Server struct {
	// Identifier is the human readable identifier for the node.
	Identifier string

	// Addresses are the IP address:port combinations that the server will bind	to for incoming TCP connections.
	Addresses []string

	// GRPCAddresses are the IP address:port combinations that the server will bind	to for incoming grpcs.
	GRPCAddresses []string

	// DataDir specifies path to a .db file holding relevant server-specific persistent data.
	DataDir string

	// MaximumAttributes specifies the maximum number of attributes the system supports.
	MaximumAttributes int

	// BlockchainNodeAddresses specifies addresses of a blockchain nodes
	// to which the issuer should send all relevant requests.
	// Note that only a single request will ever be sent, but multiple addresses are provided in case
	// the particular node was unavailable.
	BlockchainNodeAddresses []string
}

Server is the Coconut IA server configuration.

Jump to

Keyboard shortcuts

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