use of org.tron.common.application.Application in project java-tron by tronprotocol.
the class FullNode method main.
/**
* Start the FullNode.
*/
public static void main(String[] args) throws InterruptedException {
Args.setParam(args, Configuration.getByPath(Constant.NORMAL_CONF));
Args cfgArgs = Args.getInstance();
ApplicationContext context = new AnnotationConfigApplicationContext(DefaultConfig.class);
if (cfgArgs.isHelp()) {
logger.info("Here is the help message.");
return;
}
logger.info("Here is the help message." + cfgArgs.getOutputDirectory());
Application appT = ApplicationFactory.create(context);
// appT.init(cfgArgs);
RpcApiService rpcApiService = new RpcApiService(appT);
appT.addService(rpcApiService);
if (cfgArgs.isWitness()) {
appT.addService(new WitnessService(appT));
}
appT.initServices(cfgArgs);
appT.startServices();
appT.startup();
rpcApiService.blockUntilShutdown();
}
Aggregations