2018-04-27 08:53:53 +00:00
|
|
|
# Nimbus
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
# at your option.
|
|
|
|
# This file may not be copied, modified, or distributed except according to
|
|
|
|
# those terms.
|
|
|
|
|
2018-06-20 11:12:29 +00:00
|
|
|
import config
|
2018-05-02 15:01:10 +00:00
|
|
|
import p2p/service, p2p/disc4service
|
2018-04-27 08:53:53 +00:00
|
|
|
|
|
|
|
when isMainModule:
|
|
|
|
var message: string
|
2018-05-02 15:01:10 +00:00
|
|
|
if processArguments(message) != ConfigStatus.Success:
|
2018-04-27 08:53:53 +00:00
|
|
|
echo message
|
|
|
|
quit(QuitFailure)
|
|
|
|
else:
|
|
|
|
if len(message) > 0:
|
|
|
|
echo message
|
|
|
|
|
2018-05-02 15:01:10 +00:00
|
|
|
var disc4: Discovery4Service
|
2018-05-02 15:04:54 +00:00
|
|
|
if disc4.init() != ServiceStatus.Success:
|
|
|
|
quit(QuitFailure)
|
|
|
|
if disc4.configure() != ServiceStatus.Success:
|
|
|
|
echo disc4.errorMessage()
|
|
|
|
quit(QuitFailure)
|
|
|
|
if disc4.start() != ServiceStatus.Success:
|
|
|
|
echo disc4.errorMessage()
|
|
|
|
quit(QuitFailure)
|