This commit is contained in:
meshmayhem 2024-11-26 00:15:34 +00:00 committed by GitHub
commit dd074bb1fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 75 additions and 16 deletions

View file

@ -40,6 +40,7 @@ type node struct {
// The main function is responsible for configuring and starting Yggdrasil.
func main() {
genconf := flag.Bool("genconf", false, "print a new config to stdout")
security := flag.Int("security", 0, "use in combination with either -genconf or -autoconf, generates a higher security address up to the security bits desired")
useconf := flag.Bool("useconf", false, "read HJSON/JSON config from stdin")
useconffile := flag.String("useconffile", "", "read HJSON/JSON config from specified file path")
normaliseconf := flag.Bool("normaliseconf", false, "use in combination with either -useconf or -useconffile, outputs your configuration normalised")
@ -88,6 +89,11 @@ func main() {
}
cfg := config.GenerateConfig()
if (*security > 0) {
// Checks if the security flag is set, and generates a key with that many security bits
newKey, _ := config.NewSecureKeyPair(*security)
cfg.PrivateKey = []byte(newKey)
}
var err error
switch {
case *ver: