forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullNode.java
More file actions
40 lines (36 loc) · 1.28 KB
/
FullNode.java
File metadata and controls
40 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package org.tron.program;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tron.common.application.Application;
import org.tron.common.application.ApplicationFactory;
import org.tron.core.Constant;
import org.tron.core.config.Configuration;
import org.tron.core.config.args.Args;
import org.tron.core.services.RpcApiService;
import org.tron.core.services.WitnessService;
public class FullNode {
private static final Logger logger = LoggerFactory.getLogger("FullNode");
/**
* Start the FullNode.
*/
public static void main(String[] args) {
Args.setParam(args, Configuration.getByPath(Constant.NORMAL_CONF));
Args cfgArgs = Args.getInstance();
if (cfgArgs.isHelp()) {
logger.info("Here is the help message.");
return;
}
logger.info("Here is the help message." + cfgArgs.getOutputDirectory());
Application appT = ApplicationFactory.create();
appT.init(cfgArgs.getOutputDirectory(), 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();
}
}