Moralis server not listening events

I am currently working on a NFT marketplace project where i am connecting to my local running hardhat blockchain with my Moralis server. I have done everything to connect it and it is also showing connected on dashboard. I wants to listen some events from my block chain but after running a script that just list an NFT on marketplace, it is not showing anything on my Moralis dashboard. I have synced my events with Moralis and have provided everything correctly, but still not showing anything on the database.

here is an image of my Moralis database where last 4 enteries are my table that i synced with moralis server:

![evnet|690x203](upload://9USmxoa2MljDKC9u9rcOVSuv7Sv.png)

My code that i used to sync my blockchain events with my server:

const Moralis = require("moralis/node");
const dotenv = require("dotenv");
dotenv.config();

const serverUrl = process.env.NEXT_PUBLIC_SERVER_URL;
const appId = process.env.NEXT_PUBLIC_APP_ID;
const masterKey = process.env.masterKey;
const chainId = process.env.chainId || 31337;
const moralisChianId = chainId == "31337" ? "1337" : chainId;
const contractAddresses = require("./constants/address.json");

async function main() {
  await Moralis.start({ serverUrl, appId, masterKey });
  const contractAddressesArray = contractAddresses[chainId]["NFTMarketplace"];
  console.log(contractAddressesArray);
  const address =
    contractAddresses[chainId]["NFTMarketplace"][
      contractAddressesArray.length - 1
    ];

  console.log(address);

  let listItemsOptions = {
    chainId: moralisChianId,
    sync_historical: true,
    topic: "ItemListed(address,uint256,uint256,address)",
    address: address,
    abi: {
      type: "event",
      anonymous: false,
      name: "ItemListed",
      inputs: [
        { type: "address", name: "nftAddress", indexed: true },
        { type: "uint256", name: "tokenId", indexed: true },
        { type: "uint256", name: "price", indexed: true },
        { type: "address", name: "seller", indexed: false },
      ],
    },
    tableName: "ItemListed",
  };

  let buyItemsOptions = {
    chainId: moralisChianId,
    sync_historical: true,
    topic: "ItemBought(address,address,uint256,uint256)",
    address: address,
    abi: {
      type: "event",
      anonymous: false,
      name: "ItemBought",
      inputs: [
        { type: "address", name: "seller", indexed: true },
        { type: "address", name: "buyer", indexed: true },
        { type: "uint256", name: "tokenId", indexed: false },
        { type: "uint256", name: "price", indexed: true },
      ],
    },
    tableName: "ItemBought",
  };

  let updateItemsOptions = {
    chainId: moralisChianId,
    sync_historical: true,
    topic: "ItemUpdated(address,uint256,uint256,address)",
    address: address,
    abi: {
      type: "event",
      anonymous: false,
      name: "ItemUpdated",
      inputs: [
        { type: "address", name: "nftAddress", indexed: true },
        { type: "uint256", name: "newPrice", indexed: true },
        { type: "uint256", name: "tokenId", indexed: true },
        { type: "address", name: "seller", indexed: false },
      ],
    },
    tableName: "ItemUpdated",
  };

  console.log(moralisChianId);
  let removeItemsOptions = {
    chainId: moralisChianId,
    sync_historical: true,
    topic: "ItemRemoved(address,uint256,address)",
    address: address,
    abi: {
      type: "event",
      anonymous: false,
      name: "ItemRemoved",
      inputs: [
        { type: "address", name: "nftAddress", indexed: true },
        { type: "uint256", name: "tokenId", indexed: true },
        { type: "address", name: "seller", indexed: true },
      ],
    },
    tableName: "ItemRemoved",
  };

  const listResponse = await Moralis.Cloud.run(
    "watchContractEvent",
    listItemsOptions,
    {
      useMasterKey: true,
    }
  );

  const buyResponse = await Moralis.Cloud.run(
    "watchContractEvent",
    buyItemsOptions,
    {
      useMasterKey: true,
    }
  );

  const removeResponse = await Moralis.Cloud.run(
    "watchContractEvent",
    removeItemsOptions,
    {
      useMasterKey: true,
    }
  );
  const updateResponse = await Moralis.Cloud.run(
    "watchContractEvent",
    updateItemsOptions,
    {
      useMasterKey: true,
    }
  );

  if (listResponse && buyResponse && removeResponse && updateResponse) {
    console.log("database updated with watching events");
  } else {
    console.log("Something went wrong...");
  }
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.log(error);
    process.exit(1);
  });

Sharing image showing perfect connection of my local dev chain with moralis server:

![sol|690x270](upload://y6dwCX7ojC2hcNqFCfmDE11XQa3.png) ![evnet2|690x176](upload://9hWOqBhxrMlRUX6Ygvew4OV8fqT.png)

I am not able to find the problem with my setup
please help

did it ever work for you? did you try first with only one event?

can you also paste the server url?

No t didn’t try with only one table. I created 4 at the same time.
It’s my first time with moralis server. You are right i should have tried it first with only one table.
this is my server url: https://7fj3vivea6ke.usemoralis.com:2053/server

I don’t know what is the issue, it looks like there were only 2 block numbers processed from your local devchain. You can try to reset the local devchain from the admin interface. Check your local devchain to see on what block number it is, check that the transactions with those events are made in your local devchain.

can you try again now with a fresh server maybe?

Nah man i did everything you said also created new server but still having the same issue. I don’t know what the problem is.
Also 1 thing i forgot to mention is when i am trying to connect with command
.frpc -c frpc.ini
Something like that i am not able to connect.
But with the help of admin cli of moralis it is working perfectly. Maybe there is problem. What do you think

can you try again now with a new server? just to make sure that it was not another issue that was related to historical sync

what happens here? any error

It is showing on terminal that this command is not an internal or external command. Maybe this requires some permission settings or something.
I don’t know but i will try tomorrow with new server and then let you know if it works.

try ./frpc -c frpc.ini

hello @cryptokid bro,
Today i again tried with new server but still got the same issue. I also created new discussion on moralis forum but no one replied. I don’t know what to do now.

What does work? What are the steps that you do?

I created new server and then after updating my code with new variables, i am able to connect again but still not getting anything in my moralis server

Can you paste the new server url?
How many blocks are mined in your local dev chain?

it may be a general issue with devchain servers now

i have same problem man

You will have to wait until we investigate more to see what happens with devchain servers

@Aamir, @datta, try to update the server now, it should work after you update the server