blockcypher / php-client

PHP wrapper for the BlockCypher APIs
Apache License 2.0
51 stars 85 forks source link

Guzzle Eth curl wih error EOF #86

Closed hai-ru closed 4 years ago

hai-ru commented 5 years ago

resulted in a 400 Bad Request response: {"error": "Couldn't deserialize request: EOF"}

what wrong with my code? what I konwed EOF is (end of file)?

$data = (Object) [ "inputs"=>[ (Object) ["addresses" =>["add42af7dd58b27e1e6ca5c4fdc01214b52d382f"]] ], "outputs"=>[ (Object) ["addresses" => ["884bae20ee442a1d53a1d44b1067af42f896e541"]] ], "value"=>4200000000000000 ]; $client = new \GuzzleHttp\Client(); $res = $client->request('POST', 'https://api.blockcypher.com/v1/eth/main/txs/new?token='.BlockchyperController::$token, [$data]); $r = json_decode($res->getBody(), true); $r = json_decode( json_encode($r) ); return $r;

hai-ru commented 5 years ago

I already have to tried in terminal and this command in terminal server. :

curl -sd '{"inputs":[{"addresses": ["add42af7dd58b27e1e6ca5c4fdc01214b52d382f"]}],"outputs":[{"addresses": ["884bae20ee442a1d53a1d44b1067af42f896e541"], "value": 4200000000000000}]}' https://api.blockcypher.com/v1/eth/main/txs/new?token=MY_TOKEN

this is result error :

{"error": "Error retrieving input address add42af7dd58b27e1e6ca5c4fdc01214b52d382f: Failed to create state: missing trie node 057d4dab452bcc57ae77faf3aec0464afa0a041587a2e75eabb6bb32b1e23216 (path )."}

Other have some problem?

quentinlesceller commented 4 years ago

Outdated. Closing.