Skip to content

Add Device Label#12

Closed
liberty-rowland wants to merge 5 commits intonimiq:masterfrom
liberty-rowland:master
Closed

Add Device Label#12
liberty-rowland wants to merge 5 commits intonimiq:masterfrom
liberty-rowland:master

Conversation

@liberty-rowland
Copy link

@liberty-rowland liberty-rowland commented May 10, 2018

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

See:
nimiq/core-js#395
nimiq-network/developer-reference#23

@liberty-rowland
Copy link
Author

See #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments