Author

Topic: getblock method depreciated in 0.3.19? (Read 3821 times)

administrator
Activity: 5222
Merit: 13032
February 22, 2011, 08:13:41 AM
#7
Just find the location in the code and patch it manually. The ordering of lines in that section doesn't matter. Getblock (and other RPC patches) doesn't usually apply correctly, but it works on pretty much any version.
newbie
Activity: 25
Merit: 0
February 22, 2011, 05:28:10 AM
#6
Hi Themyos,

I just cloned a fresh copy of the bitcoin development tree from github, and then tried to patch in the rpc.cpp getblock patch

I got two successful hunk applications and one fail

--- rpc.cpp
+++ rpc.cpp
@@ -1926,6 +2040,8 @@
         if (strMethod == "sendfrom"               && n > 2) ConvertTo(params[2]);
         if (strMethod == "sendfrom"               && n > 3) ConvertTo(params[3]);
         if (strMethod == "listtransactions"       && n > 1) ConvertTo(params[1]);
+       if (strMethod == "getblock"               && n > 0) ConvertTo(params[0]);
+       if (strMethod == "getblockbycount"        && n > 0) ConvertTo(params[0]);

         // Execute
         Object reply = CallRPC(strMethod, params);

I tried patching 0.3.19 and got three fails.

Should I try patching 0.3.20? I'm downloading it now.

Cheers,
Jin
newbie
Activity: 25
Merit: 0
February 22, 2011, 04:56:21 AM
#5
Thanks!
administrator
Activity: 5222
Merit: 13032
February 22, 2011, 03:00:21 AM
#4
bitcoind -printblock prints to debug.log.

The getblockbycount patch is here:
http://yyz.us/bitcoin/patch.bitcoin-getblock
newbie
Activity: 25
Merit: 0
February 22, 2011, 02:38:24 AM
#3
Ah thanks. getblock in 0.3.19 is also coming up with an error.

the -printblock flag seems to work, but I don't have my gui turned on on my server so I can't see the output.


$ bitcoind getblock
error: {"code":-32601,"message":"Method not found"}


$ bitcoin -printblock
Error: Unable to initialize GTK+, is DISPLAY set properly?


$ bitcoin getblock
error: {"code":-32601,"message":"Method not found"}


is there another way to do it?
administrator
Activity: 5222
Merit: 13032
February 22, 2011, 12:33:38 AM
#2
getblockbycount has never existed in the official code. The wiki page is in error.
newbie
Activity: 25
Merit: 0
February 21, 2011, 11:51:53 PM
#1
Hi All,

I've been trying to use the getblockbycount api call to analyse the block chain

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

but I'm getting


$ bitcoind getblockbycount 109620
error: {"code":-32601,"message":"Method not found"}


any ideas why?

Cheers
nos
Jump to: