# bitcore-p2p-pac

> Interface to the PAC P2P network for bitcore-pac

Latest version **1.2.0** (published 2018-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install bitcore-p2p-pac
pnpm add bitcore-p2p-pac
yarn add bitcore-p2p-pac
bun add bitcore-p2p-pac
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2018-03-14 |
| First published | 2018-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 577.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | BitPay |
| Maintainers | alejandromgk |
| Keywords | bitcoin, bitcore |

## Links

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

## Dependencies (4)

- [bloom-filter](https://npm.io/package/bloom-filter.md) ^0.2.0
- [node-buffers](https://npm.io/package/node-buffers.md) ^0.1.1
- [socks5-client](https://npm.io/package/socks5-client.md) ^0.3.6
- [bitcore-lib-pac](https://npm.io/package/bitcore-lib-pac.md) ^0.15.0

## Recent versions

- 1.2.0 (latest) — 2018-03-14
- 5.0.0-beta.2 — 2018-03-13

## README

Bitcore P2P PAC
=======

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

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

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

## Getting Started

```sh
npm install bitcore-p2p-pac
```
In order to connect to the $PAC 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-pac').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/PACCommunity/bitcore-p2p-pac/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/PACCommunity/bitcore-p2p-pac/blob/master/LICENSE).

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

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