cc-metadata-handler
Advanced tools
Comparing version 0.3.4 to 0.4.0
36
index.js
@@ -25,4 +25,2 @@ var util = require('util') | ||
this.seedConcurrency = properties.seedConcurrency | ||
// Start the torrent Client | ||
@@ -200,36 +198,2 @@ this.client = new WebTorrent(properties.client) | ||
MetadataHandler.prototype.shareMetadataSequential = function (allInfoHashes, spv, cb) { | ||
if (typeof spv === 'function') { | ||
cb = spv | ||
spv = true | ||
} | ||
if (typeof spv === 'undefined') spv = true | ||
var self = this | ||
var cargoCount = 0 //how many times cargo executed all its tasks | ||
var seedConcurrency = self.seedConcurrency | ||
var cargo = async.cargo(function (infoHashes, callback) { | ||
var count = 0; | ||
for (var i = 0 ; i < infoHashes.length ; i++) { | ||
console.log('Start seeding : ' + infoHashes[i] + ', # ' + (cargoCount * seedConcurrency + i)) | ||
self.shareMetadata(infoHashes[i], spv, function(err) { | ||
count++ | ||
if (count == infoHashes.length) { | ||
cargoCount++ | ||
if (cargoCount != Math.ceil(allInfoHashes.length / seedConcurrency)) { | ||
return callback(err) | ||
} | ||
return cb(err) //callback of the entire function shareMetadataSequential | ||
} | ||
}) | ||
} | ||
}, seedConcurrency) | ||
allInfoHashes.forEach(function (infoHash) { | ||
cargo.push(infoHash, function(err) { | ||
if (err) return console.error("Error in shareMetadata()! err = ", err) | ||
}) | ||
}) | ||
} | ||
module.exports = MetadataHandler |
{ | ||
"name": "cc-metadata-handler", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "Colored Coins metadata handler", | ||
@@ -11,3 +11,3 @@ "main": "app.js", | ||
"cli-table": "^0.3.1", | ||
"create-torrent": "3.10.0", | ||
"create-torrent": "3.21.0", | ||
"crypto-hashing": "^0.3.1", | ||
@@ -14,0 +14,0 @@ "folder-capper": "^0.2.1", |
@@ -6,8 +6,8 @@ var MetadataHandler = require('../index.js') | ||
client: { | ||
torrentPort: 49507, | ||
dhtPort: 12679, | ||
// torrentPort: 49507, | ||
// dhtPort: 12679, | ||
// Enable DHT (default=true), or options object for DHT | ||
// dht: true, | ||
dht: true, | ||
// Max number of peers to connect to per torrent (default=100) | ||
maxPeers: 100, | ||
// maxPeers: 100, | ||
// DHT protocol node ID (default=randomly generated) | ||
@@ -24,3 +24,3 @@ // nodeId: String|Buffer, | ||
// List of additional trackers to use (added to list in .torrent or magnet uri) | ||
announce: [['udp://tracker.openbittorrent.com:80', 'udp://open.demonii.com:1337', 'udp://tracker.coppersurfer.tk:6969', 'udp://tracker.leechers-paradise.org:6969']], | ||
// announce: [['udp://tracker.openbittorrent.com:80', 'udp://open.demonii.com:1337', 'udp://tracker.coppersurfer.tk:6969', 'udp://tracker.leechers-paradise.org:6969']], | ||
// List of web seed urls (see [bep19](http://www.bittorrent.org/beps/bep_0019.html)) | ||
@@ -27,0 +27,0 @@ // urlList: [] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19706
270
+ Addedblock-stream2@1.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcreate-torrent@3.21.0(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addedfilestream@4.1.3(transitive)
+ Addedis-file@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjunk@1.0.3(transitive)
+ Addedmultistream@2.1.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedblock-stream@0.0.7(transitive)
- Removedcreate-torrent@3.10.0(transitive)
- Removedextend.js@0.0.2(transitive)
- Removedfilestream@3.0.2(transitive)
- Removedmultistream@1.6.1(transitive)
Updatedcreate-torrent@3.21.0