test new rpc apis

pull/1/head
ansuz 8 years ago
parent 2a566671f2
commit 166e70f628

@ -36,11 +36,6 @@ define([
console.log(msg);
});
}
call.getFileListSize(list, function (e, bytes) {
if (e) { return void console.error(e); }
console.log("%s total bytes used", bytes);
});
call.getServerHash(function (e, hash) {
if (e) { return void console.error(e); }
console.log("the server believes your user hash is [%s]", hash);
@ -51,6 +46,11 @@ define([
var localHash = call.localChannelsHash();
var serverHash;
call.getFileListSize(function (e, bytes) {
if (e) { return void console.error(e); }
console.log("%s total bytes used", bytes);
});
call.getServerHash(function (e, hash) {
if (e) { return void console.error(e); }
serverHash = hash;
@ -64,10 +64,21 @@ define([
var list = call.uniqueChannelList();
var left = list.length;
// now start pinning...
list.forEach(function (channel) {
call.pin(channel, function (e, out) {
if (e) { return console.error(e); }
call.pin(channel, function (e, hash) {
left--;
if (!e) {
console.log('pinned channel [%s]. new hash is [%s]', channel, hash);
} else {
console.error(e);
}
if (left === 0) {
console.log('done pinning');
}
});
});
});

Loading…
Cancel
Save