I am developing a light wallet for a private network. I use ethereumjs-accounts for storing accounts locally and ethereum-tx for signing transactions. I have deployed custom token-contract. Here is my txParams
object:
nonce: nonce, //transaction count
gasPrice: "0x0", //private network do not need gas
gas: "0x0",
from: account, //sender account
to: contractParams.address,
value: "0x0",
data: this.contractInstance.sendFunds.getData(
'0x07a204163f78bf9293c996f8c6d98a058a324b2d',
'0xd9f0443219296744c91929fc0818b3e42d90b2eb',
2,
''
) //calling functions to send tokens from 1 account to another
Than I sign the transaction and send it to the chain:
let tx = new EthereumTx(txParams);
tx.sign(privateKey);
let serializedTx = '0x' + tx.serialize().toString('hex');
this.web3.eth.sendRawTransaction(serializedTx, (err, hash) => {
if(err) {
console.info(err);
}else{
console.log('Transaction hash: ', hash);
}
});
After sending the transaction I receive tx hash but nothing more happens. I can get transaction by hash for 30-40 seconds after sending and then the transaction disappears, and if I try to get it after 40 seconds - I get null
.
Any ideas what can cause this problem and how to debug it?