def main args Array String Try if args contains -cli Controller getIns

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
def main(args: Array[String]) {
Try {
if (!args.contains("-cli")) {
Controller.getInstance().start(false) //STARTING NETWORK/BLOCKCHAIN/RPC
} else {
Iterator.continually(Console.readLine).takeWhile(!_.equals("quit")).foreach{command =>
println(s"[$command RESULT] " + ApiClient.executeCommand(command))
}
}
} match {
case Failure(e) =>
e.printStackTrace()
println("STARTUP ERROR: " + e.getMessage)
System.exit(0) // force all threads shutdown
case _ =>
}
}