GithubHelp home page GithubHelp logo

bigo2050 / dashcore-p2p Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dashpay/dashcore-p2p

0.0 1.0 0.0 746 KB

Interface to the dash P2P network for Bitcore-Dash

License: MIT License

JavaScript 100.00%

dashcore-p2p's Introduction

Dashcore P2P

NPM Package Build Status Coverage Status

dashcore-p2p adds Dash protocol support for Dashcore.

See the main dashcore repo for more information.

Getting Started

npm install @dashevo/dashcore-p2p

In order to connect to the Dash network, you'll need to know the IP address of at least one node of the network, or use Pool to discover peers using a DNS seed.

var Peer = require('@dashevo/dashcore-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:

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

Take a look at the bitcore guide on the usage of the Peer class.

Contributing

See CONTRIBUTING.md on the main dashcore repo for information about how to contribute.

License

Code released under the MIT license.

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

dashcore-p2p's People

Contributors

alex-werner avatar braydonf avatar elichai avatar eordano avatar fanatid avatar gasteve avatar kamuelafranco avatar klakurka avatar mappum avatar maraoz avatar martindale avatar pvrooyen avatar schinzelh avatar smh avatar snogcel avatar throughnothing avatar unusualbob avatar yemel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.