Bitcoin Forum
May 24, 2024, 08:07:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Blockchain 'DDoS protection by CloudFlare' has messed a project up. Small reward  (Read 1352 times)
ABitBack (OP)
Hero Member
*****
Offline Offline

Activity: 524
Merit: 502



View Profile
April 17, 2014, 11:19:49 AM
 #1

So I have this code

Code:
try{	
$data = file_get_contents("http://blockchain.info/q/addressbalance/".FAUCETADDRESS."");
}catch(Exception $e){
echo "Error getting the balance.";
}

The problem is my script cannot get the result in real time now due to cloudflare and I get this error:

Warning: file_get_contents(http://blockchain.info/q/addressbalance/*ADDRESS*): failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable

Any work around would be very much appreciated. $5 in bitcoin/pp for a quick fix.

Upon reading, this will only be temporary? just until the ddosing has stopped?

OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1004



View Profile
April 17, 2014, 11:23:43 AM
 #2

You're probably fetching the info too often.
You could either cache the result of each call and do the actual call at most once per minute, or you could (preferrably IMO) run your own bitcoin node that you can query as often as you like.

I suppose you're trying to query the balances of addresses that you don't own, right?

Onkel Paul

enriquez
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
April 17, 2014, 05:26:52 PM
 #3

I have the same issue. My app stopped working as well.

We're not doing anything wrong, they changed something on their end. I'm trying to get in contact with them, but haven't heard back yet.
enriquez
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
April 17, 2014, 05:34:45 PM
 #4

...and it's back.

It's probably a good time to investigate other options or fallbacks. I've been keeping an eye on https://helloblock.io. I would run my own node, but I wanted to keep my costs down.
1000000
Full Member
***
Offline Offline

Activity: 151
Merit: 100



View Profile
April 17, 2014, 06:23:23 PM
 #5

If you still need a quick fix you can switch to blockr.io as a temporary solution:

Code:
<?php
try{
$stream json_decode(file_get_contents("http://btc.blockr.io/api/v1/address/balance/".FAUCETADDRESS.""),true);
$data $stream['data']['balance']*100000000;  
}catch(Exception $e){
echo "Error getting the balance.";
}
?>

“The Times 03/Jan/2009 Chancellor on brink of second bailout for banks”
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!