diff --git a/app/client.js b/app/client.js index c77b769..cba0f0f 100644 --- a/app/client.js +++ b/app/client.js @@ -315,6 +315,38 @@ var main = new Vue({ farmer.join(function(err) { self.transitioning = false; + farmer.dataChannelServer.on('shardUploaded', function(item, contact) { + console.log(JSON.parse(JSON.stringify(item))); + var message = new storj.deps.kad.Message( + { + method: 'TRIGGER', + params: { + behavior: 'ProveUploadReceipt', + contents: { + item: item.hash + // rmd160sha265: storj.utils.rmd160sha256(item, 'hex'), + // sha1whirlpool: storj.utils.sha1whirlpool(item, 'hex') + } + }, + contact: { + address: tab.network.hostname, + port: tab.network.port, + nodeID: farmer.contact.nodeID, + protocol: storj.version.protocol + }, + } + ); + + farmer.transport.send(contact, message, function(err, response) { + if (err) { + console.log(err.message); + logger.error(err.message); + } + + console.log(response); + }); + }); + if (self.userdata.appSettings.reportTelemetry) { self.startReportingTelemetry(tab); } diff --git a/app/storjshare.html b/app/storjshare.html index 28344b3..d44c451 100644 --- a/app/storjshare.html +++ b/app/storjshare.html @@ -22,7 +22,7 @@