Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Device Label #12

Closed
wants to merge 5 commits into from
Closed

Add Device Label #12

wants to merge 5 commits into from

Conversation

ryan-rowland
Copy link

@ryan-rowland ryan-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

@ryan-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