Skip to main content

Peer-to-Peer

The bitcore-p2p-redd module provides peer-to-peer networking capabilities for Reddcore, and includes Peer and Pool classes. A Message class is also exposed, in addition to several types of messages. Pool will maintain connection to several peers, Peers represents a node in the reddcoin network, and Message represents data sent to and from a Peer. For detailed technical information about the bitcoin protocol, please visit the Protocol Specification on the Bitcoin Wiki.

Installation

Peer-to-peer is implemented as a separate module.

For node projects:

npm install @reddcoinproject/bitcore-p2p-redd --save

Quick Start

var Peer = require('@reddcoinproject/bitcore-p2p-redd').Peer;
var peer = new Peer({host: '5.9.85.34'});

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

peer.connect();