bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
3.01k stars 811 forks source link

How to run an SPV node. #475

Closed ATheCoder closed 6 years ago

ATheCoder commented 6 years ago

In the main readme file it says that one is able to run an spv node using bcoin, However there is really no documentation about how one is supposed to do so, The only thing that I've found is an example file in the docs that doesn't work at all.

Does bcoin really support an SPV node, if so how am I supposed to set one up?

bucko13 commented 6 years ago

Passing in the option --spv via the command line will start an spv node (this is mentioned here in the context of custom data dirs). For creating a custom script, here's an example from the docs: https://github.com/bcoin-org/bcoin/blob/master/docs/Examples/spv-sync-wallet.js

ATheCoder commented 6 years ago

Can I only run the scripts while bcoin daemon is running?

And isn't that an example for Datadir? I mean there is not a single line indicating what --spv is and what it does.

bucko13 commented 6 years ago

that script will actually start up the bcoin instance, syncing the chain, pool and wallet.

--prefix is for Datadir. You can see the parameter that is passed directly following it. --spv indicates you're starting in spv mode. Passing in--spv` will run this file: https://github.com/bcoin-org/bcoin/blob/master/bin/spvnode

ATheCoder commented 6 years ago

Thanks for the help, much appreciated!