web3p / web3.php

A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.
MIT License
1.14k stars 540 forks source link

Contract Transaction never hits chain #44

Open GeRikz opened 6 years ago

GeRikz commented 6 years ago

Im trying to do token transfer, the code gives back me tx, parity dose not show any errors but transactions never gets mined any advice how to fix this ?

sc0Vu commented 6 years ago

Hi GeRikz, I've got these question about your environment:

  1. Was your account on the node or on your computer (wallet json file)? Because you cannot sign a transaction by this library now, which means you have to use account on node (default is coinbase), and still working hard on that, you can see here: https://github.com/web3p.

  2. Did you try getTransactionReceipt or any other api to get the transaction information?

rgjvanriel commented 6 years ago

I am currently having the same issue running a local truffle development chain. I can create contracts and call "view" functions but when I call a payable function I don't get an error and the changes never hit the chain.

This also happens when creating a new sub contract in a payable function. The functions return the address of the new contract but when I check the address using remix it doesn't exist.

I am using the default accounts that the truffle development environment provides.

RonRademaker commented 6 years ago

Is there a solution for this? I'm testing with the truffle development chain as well and expected that console to use an unlocked account to handle the signatures, but I get back a 0x0000000000000000000000000000000000000000000000000000000000000000 transaction id and the transaction is never found on the chain. No errors anywhere.

RonRademaker commented 6 years ago

Found a solution, looks like using send instead of call and passing a from in that call works (of course when the account is unlocked), hello world example:

$contract->at($contractAddress)->send('hello', 'world', ['from' => $unlockedAccountAddress], $callback);
tomcyr commented 4 years ago

I have the same problem but "send" method also works for me. Thank you @RonRademaker