# b2p2p

Latest version **0.0.8** (published 2021-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install b2p2p
pnpm add b2p2p
yarn add b2p2p
bun add b2p2p
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2021-02-22 |
| First published | 2019-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 573.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Maintainers | unwriter |
| Keywords | bitcoin, bitcore |

## Links

- npm: https://www.npmjs.com/package/b2p2p
- Repository: https://github.com/bitpay/bitcore-p2p
- Homepage: https://github.com/bitpay/bitcore-p2p#readme
- Issues: https://github.com/bitpay/bitcore-p2p/issues
- npm.io page: https://npm.io/package/b2p2p

## Dependencies (4)

- [buffers](https://npm.io/package/buffers.md) github:bitpay/node-buffers#v0.1.2-bitpay
- [bloom-filter](https://npm.io/package/bloom-filter.md) ^0.2.0
- [socks5-client](https://npm.io/package/socks5-client.md) ^0.3.6
- [bitcore-lib-cash](https://npm.io/package/bitcore-lib-cash.md) ^0.17.0

## Recent versions

- 0.0.8 (latest) — 2021-02-22
- 0.0.7 — 2020-01-21
- 0.0.6 — 2020-01-08
- 0.0.5 — 2020-01-08
- 0.0.4 — 2020-01-08
- 0.0.3 — 2020-01-06
- 0.0.2 — 2020-01-06
- 0.0.1 — 2019-09-03

## README

<img src="http://bitcore.io/css/images/bitcore-p2p.svg" alt="bitcore payment protocol" height="35" width="102">

Bitcore P2P
=======

[![NPM Package](https://img.shields.io/npm/v/bitcore-p2p.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-p2p)
[![Build Status](https://img.shields.io/travis/bitpay/bitcore-p2p.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore-p2p)
[![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-p2p.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-p2p?branch=master)

`bitcore-p2p` adds [Bitcoin protocol](https://en.bitcoin.it/wiki/Protocol_documentation) support for Bitcore.

See [the main bitcore repo](https://github.com/bitpay/bitcore) for more information.

## Getting Started

```sh
npm install bitcore-p2p
```
In 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.

```javascript
var Peer = require('bitcore-p2p').Peer;

var peer = new Peer({host: '127.0.0.1'});

peer.on('ready', function() {
  // peer info
  console.log(peer.version, peer.subversion, peer.bestHeight);
});
peer.on('disconnect', function() {
  console.log('connection closed');
});
peer.connect();
```

Then, you can get information from other peers by using:

```javascript
// handle events
peer.on('inv', function(message) {
  // message.inventory[]
});
peer.on('tx', function(message) {
  // message.transaction
});
```

Take a look at the [bitcore guide](http://bitcore.io/guide/peer.html) on the usage of the `Peer` class.

## Contributing

See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo for information about how to contribute.

## License

Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).

Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.

---
_Source: https://npm.io/package/b2p2p · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
