SChernykh / p2pool

Decentralized pool for Monero mining
GNU General Public License v3.0
1.08k stars 128 forks source link

Groking p2pool JSON data from --data-api #179

Closed bladedoyle closed 2 years ago

bladedoyle commented 2 years ago

@SChernykh Can you help me understand what the "p2pool JSON data" means?

File: stats_mod What does "stats_mod" stand for? It seems like most of this data is duplicates of data in the other stats files? What does this number mean? "pool":{"stats":{"lastBlockFound":"1656533847000"} Is this the number of currently active miners? "miners":304 p2pool observer claims that "Miners Known: 2570" and "Window Miners: 87" so Im not sure what is 304?

File: pool/stats This is the total number of hashes submitted to p2pool since launch? "totalHashes": 3085610646826509, p2pool observer claims 8742 blocks have ben found, 60 is way too low? "totalBlocksFound": 60

File: local/stats These values seem to reset when the p2pool process is restarted? So the values are "since started"? Is this the number of miner connections? What other connections than incoming could there be? "connections": 1, and "incoming_connections": 1

Thanks much.

SChernykh commented 2 years ago

There's no documentation for this api. You can read the code starting from https://github.com/SChernykh/p2pool/blob/master/src/p2pool.cpp#L1106 - api_update_network_stats and other api_update_* functions.

bladedoyle commented 2 years ago

Ok. I read through enough to understand a bit.
I still dont know what "stats_mod" stands for, or why there is data in that file that seems to belong in stratum (local) stats, pool stats, and network stats but I think I am able to use the data with reasonable accuracy.