|
Title: Block_Crawler .. search by address Post by: rikkejohn on October 15, 2014, 05:41:26 PM hello,
https://github.com/CallMeJake/BlockCrawler does anyone know if it is possible to put an rpc call to search by address in Block_Crawler? He put a block on lots of calls. If it is, I guess I would need to put something in block_crawler.php to reflect the new feature. Big ask of you, so apologies. bc_api.php forbids things, but I want to make it so transactions would show by address (more user friendly) ---- // Enable the wallet require_once ("bc_daemon.php"); // A check for no request if (!isset ($_REQUEST["request"]) || $_REQUEST["request"] == "") { bcapi_error (0, "No Request"); } // URL formatting is stripped from the request $request = urldecode ($_REQUEST["request"]); // The request is split in case anyone tries to send a multi-parameter // request to the API, any parameters after method will be ignored $request = explode (" ", $request); // 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"); } if ($request[0] == "keypoolrefill") { bcapi_error (4, "Method Not Permitted: keypoolrefill"); } if ($request[0] == "getpeerinfo") { bcapi_error (5, "Method Not Permitted: getpeerinfo"); } if ($request[0] == "listreceivedbyaddress") { bcapi_error (7, "Method Not Permitted: listreceivedbyaddress"); } // Check to stop remote users from killing the daemon via API if ($request[0] == "stop") { bcapi_error (6, "Method Not Permitted: stop"); } // The first word of the request is passed to the daemon as a // JSON-RPC method $query["method"] = $request[0]; // The data is fetched from the wallet $result = wallet_fetch ($query); // The wallet fetch routine has removed the JSON formatting for // internal use. The JSON format is re-applied for the the feed print_r (json_encode ($result)); // That's it. exit; // this function is here to generate repetitive error messages function bcapi_error ($code, $message) { $error["code"] = $code; $error["message"] = $message; print_r (json_encode($error)); exit; } ?> Title: Re: Block_Crawler .. search by address Post by: bitsta on November 10, 2014, 01:02:29 PM hello, https://github.com/CallMeJake/BlockCrawler does anyone know if it is possible to put an rpc call to search by address in Block_Crawler? He put a block on lots of calls. If it is, I guess I would need to put something in block_crawler.php to reflect the new feature. Big ask of you, so apologies. bc_api.php forbids things, but I want to make it so transactions would show by address (more user friendly) ---- // Enable the wallet require_once ("bc_daemon.php"); // A check for no request if (!isset ($_REQUEST["request"]) || $_REQUEST["request"] == "") { bcapi_error (0, "No Request"); } // URL formatting is stripped from the request $request = urldecode ($_REQUEST["request"]); // The request is split in case anyone tries to send a multi-parameter // request to the API, any parameters after method will be ignored $request = explode (" ", $request); // 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"); } if ($request[0] == "keypoolrefill") { bcapi_error (4, "Method Not Permitted: keypoolrefill"); } if ($request[0] == "getpeerinfo") { bcapi_error (5, "Method Not Permitted: getpeerinfo"); } if ($request[0] == "listreceivedbyaddress") { bcapi_error (7, "Method Not Permitted: listreceivedbyaddress"); } // Check to stop remote users from killing the daemon via API if ($request[0] == "stop") { bcapi_error (6, "Method Not Permitted: stop"); } // The first word of the request is passed to the daemon as a // JSON-RPC method $query["method"] = $request[0]; // The data is fetched from the wallet $result = wallet_fetch ($query); // The wallet fetch routine has removed the JSON formatting for // internal use. The JSON format is re-applied for the the feed print_r (json_encode ($result)); // That's it. exit; // this function is here to generate repetitive error messages function bcapi_error ($code, $message) { $error["code"] = $code; $error["message"] = $message; print_r (json_encode($error)); exit; } ?> hi rikkejohn! parsing through the chain to get all tx which are related to a public key like you wanna do needs a load of resources and s gonna take some time.... (a lil longer than syncing the chain) my tip: you gotta adapt the blockcrawler to use a database and save all blockinfos initially. So when you search for addresses (public-keys) it will be fast and won't affect your system resources like it would do with your initial method.. you can also drop me a PM if you have further questions. regards, bitsta |