Search in sources :

Example 1 with WitnessService

use of org.tron.core.services.WitnessService 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();
}
Also used : Args(org.tron.core.config.args.Args) ApplicationContext(org.springframework.context.ApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) WitnessService(org.tron.core.services.WitnessService) Application(org.tron.common.application.Application) RpcApiService(org.tron.core.services.RpcApiService)

Aggregations

ApplicationContext (org.springframework.context.ApplicationContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1 Application (org.tron.common.application.Application)1 Args (org.tron.core.config.args.Args)1 RpcApiService (org.tron.core.services.RpcApiService)1 WitnessService (org.tron.core.services.WitnessService)1