From aff116849cb9a750f315f36b819de64a6907fdcc Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 5 Jun 2013 11:49:08 +0200 Subject: [PATCH] Adding support for public API polling * Does not require a token * Returns basic status as taken from default mmcfe Addresses #111 --- public/include/pages/api/public.inc.php | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 public/include/pages/api/public.inc.php diff --git a/public/include/pages/api/public.inc.php b/public/include/pages/api/public.inc.php new file mode 100644 index 00000000..162e9134 --- /dev/null +++ b/public/include/pages/api/public.inc.php @@ -0,0 +1,26 @@ +getLast(); +$aShares = $statistics->getRoundShares(); + +echo json_encode( + array( + 'pool_name' => $config['website']['name'], + 'hashrate' => $statistics->getCurrentHashrate(), + 'workers' => $worker->getCountAllActiveWorkers(), + 'shares_this_round' => $aShares['valid'], + 'last_block' => $aLastBlock['height'], + 'network_hashrate' => '0' + ) +); + +// Supress master template +$supress_master = 1; +?>