Search in sources :

Example 1 with CfgApiNrg

use of org.aion.zero.impl.config.CfgApiNrg 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;
}
Also used : CfgApiZmq(org.aion.zero.impl.config.CfgApiZmq) JSONObject(org.json.JSONObject) CfgApiNrg(org.aion.zero.impl.config.CfgApiNrg) CfgApiRpc(org.aion.zero.impl.config.CfgApiRpc) CfgApi(org.aion.zero.impl.config.CfgApi) CfgSsl(org.aion.zero.impl.config.CfgSsl)

Aggregations

CfgApi (org.aion.zero.impl.config.CfgApi)1 CfgApiNrg (org.aion.zero.impl.config.CfgApiNrg)1 CfgApiRpc (org.aion.zero.impl.config.CfgApiRpc)1 CfgApiZmq (org.aion.zero.impl.config.CfgApiZmq)1 CfgSsl (org.aion.zero.impl.config.CfgSsl)1 JSONObject (org.json.JSONObject)1