Sentinel + Autotask + Relay Missing required key 'FunctionName' in params

Sentinel + Autotask + Relay

async function main(signer) {
    const contract = new ethers.Contract(ADDRESS, ABI, signer);
    *return await contract.get_My_address();*
}

error:"Missing required key 'FunctionName' in params";

but wnen i use this:

exports.handler = async function(event) {
  const provider = new DefenderRelayProvider(event, { speed: 'fast' });
  const web3 = new Web3(provider);
  // Use web3 instance for querying or sending txs, for example...
  *const [from] = await web3.eth.getAccounts();*
  const contract = new web3.eth.Contract(ABI, ADDRESS, { from });
  await contract.methods.ping().send();
}

error:"Missing required key 'FunctionName' in params"

I don't know how to use Sentinel + Autotask + Relay to send a smart contract rpc methord.please help me.

2 Likes

I had the same issue, it's probably the "event" is not holding the credentials of your relay. Go to autotask settings and make sure it is connected to the relayer you intend to connect.