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
Faucet *Faucet
Debug *Debug
}
Config is the top level Coconut IA server configuration.
func LoadBinary ¶
LoadBinary loads, parses and validates the provided buffer b (as a config) 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
// PresenceInterval defines time interval for sending presence information to the directory server.
PresenceInterval int
}
Debug is the Coconut IA server debug configuration.
type Faucet ¶
type Faucet struct {
// EthereumNodeAddress defines address of an Ethereum node to which transactions are sent.
EthereumNodeAddress string
// 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
// BlockchainKeyFile specifies the file containing the Blockchain relevant keys.
BlockchainKeyFile string
// EtherAmount specifies how much ether (to cover the fees) should the faucet transfer alongisde the erc20 tokens.
EtherAmount float64
}
FIXME: temporary, just so that faucet extend BaseServer and use its listeners.
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
// DirectoryServerPresenceEndpoint specifies address to which server should be reporting its presence.
DirectoryServerPresenceEndpoint string
}
Server is the Coconut IA server configuration.