Author

Topic: Blockchain 'DDoS protection by CloudFlare' has messed a project up. Small reward (Read 1367 times)

full member
Activity: 151
Merit: 100
If you still need a quick fix you can switch to blockr.io as a temporary solution:

Code:
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.";
}
?>
newbie
Activity: 28
Merit: 0
...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.
newbie
Activity: 28
Merit: 0
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.
legendary
Activity: 1039
Merit: 1005
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
hero member
Activity: 524
Merit: 502
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?
Jump to: