Author

Topic: Easy way for remote transactions and wallet operations? (Read 277 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
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?

The "restore" command works in the console, command line and through an RPC call. It takes a text that can have various formats including a mnemonic word list or a master private key.

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:[email protected]: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:[email protected]: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.

I didn't know that's possible. There aren't any clear documentation about electrum's command, expect inline help (electrum help ).

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.

You're welcome Smiley
newbie
Activity: 9
Merit: 3
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?

The "restore" command works in the console, command line and through an RPC call. It takes a text that can have various formats including a mnemonic word list or a master private key.

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:[email protected]: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:[email protected]: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.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
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.

I tried it once and like it since it's very easy to use even for geeks like me.
newbie
Activity: 9
Merit: 3
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?
newbie
Activity: 9
Merit: 3
Anyone?  Embarrassed
newbie
Activity: 9
Merit: 3
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.
Jump to: