Pages:
Author

Topic: Electrum - Bitcoin client for the common users (friendly and instant) - page 34. (Read 110104 times)

hero member
Activity: 938
Merit: 1000
Tested it on a clean Debian 6 system and on OS X 10.7 and it seems to be working. Before I merge it into master though I would appreciate it if there were some other people who could give it a quick run. It required some manual merging and that's always tricky. I previously made master unstable by merging too quickly and I would like to avoid that this time.

The fully merged tree can be found on github. Thanks!
hero member
Activity: 938
Merit: 1000
Merged everything, just doing some final testing on a couple of my vm's before I merge everything back into master Smiley
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I've merged the offline wallet fix, I've commented on the "remember Gui" pull and I will check out the larger commits tonights and over the weekend. They can't be merged automatically so I want to be sure everything goes according to plan.

The commits you have done did fix my config file issues Smiley
Thx. I have a branch in my fork called "merged" which has my branches all merged. There is only one conflict and that is when you merge the SimpleConfig defaults. Just a copy/paste to fix that up.  I'm running my merged branch here as normal client. I had to go back and add a line to the setup to make sure the socks module got bundled in the dist pkg. Seems to install and work ok so far.

hero member
Activity: 938
Merit: 1000
I've merged the offline wallet fix, I've commented on the "remember Gui" pull and I will check out the larger commits tonights and over the weekend. They can't be merged automatically so I want to be sure everything goes according to plan.

The commits you have done did fix my config file issues Smiley
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I've submitted a pull request for a small change that gives expert users an option to startup in "Pro Mode".

My repo: bkkcoins/electrum branch: startup-gui-option

Adds settings dialog combo box for "Default GUI" that can be either Lite or Qt.
Saves value as gui in config.json.

Smiley
legendary
Activity: 3920
Merit: 2349
Eadem mutata resurgo
Bkkcoins : "does Tor run with SOCKS proxy?" ... yes, SOCKS5 is required for compatability with latest releases of Tor.

Also, thanks for fixing that bug with not recreating a wallet when off-line. I saw that once and it unnerved me a lot but I couldn't reproduce it (must have been particular set of circumstances, offline, new wallet, no change addresses or something?) but it has stuck in back of my mind ....
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Could you please add an option to Electrum to allow the user to refuse to accept certain coins. If he receives certain coins, he sends them back right away.

Here is the full proposal: https://bitcointalksearch.org/topic/proposal-to-help-stop-thieves-110749

Thanks.
Even if this were figured out and coded I'd be opposed to merging it in. I think it's an extremely bad idea that will only lead to weakening Bitcoin and create more confusion. Users who want this should use their own fork with the feature and it shouldn't be part of the default client. IMO. But I'm new here on Electrum.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I'm now not sure how to solve this. Is this an issue with your code specific? An other option to solve this would be to "upgrade" the default_options on each launch. Check if the default have more then the current, merge the default into the config file but don't overwrite existing options. I think this would be the best solution. What do you think?
Oh yes, I always had a config.json created by the updated SimpleConfig here. I can fix this and will do it shortly. SimpleConfig just needs to start with the default dict before loading a user one from disk as this will always make sure when it saves that it upgrades users with any new variables.

Edit: Done. Tested and pushed to my fork.
hero member
Activity: 938
Merit: 1000
I have a working version of Electrum with SOCKS and HTTP proxy support now in my fork. If anyone wants to try it / test it and give feedback I'd welcome that before going for a pull request to merge it in.

I've tested it with SOCKS4 and SOCK5 a fair bit using an ssh tunnel to my server at amazon. This was quite reliable and seemed to have no issues. I tried an HTTP proxy off a free-list and it worked as well but I found it was more inconsistent and once it had an error it usually could not recover except by restarting. This seems to be due to how the polling code is done and it doesn't handle an error condition and recuperate. I tested mostly with TCP mode but a few times with HTTP mode too.

This proxy support uses the Socksipy wrapper available from google code (apparently a fixed version of the old 2006 code). The license on that code is a bit vague. It's not explicitly based off a known entity but seems to say, well, use it but leave the notice intact is all. One drawback of this code is that it doesn't support unicode host urls. I'm not sure if that's very important for proxies as in most cases people probably use localhost anyway.

Does Tor use a SOCKS proxy? Could someone test if this allows Electrum to run over tor then? I don't know anything about that but it would be good if it worked.

To find this for testing goto my fork at bkkcoins/electrum and get the socks-support branch (NOT the master branch which is default).

Ok I ran the codebase and with a clean install it works fine and runs perfect over Socks!

There is however a problem. When you are starting from a non-fresh installation on master and you already have a config file the app crashes because the key proxy doesn't exit.

Code:
Traceback (most recent call last):
  File "./electrum", line 119, in
    parser.add_option("-p", "--proxy", dest="proxy", default=simple_config["proxy"], help="set proxy [type:]host[:port], where type is socks4,socks5 or http")
AttributeError: SimpleConfig instance has no attribute '__getitem__'

I tried solving this by writing a get_key method for SimpleConfig so that if a key is not found, it just returns nothing. Sadly this did not really solve the problem.

Code:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/Users/maran/Projects/bitcoin/bkk-electrum/lib/interface.py", line 434, in run
    self.start_interface()
  File "/Users/maran/Projects/bitcoin/bkk-electrum/lib/interface.py", line 425, in start_interface
    self.interface.init_socket()
  File "/Users/maran/Projects/bitcoin/bkk-electrum/lib/interface.py", line 263, in init_socket
    if self.proxy["mode"] == "none":
TypeError: 'NoneType' object has no attribute '__getitem__'

I'm now not sure how to solve this. Is this an issue with your code specific? An other option to solve this would be to "upgrade" the default_options on each launch. Check if the default have more then the current, merge the default into the config file but don't overwrite existing options. I think this would be the best solution. What do you think?
hero member
Activity: 938
Merit: 1000
I think there are a bunch of things higher priority at the moment for Electrum. But if you supply a pull request I'm sure it will get merged Smiley
sr. member
Activity: 317
Merit: 252
Could you please add an option to Electrum to allow the user to refuse to accept certain coins. If he receives certain coins, he sends them back right away.

Here is the full proposal: https://bitcointalksearch.org/topic/proposal-to-help-stop-thieves-110749

Thanks.
hero member
Activity: 938
Merit: 1000
Cool! I will give it a try after work tonight Smiley
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I have a working version of Electrum with SOCKS and HTTP proxy support now in my fork. If anyone wants to try it / test it and give feedback I'd welcome that before going for a pull request to merge it in.

I've tested it with SOCKS4 and SOCK5 a fair bit using an ssh tunnel to my server at amazon. This was quite reliable and seemed to have no issues. I tried an HTTP proxy off a free-list and it worked as well but I found it was more inconsistent and once it had an error it usually could not recover except by restarting. This seems to be due to how the polling code is done and it doesn't handle an error condition and recuperate. I tested mostly with TCP mode but a few times with HTTP mode too.

This proxy support uses the Socksipy wrapper available from google code (apparently a fixed version of the old 2006 code). The license on that code is a bit vague. It's not explicitly based off a known entity but seems to say, well, use it but leave the notice intact is all. One drawback of this code is that it doesn't support unicode host urls. I'm not sure if that's very important for proxies as in most cases people probably use localhost anyway.

Does Tor use a SOCKS proxy? Could someone test if this allows Electrum to run over tor then? I don't know anything about that but it would be good if it worked.

To find this for testing goto my fork at bkkcoins/electrum and get the socks-support branch (NOT the master branch which is default).
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Great, thanks for contributing! I'm not totally familiar with the new Github so I'll let others chime in.
I figured out how to clean my fork and branch separately. So now I have a fix-offline-restore branch and socks-support branch.
On the first one I have created a pull request to bring those two lines back into spesmilo.
Starting to understand github and now realize when I forked I should have kept a clean master and a branch for each set of changes I want against master. All sorted now.

Github:  bkkcoins/electrum branch fix-offline-restore (not the default master branch)
member
Activity: 107
Merit: 10
Great, thanks for contributing! I'm not totally familiar with the new Github so I'll let others chime in.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Actually I tracked down the bug. Seems not much testing was done with restoring a wallet offline as it's not possible for it to work.

When you choose to restore and also offline it will not call the wallet.synchronize() function.
I added an else: clause that calls synchronize when offline (instead of WalletSynchronizer when online). This fixed the issue and now the addresses get added to the wallet.

How do you want me to handle this for bug fix? I have a fork I'm using for SOCKS support but it's already dirty with that code. I could just create a patch and post here. Or is there a simple way to do it on github without having to merge from my SOCKS code?

edit: the fix is in my electrum fork at bkkcoins/electrum - I just need a way to send back just those two lines changed.

electrum: line 254 insert
 
Code:
           else:
                wallet.synchronize()
legendary
Activity: 1120
Merit: 1016
090930
By the way the default server list is configured at line 27 of the interface.py file, in case you want to take out the obsolete server name directly.
legendary
Activity: 1120
Merit: 1016
090930
Tried again. Same result. I'm on Linux 11.04 (natty)

$ rm savings.dat
~/.electrum$ electrum -o restore -w savings.dat
Password (hit return if you do not wish to encrypt your wallet):
server (default:ecdsa.org):
port (default:50001):
protocol [t=tcp;h=http;n=native] (default:t):
fee (default:0.001):
gap limit (default 5):10
seed:cease chair natural crave week flip lightning stolen people respond enjoy somewhere
Warning: Not hex, trying decode.
Wallet saved in 'savings.dat
~/.electrum$ electrum addresses -w savings.dat
~/.electrum$

Next I tried running electrum -w savings.dat to get GUI but it won't connect. Then I tried electrum with no -w wallet arg and it started my normal wallet and connected fine.

Code:
~/.electrum$ electrum -w savings.dat
Install zbar package to enable QR scans
Not connected
Poking
Not connected
Poking
Not connected
Poking

This is the version from "deb http://apt.bitcoins.sk/ precise main" installed with apt-get. It has worked fine with my desktop wallet and still does. I just tried again with current master branch (which I have in another dev directory) and it behaves the same with both this and my normal wallet, ie. works with normal but doesn't with this restored one.

If you want to try this you can see above my seed words to test.
Is there a debug option that might spit out some verbose logging?

---
ok. Digging into the code I see that the wallet file reads but has an empty array for wallet.addresses. I see the wallet file itself has no addresses but does have the seed value (and it looks ok) and a master_public_key. The addresses array is empty and presumably should be generated upon opening but isn't. Still looking...

I think the root cause is this: the default server (highlighted above in red) that your version of electrum has used to configure the wallet file is no longer online as far as I can tell.
Can you try the recovery again and manually enter a server name from the below list when prompted?

uncle-enzo.info
electrum.bitfoo.org
electrum.novit.ro
electrum.bitcoins.sk

Hopefully this part of the code will be made more robust soon.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Tried again. Same result. I'm on Linux 11.04 (natty)
Code:
$ rm savings.dat 
~/.electrum$ electrum -o restore -w savings.dat
Password (hit return if you do not wish to encrypt your wallet):
server (default:ecdsa.org):
port (default:50001):
protocol [t=tcp;h=http;n=native] (default:t):
fee (default:0.001):
gap limit (default 5):10
seed:cease chair natural crave week flip lightning stolen people respond enjoy somewhere
Warning: Not hex, trying decode.
Wallet saved in 'savings.dat
~/.electrum$ electrum addresses -w savings.dat
~/.electrum$
Next I tried running electrum -w savings.dat to get GUI but it won't connect. Then I tried electrum with no -w wallet arg and it started my normal wallet and connected fine.

Code:
~/.electrum$ electrum -w savings.dat
Install zbar package to enable QR scans
Not connected
Poking
Not connected
Poking
Not connected
Poking

This is the version from "deb http://apt.bitcoins.sk/ precise main" installed with apt-get. It has worked fine with my desktop wallet and still does. I just tried again with current master branch (which I have in another dev directory) and it behaves the same with both this and my normal wallet, ie. works with normal but doesn't with this restored one.

If you want to try this you can see above my seed words to test.
Is there a debug option that might spit out some verbose logging?

---
ok. Digging into the code I see that the wallet file reads but has an empty array for wallet.addresses. I see the wallet file itself has no addresses but does have the seed value (and it looks ok) and a master_public_key. The addresses array is empty and presumably should be generated upon opening but isn't. Still looking...
legendary
Activity: 1120
Merit: 1016
090930
Now going back to the cmdline the addresses show up and the 11th one is the change address. I guess that's why it didn't show. So it looks ok but why didn't it work until using the GUI mode? I would want to be able to use the client offline on a cmdline only system to do recovery. Still a little fishy there.

Opening with the GUI changed the file size from 685 bytes to 1555 bytes.

this looks like a bug.
what is your OS?
I use Linux, and it it works fine for me, both in text and gui mode.


I'm suspecting it could be related  to the known issues with server selection at startup. Until they are fixed, for consistent results, I would suggest to always use the -o switch when doing a recovery at the command line. So, try: electrum -o restore

Does this work better?
Pages:
Jump to: