diff --git a/main.go b/main.go index bbcb1a0755777fe8995a1f3588a1e2d3c02d291a..2ef99f217ceafab16fcc5e857fe1568e034e6846 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,8 @@ import ( ) func main() { + // run a self-test if set to yes + var selfTesting bool // my own Name var udpQL1AddrString string var ql1Name string @@ -19,6 +21,10 @@ func main() { // Setup flags that allows to initially provide a address to a second // quantumlayer so generated keys can be fetched. This is mainly to simplify // the initial setup process. + + flag.BoolVar(&selfTesting, "selfTesting", false, + "Will perform self-testing with second quantum link if set to true") + flag.StringVar(&udpQL1AddrString, "address", "[::1]:50900", "The UDP address for my quantumlayer so keys can be fetched") @@ -36,8 +42,12 @@ func main() { log.Println("Welcome to the proto-kms called: ", ql1Name) - go emulatedKMS(ql2Name, udpQL2AddrString, udpQL1AddrString) - emulatedKMS(ql1Name, udpQL1AddrString, udpQL2AddrString) + if selfTesting == true { + go emulatedKMS(ql2Name, udpQL2AddrString, udpQL1AddrString) + emulatedKMS(ql1Name, udpQL1AddrString, udpQL2AddrString) + } else { + emulatedKMS(ql1Name, udpQL1AddrString, "") + } return }