blocktrail-sdk-php icon indicating copy to clipboard operation
blocktrail-sdk-php copied to clipboard

Getting transaction details

Open francescopepe opened this issue 6 years ago • 13 comments

Ehy there, I'm trying to get transaction details with method ->transaction() but I get UnknownEndpointSpecificError. In the method the client sends 2 different requests to the server, the first one with "?verbose=3" and the second one without it. The first one works but the second one obtains an error 403 with empty body. If I put usleep(100 * 1000) between the 2 requests everything works. It's clearly due to the server endpoint.

What is happening with the server APIs?

francescopepe avatar Apr 18 '18 11:04 francescopepe

It was moved to btc.com and now has TONS OF PROBLEMS.

n0n0n0n0 avatar Apr 19 '18 07:04 n0n0n0n0

Which version of the SDK are you using? Can you share a code snippet of where in your code you receive the 403?

lacksfish avatar May 07 '18 09:05 lacksfish

It seems it doesn't happen anymore. Probabily it was related to the migration to btc.com

francescopepe avatar May 07 '18 17:05 francescopepe

Ehy there! The same error came out again :(

I'm using the SDK 3.2.2. Here's the snippet:

$client = new BlocktrailSDK( "*******","*******"); $transaction = $client->transaction('<id>');

I get this error: image

The error is thrown in blocktrail\blocktrail-sdk\src\BlocktrailSDK.php

I added usleep() below and If I uncomment it no error comes out. image

here there is the response I get debugging it (of course without usleep): image

Thx

francescopepe avatar May 11 '18 09:05 francescopepe

Looks like ratelimit on server side

n0n0n0n0 avatar May 11 '18 09:05 n0n0n0n0

It seems so. Who should fix this? xD

francescopepe avatar May 11 '18 10:05 francescopepe

i'm waiting for fixes since update, so be patient :D

n0n0n0n0 avatar May 11 '18 11:05 n0n0n0n0

Any fixes yet? It's almost going to be 2 months.

RishabSwift avatar Jun 25 '18 23:06 RishabSwift

Nothing yet, I always need to put usleep for now.

francescopepe avatar Jun 26 '18 07:06 francescopepe

it works for me if public function transaction($txhash) { usleep(150 * 5000); $response = $this->dataClient->get($this->converter->getUrlForTransaction($txhash)); $res = $this->converter->convertTx($response->body(), null); usleep(150 * 5000); if ($this->converter instanceof BtccomConverter) { $res['raw'] = \json_decode($this->dataClient->get("tx/{$txhash}/raw")->body(), true)['data']; }

    return $res;
}

Glebsky avatar Jan 29 '19 18:01 Glebsky

it should work w/o usleep

n0n0n0n0 avatar Jan 29 '19 18:01 n0n0n0n0

since since2 not working for me

Glebsky avatar Jan 29 '19 21:01 Glebsky

You have to use usleep for now. It seems it's not fixed yet :(.

francescopepe avatar Jan 29 '19 21:01 francescopepe