Pages:
Author

Topic: Pywallet 2.2: manage your wallet [Update required] - page 27. (Read 207945 times)

legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
Is it possible to convert tx_k tx_v to a raw transaction that can be sent by sendrawtransaction from within the newer clients?
tx_k is useless because it is '027478' (well I think so) + little endian tx id
As far as I can remember, tx_v is not only the transaction: the bitcoin client adds some data (the transaction of its inputs if the client has them in its blockchain)
So depending on what you're trying to do you can use it directly or parse it to put it in the newer client


Don't worry, it's your project after all.
I would vote for a CLI. A seperate GUI is fine as well. A single pywallet with additional dependencies makes this great tool harder to use. But it's your tool - you decide.
It's my project but I'd prefer if people like using it and find it practical
Also, I make all dependencies optional: currently you can use pywallet even if you don't have twisted+zope, you just won't be able to use the WUI. Same for ecdsa package and signature/verifications
The new pywallet would follow this rule as well
legendary
Activity: 2618
Merit: 1252
Do you think pywallet would be more practical as a Qt app?
As I said earlier I'm wondering about recoding everything. It's far from sure but if I decide to I'd like to know how to make it more user-friendly.

I would vote for a CLI. A seperate GUI is fine as well. A single pywallet with additional dependencies makes this great tool harder to use. But it's your tool - you decide.
legendary
Activity: 1708
Merit: 1019
I like putting everything into a single file because I find it easier to track and easier for newbies
I can split it in three though and then push the four files to github
Don't worry, it's your project after all.

Is it possible to convert tx_k tx_v to a raw transaction that can be sent by sendrawtransaction from within the newer clients?
newbie
Activity: 42
Merit: 0
Wow this is great thanks
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
I like putting everything into a single file because I find it easier to track and easier for newbies
I can split it in three though and then push the four files to github
legendary
Activity: 1708
Merit: 1019
Yeah, the CLI is the priority anyway
+1 to command line

It would be nice if the project was separated in three files to be able to look over it more easily:
- core functions
- command line interface
- gui/web interface
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
Yeah, the CLI is the priority anyway
legendary
Activity: 1974
Merit: 1029
To everybody
Do you think pywallet would be more practical as a Qt app?

Just as K1773R, I'd like to have a full working command-line interface, and am comfortable enough with a web browser for point n click usage.
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
I'm glad that worked and that is quick
I didn't even think that exit would raise an exception, it's ok now


You both confirm what I was afraid of, that that'd nice to have CLI+GUI+WUI
I think I won't use the twisted package anymore to deal with the WUI though, I'll manage sockets myself
I'm fed up with dependencies
sr. member
Activity: 293
Merit: 250
just tried and it tooked 5.5 minutes to delete all the 232386 transactions that was in my text file.

Great job, and thank you.

but after deleting it's showing the following:

"232386 elements deleted
Error: do not try to delete a non-existing transaction."

looks like it's raising an error on the command "exit(0)"


a GUI interface will be cool, as far I start earning some money with my project I will support this development.

regards

legendary
Activity: 1792
Merit: 1008
/dev/null
It's done, please try

To make it faster I don't catch exceptions so if you provide at least one transaction that isn't in your wallet it will crash without telling you which one
Maybe you prefer catching exceptions and avoiding all the deletions to be canceled just because one failed, just tell me what is better

I added the exit code 1 in case of failure




To everybody
Do you think pywallet would be more practical as a Qt app?
As I said earlier I'm wondering about recoding everything. It's far from sure but if I decide to I'd like to know how to make it more user-friendly.

full CLI (ie the same capabilites like the WUI) and a WUI should be doing fine.
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
It's done, please try

To make it faster I don't catch exceptions so if you provide at least one transaction that isn't in your wallet it will crash without telling you which one
Maybe you prefer catching exceptions and avoiding all the deletions to be canceled just because one failed, just tell me what is better

I added the exit code 1 in case of failure




To everybody
Do you think pywallet would be more practical as a Qt app?
As I said earlier I'm wondering about recoding everything. It's far from sure but if I decide to I'd like to know how to make it more user-friendly.
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
That's not possible, and that's what I meant by "the way Bitcoin stores txs": the key is "tx"+hash(tax). So you can apply what you proposed only if you know the hash.

Hmm, wait, I just get it, yes we have the hashes because you use the file to store them... I don't know why I thought you were using 'all'
There's some hope for speed improvement then!

Can this work on jailbroken iOS?
Yes absolutely. I made it work on iOS 5.
Look if there's a Python port for your iOS. If so that should work.
member
Activity: 104
Merit: 10
Can this work on jailbroken iOS?
sr. member
Activity: 293
Merit: 250
hi, I looked your new code and, as you said, maybe it won't change the performance to much.

I was thinking in something like this:

at line 1779
Quote
   for i in range(len(kd)):
      keydel=kd[ i ]
      if typedel == "tx" and keydel "all":
         
         db.delete(key)
         deleted_items+=1
      else:

         for (key, value) in db.items():
            .
            .
            .

Do you think it is possible?

Regards
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
I made a small improvement
I'm not really sure it would change a lot though. I don't think it might make it faster than now, because of the way Bitcoin stores the txs
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
I completely forgot to work on it, I'll do this in the following hours
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
Question: in the line of code "db.delete(key)", if the "key" don't exist, will it raise an error or it will pass without problem?
It looks like that it passes without problem. Actually the delete function searches in all the DB to find all the keys to delete, so my method is pretty dumb...
I made it at the beginning of my fork, which corresponds to the beginning of my learning of Python/serious programming. The more I look at the code I made, the more I find it ugly

My suggestion: when deleting transactions, instead of applying the modifications on the "key" to compare to the "keydel", why not just transforming the "keydel" to the "key" format and deleting it without iterating through all the wallet keys?
Yeah that's better that what's done currently, but as I wrote the delete function will take care of that even better
sr. member
Activity: 293
Merit: 250
Hi,

I downloaded your new pywallet, modified my program to generate a file with all my transactions ids and started pywallet with the multidelete option.

After 15 minutes running I decided to interrupt the execution of the pywallet and start investigating your python code to try to determine where the problem is (I never worked with python, but as a programmer I haven't problem undertanding it.) and I think I found it.

The problem is that my file has about 200k transactions and my wallet has at least 200k+70k(addresses) keys. Well, if for each transaction in the file, it will interact trough all the keys of the wallet (I didnt' see anywhere in the code where you break the iteratioon of the second "for" when finding the key), so the pywallet will need to do a total of 54 billions of iterations.

So I was thinking a bit and I have a question and a suggestion.

Question: in the line of code "db.delete(key)", if the "key" don't exist, will it raise an error or it will pass without problem?

My suggestion: when deleting transactions, instead of applying the modifications on the "key" to compare to the "keydel", why not just transforming the "keydel" to the "key" format and deleting it without iterating through all the wallet keys?

Regards.
legendary
Activity: 1176
Merit: 1233
May Bitcoin be touched by his Noodly Appendage
I just pushed the new version: no more '#' bugs in passphrases and you can use file for deletions

Format: 1st line=type ('tx' or 'key'), then 1line=1data to delete
Code: pywallet.py --multidelete file.txt [--wallet wallet.dat] [--datadir /bitcoin/directory]
Code: (file.txt)
tx
b0b0865e723101b5a720a79d805efd544c59fa2ceebffc724a12cd5fe683057f
07941322e6dd5b15b3bde0739648d49526e19ea78b8f4085e943fca473cbfdbf
etc...


by the way, I received the following error when making the dump (but it completed successfully):

2013-05-22 18:36:52-0300 [HTTPChannel,2,127.0.0.1] Wallet data not recognized: {'__type__': 'orderposnext', '__value__': '\xc1\x8b\x03\x00\x00\x00\x00\x00', '__key__': '\x0corderposnext'}
That just means that the 'orderposnext' entry in your wallet isn't recognized. That is because I personally don't know what it is and I doubt it's useful.
Pywallet will keep it inside your wallet when you import/delete/dump/whatever though, it just doesn't understand it
Pages:
Jump to: