Title: Easy way for remote transactions and wallet operations? Post by: ziggybtc9 on August 17, 2019, 12:59:56 PM I want to set up a server that will receive http requests (using a simple protocol I define) and perform some simple bitcoin related operations, including import of a HD wallet and pushing transactions.
I wonder what is a good way to do it. I will use an NGINX web server to receive the requests and process them with PHP (I'm also comfortable with python, just for background). As for the operations themselves, I thought about the following options: - Run a full bitcoin node on the server and send JSON-RPC requests to bitcoind - Run a full node + an electrum server and send the requests to the electrum server (with electrum dameon) - Send them to electrum daemon. No full node / electrum server. - Don't run anything locally (except the web server) - use a third party API, such as of blockchain.com. Problem is I didn't see an api that allows import / restore of a HD wallet. I assume there are other options I didn't think. I will appreciate your input on this. Title: Re: Easy way for remote transactions and wallet operations? Post by: ziggybtc9 on August 18, 2019, 01:11:50 PM Anyone? :-[
Title: Re: Easy way for remote transactions and wallet operations? Post by: ziggybtc9 on August 19, 2019, 10:06:11 AM Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there.
Another way is do it with a python library. I see that https://github.com/primal100/pybitcointools is archived and not maintained any longer. Any good alternatives? Title: Re: Easy way for remote transactions and wallet operations? Post by: ABCbits on August 19, 2019, 05:15:10 PM Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there. Yes, but what i meant is there's no Electrum command to import HD wallet. You don't plan to import it manually, do you? Another way is do it with a python library. I see that https://github.com/primal100/pybitcointools is archived and not maintained any longer. Any good alternatives? I don't know if it's good or not, but i'd recommend https://github.com/ofek/bit (https://github.com/ofek/bit). I tried it once and like it since it's very easy to use even for geeks like me. Title: Re: Easy way for remote transactions and wallet operations? Post by: ziggybtc9 on August 20, 2019, 04:33:37 AM Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there. Yes, but what i meant is there's no Electrum command to import HD wallet. You don't plan to import it manually, do you? See lines 151-166 in https://github.com/spesmilo/electrum/blob/master/electrum/commands.py With Curl: curl --data-binary '{"id":"curltext","method":"restore","params":{"text":"word1 word2 word3...""}}' http://user:password@127.0.0.1:7777 As for working with multiple wallets, that's a bit hacky but I figured out switching between them can be done by using the "setconfig" command. For example: curl --data-binary '{"id":"curltext","method":"setconfig","params":{"key":"wallet_path","value":"path/to/wallet1"}}' http://user:password@127.0.0.1:7777 switches to wallet1 file. It's then possible to work with any number of wallet files without restarting the electrum daemon (as I previously thought will be necessary). I wish they'd publish a full reference for the RPC API, it is tricky to figure out what goes where. Quote I don't know if it's good or not, but i'd recommend https://github.com/ofek/bit (https://github.com/ofek/bit). Thanks a lot, I'll check that one as well. |