0

I am trying to create a meta-transaction system using alchemy rpc. It is working 50% of the time.

If I try to mint for the first time it works, second time it doesn't, third time works again.

sometimes the error - timeout error, some time it gives a cors error, regardless, nor issue is found by try catch

This is my aws lambda code -

const Web3 = require('web3');
const Provider = require('@truffle/hdwallet-provider');
const provider = new Provider(process.env.OWNER_WALLET_PRIVATE_KEY , 'https-link of alchemy polygon mumbai key'); 
function starts -
    const web3 = new Web3(provider);
    const networkId = await web3.eth.net.getId();
    // const gasPrice = await web3.eth.getGasPrice()
    console.log(networkId," networkid")
  
    const myContract = new web3.eth.Contract(
        abi,
      contractAddress 
    );
console.log(pool.received_amount,pool.recipient,`Old data value: ${await myContract.methods.totalSupply().call()}`);
    const receipt = await myContract.methods.mint(received_amount,recipient).send({ from:owner_wallet_id,gasPrice: String(gasPrice), gasLimit:String(gasLimit) });

now I am really confused is it an coding issue or an aws issue or an alchemy issue. I have done this meta transaction system very first time. So I might not understand every aspects of it. Let me know if I have missed something to provide here.

Blockchain Kid
  • 315
  • 2
  • 9

0 Answers0