Search content
Sort by

Showing 17 of 17 results by kohlanta
Post
Topic
Board Development & Technical Discussion
Re: [5 btc bounty] http error from json-rpc in php
by
kohlanta
on 06/03/2013, 08:06:28 UTC
Try setting stream_context timeout to longer time, might help.

Or try cURL!

And try taking the http:// outta there.

And if it helps, here's an example on how to do it:
http://pastebin.com/YCYb0nPv

Let me know if any of these works.

curl solved all of my problems!  got the code I needed here: http://pastebin.com/vREuHVr5
where would you like the 5 btc sent?
Post
Topic
Board Development & Technical Discussion
Re: [5 btc bounty] http error from json-rpc in php
by
kohlanta
on 06/03/2013, 00:16:55 UTC
Try setting stream_context timeout to longer time, might help.

Or try cURL!

And try taking the http:// outta there.

And if it helps, here's an example on how to do it:
http://pastebin.com/YCYb0nPv

Let me know if any of these works.

Great ideas.  I'll play around with this and get back to you.
Post
Topic
Board Development & Technical Discussion
Topic OP
[solved] http error from json-rpc in php
by
kohlanta
on 05/03/2013, 21:56:25 UTC
I am using the json-rpc php library from the bitcoin wiki (http://jsonrpcphp.org/) to send commands to my bitcoind instance.  For the most part, it works as expected, but occasionally, when I use the sendtoaddress command, it will return one of the following errors:
Code:
fopen(http://...@localhost:8334/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
or
Code:
fopen(http://...@localhost:8334/): failed to open stream: HTTP request failed!
I noticed that the first one seems to happen only when there are insufficient funds in the wallet.  The second seems to happen at random.  When the first occurs, no coins are sent.  When the second occurs, the coins are almost always sent just as if there was no error even though it seems, based on the error, that the command never made it to bitcoind.  Occasionally though, the second error will be returned and the coins aren't sent.

This ambiguity is a problem for me.  What I would really like is for the jsonrpc client to return a meaningful error when it cannot process the request (such as insufficient funds) and to return the usual output (txid) when sendtoaddress is successfully executed.  I'm most comfortable in php, but am willing to learn other languages to achieve the same ends.  Ultimately I need to take addresses/amounts from a mysql database and construct transactions in my bitcoind server.

So, if anyone knows how to make this work in php or another language, perhaps perl or ruby or python and can walk me though it, and it works as described, 5 btc will be yours.
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 27/01/2013, 02:43:34 UTC
that part of the solution was actually on these forums:

https://bitcointalk.org/index.php?topic=43496.msg1065765#msg1065765
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 26/01/2013, 02:03:39 UTC
found and confirmed a hack that takes the import time down to 6 seconds per key.

psy please provide an address for your 10 btc reward for helping me find pywallet.
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 26/01/2013, 01:10:24 UTC
ok, pywallet works well to get the privkeys from wallet a, but unfortunately it is not designed to work with wallets with versions later than 32500, so when I try to import into a new wallet, the wallet gets corrupted.

So, I am very close, and I like this bulk import/export method because I can prune this giant wallet I have, but I am at a loss how to import the addresses.  The new client has the importprivkey function, but it takes 1-2 minutes per address to import.

Does anyone know a way to import privkeys into a wallet quickly?
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 25/01/2013, 01:31:44 UTC
I think pywallet plus some scripting will do the trick.  I'll check back in here when/if I get it to work and hit you guys up for payment addresses for the bounty.
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 25/01/2013, 00:25:22 UTC
ok, im looking into pywallet.
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 24/01/2013, 23:28:05 UTC
Start bitcoind with
Code:
bitcoind -detachdb=1
and after shut it down as usual.


Let me make sure I have this straight.  I start wallet a with bitcoind -detachdb=1, then stop it with bitcoind stop, then take the wallet.dat for wallet a and try to run the latest client with it?
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 24/01/2013, 23:15:55 UTC
On the options window there is a checkbox with that text. Check it. Close the client. It will take a few minutes to completely close while it detaches the DB's.

I'm using the headless client on a server, so there must be a flag or something.  I usually shutdown by doing
Code:
bitcoind stop
Post
Topic
Board Bitcoin Technical Support
Re: [10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 24/01/2013, 23:06:57 UTC
Try to detach databases on shutdown and then replace the wallet.
You have to do that when upgrading from 0.6.x to 0.7.x

Not sure if you should also copy the blockchain data, to make it think you are upgrading.

BTW, this is a wild guess Grin

a wild guess is better than none.  how do I "detach databases on shutdown"?
Post
Topic
Board Bitcoin Technical Support
Topic OP
[10 btc reward] protocol, wallet and client version mismatch errors
by
kohlanta
on 24/01/2013, 22:55:31 UTC
I am running 2 bitcoind instances on ubuntu 12.04.1 LTS server, wallet a and wallet b.  The version info from getinfo() for wallet a is
Code:
    "version" : 60300,
    "protocolversion" : 60001,
    "walletversion" : 60000,

The version info from getinfo() for wallet b is
Code:
    "version" : 70200,
    "protocolversion" : 60002,
    "walletversion" : 60000,

If I try to export wallet.dat from wallet a, put it in an empty .bitcoin directory and run it with the latest client version (7.0.2) I get the following error
Code:
Bitcoin: wallet.dat corrupt, salvage failed

Obviously wallet b will run with the latest client as seen in the version output.  This leads me to believe that the issue is the protocol version.  For some reason 60001 is incompatible with the latest client, and 60002 is.

So, here is the 10 btc question:
How can I get wallet a to run on the latest client?  It doesn't work for me to just transfer the balance to a new wallet, because I need the addresses in wallet a.  Also, wallet a has a bunch of addys.  It's around 1 gb in size.

First person to post a solution that I can get to work wins the 10 btc.  Thanks in advance!
Post
Topic
Board Beginners & Help
Re: can't restore wallet with over 40k btc in it. Please HELP!
by
kohlanta
on 19/08/2012, 23:07:53 UTC
Do you also own the other addresses that end in .031337 BTC?

what addresses are those?
Post
Topic
Board Beginners & Help
Re: can't restore wallet with over 40k btc in it. Please HELP!
by
kohlanta
on 19/08/2012, 22:56:56 UTC
success!  where would you like your coins sent fcmatt?
Post
Topic
Board Beginners & Help
Re: can't restore wallet with over 40k btc in it. Please HELP!
by
kohlanta
on 19/08/2012, 22:52:09 UTC
sorry it's a bit over my head.  I did:
Code:
bitcoind help
, but didn't see a command for rescanning.  can you please be more specific about what I should type in exactly?
Post
Topic
Board Beginners & Help
Re: can't restore wallet with over 40k btc in it. Please HELP!
by
kohlanta
on 19/08/2012, 22:45:12 UTC
that means I should stop the wallet, delete everything but wallet.dat and bitcoin.conf, and then start it up again, right?
Post
Topic
Board Beginners & Help
Topic OP
can't restore wallet with over 40k btc in it. Please HELP!
by
kohlanta
on 19/08/2012, 22:41:23 UTC
I own this address:

1MR6pXDZ6gpBVN8n61SqCNF61vU8ZzRu8Y

If you look it up in the blockchain, you can see that currently it contains 44,914.031337 BTC

When I try to restore the wallet containing this address in bitcoind on ubuntu, it tells me the balance is zero.  Here are some outputs:

Code:
$ bitcoind getinfo
{
    "version" : 60300,
    "protocolversion" : 60001,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 194708,
    "connections" : 6,
    "proxy" : "127.0.0.1:9050",
    "difficulty" : 2190865.97010286,
    "testnet" : false,
    "keypoololdest" : 1336772999,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : ""
}
Code:
$ bitcoind validateaddress 1MR6pXDZ6gpBVN8n61SqCNF61vU8ZzRu8Y
{
    "isvalid" : true,
    "address" : "1MR6pXDZ6gpBVN8n61SqCNF61vU8ZzRu8Y",
    "ismine" : true,
    "pubkey" : "02701400207b34aa2b8579625e6a9a3bfd6dc6e55cbe000dc693f46615a18d13a4",
    "iscompressed" : true,
    "account" : ""
}

As you can see, the address is present in the wallet, and the blockchain is up to date, yet the balance reads zero.  If anyone with the correct privileges feels it is appropriate, I would very much appreciate a repost of this in the main tech support section.  100 btc to anyone who can help me solve this problem.  Thanks!