Forking main net with hardhat

Hi, Is there any timeline around supporting a forked main net? Any workarounds until then?

Have you tried using an archive speedy node as a fork network in your hardhat settings?

yep, does not work. Does morals support mainnet forking?

What errors do you get and which mainnet? People have done it before but maybe there’s issues now.

Transferred tokens after forking, tokens do not appear when doing the moralis getTokenBalance API call

Ok that is a separate issue, that’s to do with the API. Can you post an example of the API call you’re making and what should it have?

Here is what I have done to setup the environment.

  1. npx hardhat node --fork {MORALIS SPEEDY ARCHIVE NODE URL}
  2. ./frpc -c frpc.ini (to setup proxy for connection)
  3. moralis.Web3API.account.getNativeBalance(options);

#3 returns the balance right at the forked block number (which is zero)

  1. I then connect my hardhat fork (running on localhost) to my metamask, and transfer 1 ETH to address: XXX
  2. This transaction gets mined successfully, since it’s a local hardhat environment, and metamask shows me 1eth transferred
  3. I again make the call moralis.Web3API.account.getNativeBalance({address: XXX}); expecting it to show me 1eth, but the balance is still 0.

I was mistaken, since you’re using a forked or local chain, the Web3API won’t work with it. See here: Supported Chains - Moralis

Any update on when hardhat would be working with Moralis WEB3 API?