diff --git a/app/Main.hs b/app/Main.hs index 3bdb4d4..4810fb0 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -45,13 +45,19 @@ main = do readConfig :: IO (FediChordConf, ServiceConf) readConfig = do - confDomainString : ipString : portString : bootstrapHost : bootstrapPortString : servicePortString : speedup : _ <- getArgs + confDomainString : ipString : portString : servicePortString : speedup : remainingArgs <- getArgs + -- allow starting the initial node without bootstrapping info to avoid + -- waiting for timeout let + confBootstrapNodes' = case remainingArgs of + bootstrapHost : bootstrapPortString : _ -> + [(bootstrapHost, read bootstrapPortString)] + _ -> [] fConf = FediChordConf { confDomain = confDomainString , confIP = toHostAddress6 . read $ ipString , confDhtPort = read portString - , confBootstrapNodes = [(bootstrapHost, read bootstrapPortString)] + , confBootstrapNodes = confBootstrapNodes' --, confStabiliseInterval = 60 , confBootstrapSamplingInterval = 180 , confMaxLookupCacheAge = 300