Hello,
When my server was on Moralis, I could run smart contract write function with private key using Moralis.Web3 in cloud codes. However, that codes did not work on self hosted. I found your document about âHow to run contract functionsâ. But, I couldnât find any information about for ârun the write functionâ.
Can you help me?
Thanks
Note: How to run contract functions link
My old codes;
const web3 = new Parse.Web3(new Parse.Web3.providers.HttpProvider(RPC_URL));
await web3.eth.accounts.privateKeyToAccount(ACCOUNT_PRIVATE_KEY);
await web3.eth.accounts.wallet.add({
privateKey: ACCOUNT_PRIVATE_KEY,
address: ACCOUNT_ADDRESS,
});
const contract = await new web3.eth.Contract(CONTRACT_ABI, CONTRACT_ADDRESS, {
gas: 3000000,
});
...
Note: These codes from this link