Socket
Socket
Sign inDemoInstall

cc-metadata-handler

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-metadata-handler - npm Package Compare versions

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

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc