use of org.aion.zero.impl.config.CfgConsensusUnity 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;
}
Aggregations