A key/value store based on DHT.
- use custom keys differ from BEP 44
- support ttl
$ npm install dht-store
var Store = require('dht-store');
var store = new Store();
store.on('ready', function() {
store.kvPut('key', 'test', function(err, key, n) {
if (err) {
console.log('err:', err);
store.destroy();
return;
}
store.kvGet('key', function(err, n, v) {
console.log('value:', v);
store.destroy();
});
});
});
More examples can be found in the folder examples.
$ make init
$ make build
$ make test