2.1.0 • Published 7 years ago
xonlinetracker-core v2.1.0
XOnlineTracker (Core)
This component is the core of XOnlineTracker which tracks the IP address and the key hash of clients.
Installation
To install this component, type following commands in the terminal:
npm install xonlinetracker-core
--save
API
Before using, you should import Tracker
class from the library.
var Tracker = require("xonlinetracker-core").Tracker;
The Tracker
class has following methods.
API | Description | Parameters |
---|---|---|
clear() | Clear saved data. | |
collect(timeout) | Collect expired data. | timeout (Integer): Expiry timeout. |
query(keyHash) | Query addresses mapped to specific key hash. | keyHash (String): The hash of the client key. |
renew(address, keyHash) | Renew an address-key hash pair. | address (String): The address of the client. keyHash (String): The hash of the client key. |