Giter Site home page Giter Site logo

webcoin's Introduction

Webcoin

A Bitcoin client for Node.js and the browser

Build Status Dependency Status npm version


Webcoin is a Bitcoin client that works in Node.js and the browser. In the browser, it uses WebRTC to make P2P connections rather than relying on a centralized server to get data (like all the other JS Bitcoin libraries). It's kind of like the Bitcoin equivalent of WebTorrent.

You can use Webcoin to add Bitcoin payments to your application, without the need to hold your users' funds, and without making them trust any third-parties with their money. Webcoin is an SPV light client, so it only uses a minimal amount of bandwidth and storage; it even works great on mobile devices!

Status

Much of Webcoin is already written and works well, including:

  • Downloading block headers from peers
  • Verifying block headers
  • Creating HD wallets
  • Filtering transactions with Bloom filters
  • Detecting incoming transactions confirmed in blocks

I am currently making some major refactors to the codebase, and documenting all of it. Much of the code in this repo is being broken out into smaller modules, each with comprehensive tests and docs.

Modules

Webcoin is made up of many small modules, most of which can each be used independently.

module version tests issues description
webcoin SPV Bitcoin client for Node and the browser (this module)
peer-exchange Decentralized p2p signalling and discovery
blockchain-spv Stores blockchain headers and verifies with SPV
blockchain-download Download blockchain data from peers
bitcoin-wallet Sends and receives coins
bitcoin-protocol Bitcoin network protocol streams
bitcoin-inventory Exchange transactions with peers
bitcoin-util Utility functions for Bitcoin hashes and targets
bitcoin-merkle-proof Verify bitcoin Merkle proofs
bitcoin-filter Bloom filtering (BIP37)
webcoin-bridge A proxy that bridges the Bitcoin TCP and WebRTC networks
webcoin-params Abstract parameters, used for supporting other cryptocurrencies
webcoin-param-tests Tests for parameters
electron-webrtc WebRTC for Node via a hidden Electron process

Parameters

Webcoin was built from the ground-up with multiple cryptocurrencies in mind. The following modules are parameters which can be plugged in to Webcoin in order to support other currency networks.

network module version tests
Bitcoin webcoin-bitcoin
Bitcoin Testnet webcoin-bitcoin-testnet
Litecoin webcoin-litecoin (UNFINISHED)
Zcash Alpha webcoin-zcash-alpha (UNFINISHED)

License (MIT)

Copyright 2015 Matt Bell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

webcoin's People

Contributors

fanatid avatar langri-sha avatar mappum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webcoin's Issues

Default web seed doesn't work

I'm not able to make a connection to 104.236.185.38:8192 from my computer.

paul ~/repos/webcoin master $ node bin/bridge.js
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 104.236.185.38:8192
    at Object.exports._errnoException (util.js:856:11)
    at exports._exceptionWithHostPort (util.js:879:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1062:14)

Question: how will lightning network factor in?

Now that lightning network is inevitable (at least on litecoin) how would this facilitate or otherwise affect webcoin (if at all) ?

I am still pretty new to this field, so forgive me if this seems entirely irrelevant.

PS i cant believe this webcoin concept hasnt gotten more attention, this could be gamechanging

Retrieving past transactions using webcoin?

I'm interested in retrieving past transactions for a particular address using webcoin. As far as I know, the Bitcoin protocol doesn't provide a way to ask for all the transactions for an address, but if you have a list of blocks that may contain transactions for the address, then as long as your Bloom filter is set, you should be able to request those blocks and receive the relevant transactions.

Is this something that can currently be done with webcoin? If not, could I try to add this feature?

Using Bloom filter to verify balance

Hello,

I would like to use webcoin and more particularly the Bloom filter. I am having a hard time to understand how it works. So simple use case : I would like to verify how much there is on a address. How can I do this, do I still need to sync all the headers ?

Thanks,

Lots of build warnings

This might not be super high priority: my build succeeds and I believe that my installation works when I install wrtc, but there are a lot of warnings caused by optional dependencies, which makes it hard to see if there are important problems. I'm running node 5.5 on OSX 10.10.

paul ~/repos/webcoin master $ npm i
loadDep:socks5-client → 3 ▀ ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
loadDevDep:tape → network ▀ ╢████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"iojs":"^1","node":"^0.10","npm":"^2"} (current: {"node":"5.5.0","npm":"3npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN prefer global [email protected] should be installed with -g
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /Users/paul/repos/webcoin/node_modules/bufferutil
> node-gyp rebuild

  array-index setting "length": 0 +0ms
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../node_modules/nan/nan.h:661:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:672:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion
      from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument
      ('const char *') would lose const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2
      arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5
      arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:676:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to
      'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not
      viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' for 1st
      argument
class Local {
      ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not
      viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&' for 1st argument
class Local {
      ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local'
      against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against
      'v8::MaybeLocal<v8::Object>'
  V8_INLINE Local(S* that)
            ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:683:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
In file included from ../src/bufferutil.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:414:12: note: in instantiation of function template specialization
      'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:424:12: note: in instantiation of function template specialization
      'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1514:12: note: in instantiation of function template specialization
      'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type
      'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1632:12: note: in instantiation of function template specialization
      'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
9 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/bufferutil
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install /Users/paul/repos/webcoin/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/paul/repos/webcoin/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" is installed via remote

> [email protected] install /Users/paul/repos/webcoin/node_modules/utf-8-validate
> node-gyp rebuild

  array-index setting "length": 0 +0ms
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../node_modules/nan/nan.h:661:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:672:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion
      from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument
      ('const char *') would lose const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2
      arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/paul/.node-gyp/5.5.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5
      arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:676:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to
      'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not
      viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' for 1st
      argument
class Local {
      ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not
      viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&' for 1st argument
class Local {
      ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local'
      against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against
      'v8::MaybeLocal<v8::Object>'
  V8_INLINE Local(S* that)
            ^
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:683:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
In file included from ../src/validation.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:414:12: note: in instantiation of function template specialization
      'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:424:12: note: in instantiation of function template specialization
      'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible
      type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1514:12: note: in instantiation of function template specialization
      'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type
      'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/paul/.node-gyp/5.5.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1632:12: note: in instantiation of function template specialization
      'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
9 errors generated.
make: *** [Release/obj.target/validation/src/validation.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/utf-8-validate
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc
> node-pre-gyp install --fallback-to-build

gyp: /Users/paul/.node-gyp/5.5.0/common.gypi not found (cwd: /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64/wrtc.node" "--module_name=wrtc" "--module_path=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64"
gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/5.5.0/bin/node /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64/wrtc.node --module_name=wrtc --module_path=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/node_modules/node-pre-gyp/lib/util/compile.js:73:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 14.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc
node-pre-gyp ERR! node -v v5.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/5.5.0/bin/node /Users/paul/repos/webcoin/node_modules/peerhub/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64/wrtc.node --module_name=wrtc --module_path=/Users/paul/repos/webcoin/node_modules/peerhub/node_modules/wrtc/build/wrtc/v0.0.55/Release/node-v47-darwin-x64' (1)
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] Exit status 1

> [email protected] install /Users/paul/repos/webcoin/node_modules/buffertools
> node-gyp rebuild

  array-index setting "length": 0 +0ms
  CXX(target) Release/obj.target/buffertools/buffertools.o
  SOLINK_MODULE(target) Release/buffertools.node

> [email protected] install /Users/paul/repos/webcoin/node_modules/leveldown
> prebuild --install


> [email protected] install /Users/paul/repos/webcoin/node_modules/wrtc
> node-pre-gyp install --fallback-to-build

gyp: /Users/paul/.node-gyp/5.5.0/common.gypi not found (cwd: /Users/paul/repos/webcoin/node_modules/wrtc) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/paul/repos/webcoin/node_modules/wrtc/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/Users/paul/repos/webcoin/node_modules/wrtc/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64/wrtc.node" "--module_name=wrtc" "--module_path=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64"
gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/wrtc
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/5.5.0/bin/node /Users/paul/repos/webcoin/node_modules/wrtc/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64/wrtc.node --module_name=wrtc --module_path=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/paul/repos/webcoin/node_modules/wrtc/node_modules/node-pre-gyp/lib/util/compile.js:73:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 14.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/5.5.0/bin/node" "/Users/paul/repos/webcoin/node_modules/wrtc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/paul/repos/webcoin/node_modules/wrtc
node-pre-gyp ERR! node -v v5.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/5.5.0/bin/node /Users/paul/repos/webcoin/node_modules/wrtc/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64/wrtc.node --module_name=wrtc --module_path=/Users/paul/repos/webcoin/node_modules/wrtc/build/wrtc/v0.0.58/Release/node-v47-darwin-x64' (1)
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] Exit status 1

> [email protected] postinstall /Users/paul/repos/webcoin/node_modules/spawn-sync
> node postinstall


> [email protected] prepublish /Users/paul/repos/webcoin
> semantic-release pre

[email protected] /Users/paul/repos/webcoin
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ └─┬ [email protected]
│   │ │   ├── [email protected]
│   │ │   ├── [email protected]
│   │ │   ├── [email protected]
│   │ │   ├── [email protected]
│   │ │   └── [email protected]
│   │ └── [email protected]
│   └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ ├─┬ [email protected]
│   │ │ │ │ ├─┬ [email protected]
│   │ │ │ │ │ └── [email protected]
│   │ │ │ │ └─┬ [email protected]
│   │ │ │ │   ├── [email protected]
│   │ │ │ │   └── [email protected]
│   │ │ │ └── [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └─┬ [email protected]
│   │ │   └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └─┬ [email protected]
│   │   ├─┬ [email protected]
│   │   │ └── [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ └─┬ [email protected]
│   │   ├── [email protected]
│   │   ├─┬ [email protected]
│   │   │ └── [email protected]
│   │   ├─┬ [email protected]
│   │   │ ├── [email protected]
│   │   │ └── [email protected]
│   │   └── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ └── [email protected]
│   │ └── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └─┬ [email protected]
│ │     └─┬ [email protected]
│ │       └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   ├─┬ [email protected]
│ │ │ │ │   │ ├─┬ [email protected]
│ │ │ │ │   │ │ ├─┬ [email protected]
│ │ │ │ │   │ │ │ └── [email protected]
│ │ │ │ │   │ │ └── [email protected]
│ │ │ │ │   │ ├── [email protected]
│ │ │ │ │   │ └── [email protected]
│ │ │ │ │   ├─┬ [email protected]
│ │ │ │ │   │ └─┬ [email protected]
│ │ │ │ │   │   └── [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ ├── [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ └─┬ [email protected]
│ │ │ │   │   ├── [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ ├── [email protected]
│ │ │ │   │   │ └─┬ [email protected]
│ │ │ │   │   │   └── [email protected]
│ │ │ │   │   ├── [email protected]
│ │ │ │   │   └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ │ └── [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ └── [email protected]
│ │ │ │   │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ └── [email protected]
│ │ │ │   │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ │ └── [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ └── [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ ├── [email protected]
│ │ │ │   │ │ ├── [email protected]
│ │ │ │   │ │ ├── [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ ├── [email protected]
│ │ │ │   │ │ ├─┬ [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ ├── [email protected]
│ │ │ │   │ │ │ └── [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └─┬ [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ └── [email protected]
│ │ │ │   │   ├── [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ └─┬ [email protected]
│ │ │ │   │   │   ├── [email protected]
│ │ │ │   │   │   └── [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ └── [email protected]
│ │ │ │   │   └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     ├─┬ [email protected]
│ │ │ │     │ └─┬ [email protected]
│ │ │ │     │   └─┬ [email protected]
│ │ │ │     │     ├── [email protected]
│ │ │ │     │     └── [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     ├─┬ [email protected]
│ │ │ │     │ ├── [email protected]
│ │ │ │     │ ├── [email protected]
│ │ │ │     │ ├── [email protected]
│ │ │ │     │ └── [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ ├─┬ [email protected]
│ │ │   │ │ └── [email protected]
│ │ │   │ └─┬ [email protected]
│ │ │   │   ├─┬ [email protected]
│ │ │   │   │ └── [email protected]
│ │ │   │   └─┬ [email protected]
│ │ │   │     └── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ ├─┬ [email protected]
│ │ │   │ │ └── [email protected]
│ │ │   │ └─┬ [email protected]
│ │ │   │   ├─┬ [email protected]
│ │ │   │   │ ├─┬ [email protected]
│ │ │   │   │ │ └─┬ [email protected]
│ │ │   │   │ │   └── [email protected]
│ │ │   │   │ └─┬ [email protected]
│ │ │   │   │   └── [email protected]
│ │ │   │   ├── [email protected]
│ │ │   │   └── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └─┬ [email protected]
│ │ │   │   └── [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ └─┬ [email protected]
│ │   │   └── [email protected]
│ │   └─┬ [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └── [email protected]
│   │ │ └── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ └── [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ └─┬ [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   └── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   └─┬ [email protected]
  │     ├── [email protected]
  │     └── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ └─┬ [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   └── [email protected]
  └── [email protected]

Uncaught TypeError: Cannot read property 'message' of null

I got this error on the following line of code, lib/node.js line 160 or so, presumably because err is null. I saw this while running a browserified version of bin/wallet.js.

if (err !== true && !(err.message === 'Database is not open' && self.closing)) {

I'm happy to send a PR to fix this, but I'm a little confused by the way the err variable is working. What does err = true mean here? It sort of seems like err = true isn't actually an error.

Test failure: connection reset

I've only seen this once, so it's definitely a nondeterministic failure.

paul ~/repos/webcoin master $ npm test

> [email protected] test /Users/paul/repos/webcoin
> npm run standard && ./node_modules/.bin/tape test/*.js


> [email protected] standard /Users/paul/repos/webcoin
> standard lib/*.js test/*.js bin/*.js index.js

TAP version 13
# open blockstore
# opening on a path that is already locked
ok 1 LevelUP
ok 2 (unnamed assert)
# closing
# blockstore put
# simple put
# put existing block
# put invalid blocks
ok 3 (unnamed assert)
ok 4 (unnamed assert)
ok 5 (unnamed assert)
# put after close
ok 6 undefined
ok 7 (unnamed assert)
# blockstore get
ok 8 null
# get using `header.hash`
ok 9 null
ok 10 should be equal
ok 11 should be equal
ok 12 should be equivalent
# get using buffer hash
ok 13 null
ok 14 should be equal
ok 15 should be equal
ok 16 should be equivalent
# get an invalid hash
ok 17 (unnamed assert)
ok 18 should be equal
ok 19 (unnamed assert)
# get a valid, nonexistent hash
ok 20 (unnamed assert)
ok 21 should be equal
ok 22 (unnamed assert)
# closing
# creating blockchain instances
# create blockchain with instantiated BlockStore
ok 23 should not throw
ok 24 undefined
# create blockchain with path instead of BlockStore
ok 25 should not throw
ok 26 undefined
# blockchain paths
# headers add to blockchain
# simple path with no fork
ok 27 (unnamed assert)
ok 28 (unnamed assert)
ok 29 (unnamed assert)
ok 30 (unnamed assert)
ok 31 should be equal
ok 32 should be equal
ok 33 should be equal
ok 34 should be equal
ok 35 should be equal
ok 36 should be equal
# backwards path with no fork
ok 37 (unnamed assert)
ok 38 (unnamed assert)
ok 39 (unnamed assert)
ok 40 (unnamed assert)
ok 41 should be equal
ok 42 should be equal
ok 43 should be equal
ok 44 should be equal
ok 45 should be equal
ok 46 should be equal
# fork headers add to blockchain
# path with fork
ok 47 (unnamed assert)
ok 48 (unnamed assert)
ok 49 (unnamed assert)
ok 50 should be equal
ok 51 should be equal
ok 52 should be equal
ok 53 should be equal
ok 54 should be equal
ok 55 should be equal
ok 56 should be equal
ok 57 should be equal
ok 58 should be equal
ok 59 should be equal
ok 60 should be equal
# backwards path with fork
ok 61 (unnamed assert)
ok 62 (unnamed assert)
ok 63 (unnamed assert)
ok 64 should be equal
ok 65 should be equal
ok 66 should be equal
ok 67 should be equal
ok 68 should be equal
ok 69 should be equal
ok 70 should be equal
ok 71 should be equal
ok 72 should be equal
ok 73 should be equal
ok 74 should be equal
# deleting blockstore
ok 75 undefined
# blockchain verification
# headers add to blockchain
# error on header that doesn't connect
ok 76 (unnamed assert)
ok 77 should be equal
# error on nonconsecutive headers
ok 78 (unnamed assert)
ok 79 should be equal
# error on header with unexpected difficulty change
ok 80 (unnamed assert)
ok 81 should be equal
# error on header with invalid proof of work
ok 82 (unnamed assert)
ok 83 should be equal
# error on header with invalid difficulty change
ok 84 (unnamed assert)
ok 85 should be equal
# accept valid difficulty change
# teardown
ok 86 undefined
# blockchain queries
# setup
# get block at height
ok 87 (unnamed assert)
ok 88 (unnamed assert)
ok 89 should be equal
ok 90 (unnamed assert)
ok 91 (unnamed assert)
ok 92 should be equal
ok 93 null
ok 94 (unnamed assert)
ok 95 should be equal
ok 96 should be equal
ok 97 null
ok 98 (unnamed assert)
ok 99 should be equal
ok 100 should be equal
# get block at time
ok 101 null
ok 102 (unnamed assert)
ok 103 should be equal
ok 104 should be equal
ok 105 null
ok 106 (unnamed assert)
ok 107 should be equal
ok 108 should be equal
ok 109 null
ok 110 (unnamed assert)
ok 111 should be equal
ok 112 should be equal
ok 113 null
ok 114 (unnamed assert)
ok 115 should be equal
ok 116 should be equal
# get block
ok 117 (unnamed assert)
ok 118 should be equal
ok 119 null
ok 120 (unnamed assert)
ok 121 should be equal
ok 122 should be equal
ok 123 null
ok 124 (unnamed assert)
ok 125 should be equal
ok 126 should be equal
ok 127 null
ok 128 (unnamed assert)
ok 129 should be equal
ok 130 should be equal
# teardown
ok 131 undefined
# blockchain sync
# setup
ok 132 opened BlockStore
# sync
ok 133 downloading from peer
ok 134 (unnamed assert)
ok 135 should be equal
ok 136 (unnamed assert)
ok 137 should be equal
ok 138 should be equal
# teardown
ok 139 undefined
# build from MerkleBlock
# bitcoin.org example
ok 140 (unnamed assert)
ok 141 (unnamed assert)
ok 142 (unnamed assert)
ok 143 (unnamed assert)
ok 144 (unnamed assert)
ok 145 (unnamed assert)
# block 1
ok 146 (unnamed assert)
# block 2
ok 147 (unnamed assert)
ok 148 should not throw
ok 149 should not throw
ok 150 should not throw
# Node constructor
# setup
ok 151 ,
# chain
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:856:11)
    at TCP.onread (net.js:544:26)
npm ERR! Test failed.  See above for more details.

Big Refactor

I'm moving a lot of the code in this repo into smaller modules, refactoring the APIs, and writing documentation.

TODO:

  • peerhub
  • peer-exchange
  • bitcoin-net
    • Remove bitcore-lib/bitcore-p2p dependencies
    • Integrate with bitcoin-protocol
    • README
    • Tests
  • webcoin-params
  • webcoin-param-tests
  • bitcoin-wallet
    • Refactor for interfacing with other webcoin modules
    • README
    • Tests
  • webcoin
    • Remove extracted code
    • Integrate with other webcoin modules
    • README
    • Tests

Is it working ?

Is it working ?
I can't get it to sync. It seems it is not able to find peers...

Clarify deprecation status of this package

It seems like there should perhaps be a clearer note explaining that users can find more up-to-date functionality in the smaller packages. In general, most users should not use the webcoin package itself, right?

Maybe convert project to a monorepository?

I am not certain what complexity is entailed with managing a monorepository (design document 📝), but it appears that Webcoin could benefit if we collocate all the different projects together.

Some immediate obvious benefits:

  • one GitHub repository (this is really powerful, take a moment to consider all the implications)
  • managing inter-package dependencies and versions can be automated
  • easier setup for over-arching work, like building documentation by reaching into every project #3

Some qualities that are retained:

  • each project lives as an independent package in the registry
  • different projects can still continue to develop on their own; Babel's packages are synced on the major version, but otherwise have an independent release cycle, just to point out that a monorepo doesn't force you to always update all the packages when one changes in case someone is already familiar with React's release cycles

Peerlist / Stratum compatible?/ Network topology?

Hi I have some questions regarding webcoin:

1- How can I find a list of peers like the Electrum IRC?
2- Is webcoin compatible with Stratum protocol for SPV wallets and minig pools?
3- Related to 2-: Does webcoin uses some sort of hybrid non-stratum node, like webtorrent?

Thanks!

Webcoin doesn't seem to start with testnet

Maybe this is just set up wrong, but when I run the script below, the process exits after a very short delay. When I change Networks.testnet to Networks.livenet, the script works fine and prints out the updates from the chain's sync event.

I've tried deleting node_modules, and I make sure to delete the data folder before each run.

var Networks = require('bitcore-lib').Networks
var Node = require('webcoin').Node
var assert = require('assert')

var node = new Node({
    network: Networks.testnet,
    path: 'data',
    acceptWeb: true
})
node.on('error', assert.ifError)
node.chain.on('sync', console.log)

node.start()

Here's my output from npm ls:

[email protected] /Users/paul/projects/burnstream
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   ├─┬ [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ └─┬ [email protected]
  │   │ │   ├── [email protected]
  │   │ │   └── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └─┬ [email protected]
  │   │ │   ├── [email protected]
  │   │ │   ├── [email protected]
  │   │ │   ├── [email protected]
  │   │ │   ├── [email protected]
  │   │ │   ├── [email protected]
  │   │ │   └── [email protected]
  │   │ └── [email protected]
  │   └── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├─┬ [email protected]
  │   │ │ │ ├─┬ [email protected]
  │   │ │ │ │ ├─┬ [email protected]
  │   │ │ │ │ │ └── [email protected]
  │   │ │ │ │ └─┬ [email protected]
  │   │ │ │ │   ├── [email protected]
  │   │ │ │ │   └── [email protected]
  │   │ │ │ ├── [email protected]
  │   │ │ │ └── [email protected]
  │   │ │ └── [email protected]
  │   │ ├── [email protected]
  │   │ ├── [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── UNMET DEPENDENCY fstream@^1.0.0
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └─┬ [email protected]
  │   │ │   └─┬ [email protected]
  │   │ │     ├── [email protected]
  │   │ │     └── [email protected]
  │   │ ├── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ └── UNMET DEPENDENCY abbrev@1
  │   │ ├── [email protected]
  │   │ ├── UNMET DEPENDENCY osenv@0
  │   │ ├─┬ [email protected]
  │   │ │ └─┬ [email protected]
  │   │ │   └─┬ [email protected]
  │   │ │     ├── [email protected]
  │   │ │     └─┬ [email protected]
  │   │ │       └── [email protected]
  │   │ ├── UNMET DEPENDENCY request@2
  │   │ ├── UNMET DEPENDENCY rimraf@2
  │   │ ├─┬ [email protected]
  │   │ │ ├── UNMET DEPENDENCY block-stream@*
  │   │ │ └── UNMET DEPENDENCY fstream@^1.0.2
  │   │ └── UNMET DEPENDENCY which@1
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ └── [email protected]
  │   │ └─┬ [email protected]
  │   │   ├── [email protected]
  │   │   ├─┬ [email protected]
  │   │   │ ├── [email protected]
  │   │   │ └── [email protected]
  │   │   ├─┬ [email protected]
  │   │   │ ├── [email protected]
  │   │   │ └── [email protected]
  │   │   └── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├── [email protected]
  │   │ └── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ ├── [email protected]
  │   │ ├─┬ [email protected]
  │   │ │ ├── [email protected]
  │   │ │ └── [email protected]
  │   │ └── [email protected]
  │   └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   ├── [email protected]
  │ │   └─┬ [email protected]
  │ │     └─┬ [email protected]
  │ │       └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├── UNMET OPTIONAL DEPENDENCY [email protected]
  │ └─┬ [email protected]
  │   ├── UNMET OPTIONAL DEPENDENCY [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   └── UNMET OPTIONAL DEPENDENCY [email protected]
  ├── [email protected]
  └── UNMET OPTIONAL DEPENDENCY [email protected]

npm ERR! missing: fstream@^1.0.0, required by [email protected]
npm ERR! missing: osenv@0, required by [email protected]
npm ERR! missing: request@2, required by [email protected]
npm ERR! missing: rimraf@2, required by [email protected]
npm ERR! missing: which@1, required by [email protected]
npm ERR! missing: abbrev@1, required by [email protected]
npm ERR! missing: block-stream@*, required by [email protected]
npm ERR! missing: fstream@^1.0.2, required by [email protected]

WebRTC privacy vulnerability with webcoin

Webcoin (and if I understand it correctly, possibly a future version of Mercury decentralized exchange) is dependent upon WebRTC. This directly exposes the user to certain privacy vulnerabilities, namely, persistent exposure of IP and other information. See for example, a similar issue here:

VoluntaryLabs/Bitmarkets#35

This issue is opened in order that this vulnerability may be fully discussed and that a strong mitigation / prevention for the problem be developed. If an effort is already underway to do so in this repository please provide a link to the specific area of code in a comment in this issue for discussion.

add example

very very cool stuff!

@mappum we're going to need an SPV wallet to use with our project Trust in Motion (for our startup Tradle). Would you mind making a few examples? Currently we're using my single-key common-blockchain based wallet. bcoin is another candidate, but it's not being supported.

also, I want to ask you if you'd be interested in getting involved with Tradle and Trust in Motion. We just got into StartupBootCamp UK, and you're the kind of coder we need: solid nodejs skills, experience in cryptocurrencies, passionate about decentralized tech. It's a great time to get involved: there's serious outside validation, but you're early enough to make a big impact on the code.

Skype me at luigimvm if you're interested, or find me in the tradle-dev gitter room

Browser-based demo ideas?

I'm interested in implemented a browser-based demo that shows off the power of webcoin. Any ideas about this?

One pretty simple idea is to show activity from a hard-coded list of richest bitcoin addresses.

It would also be cool to show a visualization of all transactions that are occurring, but that would require a lot of bandwidth from web seeds.

I think an issue that would need to be tackled is web seed reliability, which I mentioned in #5.

Test failure: socket not opened

I'm seeing this fail every time now, but previously I think the same test was passing, so this may be nondeterministic.

paul ~/repos/webcoin master $ npm test

> [email protected] test /Users/paul/repos/webcoin
> npm run standard && ./node_modules/.bin/tape test/*.js


> [email protected] standard /Users/paul/repos/webcoin
> standard lib/*.js test/*.js bin/*.js index.js

TAP version 13
# open blockstore
# opening on a path that is already locked
ok 1 LevelUP
ok 2 (unnamed assert)
# closing
# blockstore put
# simple put
# put existing block
# put invalid blocks
ok 3 (unnamed assert)
ok 4 (unnamed assert)
ok 5 (unnamed assert)
# put after close
ok 6 undefined
ok 7 (unnamed assert)
# blockstore get
ok 8 null
# get using `header.hash`
ok 9 null
ok 10 should be equal
ok 11 should be equal
ok 12 should be equivalent
# get using buffer hash
ok 13 null
ok 14 should be equal
ok 15 should be equal
ok 16 should be equivalent
# get an invalid hash
ok 17 (unnamed assert)
ok 18 should be equal
ok 19 (unnamed assert)
# get a valid, nonexistent hash
ok 20 (unnamed assert)
ok 21 should be equal
ok 22 (unnamed assert)
# closing
# creating blockchain instances
# create blockchain with instantiated BlockStore
ok 23 should not throw
ok 24 undefined
# create blockchain with path instead of BlockStore
ok 25 should not throw
ok 26 undefined
# blockchain paths
# headers add to blockchain
# simple path with no fork
ok 27 (unnamed assert)
ok 28 (unnamed assert)
ok 29 (unnamed assert)
ok 30 (unnamed assert)
ok 31 should be equal
ok 32 should be equal
ok 33 should be equal
ok 34 should be equal
ok 35 should be equal
ok 36 should be equal
# backwards path with no fork
ok 37 (unnamed assert)
ok 38 (unnamed assert)
ok 39 (unnamed assert)
ok 40 (unnamed assert)
ok 41 should be equal
ok 42 should be equal
ok 43 should be equal
ok 44 should be equal
ok 45 should be equal
ok 46 should be equal
# fork headers add to blockchain
# path with fork
ok 47 (unnamed assert)
ok 48 (unnamed assert)
ok 49 (unnamed assert)
ok 50 should be equal
ok 51 should be equal
ok 52 should be equal
ok 53 should be equal
ok 54 should be equal
ok 55 should be equal
ok 56 should be equal
ok 57 should be equal
ok 58 should be equal
ok 59 should be equal
ok 60 should be equal
# backwards path with fork
ok 61 (unnamed assert)
ok 62 (unnamed assert)
ok 63 (unnamed assert)
ok 64 should be equal
ok 65 should be equal
ok 66 should be equal
ok 67 should be equal
ok 68 should be equal
ok 69 should be equal
ok 70 should be equal
ok 71 should be equal
ok 72 should be equal
ok 73 should be equal
ok 74 should be equal
# deleting blockstore
ok 75 undefined
# blockchain verification
# headers add to blockchain
# error on header that doesn't connect
ok 76 (unnamed assert)
ok 77 should be equal
# error on nonconsecutive headers
ok 78 (unnamed assert)
ok 79 should be equal
# error on header with unexpected difficulty change
ok 80 (unnamed assert)
ok 81 should be equal
# error on header with invalid proof of work
ok 82 (unnamed assert)
ok 83 should be equal
# error on header with invalid difficulty change
ok 84 (unnamed assert)
ok 85 should be equal
# accept valid difficulty change
# teardown
ok 86 undefined
# blockchain queries
# setup
# get block at height
ok 87 (unnamed assert)
ok 88 (unnamed assert)
ok 89 should be equal
ok 90 (unnamed assert)
ok 91 (unnamed assert)
ok 92 should be equal
ok 93 null
ok 94 (unnamed assert)
ok 95 should be equal
ok 96 should be equal
ok 97 null
ok 98 (unnamed assert)
ok 99 should be equal
ok 100 should be equal
# get block at time
ok 101 null
ok 102 (unnamed assert)
ok 103 should be equal
ok 104 should be equal
ok 105 null
ok 106 (unnamed assert)
ok 107 should be equal
ok 108 should be equal
ok 109 null
ok 110 (unnamed assert)
ok 111 should be equal
ok 112 should be equal
ok 113 null
ok 114 (unnamed assert)
ok 115 should be equal
ok 116 should be equal
# get block
ok 117 (unnamed assert)
ok 118 should be equal
ok 119 null
ok 120 (unnamed assert)
ok 121 should be equal
ok 122 should be equal
ok 123 null
ok 124 (unnamed assert)
ok 125 should be equal
ok 126 should be equal
ok 127 null
ok 128 (unnamed assert)
ok 129 should be equal
ok 130 should be equal
# teardown
ok 131 undefined
# blockchain sync
# setup
ok 132 opened BlockStore
# sync
ok 133 downloading from peer
ok 134 (unnamed assert)
ok 135 should be equal
ok 136 (unnamed assert)
ok 137 should be equal
ok 138 should be equal
# teardown
ok 139 undefined
# build from MerkleBlock
# bitcoin.org example
ok 140 (unnamed assert)
ok 141 (unnamed assert)
ok 142 (unnamed assert)
ok 143 (unnamed assert)
ok 144 (unnamed assert)
ok 145 (unnamed assert)
# block 1
ok 146 (unnamed assert)
# block 2
ok 147 (unnamed assert)
ok 148 should not throw
ok 149 should not throw
ok 150 should not throw
# Node constructor
# setup
ok 151 ,
# chain
ok 152 should be equal
ok 153 should be equal
ok 154 (unnamed assert)
# teardown
# creating TransactionStore instances
# error when no path specified
ok 155 should throw
# no error when path is specified
ok 156 (unnamed assert)
ok 157 should not throw
# isOpen() returns true after init callback
ok 158 (unnamed assert)
# isClosed() returns false after init callback
ok 159 (unnamed assert)
# TransactionStore put
# error when putting with no block
ok 160 (unnamed assert)
ok 161 should be equal
# put succeeds with block or header
ok 162 0100000000010000000000000000126a1099d6c34eb156fcb9428152c4f8676de600000000
ok 163 0100000000010000000000000000126a10f8f8fedb2858b5279c29876adf3012a400000000
# error when putting invalid data
ok 164 (unnamed assert)
ok 165 should be equal
# error when putting with invalid block hash
ok 166 should throw
# put succeeds for duplicate entries
ok 167 0100000000010000000000000000126a10cc553ce148ee112ce173cae3e7149c8f00000000
ok 168 0100000000010000000000000000126a10cc553ce148ee112ce173cae3e7149c8f00000000
# TransactionStore get
# setup
# simple get
ok 169 null
ok 170 (unnamed assert)
ok 171 should be equal
ok 172 (unnamed assert)
ok 173 (unnamed assert)
ok 174 should be equal
# error when getting with invalid hash
ok 175 (unnamed assert)
# teardown
ok 176 undefined
# isOpen() returns false after close callback
ok 177 (unnamed assert)
# isClosed() returns true after close callback
ok 178 (unnamed assert)
# toHash
ok 179 should be equal
# createStore
# simple createStore
ok 180 null
# error when createStore is called without a path
ok 181 should throw
# toCompactTarget
ok 182 should be equal
ok 183 should be equal
ok 184 should be equal
ok 185 should be equal
ok 186 should be equal
# Node wallet creation
# setup
# teardown
ok 187 null
/Users/paul/repos/webcoin/node_modules/ws/lib/WebSocket.js:214
    else throw new Error('not opened');
         ^

Error: not opened
    at WebSocket.send (/Users/paul/repos/webcoin/node_modules/ws/lib/WebSocket.js:214:16)
    at Peer.<anonymous> (/Users/paul/repos/webcoin/node_modules/peerhub/client.js:86:15)
    at emitOne (events.js:90:13)
    at Peer.emit (events.js:182:7)
    at sendOffer (/Users/paul/repos/webcoin/node_modules/simple-peer/index.js:310:12)
    at RTCPeerConnection.<anonymous> (/Users/paul/repos/webcoin/node_modules/simple-peer/index.js:315:44)
    at RTCPeerConnection.queueOrRun.onSuccess (/Users/paul/repos/node-webrtc/lib/peerconnection.js:215:25)
    at PeerConnection.onsuccess (/Users/paul/repos/node-webrtc/lib/peerconnection.js:89:25)
npm ERR! Test failed.  See above for more details.

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.