{"id":13772777,"url":"https://github.com/bitpay/bitcore-p2p","last_synced_at":"2025-04-13T00:46:50.533Z","repository":{"id":25174250,"uuid":"28597370","full_name":"bitpay/bitcore-p2p","owner":"bitpay","description":"Interface to the bitcoin P2P network for bitcore","archived":false,"fork":false,"pushed_at":"2023-03-08T08:16:37.000Z","size":1301,"stargazers_count":81,"open_issues_count":48,"forks_count":275,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T00:46:42.736Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitpay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-12-29T15:58:23.000Z","updated_at":"2024-09-26T21:42:33.000Z","dependencies_parsed_at":"2024-01-15T03:41:31.182Z","dependency_job_id":null,"html_url":"https://github.com/bitpay/bitcore-p2p","commit_stats":{"total_commits":243,"total_committers":20,"mean_commits":12.15,"dds":0.5843621399176955,"last_synced_commit":"10a21524d875efd8d28d4207011f391d778609d6"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-p2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-p2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-p2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-p2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitpay","download_url":"https://codeload.github.com/bitpay/bitcore-p2p/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"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","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-08-03T17:01:07.723Z","updated_at":"2025-04-13T00:46:50.514Z","avatar_url":"https://github.com/bitpay.png","language":"JavaScript","funding_links":[],"categories":["List of content"],"sub_categories":["P2P"],"readme":"\u003cimg src=\"http://bitcore.io/css/images/bitcore-p2p.svg\" alt=\"bitcore payment protocol\" height=\"35\" width=\"102\"\u003e\n\nBitcore P2P\n=======\n\n[![NPM Package](https://img.shields.io/npm/v/bitcore-p2p.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-p2p)\n[![Build Status](https://img.shields.io/travis/bitpay/bitcore-p2p.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/bitpay/bitcore-p2p)\n[![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-p2p.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-p2p?branch=master)\n\n`bitcore-p2p` adds [Bitcoin protocol](https://en.bitcoin.it/wiki/Protocol_documentation) support for Bitcore.\n\nSee [the main bitcore repo](https://github.com/bitpay/bitcore) for more information.\n\n## Getting Started\n\n```sh\nnpm install bitcore-p2p\n```\nIn order to connect to the Bitcoin network, you'll need to know the IP address of at least one node of the network, or use [Pool](/docs/pool.md) to discover peers using a DNS seed.\n\n```javascript\nvar Peer = require('bitcore-p2p').Peer;\n\nvar peer = new Peer({host: '127.0.0.1'});\n\npeer.on('ready', function() {\n  // peer info\n  console.log(peer.version, peer.subversion, peer.bestHeight);\n});\npeer.on('disconnect', function() {\n  console.log('connection closed');\n});\npeer.connect();\n```\n\nThen, you can get information from other peers by using:\n\n```javascript\n// handle events\npeer.on('inv', function(message) {\n  // message.inventory[]\n});\npeer.on('tx', function(message) {\n  // message.transaction\n});\n```\n\nTake a look at the [bitcore guide](http://bitcore.io/guide/peer.html) on the usage of the `Peer` class.\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo for information about how to contribute.\n\n## License\n\nCode released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).\n\nCopyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-p2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitpay%2Fbitcore-p2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-p2p/lists"}