use of org.aion.zero.impl.config.CfgApi in project aion by aionnetwork.
the class ApiWeb3Aion method configApi.
private static JSONObject configApi() {
CfgApi config = CfgAion.inst().getApi();
JSONObject obj = new JSONObject();
// base.api.rpc
CfgApiRpc rpcConfig = config.getRpc();
CfgSsl sslConfig = rpcConfig.getSsl();
JSONObject rpc = new JSONObject();
rpc.put("ip", rpcConfig.getIp());
rpc.put("port", rpcConfig.getPort());
rpc.put("corsEnabled", rpcConfig.isCorsEnabled());
rpc.put("active", rpcConfig.isActive());
rpc.put("maxThread", rpcConfig.getWorkerThreads());
rpc.put("sslEnabled", sslConfig.getEnabled());
rpc.put("sslCert", sslConfig.getCert());
rpc.put("sslPass", sslConfig.getPass());
// end
obj.put("rpc", rpc);
// base.api.zmq
CfgApiZmq zmqConfig = config.getZmq();
JSONObject zmq = new JSONObject();
zmq.put("ip", zmqConfig.getIp());
zmq.put("port", zmqConfig.getPort());
zmq.put("active", zmqConfig.getActive());
// end
obj.put("zmq", zmq);
// base.api.nrg
CfgApiNrg nrgConfig = config.getNrg();
JSONObject nrg = new JSONObject();
nrg.put("defaultPrice", nrgConfig.getNrgPriceDefault());
nrg.put("maxPrice", nrgConfig.getNrgPriceMax());
// end
obj.put("nrg", nrg);
return obj;
}