Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/getbitpocket/bitcore-p2p-cordova
Interface to the bitcoin P2P network for Cordova/Phonegap apps
https://github.com/getbitpocket/bitcore-p2p-cordova
bitcoin bitcoin-p2p-network cordova
Last synced: 27 days ago
JSON representation
Interface to the bitcoin P2P network for Cordova/Phonegap apps
- Host: GitHub
- URL: https://github.com/getbitpocket/bitcore-p2p-cordova
- Owner: getbitpocket
- License: apache-2.0
- Created: 2015-12-01T10:52:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-27T13:37:00.000Z (almost 9 years ago)
- Last Synced: 2024-11-12T23:00:30.403Z (30 days ago)
- Topics: bitcoin, bitcoin-p2p-network, cordova
- Language: JavaScript
- Size: 409 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cryptocoinjs - bitcoin
README
[![Build Status](https://travis-ci.org/getbitpocket/bitcore-p2p-cordova.svg?branch=master)](https://travis-ci.org/getbitpocket/bitcore-p2p-cordova)
## Interface to the bitcoin P2P network for Cordova/Phonegap apps
## Getting Started
- Add the Plugin to your Cordova project: `cordova plugin add https://github.com/getbitpocket/bitcore-p2p-cordova`
- Inside the `index.html` of your Cordova project add the script: `` (A better solution might be found in the future, which makes this obsolete, however for now it is problematic to automatically add browserified js files)### Example: Connecting to a Peer
```javascript
var peer = new bitcore.p2p.Peer({host:'bitcoin-peer-ip'});peer.on('ready',function(message) {
console.log("version: " + peer.version + ", best height: " + peer.bestHeight);
});peer.on('inv',function(message) {
console.log("received inv message");
});peer.connect();
```### Example: Connecting a Pool
```javascript
var pool = new bitcore.p2p.Pool({
network : 'testnet'
});pool.on('peerready', function(peer) {
console.log("Peer ready " + peer.host + ":" + peer.port);
});pool.connect();
```## Build
```sh
npm install
gulp build
```## Running Unit Tests
```sh
npm install
gulp test
```
## Running Cordova Tests- Add tests as plugin `cordova plugin add https://github.com/getbitpocket/bitcore-p2p-cordova.git#:/integration`
- Follow the [Cordova Plugins Tests](https://github.com/apache/cordova-plugin-test-framework#running-plugin-tests) guide
- Run the tests by launching app `cordova emulate`