<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged getblock</title>
<link>https://www.multichain.com/qa/tag/getblock</link>
<description>Powered by Question2Answer</description>
<item>
<title>Height Of A Block</title>
<link>https://www.multichain.com/qa/10042/height-of-a-block</link>
<description>&lt;p&gt;My understanding is this, that, MultiChain, internally, manages collection of blocks, in the form of &quot;Merkle Tree&quot;.&lt;/p&gt;&lt;p&gt;In my chain, &quot;getblockchaininfo&quot; command depicts, &quot;&lt;strong&gt;blocks: 81&lt;/strong&gt;&quot;....i.e. my chain is having &quot;Total Block Count = 81&quot;.&lt;/p&gt;&lt;p&gt;Initially, I thought, 81th-block, shall be the leaf in my &quot;Merkle Tree&quot;.&lt;/p&gt;&lt;p&gt;but, I was wrong, as, from the output of commands&amp;nbsp;&quot;getblockhash &amp;amp; getblock&quot;.....I had seen that 81th-block is actually the root of the Merkle Tree.&lt;/p&gt;&lt;p&gt;How I reached to that conclusion ?&lt;/p&gt;&lt;p&gt;Well, &amp;nbsp;because total confirmations in the output of &quot;getblock&quot;&amp;nbsp;...was ONLY ONE.&lt;/p&gt;&lt;p&gt;So, the analogy I have build from aforesaid observations is as follows:&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;Any &quot;New Block&quot;, in the MultiChain, shall increase the &quot;Height&quot; of existing blocks, BY ONE.&lt;/span&gt;&amp;nbsp;&lt;/h3&gt;&lt;p&gt;Am I building correct analogy&amp;nbsp;?&lt;/p&gt;&lt;p&gt;Following was the output of getblockhash &amp;amp; getblock for the reference:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;uselesschain1: &lt;strong&gt;getblockhash 81&lt;/strong&gt;&lt;br&gt;{&quot;method&quot;:&quot;getblockhash&quot;,&quot;params&quot;:[81],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;uselesschain1&quot;}&lt;/p&gt;&lt;p&gt;&lt;strong&gt;0038578b101797832a59e84d2a7847015e04810834904d2f777548669b3ea57f&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;uselesschain1: &lt;strong&gt;getblock 0038578b101797832a59e84d2a7847015e04810834904d2f777548669b3ea57f&lt;/strong&gt;&lt;br&gt;{&quot;method&quot;:&quot;getblock&quot;,&quot;params&quot;:[&quot;0038578b101797832a59e84d2a7847015e04810834904d2f777548669b3ea57f&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;uselesschain1&quot;}&lt;/p&gt;&lt;p&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;hash&quot; : &quot;0038578b101797832a59e84d2a7847015e04810834904d2f777548669b3ea57f&quot;,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;miner&quot; : &quot;1JZzMjVbs1cgb4fDKRSRAHXwj8dVERPJFQjJu6&quot;,&lt;br&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &quot;confirmations&quot; : 1,&lt;/strong&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;size&quot; : 266,&lt;br&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &quot;height&quot; : 81,&lt;/strong&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;version&quot; : 3,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;merkleroot&quot; : &quot;8eeeda5a3fc176fa795041ee820fef2ca173fc8e50d1dd7d6a17022603a44241&quot;,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;tx&quot; : [&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;8eeeda5a3fc176fa795041ee820fef2ca173fc8e50d1dd7d6a17022603a44241&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; ],&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;time&quot; : 1529827770,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;nonce&quot; : 57,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;bits&quot; : &quot;2000ffff&quot;,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;difficulty&quot; : 0.00000006,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;chainwork&quot; : &quot;0000000000000000000000000000000000000000000000000000000000005200&quot;,&lt;br&gt;&amp;nbsp; &amp;nbsp; &quot;previousblockhash&quot; : &quot;00091aa81e8e8e106ca2a83b58b86534c1e9c219d986f10f8652a702810c8b7d&quot;&lt;br&gt;}&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/10042/height-of-a-block</guid>
<pubDate>Sun, 24 Jun 2018 09:04:18 +0000</pubDate>
</item>
<item>
<title>Behaviour of getblock</title>
<link>https://www.multichain.com/qa/9155/behaviour-of-getblock</link>
<description>&lt;p&gt;Hi, I was doing a bit of testing with getblock and noticed some&amp;nbsp;unexpected behaviour&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;&lt;span style=&quot;font-family:courier new,courier,monospace&quot;&gt;When I give the request a blockId way beyond the current block height of the chain I'll get an error -&amp;nbsp;Block height out of range - All good&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;&lt;span style=&quot;font-family:courier new,courier,monospace&quot;&gt;But when I give the request some random strings, for example ''a&quot;, &quot;ab&quot;, &quot;fab&quot;&amp;nbsp; all return the first block 0 in the chain.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;&lt;span style=&quot;font-family:courier new,courier,monospace&quot;&gt;Passing &quot;1234fab&quot; returns block 1234 - I can see what's it's doing there,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;&lt;span style=&quot;font-family:courier new,courier,monospace&quot;&gt;and passing a transaction Hash returns &quot;Block not found&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I was testing this to understand what error handling to do on our end, and feel the behaviour for passing an incorrect block-id is a bit inconsistent.&amp;nbsp; It would be much cleaner to just return a block not found response in all these error conditions.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What are your thoughts?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Cheers&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Marty&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/9155/behaviour-of-getblock</guid>
<pubDate>Fri, 30 Mar 2018 10:47:43 +0000</pubDate>
</item>
<item>
<title>Setup a mining pool for a blockchain created using MultiChain</title>
<link>https://www.multichain.com/qa/7687/setup-mining-pool-for-blockchain-created-using-multichain</link>
<description>Hello,&lt;br /&gt;
I am working on my college project and multichian is perfect for my project. I need to implement a mining pool for my chain which i created using multichian . I came upon some problems which are referenced in this question : &lt;a href=&quot;https://www.multichain.com/qa/6583/how-does-install-mining-pool-in-multichain?show=6583#q6583&quot; rel=&quot;nofollow&quot;&gt;https://www.multichain.com/qa/6583/how-does-install-mining-pool-in-multichain?show=6583#q6583&lt;/a&gt;&lt;br /&gt;
As you are aware that multichain doesn't provide the &amp;quot;getblockteplate&amp;quot; json-rpc so i searched on the web and multichian website and found that multichain's &amp;quot;getblock&amp;quot; is almost similar to &amp;quot;getblocktemplate&amp;quot;.&lt;br /&gt;
I am using NOMP ( &lt;a href=&quot;https://github.com/zone117x/node-open-mining-portal&quot; rel=&quot;nofollow&quot;&gt;https://github.com/zone117x/node-open-mining-portal&lt;/a&gt; ) to setup the pool for testing. I changed the RPC call inside the code of NOMP to make it work with &amp;quot;getblock&amp;quot;. It calls the &amp;quot;getblock&amp;quot; but returns this error : error: { code: -1, message: 'value is type obj, expected str' }. In the developers section on the website, it is written to report any code -1 errors to the devs.&lt;br /&gt;
&lt;br /&gt;
This is my RPC call &amp;nbsp;: _this.daemon.cmd('getblock', [ { &amp;quot;params&amp;quot; : [blockNumber, &amp;quot;4&amp;quot;] } ], function(results){ console.log(results); });&lt;br /&gt;
&lt;br /&gt;
Also there is no &amp;quot;coinbaseaux&amp;quot; in the &amp;quot;getblock&amp;quot; rpc and pools require that too.&lt;br /&gt;
If you can help me out, I'll be really thankful :)&lt;br /&gt;
Thanks</description>
<guid isPermaLink="true">https://www.multichain.com/qa/7687/setup-mining-pool-for-blockchain-created-using-multichain</guid>
<pubDate>Wed, 29 Nov 2017 07:53:46 +0000</pubDate>
</item>
<item>
<title>getblock info for calculating balances</title>
<link>https://www.multichain.com/qa/7261/getblock-info-for-calculating-balances</link>
<description>Looking at the data for getblock, we can store that data in our database and update balances. eg:&lt;br /&gt;
&lt;br /&gt;
For asset transfers&lt;br /&gt;
&lt;br /&gt;
vout n=0 : &amp;nbsp;amount 30 of an asset with type transfer, we can add that to an address&lt;br /&gt;
vout n=1 (or next number with different address) : amount of 30 (from above n=0) deduct from the address listed there&lt;br /&gt;
&lt;br /&gt;
For native currency transfers, not quite sure how best to calculate it, as the tx fee varies.&lt;br /&gt;
&lt;br /&gt;
Does anyone have advice on how to calculate from getblock and transaction data?</description>
<guid isPermaLink="true">https://www.multichain.com/qa/7261/getblock-info-for-calculating-balances</guid>
<pubDate>Mon, 23 Oct 2017 10:45:08 +0000</pubDate>
</item>
<item>
<title>getblock verbose</title>
<link>https://www.multichain.com/qa/7237/getblock-verbose</link>
<description>I am using getblock (verbose=4), and i don't seem to be getting any extra information on the tx eg:&lt;br /&gt;
&lt;br /&gt;
getblock &amp;quot;71&amp;quot;,(verbose=4)&lt;br /&gt;
{&amp;quot;method&amp;quot;:&amp;quot;getblock&amp;quot;,&amp;quot;params&amp;quot;:[&amp;quot;71,(verbose=4)&amp;quot;],&amp;quot;id&amp;quot;:1,&amp;quot;chain_name&amp;quot;:&amp;quot;php&amp;quot;}&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;hash&amp;quot; : &amp;quot;00a31537cdba41ad687e9f14111313c56734d11f80458e2440f3410341251089&amp;quot;,&lt;br /&gt;
&amp;quot;miner&amp;quot; : &amp;quot;16YU9NqCaugEEXfdB65o65wM6eZnerERVp&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;quot;confirmations&amp;quot; : 1,&lt;br /&gt;
&amp;nbsp;&amp;quot;size&amp;quot; : 551,&lt;br /&gt;
&amp;quot;height&amp;quot; : 71,&lt;br /&gt;
&amp;quot;version&amp;quot; : 3,&lt;br /&gt;
&amp;nbsp;&amp;quot;merkleroot&amp;quot; : &amp;quot;d05b1f510319c9e764c84edf65743221b6bc8689d6a2ba971d4870afac9a40fb&amp;quot;,&lt;br /&gt;
&amp;quot;tx&amp;quot; : [&lt;br /&gt;
&amp;quot;c7d95137bae38844529a211d35bd09071e18166f347d4077914ed639e6dbd73a&amp;quot;,&lt;br /&gt;
&amp;quot;af31d8ae32fc6085e0c8ed1287160ec95268f8f596454dc23dec63c45ea4b1de&amp;quot;&lt;br /&gt;
],&lt;br /&gt;
&amp;quot;time&amp;quot; : 1508514758,&lt;br /&gt;
&amp;quot;nonce&amp;quot; : 169,&lt;br /&gt;
&amp;quot;bits&amp;quot; : &amp;quot;2000ffff&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;quot;difficulty&amp;quot; : 0.00000006,&lt;br /&gt;
&amp;quot;chainwork&amp;quot; : &amp;quot;0000000000000000000000000000000000000000000000000000000000004800&amp;quot;,&lt;br /&gt;
&amp;quot;previousblockhash&amp;quot; : &amp;quot;009eff6b475a45accdd570e052036eaae40b904b76a1bc5779660183e7c0e55d&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
you can see this online at &lt;a href=&quot;http://php.tagcash.com/Philippine%20Pesos%20(PHP)/tx/af31d8ae32fc6085e0c8ed1287160ec95268f8f596454dc23dec63c45ea4b1de&quot; rel=&quot;nofollow&quot;&gt;http://php.tagcash.com/Philippine%20Pesos%20(PHP)/tx/af31d8ae32fc6085e0c8ed1287160ec95268f8f596454dc23dec63c45ea4b1de&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I can get the data I need by doing a getrawtransaction followed by a decoderawtransaction, but just wanted to make sure this was they best way to do it before moving on.&lt;br /&gt;
&lt;br /&gt;
I thought I would be getting the data i need for the transaction there - do I have to take other steps to get to the data i need?</description>
<guid isPermaLink="true">https://www.multichain.com/qa/7237/getblock-verbose</guid>
<pubDate>Fri, 20 Oct 2017 19:09:34 +0000</pubDate>
</item>
<item>
<title>getblock expects bolean. please look at this error when I execute getblock with verbose = 4</title>
<link>https://www.multichain.com/qa/6453/getblock-expects-bolean-please-error-execute-getblock-verbose</link>
<description>&lt;p&gt;getblock('0000010b36c727389e9ef920b7b4a6f327d95f7a33caf8d9c2091b762fef7d2a',4)&lt;/p&gt;&lt;p&gt;response i get:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:times; font-size:medium&quot;&gt;status=&quot;500&quot; and error=&quot;value is type int, expected bool&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;and if i use TRUE or FALSE works fine.&amp;nbsp;&lt;/p&gt;&lt;p&gt;so either documentation is misleading or this is a bug.&lt;/p&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;getblock&lt;/td&gt;&lt;td&gt;hash|height&lt;br&gt;(verbose=1)&lt;/td&gt;&lt;td&gt;Returns information about the block with&amp;nbsp;hash&amp;nbsp;(retrievable from&amp;nbsp;getblockhash) or at the given&amp;nbsp;height&amp;nbsp;in the active chain. Set&amp;nbsp;verbose&amp;nbsp;to&amp;nbsp;0&amp;nbsp;or&amp;nbsp;false&amp;nbsp;for the block in raw hexadecimal form. Set to&amp;nbsp;1&amp;nbsp;or&amp;nbsp;true&amp;nbsp;for a block summary including the&amp;nbsp;miner&amp;nbsp;address and a list of txids. Set to&amp;nbsp;2&amp;nbsp;to&amp;nbsp;3&amp;nbsp;to include more information about each transaction and its raw hexadecimal. Set to&amp;nbsp;4&amp;nbsp;to include a full description of each transaction, formatted like the output of&amp;nbsp;decoderawtransaction.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/6453/getblock-expects-bolean-please-error-execute-getblock-verbose</guid>
<pubDate>Wed, 30 Aug 2017 14:37:30 +0000</pubDate>
</item>
<item>
<title>How does block/transaction confirmations work?</title>
<link>https://www.multichain.com/qa/6064/how-does-block-transaction-confirmations-work</link>
<description>&lt;p&gt;&lt;span style=&quot;font-family:courier new,courier,monospace&quot;&gt;multichain-cli chain getblock {blocknumber} 4&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;span style=&quot;font-family:lucida sans unicode,lucida grande,sans-serif&quot;&gt;{&quot;method&quot;:&quot;getblock&quot;,&quot;params&quot;:[&quot;{blocknumber}&quot;,4],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;chain&quot;}&lt;br&gt;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;hash&quot; : &quot;{blockaddress}&quot;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;miner&quot; : &quot;{mineraddress}&quot;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;confirmations&quot; : 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:lucida sans unicode,lucida grande,sans-serif&quot;&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;Based on this example, how does block/transaction confirmations work? &amp;nbsp;This block in question has only one transaction in it &amp;nbsp;- the miner transaction.&lt;br&gt;&lt;br&gt;I am getting for example a block with 20 transactions but each transaction is confirmed only twice or once and on others its 21 or 25 times confirmed.&lt;br&gt;&lt;br&gt;Not quite clear on how this works or is being determined.&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/6064/how-does-block-transaction-confirmations-work</guid>
<pubDate>Fri, 04 Aug 2017 09:36:08 +0000</pubDate>
</item>
<item>
<title>getblockhash returning 500 error : where is rpc request logs location?</title>
<link>https://www.multichain.com/qa/1671/getblockhash-returning-error-where-request-logs-location</link>
<description>&lt;p&gt;Where can i find&amp;nbsp; the rpc server logs.&lt;/p&gt;&lt;p&gt;I am writing a perl script to interact with a private blockchain and I am able to make few api calls but server is throwing &quot;500 Internal Server Error&quot; when I invoke getblockhash&lt;/p&gt;&lt;p&gt;Code snippet:&lt;br&gt;&lt;span style=&quot;color:#0000FF&quot;&gt;&amp;nbsp; sub getBlockHash {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $class=shift;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my $height=shift;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &quot;height inside fn: $height \n&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;color:#FF0000&quot;&gt;# I am getting the number correctly here&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color:#0000FF&quot;&gt;.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my $obj = {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method&amp;nbsp; =&amp;gt; 'getblockhash',&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color:#FF0000&quot;&gt;# similar function with getinfo or getblockcount without&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:#0000FF&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params&amp;nbsp; =&amp;gt; [$height],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color:#FF0000&quot;&gt;# passing params works well. &lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:#0000FF&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:#FF0000&quot;&gt; # tried sendwithmetadata , it works with params&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:#0000FF&quot;&gt;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my $res = $client-&amp;gt;call( $uri, $obj );&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($res){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &quot;Got res\n&quot;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($res-&amp;gt;is_error) { print &quot;Error : &quot;, $res-&amp;gt;error_message; return &quot;ERROR&quot;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my $data = Dumper ($res-&amp;gt;result);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $bcount = substr ($data,length('$VAR1 = '),length($data));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $bcount =~ s/\W//g;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&amp;nbsp; $bcount;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &quot;no res\n&quot;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print $client-&amp;gt;status_line;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;ERROR&quot;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp; }&lt;br&gt;----------------- RESULT -----------------------&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:#FF0000&quot;&gt;height inside fn: 15545&lt;br&gt;no res&lt;br&gt;500 Internal Server ErrorHash = ERROR&lt;/span&gt;&lt;/p&gt;&lt;p&gt;---------------------&lt;br&gt;Where can I find the logs to debug these kind of errors? is getblockhash not recognised?&lt;br&gt;&lt;br&gt;I want to traverse the block starting from 0 to total number of blocks , using getblock api after I get the hash from getblockhash &amp;lt;height&amp;gt; call.&lt;br&gt;is there any other&amp;nbsp; method to do this? I am interested to fetch transactions which has metadata attached to them.&lt;br&gt;&lt;br&gt;any help much appreciated.&lt;br&gt;thanks&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/1671/getblockhash-returning-error-where-request-logs-location</guid>
<pubDate>Thu, 28 Apr 2016 10:36:54 +0000</pubDate>
</item>
</channel>
</rss>