Watching a Polygon address

We are trying to watch addresses on Polygon from code.
The call doesn’t throw any error, but I can’t seem to see the address been added to any table in our server.
The only tables we can see on the server are Eth ones.

Moralis.Cloud.run(`watchPolygonAddress`, {
          address: walletAddress,
          sync_historical: true,
        });
1 Like

I tried this now and it looks like it worked fine for me:

await Moralis.Cloud.run("watchPolygonAddress", { address: "0x46f3bfd8115822aEB8e43C70b5FD3eb9d52fDf62".toLowerCase(), "sync_historical":true })

Thx for replying!
When you say fine, what do you mean? Where can you see that the address is being watched?

I looked on my server where I executed that command, and entry was created in WatchedPolygonAddress and the transactions were synced

Doesn’t appear on our server.
Maybe it’s because when we started the server we chose just Ethereum and just later added the rest of the chains?

I had a server with all the chains selected, you can also try to restart/update the server

We restarted it a few times. I would just create a new one, but we are also paying for this one right now so we didn’t want to just start a new one.

can you add that watch address from the interface?
to see if it works that way

I tested now with a server that was created without polygon evm, I added after that polygon evm, and that command still works fine

So it works when we add a sync address from the server UI but not when making the call from code.

I also see 2 rows for the same address, created seconds from each other in the WatchedPolygonAddress. One of them also shows an error.

And if you remove it now from the interface and try again from code?

Still nothing. It doesn’t add the address to the watched table.

Can you try with a different address?

Yep. Nothing.
By the way, I also don’t see the call in the logs of the server. But I know it is being made as if I put something else instead of “watchPolygonAddress” I do get an error thrown that I’m trying to call the wrong cloud method

OK. I think something wrong with this specific server.
I started a new server, configured the app to work against it and I can see the address being added.

what is the server url/subdomain that has that problem?

The server with the problem is this one: https://r7ub9psjldk5.usemoralis.com:2053/server

I wrote to support (didn’t hear back yet) and offered to switch servers. So basically to upgrade a new one I created (https://goqpbkeixsxx.usemoralis.com:2053/server) and then I’ll kill the problematic one.
We are launching in 3 - 4 days so I can still move servers.

Dear @shaharnechmad’s other server is now upgraded! The new one.

Thanks!
That said, since the move we started seeing some discrepancies in data retrieval. Wallet addresses that has NFTs in them and we could retrieve them correctly started to come back with empty result set (and if we do the same call using NFTPort or OpenSea API we do get the NFTs back).
Is there anything that can be done to reindex/fix this?
Here is an example for a call that return an empty result set while the other APIs brings back the NFTs the wallet holds.

curl -X 'GET' \
  'https://deep-index.moralis.io/api/v2/nft/0xfa350CFf201158e2a7e6bBfc25506d3554336b53?chain=eth&format=decimal' \
  -H 'accept: application/json' \