Closed BadTigrou closed 9 months ago
json api file size is limited to 16 kB: https://github.com/SChernykh/p2pool/blob/master/src/p2pool_api.cpp#L109 So there is a reason for not having worker list (it can be thousands of workers), and for writing p2p peer list in compact form.
Ok got it for the compact version and the 16 kb file size limitation. Is it problematic to increase JSON file size to 32 or even 64kb ? Combining with a compact form it should allow to logs up several thousands of workers.
@BadTigrou I've submitted https://github.com/SChernykh/p2pool/commit/0b544bf55aea8a46e21cfe63f3e69b29f2a04256 to fix this. Can you update your PR and keep the compact form for both P2P and Stratum?
I reverted back the changes in p2p_server.ccp to keep compact format. Revert back some change in stratum_server.cpp to minimize code change.
I notice an issue with the compact format for the worker :
"127.0.0.1:45076,50,2501,722 H/s,z","192.168.1.2:54630,76,1000225,33.340 KH/s,y"
If worker's hashrate is logged in H/s it introduce a new ',' in the worker's line.
Changed to log hashrate as an integer
You don't need if (s.m_pos + 128 >= s.m_bufSize)
check anymore. Otherwise, looks good. Also, when you're done please squash all commits into one (or open a new PR with a single commit, if you can't squash because you already merged master branch into your PR).
Closing this to make a new clean pull request with a single commit. See PR https://github.com/SChernykh/p2pool/pull/278
First change is in api_update_local_stats to output a full json file :
Before :
After :
Second change is in api_update_local_stats to add workers data in the stratum file