make passing bootstrap information optional
reason: allow the first node to start without having to wait for a timeout part of #58
This commit is contained in:
parent
59beb3441f
commit
20050654bc
10
app/Main.hs
10
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
|
||||
|
|
Loading…
Reference in a new issue