Search in sources :

Example 1 with CfgEnergyStrategy

use of org.aion.zero.impl.config.CfgEnergyStrategy in project aion by aionnetwork.

the class ApiWeb3Aion method configConsensus.

private static JSONObject configConsensus() {
    CfgConsensusUnity config = CfgAion.inst().getConsensus();
    JSONObject obj = new JSONObject();
    obj.put("mining", config.getMining());
    obj.put("minerAddress", config.getMinerAddress());
    obj.put("threads", config.getCpuMineThreads());
    obj.put("extraData", config.getExtraData());
    // base.consensus.energyStrategy
    CfgEnergyStrategy nrg = config.getEnergyStrategy();
    JSONObject nrgObj = new JSONObject();
    nrgObj.put("strategy", nrg.getStrategy());
    nrgObj.put("target", nrg.getTarget());
    nrgObj.put("upper", nrg.getUpperBound());
    nrgObj.put("lower", nrg.getLowerBound());
    // end
    obj.put("energyStrategy", nrgObj);
    return obj;
}
Also used : CfgEnergyStrategy(org.aion.zero.impl.config.CfgEnergyStrategy) JSONObject(org.json.JSONObject) CfgConsensusUnity(org.aion.zero.impl.config.CfgConsensusUnity)

Aggregations

CfgConsensusUnity (org.aion.zero.impl.config.CfgConsensusUnity)1 CfgEnergyStrategy (org.aion.zero.impl.config.CfgEnergyStrategy)1 JSONObject (org.json.JSONObject)1