Post
Topic
Board Bitcoin Technical Support
Topic OP
adding rpc call for getbalance [account] or listtraanactions [account]
by
rikkejohn
on 04/11/2015, 02:06:57 UTC
Frustrated by this, I have been trying to make an updated pretty version of block_crawler with the added beauty of "search by address"

I can see where to add code in block_explorer.php

echo "      
\n";
      echo "         Enter a Block Index / Height
\n";
      echo "         
\n";
      echo "            \n";
      echo "            \n";
      echo "         
\n";
      echo "      
\n";
      echo "\n";
      echo "      
\n";
      echo "         Enter A Block Hash
\n";
      echo "         
\n";
      echo "            \n";
      echo "            \n";
      echo "         
\n";
      echo "      
\n";
      echo "\n";
      echo "      
\n";
      echo "         Enter A Transaction ID
\n";
      echo "         
\n";
      echo "            \n";
      echo "               \n";
      echo "         
\n";
      echo "      
\n";
      echo "\n";
      echo "   \n";
      echo "\n";
   }



It seems simply copy paste one of the 3 above, and alter it to a different rpc call (the rpc call does not work but visually it appears as if you could search by address).

echo "\n";
      echo "      
\n";
      echo "         Enter A Transaction ID Enter an Address
\n";
      echo "         
\n";
      echo "            transaction\" size=\"40\">\n";
      echo "               \n";
      echo "         
\n";
      echo "      
\n";



Then of course remove the ban in bc_api.php, either or both of these I guess

//////////////////////////////////////////////////////////////////////////////////////////////////
//   These are security checks to ensure that no one uses the API
//   to request balance data or mess up the wallet.
   if ($request[0] == "getbalance")
   {
      bcapi_error (1, "Method Not Permitted: getbalance");
   }   
   
   if ($request[0] == "listaccounts")
   {
      bcapi_error (2, "Method Not Permitted: listaccounts");
   }   
   
   if ($request[0] == "listtransactions")
   {
      bcapi_error (3, "Method Not Permitted: listtransactions");
   }   

/////////////////////////////////////////////////////////////////////////////////////////////////


Then I am left with making right call on my new add-on in block_crawler.php

echo "\n";
      echo "      
\n";
      echo "         Enter A Transaction ID Enter an Address
\n";
      echo "         
\n";
      echo "            transaction\" size=\"40\">\n";
      echo "               \n";
      echo "         
\n";
      echo "      
\n";


I guessed there would be a "getbalance" or "lisittransactions" in there but php is not my forte.

Then I thought maybe I needed a GET or just a REQUEST or something in there.

To some people this is easy, and I have scoured the web.

Anyone know where I am wrong?

Visually it is not tricky to make the old crawler look a bit nicer.

https://github.com/CallMeJake/BlockCrawler