Infura do not send signed transaction to the ETH mainnet network

Hi. my ether wallet test web3 version 1.2.11.
but do not sendSignedTrasaction function.

error message is ‘Error: Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!’

signed raw transaction body
0xf86e827b7d850df8475800830186a094d760dc10f70ade6dfa1b012b28eda7acceeee893871550f7dca70000801ba00b0b14b1d91ac80d538d21ea1aff477e0240942d394e26f5a27aeaa7e9ca2b33a066105a744a715608540d9a981e8da1b596e4ea0e5360fb496b499ed00160987c

can you help me?

thank you

Hi @hsson - welcome to the Infura community! If your transaction was not mined within 750 seconds, I would suggest increasing the gas price. If that doesn’t work, please let us know and we can help you figure out what’s going on.

@Leiya_Kenney

I am grateful for your kindness.

This is my code sample.
Still I haven’t found a workaround. What is wrong?


let Web3Ex = function() {
this.setProvider(new this.providers.HttpProvider(global.config.ETH.host));

this.GAS_PRICE = this.utils.toWei( '60', 'gwei');
this.GAS_LIMIT = 100000;
this.TRANSACTION_FEE_WEI = (this.GAS_LIMIT * this.GAS_PRICE);
this.last_nonce = 0;
global.config.ETH.web3ex = this;
return this;

};

sendfee: async function( resp, addr, callback ) {
let FeeWalletAddr= this.hdwallet.feewallet_addr;
let FeeWalletPK = this.hdwallet.feewallet_pk;
let sender = this;

    let web = new web3();
    global.config.ETH.web3ex = web.setProvider(new web.providers.HttpProvider(global.config.ETH.host));


    let remain = this.web3ex.eth.getBalance(addr);
    let remain_fee = this.web3ex.eth.getBalance(FeeWalletAddr);

    if(remain_fee <= 0 ) {
        resp.send(_make_error_ret({ value: remain_fee, msg: 'Fee Account balance is insufficiant. (current amount : ' + remain_fee + ')'}, 'error'));
        return
    }

    if(remain >= this.web3ex.TRANSACTION_FEE_WEI ) {
        return
    }

    let nonce = this.web3ex.eth.getTransactionCount(FeeWalletAddr, 'pending');
    let gasPrice = this.web3ex.GAS_PRICE;
    let gasLimit = this.web3ex.GAS_LIMIT;

    let amount = this.web3ex.TRANSACTION_FEE_WEI;

    const params = {
        nonce: this.web3ex.utils.toHex(nonce),
        // nonce: this.web3ex.utils.toHex(10),
        from: FeeWalletAddr.toLowerCase(),
        to: addr.toLowerCase(),
        value: this.web3ex.utils.toHex(amount),
        gasPrice: this.web3ex.utils.toHex(gasPrice),
        gasLimit: this.web3ex.utils.toHex(gasLimit),
    };

    const tx = new ethTx( params, {chain: 'mainnet', hardfork: 'constantinople'} );

    let pkBuffer = new Buffer(FeeWalletPK, "hex");
    tx.sign(pkBuffer);

    const serializedTx = tx.serialize();
    const txData = `0x${serializedTx.toString('hex')}`;
    params.tx = txData;
    console.log( params )

    // callback( { success: true, txid: txData, params: params} )
    this.web3ex.eth.sendSignedTransaction(txData)
    .on('transactionHash', (hash) => {
        console.log( hash )
    })
    .on('receipt', (txid) => {
        let result = { error: false, txid: txid, params: params }
        callback(result)
    })
    .on('error', (error) => {
        let result = { error: true, msg: error, params: params }
        callback( result )
    });
},

It looks like you have 60 gwei as your gas price. According to ethgasstation.info, recommended gas prices are much higher, closer to 90 gwei. I would suggest increasing your gas price closer to that and seeing if it gets mined.

@hsson, @Leiya_Kenney is saying right, its not good to hardcode the the Gas price, Web3 offer functions to fetch current network Gas price.

Please reffer to this link: https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#getgasprice