Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: gweedo on February 07, 2013, 10:08:41 PM



Title: How can I create a cron job to prune out my wallet.dat file?
Post by: gweedo on February 07, 2013, 10:08:41 PM
My wallet.dat file is getting out of control how can I remove some addresses that were used in once off transactions and are now empty in php?

I know PHP has a berkley db tools to interact with it, so has anyone written a script for this?


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: deepceleron on February 08, 2013, 05:34:23 AM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

You shouldn't use a cron job for anything except Bitcoin RPC commands, accessing the data files when Bitcoin could be running is a bad thing.


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: gweedo on February 08, 2013, 05:43:02 AM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

Yes when you have over 200,000 bitcoin addresses, the bitcoind system starts getting slow, and I want to make it faster, this would be one way. I guess one day I will be taking to write a script to clear it out.


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: deepceleron on February 08, 2013, 06:02:08 AM
You'd have a hard time figuring out what addresses to remove. If you make a script to "remove addresses with 0 balance and all their transactions if they previously received coins", it may remove persistent receiving addresses like 1gweedo, etc, and such a task would only work correctly if the information in the wallet is actually correct. It would be much better to just dump the private keys of addresses you want to keep and send the balance to a new wallet.


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: gweedo on February 08, 2013, 06:15:07 AM
You'd have a hard time figuring out what addresses to remove. If you make a script to "remove addresses with 0 balance and all their transactions if they previously received coins", it may remove persistent receiving addresses like 1gweedo, etc, and such a task would only work correctly if the information in the wallet is actually correct. It would be much better to just dump the private keys of addresses you want to keep and send the balance to a new wallet.

well these addresses are for one off transactions, that people know about that. I also need to keep the accounts intact, I mean the worst case I can rebuild the accounts from the database. I guess it is back to testnet and see what works.


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: K1773R on February 08, 2013, 09:28:46 AM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

Yes when you have over 200,000 bitcoin addresses, the bitcoind system starts getting slow, and I want to make it faster, this would be one way. I guess one day I will be taking to write a script to clear it out.
did you once already had more than 1 million addresses?
still looking for a solution to manage 46M adresses.
sry for topic hijacking!


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: gweedo on February 08, 2013, 05:55:52 PM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

Yes when you have over 200,000 bitcoin addresses, the bitcoind system starts getting slow, and I want to make it faster, this would be one way. I guess one day I will be taking to write a script to clear it out.
did you once already had more than 1 million addresses?
still looking for a solution to manage 46M adresses.
sry for topic hijacking!

what?


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: K1773R on February 08, 2013, 07:04:26 PM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

Yes when you have over 200,000 bitcoin addresses, the bitcoind system starts getting slow, and I want to make it faster, this would be one way. I guess one day I will be taking to write a script to clear it out.
did you once already had more than 1 million addresses?
still looking for a solution to manage 46M adresses.
sry for topic hijacking!

what?
did you manage to have a working wallet.dat with atleast 1m addresses?


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: gweedo on February 08, 2013, 07:14:53 PM
Here's a start, as a bonus you get a language that's designed for data and analytics, not for making web pages.

https://github.com/gavinandresen/bitcointools

You've got 6GB of blockchain and you're worried about your wallet?

Yes when you have over 200,000 bitcoin addresses, the bitcoind system starts getting slow, and I want to make it faster, this would be one way. I guess one day I will be taking to write a script to clear it out.
did you once already had more than 1 million addresses?
still looking for a solution to manage 46M adresses.
sry for topic hijacking!

what?
did you manage to have a working wallet.dat with atleast 1m addresses?

nope that was someone else I think I remember that thread or something


Title: Re: How can I create a cron job to prune out my wallet.dat file?
Post by: davout on February 08, 2013, 07:59:34 PM
Import the keys you use into a blank wallet, you'll just need JSON-RPC