Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Handle downloadedshard
Browse files Browse the repository at this point in the history
  • Loading branch information
aleitner committed Sep 21, 2016
1 parent bc38442 commit db5d5b0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions app/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion app/storjshare.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4 class="modal-title">Error</h4>
<div class="modal-body">
<p>Something has happened with drive [ {{error.drive}} ]!</p><br />
<p>{{error.message}}</p><br />
</p>If the problem persists check your logs for more info, and please open an issue with us at <a class="logo" href="#" onclick="require('shell').openExternal('https://github.com/Storj/storjshare-gui/issues');" >github</a>!!</p>
</p>If the problem persists check your logs for more info, and please open an issue with us at <a href="#" onclick="require('shell').openExternal('https://github.com/Storj/storjshare-gui/issues');" >github</a>!!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-blue" data-dismiss="modal">Close</button>
Expand Down

0 comments on commit db5d5b0

Please sign in to comment.