Expect optional deviceLabel field in REGISTER message, saving it to a new table called device, indexed by id. This can be used like:
CREATE PROCEDURE getUserDevices(IN address VARCHAR(28), IN seconds INT)
BEGIN
SELECT device.label as label, COUNT(DISTINCT share.device) as deviceCount, SUM(share.difficulty) * 65536 / seconds as hashRate
FROM share, device, user
WHERE user.address = address
AND share.user = user.id
AND device.id = share.device
AND share.datetime > (UNIX_TIMESTAMP(now()) - seconds) * 1000
GROUP BY device.label;
END
Expect optional
deviceLabel
field inREGISTER
message, saving it to a new table calleddevice
, indexed byid
. This can be used like:See: https://github.com/nimiq-network/core/pull/395 https://github.com/nimiq-network/developer-reference/pull/23