diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a48004446..29bcb9874a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Basic API authentication to protect exposure of API port to the internet [#1228](/~https://github.com/ethereum-mining/ethminer/pull/1228). - Add `ispaused` information into response of `miner_getstathr` API query [#1232](/~https://github.com/ethereum-mining/ethminer/pull/1232). +- API responses return "ethminer-" as version prefix. [#1300](/~https://github.com/ethereum-mining/ethminer/pull/1300). ## 0.15.0rc1 diff --git a/docs/API_DOCUMENTATION.md b/docs/API_DOCUMENTATION.md index 6d278e9a0b..4d0ae0ee36 100644 --- a/docs/API_DOCUMENTATION.md +++ b/docs/API_DOCUMENTATION.md @@ -176,7 +176,7 @@ and expect back a response like this: "id": 1, "jsonrpc": "2.0", "result": [ - "0.16.0.dev0+commit.41639944", // The actual release of ethminer + "ethminer-0.16.0.dev0+commit.41639944", // Running ethminer's version "48", // Total running time in minutes "87221;54;0", // ETH hashrate in KH/s, submitted shares, rejected shares "14683;14508;14508;14508;14508;14508", // Detailed ETH hashrate in KH/s per GPU @@ -257,7 +257,7 @@ and expect back a response like this: true, false ], - "version": "0.16.0.dev0+commit.41639944" // Running ethminer's version + "version": "ethminer-0.16.0.dev0+commit.41639944" // Running ethminer's version } } ``` diff --git a/libapicore/ApiServer.cpp b/libapicore/ApiServer.cpp index d5b4118c53..82d2dd8f3b 100644 --- a/libapicore/ApiServer.cpp +++ b/libapicore/ApiServer.cpp @@ -625,7 +625,7 @@ Json::Value ApiConnection::getMinerStat1() Json::Value jRes; - jRes[0] = ethminer_get_buildinfo()->project_version; //miner version. + jRes[0] = std::string("ethminer-") + ethminer_get_buildinfo()->project_version; //miner version. jRes[1] = toString(runningTime.count()); // running time, in minutes. jRes[2] = totalMhEth.str(); // total ETH hashrate in MH/s, number of ETH shares, number of ETH rejected shares. jRes[3] = detailedMhEth.str(); // detailed ETH hashrate for all GPUs. @@ -657,7 +657,7 @@ Json::Value ApiConnection::getMinerStatHR() Json::Value ispaused; ostringstream poolAddresses; - version << ethminer_get_buildinfo()->project_version; + version << "ethminer-" << ethminer_get_buildinfo()->project_version; runtime << toString(runningTime.count()); poolAddresses << m_farm.get_pool_addresses(); @@ -681,8 +681,8 @@ Json::Value ApiConnection::getMinerStatHR() } Json::Value jRes; - jRes["version"] = version.str(); // miner version. - jRes["runtime"] = runtime.str(); // running time, in minutes. + jRes["version"] = version.str(); // miner version. + jRes["runtime"] = runtime.str(); // running time, in minutes. // total ETH hashrate in MH/s, number of ETH shares, number of ETH rejected shares. jRes["ethhashrate"] = (p.rate()); jRes["ethhashrates"] = detailedMhEth; diff --git a/libapicore/httpServer.cpp b/libapicore/httpServer.cpp index ec1854b028..e24c5ed1f3 100644 --- a/libapicore/httpServer.cpp +++ b/libapicore/httpServer.cpp @@ -18,7 +18,7 @@ httpServer http_server; void httpServer::tableHeader(stringstream& ss, unsigned columns) { - auto info = ethminer_get_buildinfo(); + auto version = std::string("ethminer-") + ethminer_get_buildinfo()->project_version; char hostName[HOST_NAME_MAX + 1]; gethostname(hostName, HOST_NAME_MAX + 1); string l = m_farm->farmLaunchedFormatted(); @@ -26,7 +26,7 @@ void httpServer::tableHeader(stringstream& ss, unsigned columns) "" << hostName << "" "" - ""; } diff --git a/libethcore/Miner.h b/libethcore/Miner.h index db96257ce4..2eeb7b8d9d 100644 --- a/libethcore/Miner.h +++ b/libethcore/Miner.h @@ -235,7 +235,7 @@ class Miner: public Worker void update_temperature(unsigned temperature) { /* - cnote << "Setting temp" << temperature << " for gpu/" << index << + cnote << "Setting temp" << temperature << " for gpu" << index << " tstop=" << farm.get_tstop() << " tstart=" << farm.get_tstart(); */ bool _wait_for_tstart_temp = m_wait_for_tstart_temp.load(std::memory_order_relaxed); @@ -244,14 +244,14 @@ class Miner: public Worker unsigned tstop = farm.get_tstop(); if (tstop && temperature >= tstop) { - cwarn << "Pause mining on gpu/" << index << " : temperature " << temperature << " is above --tstop " << tstop; + cwarn << "Pause mining on gpu" << index << " : temperature " << temperature << " is above --tstop " << tstop; m_wait_for_tstart_temp.store(true, std::memory_order_relaxed); } } else { unsigned tstart = farm.get_tstart(); if (tstart && temperature <= tstart) { - cnote << "(Re)starting mining on gpu/" << index << " : temperature " << temperature << " is now below --tstart " << tstart; + cnote << "(Re)starting mining on gpu" << index << " : temperature " << temperature << " is now below --tstart " << tstart; m_wait_for_tstart_temp.store(false, std::memory_order_relaxed); } }
" << info->project_version << + "
" << version << " on " << hostName << " - " << l << "