I have set up a local dev chain using hardhat, without any mainnet forking, using chainId: 31337
.
I have a script that deploys a few contracts, and a separate script that calls those contracts to execute a few of our expected user flows.
I spun up a Moralis server and pointed it to my Local Dev Chain. Server URL: https://ud5f2waitqqg.usemoralis.com:2053/server.
I have frpc configured to point to the Moralis server, and in the Dashboard > View Details > Devchain Proxy Server interface I see a status of “Connected”
So far so good.
The issue comes when I try to create event listeners for any of my contracts. In the “Sync and Watch Contract Events” form I have ensured that my contract’s Topic, ABI, and Address are all correct. I also enabled historical syncing to make sure that once the event listener is created it will backfill everything that has occurred on my local hardhat network.
In order to avoid the issues outlined here (Sync events on local dev chain) where event listeners break if you stop and restart your hardhat network, my order of operations was:
- Start hardhat network
- Run contract-deploying and contract-function-calling scripts
- Spin up a totally new Moralis server
- Copy the frpc configs from the Moralis UI and paste them into my
frpc.ini
- Start the frpc process
- Ensure the Moralis UI shows “Connected”
- Create the event listener via the “Sync and Watch Contract Events” form, then wait a few minutes
After all of that, there are 2 major issues:
- The table that was automatically created by Moralis when I created the event listener contains the following fields:
objectId
,updatedAt
,createdAt
,ACL
instead of the fields outlined by my ABI (shown below). - That table does not get populated with any events.
I have been fighting with this for several days so any help would be much appreciated
Topic:
ChangeDaoNFTCloneCreated(address,address)
ABI:
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "changeDaoNFTClone",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "changeMaker",
"type": "address"
}
],
"name": "ChangeDaoNFTCloneCreated",
"type": "event"
}