genconfig

package
v0.0.76 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 31 Imported by: 0

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

View Source
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 AddressesFromURLs(addrs []string) map[string][]string

func CfgIdKey

func CfgIdKey(cfg interface{}, outDir string) sign.PublicKey

func CfgLinkKey

func CfgLinkKey(cfg interface{}, outDir string, kemScheme string) kem.PublicKey

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

func RunGenConfig(cfg Config) error

RunGenConfig executes the main configuration generation logic

func SaveCfg

func SaveCfg(cfg interface{}, outDir string) error

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 TomlName

func TomlName(cfg interface{}) string

func ValidateConfig

func ValidateConfig(cfg *Config) error

ValidateConfig validates the parsed configuration and returns any errors

func Write

func Write(f *os.File, str string, args ...interface{})

Types

type AuthById

type AuthById []*vConfig.Authority

func (AuthById) Len

func (a AuthById) Len() int

func (AuthById) Less

func (a AuthById) Less(i, j int) bool

func (AuthById) Swap

func (a AuthById) Swap(i, j int)

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 NodeById

type NodeById []*vConfig.Node

func (NodeById) Len

func (a NodeById) Len() int

func (NodeById) Less

func (a NodeById) Less(i, j int) bool

func (NodeById) Swap

func (a NodeById) Swap(i, j int)

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)

Jump to

Keyboard shortcuts

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