It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
foreach ($tx["vout"] as $tx_out)
{
$scripttype=$tx_out["scriptPubKey"]["type"];
switch ($scripttype)
{
case "pubkeyhash":
case "pubkey":
case "scripthash":
$mysqli->query("insert into outputs (block_num, block_hash, transaction_hash, sequence, address, balance) values (".$i.", '".$block["hash"]."', '".$txid."', ".$tx_out["n"].", '".$tx_out["scriptPubKey"]["addresses"][0]."', ".$tx_out["value"].")");
break;
case "scriptPubKey":
case "multisig":
$mysqli->query("insert into outputs (block_num, block_hash, transaction_hash, sequence, address, balance) values (".$i.", '".$block["hash"]."', '".$txid."', ".$tx_out["n"].", '** ".$scripttype." **', ".$tx_out["value"].")");
break;
case "nonstandard":
$mysqli->query("insert into outputs (block_num, block_hash, transaction_hash, sequence, address, balance) values (".$i.", '".$block["hash"]."', '".$txid."', ".$tx_out["n"].", '** ".$scripttype." **', ".$tx_out["value"].")");
default:
throw new Exception("don't know how to handle ".$scripttype." scripts in transaction ".$txid);
continue;
PHP Fatal error: Uncaught exception 'Exception' with message 'don't know how to handle nonstandard scripts in transaction 521fdd0f3bd589de759af578cf6bfc595854ba578eb709fe7f7f42d43b2c7960' in /home/build/nrsbala/update-database.php:91
Stack trace:
#0 {main}
thrown in /home/build/nrsbala/update-database.php on line 91
Array
(
[hex] => 010000008b636053010000000000000000000000000000000000000000000000000000000000000000ffffffff0c02a25a0105062f503253482fffffffff010000000000000000000000000000
[txid] => 521fdd0f3bd589de759af578cf6bfc595854ba578eb709fe7f7f42d43b2c7960
[version] => 1
[time] => 1398825867
[locktime] => 0
[vin] => Array
(
[0] => Array
(
[coinbase] => 02a25a0105062f503253482f
[sequence] => 4294967295
)
)
[vout] => Array
(
[0] => Array
(
[value] => 0
[n] => 0
[scriptPubKey] => Array
(
[asm] =>
[hex] =>
[type] => nonstandard
)
)
)
[blockhash] => 0fcc89dcc850cbf7d7149b8f1534b2464a7902991d19a9367dae0751b3a25be0
[confirmations] => 46496
[blocktime] => 1398825867
)
require_once "jsonRPCClient.php";
$mysqli=new mysqli("" , "" , "" , "" );
if ($mysqli->connect_errno)
throw new Exception("database connection error");
$r=$mysqli->query("select max(block_num) from outputs", MYSQLI_USE_RESULT);
$w=$r->fetch_assoc();
$last_block_in_db=$w["max(block_num)"]+0;
$r->close();
$btc=new jsonRPCClient("http://: );@localhost:8332"
$blocknum=$btc->getblockcount();
if ($last_block_in_db<$blocknum)
{
for ($i=$last_block_in_db+1; $i<=$blocknum; $i++)
{
echo "block ".$i."\n";
$block=$btc->getblock($btc->getblockhash($i));
foreach ($block["tx"] as $txid)
{
$tx=$btc->decoderawtransaction($btc->getrawtransaction($txid));
foreach ($tx["vin"] as $tx_in)
{
if (!array_key_exists("coinbase", $tx_in))
$mysqli->query("delete from outputs where transaction_hash='".$tx_in["txid"]."' and sequence=".$tx_in["vout"].";");
}
foreach ($tx["vout"] as $tx_out)
{
$scripttype=$tx_out["scriptPubKey"]["type"];
switch ($scripttype)
{
case "pubkeyhash":
case "pubkey":
case "scripthash":
$mysqli->query("insert into outputs (block_num, block_hash, transaction_hash, sequence, address, balance) values (".$i.", '".$block["hash"]."', '".$txid."', ".$tx_out["n"].", '".$tx_out["scriptPubKey"]["addresses"][0]."', ".$tx_out["value"].")");
break;
case "nonstandard":
case "multisig":
$mysqli->query("insert into outputs (block_num, block_hash, transaction_hash, sequence, address, balance) values (".$i.", '".$block["hash"]."', '".$txid."', ".$tx_out["n"].", '** ".$scripttype." **', ".$tx_out["value"].")");
break;
default:
throw new Exception("don't know how to handle ".$scripttype." scripts in transaction ".$txid);
break;
}
}
}
}
}
else
echo "database is current\n";
?>
CREATE TABLE `outputs` (
`block_num` int(11) NOT NULL,
`block_hash` char(64) NOT NULL,
`transaction_hash` char(64) NOT NULL,
`sequence` int(11) NOT NULL,
`address` varchar(34) NOT NULL,
`balance` decimal(16,8) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1