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(
        ) //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);


    let serializedTx = '0x' + tx.serialize().toString('hex');

    this.web3.eth.sendRawTransaction(serializedTx, (err, hash) => {
        if(err) {
            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?

Transaction object from web3.eth.getTransaction(); enter image description here

1 Answer 1


are nonce and contractParams.address both hex-encoded with a leading 0x prefix?

ps) it would be a good idea to pad all hex-encoded values with a leading 0 if the length is odd.. to ensure that the length is even. (ie: 0x1 should be entered as 0x01, etc)

pps) txParams.from can be removed.. it has no meaning

  • Thanks for comment. Problem solved, but was at anotyher sing. Don't know why, but web3js couldn't get public key to fill from field. I have reinstalled lib and it works now.
    – Baga
    Commented Jul 24, 2017 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.