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 _ =>
}
}