Bitcoin Forum
May 07, 2024, 06:30:41 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Questions regarding Electrum on a server  (Read 1356 times)
BioMike (OP)
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
September 28, 2014, 09:49:28 AM
 #1

In the past I've used bitcoind on a server to run a web service and used bitcoind to arrange the payments. The problem was that the whole blockchain was too heavy in disc usage. For a different project I have to interface with the bitcoin network again, but bitcoind is out of the question. I'm looking into Electrum instead.

Things that I need for my project:
- query for a new address.
- periodically, check the balance of that address.
- sometimes send funds from the server to an other address.

I think I can manage do those things with Electrum (been playing a bit with it for now).

My question is how to interface with Electrum programmatically. I was thinking to use Python, but can't seem to find what to import and if there is a general class available that allows me to call the methods I need for the 3 things mentioned above.

I guess I can import Electrum from Python by using:

Code:
from Electrum import *

Right? And then? How would I continue then?

The server has no x/qt/gtk libraries, so everything has not to depend on those.
1715063441
Hero Member
*
Offline Offline

Posts: 1715063441

View Profile Personal Message (Offline)

Ignore
1715063441
Reply with quote  #2

1715063441
Report to moderator
1715063441
Hero Member
*
Offline Offline

Posts: 1715063441

View Profile Personal Message (Offline)

Ignore
1715063441
Reply with quote  #2

1715063441
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715063441
Hero Member
*
Offline Offline

Posts: 1715063441

View Profile Personal Message (Offline)

Ignore
1715063441
Reply with quote  #2

1715063441
Report to moderator
1715063441
Hero Member
*
Offline Offline

Posts: 1715063441

View Profile Personal Message (Offline)

Ignore
1715063441
Reply with quote  #2

1715063441
Report to moderator
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
September 30, 2014, 03:25:11 AM
Last edit: September 30, 2014, 04:47:39 AM by Abdussamad
 #2

You can do this via the command line. Type `electrum help` to see the available commands and `electrum help <command_name>` for command specific help.

As for balance checks in recent electrum versions it spawns a daemon that listens for multiple requests. The daemon automatically dies if no new requests are forthcoming. So you can do periodic bulk checks via  a cron job.
BioMike (OP)
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
October 03, 2014, 08:55:43 AM
 #3

You can do this via the command line. Type `electrum help` to see the available commands and `electrum help <command_name>` for command specific help.

As for balance checks in recent electrum versions it spawns a daemon that listens for multiple requests. The daemon automatically dies if no new requests are forthcoming. So you can do periodic bulk checks via  a cron job.

Thank you for your reply. I prefer to avoid calling the shell (the shellshock bug shows nicely why I don't like it), else I would not be asking the question.

Past few days I've been going through the code and started writing the python code to interface with Electrum in a programmable way. The problem that I'm running now in to is that the Electrum code is poorly documented and to my opinion made more complex than it should be (Wallet and WalletStore classes to mention one example).
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
October 04, 2014, 01:16:46 AM
 #4

I don't know python very well but you could hire one of the electrum developers to make this for you.
BioMike (OP)
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
October 04, 2014, 06:51:55 AM
 #5

I don't know python very well but you could hire one of the electrum developers to make this for you.

Yeah, I know, but I managed yesterday to get the functionality that I needed working (except for the new addresses, but on second thought that isn't really needed for my project).
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!