Pages:
Author

Topic: [ANNOUNCE] Electrum - Lightweight Bitcoin Client - page 93. (Read 274537 times)

legendary
Activity: 1386
Merit: 1097
#1. Config file should be (in order): ~/electum.conf, /etc/electum.conf, or the hardcoded defaults if neither exist.

I don't think /etc/electrum.conf is good place, because client need write access to that (as it contains private keys). And give any non-root user access to /etc/ is imho bad thing (tm).
legendary
Activity: 1896
Merit: 1353
#2. The server readme file refers to the patch bitcoinrpc_connection.py.diff agains bitcoinrpc (https://gitorious.org/python-bitcoin), but the file it modifies doesn't exist in that project (src/bitcoinrpc/connection.py). Please advise/fix.

Sorry, it's not python-bitcoin but bitcoin-python.
You can get it from here: https://github.com/toomanysecrets0/bitcoin-python
I had both installed at some point, hence the confusion
sr. member
Activity: 252
Merit: 250
This shouldn't be posted here, but I don't see any bug tracker on gitorius, so here:

#1. Config file should be (in order): ~/electum.conf, /etc/electum.conf, or the hardcoded defaults if neither exist.

#2. The server readme file refers to the patch bitcoinrpc_connection.py.diff agains bitcoinrpc (https://gitorious.org/python-bitcoin), but the file it modifies doesn't exist in that project (src/bitcoinrpc/connection.py). Please advise/fix.

Also, there should be documentation about how to run Electrum and all deps from a single directory. For example, I don't want to install bitcoin-abe and other stuff that doesnt's exist in Debian system-wide. I want to have them all under the user 'bitcoin', for security and ease of administration reasons. After I'm done testing, I'll write my own howto, for the moment I'm stuck Smiley
legendary
Activity: 1896
Merit: 1353
I knocked up first version of QR code support, feature which I'm missing in official client. It is using 3rd party library from googlecode, which isn't available thru easy_install, so I decided to add it directly to sources and do not create some weird dependency. Alsp PIL (python imaging library) is necessary for rendering image.

QR code is displaying in separate window instead directly in GUI because I'm lacking some high-level concept of GUI (and, honestly, I feel like GUI need a lot of work Wink ). I just made it as simple as possible, but I'm open to make QR code as part of main window if you tell me where you want to show it. But I still hope you decide to go to Qt so I won't need to fiddle with Gtk (and I'll finally learn Qt instead).

http://mining.bitcoin.cz/media/download/qrsupport.tgz

nice, thanks. I just added it to Electrum, and released version 0.27
note that I reimplemented the rendering with pygtk, because I did not want to create another dependency with IM

legendary
Activity: 1386
Merit: 1097
A quick and dirty fix could be to replace all instances of ast.literal_eval() with eval(), but doing so exposes your client to messages containing code sent by a malicious server.
I guess some sanitization is possible using regular expressions.

I think using eval is really bad idea as it literally open the door for mitm attackers (you can do almost everything with eval like accessing local filesystem). I still re-read documentation for ast yesterday to be sure there's no possibility to attack clients with modified payload and so far it looks safe.
legendary
Activity: 1896
Merit: 1353
Any idea what's the package name of module I am missing?

Module AST has been introduced into standard python library in version 2.6, which is the reason why python 2.5 throws such error. I think electrum can safely expect python 2.6 as minimal version, as 2.5 is beeing obsolete in almost every distribution.


A quick and dirty fix could be to replace all instances of ast.literal_eval() with eval(), but doing so exposes your client to messages containing code sent by a malicious server.
I guess some sanitization is possible using regular expressions.
legendary
Activity: 1896
Merit: 1353
Quote
Try downloading python 2.7
I have only python 2.5 on Maemo5 and there is no easy way to upgrade it, but I have somehow managed to install all necessary dependencies on chrooted debian image with python 2.6

Screenshot

cute!
legendary
Activity: 1896
Merit: 1353
One more finding: As far as I understand fee calculations in official client, it is "fee per kB", not "fee per transaction" as is implemented in Electrum. Normal transaction is usually under 1kB, however sometimes there are strange multi-kB transactions - especially when miners are consolidating their 0.01 payouts from pool to one address. Then static fee in Electrum can lead to some unexpected behaviour.

Indeed. well, the fee calculation in the official bitcoin client is quite complicated, and I did not take the time to reproduce it. However, when I first used the official client, it took me some time to realize that the fee was "per kB". In any case, I think that the fee should be visible from the user before they press the "send" button. Maybe we should display the suggested fee, and give the user the option to increase or decrease it.
legendary
Activity: 1896
Merit: 1353
Thomas, excellent work! I finally found some time to test everything and read (most of) the code. I really appreciate small footprint of client. There's lot of things which I like on your client, namely deterministic wallet (no need for periodic backup is awesome feature) and client-server architecture, which makes client really lightweight and very fast to use.

Few comment though.

1. Consider to switch to Qt. It's much modern gui toolkit and looks better especially on Windows. Thanks to minimalistic GUI it's still pretty easy to switch. Your client has great potential but GTK looks weird on Win and it's wrong to focus only on linux users (although I'm 100% linux user).

2. Consider better network interface and wallet format. Using 'repr' may break things in future as this isn't supposed to be platform-independent serializing method ;-). I see potential in using server side with some mobile clients, however implementing repr in java might be real hell. Although I don't recommend Json, it would be better than repr and it does not need new dependency as json parser is in stock python. Also thinking about pub/sub mechanism which can avoid server polling would be great. pubsub can make updates on client instant and yet vastly save server resources (as common client does not receive transaction all day long).

3. Consider to move to Github. I'd like to submit some fixes time to time and I finally need to learn with Git & Github :-). So migration to github would be good reason for me to go thru git manual (I'm mercurial user for years).

I can imagine that I'll install electrum to my friends instead of standard client when electrum matures a bit, because handling blockchain is simply big overhead for occasional users. Once again - really good work so far!

hi slush, thanks for the feedback!

1. Concerning Qt, I do not think we need to switch to Qt, we can just provide both Qt and gtk :-)  I will not do it myself, because I am not familiar with Qt, but I will be very happy to include an alternative GUI if someone decides to write it. Note that someone already made the same proposal: https://bitcointalksearch.org/topic/m.618488 . Please also note that in the current GUI, I made sure that all functions can be accessed with the keyboard, with no need to reach for the mouse; if you design a Qt gui, I would love to keep the same accessibility.

2. wallet format: you are right. any patch is welcome.

2. server polling versus push: I disagree here. I decided to use polling instead of push for a reason. Many people have difficulties configuring with firewalls and opening ports. I wanted Electrum to be as easy to use as possible, and to require as little configuration as possible. I do not think that minimizing bandwidth is an issue at this point. Now, if you really want Electrum to use a push protocol, we can add it, but do not think that it should be the default.

3. the project is on gitorious. My username was already taken at github. not at gitorious :-)
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
Any tips for getting it working with Symbian non touch screen phones?
I think it has not really been developed for phones like that yet. It's just the concept that would work rather well on phones, as you don't need the blockchain and such.

So no, I don't think that will be easy to use, for now.
hero member
Activity: 900
Merit: 1000
Crypto Geek
Any tips for getting it working with Symbian non touch screen phones?
legendary
Activity: 1386
Merit: 1097
Any idea what's the package name of module I am missing?

Module AST has been introduced into standard python library in version 2.6, which is the reason why python 2.5 throws such error. I think electrum can safely expect python 2.6 as minimal version, as 2.5 is beeing obsolete in almost every distribution.
legendary
Activity: 1386
Merit: 1097
One more finding: As far as I understand fee calculations in official client, it is "fee per kB", not "fee per transaction" as is implemented in Electrum. Normal transaction is usually under 1kB, however sometimes there are strange multi-kB transactions - especially when miners are consolidating their 0.01 payouts from pool to one address. Then static fee in Electrum can lead to some unexpected behaviour.
hero member
Activity: 482
Merit: 502
Quote
Try downloading python 2.7
I have only python 2.5 on Maemo5 and there is no easy way to upgrade it, but I have somehow managed to install all necessary dependencies on chrooted debian image with python 2.6

Screenshot
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
It seems this is generating some interest now. Cool!

Any idea what's the package name of module I am missing?
Code:
[user@N900 user]$ python /opt/Electrum-0.26b/client/electrum.py
Traceback (most recent call last):
  File "/opt/Electrum-0.26b/client/electrum.py", line 20, in
    import sys, base64, os, re, hashlib, socket, getpass, copy, operator, ast
ImportError: No module named ast
[user@N900 user]$
As far as I can tell, this is an abstract syntax tree, which is supposedly part of native python. What version are you running? Try downloading python 2.7, see if that helps.

3. Consider to move to Github. I'd like to submit some fixes time to time and I finally need to learn with Git & Github :-). So migration to github would be good reason for me to go thru git manual (I'm mercurial user for years).
The code is hosted on Gitorius (Link) which in practice is nearly the same thing as Github. In any case you should be able to do clones and merge requests and such (although I don't have any experience with Gitorius).

legendary
Activity: 1386
Merit: 1097
I knocked up first version of QR code support, feature which I'm missing in official client. It is using 3rd party library from googlecode, which isn't available thru easy_install, so I decided to add it directly to sources and do not create some weird dependency. Alsp PIL (python imaging library) is necessary for rendering image.

QR code is displaying in separate window instead directly in GUI because I'm lacking some high-level concept of GUI (and, honestly, I feel like GUI need a lot of work Wink ). I just made it as simple as possible, but I'm open to make QR code as part of main window if you tell me where you want to show it. But I still hope you decide to go to Qt so I won't need to fiddle with Gtk (and I'll finally learn Qt instead).

http://mining.bitcoin.cz/media/download/qrsupport.tgz
legendary
Activity: 1386
Merit: 1097
Thomas, excellent work! I finally found some time to test everything and read (most of) the code. I really appreciate small footprint of client. There's lot of things which I like on your client, namely deterministic wallet (no need for periodic backup is awesome feature) and client-server architecture, which makes client really lightweight and very fast to use.

Few comment though.

1. Consider to switch to Qt. It's much modern gui toolkit and looks better especially on Windows. Thanks to minimalistic GUI it's still pretty easy to switch. Your client has great potential but GTK looks weird on Win and it's wrong to focus only on linux users (although I'm 100% linux user).

2. Consider better network interface and wallet format. Using 'repr' may break things in future as this isn't supposed to be platform-independent serializing method ;-). I see potential in using server side with some mobile clients, however implementing repr in java might be real hell. Although I don't recommend Json, it would be better than repr and it does not need new dependency as json parser is in stock python. Also thinking about pub/sub mechanism which can avoid server polling would be great. pubsub can make updates on client instant and yet vastly save server resources (as common client does not receive transaction all day long).

3. Consider to move to Github. I'd like to submit some fixes time to time and I finally need to learn with Git & Github :-). So migration to github would be good reason for me to go thru git manual (I'm mercurial user for years).

I can imagine that I'll install electrum to my friends instead of standard client when electrum matures a bit, because handling blockchain is simply big overhead for occasional users. Once again - really good work so far!

OT: If I remember well, we made OTC trade on 1st January together, right? It was my first sell-off and your first buy :-D.
hero member
Activity: 742
Merit: 500
Great! I'll test when I'll have some free time and put up a public server online.

Ditto.

I have so many projects tho, it might be a while.

Keep up the great work.  The readability of python is a great benefit.
hero member
Activity: 482
Merit: 502
Any idea what's the package name of module I am missing?
Code:
[user@N900 user]$ python /opt/Electrum-0.26b/client/electrum.py
Traceback (most recent call last):
  File "/opt/Electrum-0.26b/client/electrum.py", line 20, in
    import sys, base64, os, re, hashlib, socket, getpass, copy, operator, ast
ImportError: No module named ast
[user@N900 user]$
legendary
Activity: 1896
Merit: 1353
Great! I'll test when I'll have some free time and put up a public server online.

Awesome!
Note that the server will join an irc channel in order to discover peers.
The server has a 'peers' command that returns the list of other servers on the channel; it is not used by the client at this point.
Pages:
Jump to: