Documentation
¶
Overview ¶
Package genconfig generates Katzenpost mixnet configuration files ostensibly for testing. Currently the Katzenpost project uses this package as the main dependency for cmd/genconfig which is a CLI tool used by our docker mixnet setup.
Index ¶
- Constants
- func AddressesFromURLs(addrs []string) map[string][]string
- func CfgIdKey(cfg interface{}, outDir string) sign.PublicKey
- func CfgLinkKey(cfg interface{}, outDir string, kemScheme string) kem.PublicKey
- func ConfigureAuthorities(s *Katzenpost, cfg *Config) error
- func GenerateClientConfigurations(s *Katzenpost) error
- func GenerateNodes(s *Katzenpost, cfg *Config) error
- func GenerateOutputFiles(s *Katzenpost, cfg *Config) error
- func Identifier(cfg interface{}) string
- func RunGenConfig(cfg Config) error
- func SaveCfg(cfg interface{}, outDir string) error
- func SaveConfigurations(s *Katzenpost, cfg *Config) error
- func SetupGeometry(s *Katzenpost, cfg *Config) error
- func TomlName(cfg interface{}) string
- func ValidateConfig(cfg *Config) error
- func Write(f *os.File, str string, args ...interface{})
- type AuthById
- type Config
- type Katzenpost
- func (s *Katzenpost) GenAuthorizedNodes() ([]*vConfig.StorageReplicaNode, []*vConfig.Node, []*vConfig.Node, ...)
- func (s *Katzenpost) GenClient2Cfg(net, addr string) error
- func (s *Katzenpost) GenClient2ThinCfg(net, addr string) error
- func (s *Katzenpost) GenCourierConfig(datadir string) *courierConfig.Config
- func (s *Katzenpost) GenDockerCompose(dockerImage string) error
- func (s *Katzenpost) GenGrafana() error
- func (s *Katzenpost) GenNodeConfig(isGateway, isServiceNode bool, isVoting bool) error
- func (s *Katzenpost) GenPrometheus() error
- func (s *Katzenpost) GenReplicaNodeConfig() error
- func (s *Katzenpost) GenVotingAuthoritiesCfg(numAuthorities int, parameters *vConfig.Parameters, nrLayers int, ...) error
- type NodeById
- type StorageReplicaNodeById
Constants ¶
const ( BasePort = 30000 BindAddr = "127.0.0.1" NrLayers = 3 NrNodes = 6 NrGateways = 1 NrServiceNodes = 1 NrStorageNodes = 5 NrAuthorities = 3 ServerLogFile = "katzenpost.log" TcpAddrFormat = "tcp://127.0.0.1:%d" IdentityPublicKeyFile = "identity.public.pem" IdentityPrivateKeyFile = "identity.private.pem" LinkPublicKeyFile = "link.public.pem" LinkPrivateKeyFile = "link.private.pem" CourierService = "courier" ClientIdentifier = "client" DebugLogLevel = "DEBUG" AuthNodeFormat = "auth%d" WritingLogFormat = "writing %s" )
Variables ¶
This section is empty.
Functions ¶
func AddressesFromURLs ¶
func ConfigureAuthorities ¶
func ConfigureAuthorities(s *Katzenpost, cfg *Config) error
ConfigureAuthorities handles voting authority configuration and topology setup
func GenerateClientConfigurations ¶
func GenerateClientConfigurations(s *Katzenpost) error
GenerateClientConfigurations creates all client configuration files
func GenerateNodes ¶
func GenerateNodes(s *Katzenpost, cfg *Config) error
GenerateNodes creates all the different types of nodes (gateways, service nodes, mixes, replicas)
func GenerateOutputFiles ¶
func GenerateOutputFiles(s *Katzenpost, cfg *Config) error
GenerateOutputFiles creates docker-compose and prometheus configuration files
func Identifier ¶
func Identifier(cfg interface{}) string
func RunGenConfig ¶
RunGenConfig executes the main configuration generation logic
func SaveConfigurations ¶
func SaveConfigurations(s *Katzenpost, cfg *Config) error
SaveConfigurations saves all generated configurations to disk
func SetupGeometry ¶
func SetupGeometry(s *Katzenpost, cfg *Config) error
SetupGeometry configures the cryptographic schemes and geometries
func ValidateConfig ¶
ValidateConfig validates the parsed configuration and returns any errors
Types ¶
type Config ¶
type Config struct {
NrLayers int
NrNodes int
NrGateways int
NrServiceNodes int
NrStorageNodes int
Voting bool
NrVoting int
BaseDir string
BasePort int
BindAddr string
OutDir string
DockerImage string
BinSuffix string
LogLevel string
OmitTopology bool
Wirekem string
Kem string
Nike string
UserForwardPayloadLength int
PkiSignatureScheme string
EpochDuration string
NoDecoy bool
NoClientDecoy bool
NoCourierReplicaDecoy bool
NoMixDecoy bool
NoMetrics bool
PyroscopeDirauth bool
PyroscopeKpclientd bool
DialTimeout int
MaxPKIDelay int
PollingIntvl int
Sr uint64
Mu float64
MuMax uint64
LP float64
LPMax uint64
LL float64
LLMax uint64
LD float64
LDMax uint64
LM float64
LMMax uint64
LGMax uint64
LR float64
LRMax uint64
SchedulerSlack int
SchedulerMaxBurst int
SendSlack int
UnwrapDelay int
NumSphinxWorkers int
}
Config holds all the parsed command line flags
type Katzenpost ¶
type Katzenpost struct {
BaseDir string
OutDir string
BinSuffix string
LogLevel string
LogWriter io.Writer
WireKEMScheme string
PkiSignatureScheme sign.Scheme
ReplicaNIKEScheme nike.Scheme
SphinxGeometry *geo.Geometry
PigeonholeGeometry *pigeonholeGeo.Geometry
VotingAuthConfigs []*vConfig.Config
Authorities map[[32]byte]*vConfig.Authority
AuthIdentity sign.PublicKey
NodeConfigs []*sConfig.Config
ReplicaNodeConfigs []*rConfig.Config
CourierConfigs []*courierConfig.Config
BasePort uint16
LastPort uint16
LastReplicaPort uint16
ReplicaNodeIdx int
BindAddr string
NodeIdx int
GatewayIdx int
ServiceNodeIdx int
NoClientDecoy bool
NoCourierReplicaDecoy bool
NoMixDecoy bool
NoMetrics bool
PyroscopeDirauth bool
PyroscopeKpclientd bool
EpochDuration string
DebugConfig *cConfig.Debug
SchedulerSlack int
SchedulerMaxBurst int
SendSlack int
UnwrapDelay int
NumSphinxWorkers int
}
func InitializeKatzenpost ¶
func InitializeKatzenpost(cfg *Config) *Katzenpost
InitializeKatzenpost creates and initializes a Katzenpost struct with the given configuration
func (*Katzenpost) GenAuthorizedNodes ¶
func (s *Katzenpost) GenAuthorizedNodes() ([]*vConfig.StorageReplicaNode, []*vConfig.Node, []*vConfig.Node, []*vConfig.Node, error)
func (*Katzenpost) GenClient2Cfg ¶
func (s *Katzenpost) GenClient2Cfg(net, addr string) error
func (*Katzenpost) GenClient2ThinCfg ¶
func (s *Katzenpost) GenClient2ThinCfg(net, addr string) error
this generates the thin client config and NOT the client daemon config
func (*Katzenpost) GenCourierConfig ¶
func (s *Katzenpost) GenCourierConfig(datadir string) *courierConfig.Config
func (*Katzenpost) GenDockerCompose ¶
func (s *Katzenpost) GenDockerCompose(dockerImage string) error
func (*Katzenpost) GenGrafana ¶ added in v0.0.73
func (s *Katzenpost) GenGrafana() error
func (*Katzenpost) GenNodeConfig ¶
func (s *Katzenpost) GenNodeConfig(isGateway, isServiceNode bool, isVoting bool) error
func (*Katzenpost) GenPrometheus ¶
func (s *Katzenpost) GenPrometheus() error
func (*Katzenpost) GenReplicaNodeConfig ¶
func (s *Katzenpost) GenReplicaNodeConfig() error
func (*Katzenpost) GenVotingAuthoritiesCfg ¶
func (s *Katzenpost) GenVotingAuthoritiesCfg(numAuthorities int, parameters *vConfig.Parameters, nrLayers int, wirekem string) error
type StorageReplicaNodeById ¶ added in v0.0.73
type StorageReplicaNodeById []*vConfig.StorageReplicaNode
func (StorageReplicaNodeById) Len ¶ added in v0.0.73
func (a StorageReplicaNodeById) Len() int
func (StorageReplicaNodeById) Less ¶ added in v0.0.73
func (a StorageReplicaNodeById) Less(i, j int) bool
func (StorageReplicaNodeById) Swap ¶ added in v0.0.73
func (a StorageReplicaNodeById) Swap(i, j int)