{"id":21035226,"url":"https://github.com/colored-coins/metadata-handler","last_synced_at":"2025-10-04T11:41:23.679Z","repository":{"id":33742481,"uuid":"37397197","full_name":"Colored-Coins/Metadata-Handler","owner":"Colored-Coins","description":"Colored Coins metadata handler using torrents and DHT to share unlimited amount of extra data for any Colored Coins transaction","archived":false,"fork":false,"pushed_at":"2017-09-27T23:09:05.000Z","size":79,"stargazers_count":4,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-01T15:25:50.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Colored-Coins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-14T03:15:10.000Z","updated_at":"2019-01-13T14:01:54.000Z","dependencies_parsed_at":"2022-09-07T20:50:15.151Z","dependency_job_id":null,"html_url":"https://github.com/Colored-Coins/Metadata-Handler","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Colored-Coins/Metadata-Handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2FMetadata-Handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2FMetadata-Handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2FMetadata-Handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2FMetadata-Handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Colored-Coins","download_url":"https://codeload.github.com/Colored-Coins/Metadata-Handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2FMetadata-Handler/sbom","scorecard":{"id":32396,"data":{"date":"2025-08-11","repo":{"name":"github.com/Colored-Coins/Metadata-Handler","commit":"ebd61384a0455db3c145514608ff743f222af28b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T19:26:56.105Z","repository_id":33742481,"created_at":"2025-08-14T19:26:56.105Z","updated_at":"2025-08-14T19:26:56.105Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278308047,"owners_count":25965652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T13:14:05.233Z","updated_at":"2025-10-04T11:41:23.660Z","avatar_url":"https://github.com/Colored-Coins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Colored Coins Metadata Handler\n[![Build Status](https://travis-ci.org/Colored-Coins/Metadata-Handler.svg?branch=master)](https://travis-ci.org/Colored-Coins/Metadata-Handler) [![Coverage Status](https://coveralls.io/repos/Colored-Coins/Metadata-Handler/badge.svg?branch=master)](https://coveralls.io/r/Colored-Coins/Metadata-Handler?branch=master) [![npm version](https://badge.fury.io/js/cc-metadata-handler.svg)](http://badge.fury.io/js/cc-metadata-handler) [![npm version](http://slack.coloredcoins.org/badge.svg)](http://slack.coloredcoins.org)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n### Installation\n\n```sh\n$ npm i cc-metadata-handler\n```\n\n\n### Initialize\n\n```js\nvar MetadataHandler = require('cc-metadata-handler')\n\nvar properties = {\n  tracker: {               // Tracker settings\n    udp: Boolean,           // Using udp for torrent trafic or not\n    http: Boolean,          // Using http for torrent trafic or not\n    ws: Boolean,            // Using websockets for torrent trafic or not\n    hostname: String,       // Our machince host name\n    port: Number            // Port to listen as tracker\n  }\n  client: {\n    torrentPort: Number,\n    dhtPort: Number,\n  // Enable DHT (default=true), or options object for DHT\n    // dht: true,\n  // Max number of peers to connect to per torrent (default=100)\n    maxPeers: Number,\n  // DHT protocol node ID (default=randomly generated)\n    // nodeId: String|Buffer,\n  // Wire protocol peer ID (default=randomly generated)\n    // peerId: '01234567890123456789',\n  // RTCPeerConnection configuration object (default=STUN only)\n    // rtcConfig: Object,,\n  // custom storage engine, or `false` to use in-memory engine\n    // storage: Function,\n  // custom webrtc implementation (in node, specify the [wrtc](https://www.npmjs.com/package/wrtc) package)\n    // wrtc: {},\n  // List of additional trackers to use (added to list in .torrent or magnet uri)\n    // announce: [],\n  // List of web seed urls (see [bep19](http://www.bittorrent.org/beps/bep_0019.html))\n    // urlList: []\n  // Whether or not to enable trackers (default=true)\n    tracker: false\n  },\n  folders: { // Folder structure settings\n    torrents: '/torrents',  // Path to save torrent files to, if left empty, all the torrent references will be saved in memory and will be lost on restart\n    data: '/data',          // Main path to where all the data is stored\n    capSize: '80%',          // Number of MB or percent in the form of 12%\n    retryTime: 10000,\n    autoWatchInterval: 60000,\n    ignores: []\n  }\n}\n\nvar handler = new MetadataHandler(settings)\n```\n\n### Fetch Metadata\n\nParams:\n  - torrentHash - The torrent infoHash of the metadata.\n  - metadataSHA2 - The sha256 of the metadata json.\n\n```js\n\nvar torrentHash = '5add2b0ce8f7da372c856d4efe6b9b6e8584919e'\nvar metadataSHA2 = '6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4'\n\nhandler.getMetadata(torrentHash, metadataSHA2, function (err, metadata) {\n  if (err) return console.error(err)\n  console.log(metadata) // Will print the json file of the metadata\n})\n\n```\n\nYou can also use this method together with an event listner like this:\n\n```js\n\n// You can listen for the channel of the torrentHash to get the metadata\nhandler.on('downloads/'+torrentHash, function (metadata) {\n  console.log(metadata) // Will print the the metadata parsed to json\n})\n\n// Starting the proccess of getting the metadata from the torrent network.\nhandler.getMetadata(torrentHash, metadataSHA2, importent)\n\n```\n\n### Add new Metadata\n\nParams:\n  - metadata - A new metadata json we just created and we plan on sharing with other people.\n\n```js\n\n// Creates the torrent file and sha2 for the metadata.\n// Saves the metadata as a local torrentHash.dat file.\n// Saves the torrent file called torrentHash.torrent for future use.\n// Returns the torrentHash and sha2 created.\nhandler.addMetadata(metadata, function (err, hashes) {\n  if (err) return console.error(err)\n  console.log(hashes.torrentHash) // Will print BitTorrent hashing scheme using sha1 as the hashing algorithem\n  console.log(hashes.sha2) // Will print the sha256 of the raw metadata file\n})\n\n```\n\n### Share Metadata\n\nParams:\n  - torrentHash - The torrent info hash of the metadata we want to share with other people\n\n```js\n\n// You can listen for the channel of the torrentHash to get the metadata\nhandler.on('uploads/'+torrentHash, function (peer) {\n  console.log(peer) // Will print information about the latest peer that is trying to download the metadata from your client\n})\n\nhandler.shareMetadata(torrentHash, function (err) {\n  if (err) console.log(err) // Returns error if there is problem with sharing the file\n})\n\n```\n\n### Remove Metadata\n\nRemove torrent from BitTorrent client. Destroy all torrent connections to peers, delete all saved data.\n\nParams:\n  - torrentHash - The torrent info hash of the metadata we want to remove \n\n```js\n\nhandler.removeMetadata(torrentHash, function (err) {\n  if (err) throw err\n  console.log('successfully deleted torrent')\n})\n\n```\n\n### Other Events\n\n```js\n\n// Receives the latest metadata we finished downloading\nhandler.on('downloads', function (metadata) {\n  console.log(metadata) // Will print the the metadata parsed to json\n})\n\n// Receives the latest peer that is trying to get a file from our client and the file it's trying to get\nhandler.on('uploads', function (peer) {\n  console.log(peer.info) // Will print info about the peer\n  console.log(peer.file) // Will print info about the file\n})\n\n// If any error occurs\nhandler.on('error', function (err) {\n  console.error(err)\n})\n\n```\n\n### Testing\n\n```sh\n$ cd /\"module-path\"/cc-metadata-handler\n$ mocha\n```\n\n\nLicense\n----\n\n[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolored-coins%2Fmetadata-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolored-coins%2Fmetadata-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolored-coins%2Fmetadata-handler/lists"}