cyphernode icon indicating copy to clipboard operation
cyphernode copied to clipboard

Expose default wallet via an API call

Open chrisjmccreadie opened this issue 5 years ago • 4 comments

It would be useful to have an API call which returned the default wallet this would allow third parties who are using this/building on top of cyphernode to interface with the full node via RPC (or whatever their preference was). It has lately become essential for anyone using the NPM version of Bitcoin core as it requires a wallet to be defined since 0.17 and the depreciation of accounts.

I know it can be found by checking bitcoin.conf but it would be better if 3rd party developers did not even have to look here.

Example set up here

client = new Client({ host: "127.0.0.1", port: 18332, username: process.env.RPCUSERNAME, password: process.env.RPCPASSWORD });

chrisjmccreadie avatar Aug 18 '19 12:08 chrisjmccreadie

Do you have a use case? What do you want to accomplish? If you want to access the bitcoin core node directly I fear our cyphernode API is missing calls and we force you to do hacky stuff like that to accomplish your goal. :)

schulterklopfer avatar Aug 18 '19 12:08 schulterklopfer

Yes, I am building an ecommerce platform and replaced my backend with cyphernode (as it is way better than what I had) I got the wallet name by looking in the bitcoin.conf (spending001.dat) but I would like to be able to know what it is called without having to look at the config files as I plan to make it as agnostic as possible.

It is worth saying that I am only 2 weeks into using cyphernode and I have not really tapped into its full power yet so I may be missing something obvious that achieves this goal.

You can read about what I have done thus far

part 1

https://medium.com/bitcoin-e-commerce-development/part-18-cyphernode-ab682ff85659

part 2 (integration may be more useful for you in this context)

https://medium.com/bitcoin-e-commerce-development/part-19-cyphernode-ii-a2b01e8d702c?postPublishedType=initial

chrisjmccreadie avatar Aug 18 '19 16:08 chrisjmccreadie

Hi @chrisjmccreadie ! Very nice to see what you are building. I looked at your 2 Medium posts, good stuff! Thanks for being around!

If I understand correctly, you need to know the wallet name because you want to access the Bitcoin node directly (using -rpcwallet or /wallets) without going through the Cyphernode API. Is that it?

If everything you need for your ecommerce platform was available through the Cyphernode API, would it fulfill your needs?

The point of having the Cyphernode API in front of all the components (like the Bitcoin node) is to abstract those components. For example, if you switch from using Bitcoin Core to using btcd as your Bitcoin node, Cyphernode would still have the same API calls even if btcd has different RPC calls than Core. Same goes with c-lightning vs LND, for example. Cyphernode becomes an abstraction layer.

Cyphernode currently supports different kinds of wallets: spending, watching, xpub watcher, LN, wasabi (soon), etc. We'd like to abstract the details of those kinds of wallet behind the Cyphernode API. It is still a work-in-progress of course, but that's our vision.

I think it's ok to have a little more details about the different components (in the Welcome app, you can see some information about every piece of Cyphernode). We could add some information in the "Bitcoin core node" tile. It defeats a little bit the point of abstracting the details though... but we're still not there yet to support everything we would like, so it could be useful in the mean time.

Kexkey avatar Aug 19 '19 14:08 Kexkey

From what I understand, this issue addresses the larger issue of "multi-wallet management".

Right now, there is only one spending wallet per cyphernode instance, but we are working on multi-wallet support for our own use-case, so this is definitely an issue that will be addressed eventually.

FrancisPouliot avatar Nov 13 '19 21:11 FrancisPouliot