config

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config defines configuration used by coconut client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Identifier is the human readable identifier for the instance.
	Identifier string

	// IAAddresses are the IP address:port combinations of Issuing Authority Servers.
	IAAddresses []string

	// UseGRPC specifies whether to use gRPC for sending server requests or TCP sockets.
	UseGRPC bool

	// IAAddresses are the gRPC IP address:port combinations of Issuing Authority Servers.
	IAgRPCAddresses []string

	// MaxRequests defines maximum number of concurrent requests each client can make.
	// -1 indicates no limit
	MaxRequests int

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

	// MaximumAttributes specifies the maximum number of attributes the client will want to have signed.
	MaximumAttributes int
}

Client is the Coconut Client configuration.

type Config

type Config struct {
	Client  *Client
	Nym     *Nym
	Logging *Logging

	Debug *Debug
}

Config is the top level Coconut Client 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

	// 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 is going to wait for its request to resolve.
	RequestTimeout int

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

	// NumberOfLookUpRetries specifies maximum number of retries to call issuer to look up the credentials.
	NumberOfLookUpRetries int

	// LookUpBackoff specifies the backoff duration after failing to look up credential
	// (assuming it was due to not being processed yet).
	LookUpBackoff int

	// FaucetRequestTimeout specifies the maximum time a client is going to wait for faucet request to resolve.
	FaucetRequestTimeout int
}

Debug is the Coconut Client debug configuration.

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 Client logging configuration.

type Nym

type Nym struct {
	// NymContract defined address of the ERC20 token Nym contract. It is expected to be provided in hex format.
	NymContract ethcommon.Address

	// PipeAccount defines address of Ethereum account that pipes Nym ERC20 into Nym Tendermint coins.
	// It is expected to be provided in hex format.
	PipeAccount ethcommon.Address

	// AccountKeysFile specifies the file containing keys used for the accounts on the Nym Blockchain.
	AccountKeysFile string

	// BlockchainNodeAddresses specifies addresses of blockchain nodes
	// to which the client 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

	// EthereumNodeAddresses specifies addresses of Ethereum nodes
	// to which the client 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. (TODO: implement this functionality)
	EthereumNodeAddresses []string

	// FaucetAddress defines address of ERC20 Nym Faucet.
	FaucetAddress string

	// ServiceProviders defines addresses of dummy Nym Service Providers. Added for the sake of demo.
	// It is a temporary parameter.
	ServiceProviders map[string]string
}

Nym defines Nym-specific configuration options.

Jump to

Keyboard shortcuts

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