Event Syncing - Ganache

Hello,

A week ago I set up an event watcher plugin (connected to ganache). It worked, Database was created and synched. I lost power and so had to restart with a new Ganache instance. I had set up the original plugin to watch a specific function at specific contract address. After some help from Moralis team I leared I would need to delete and recreate the event watcher and set up Ganache so that it persists data. Then my virus software started complainging about frpc (see topic: frpc zips had trojan). So I updated frpc.

Here is what I see:

  1. Log of plugin setup:
2021-05-09T22:09:46.759Z - Initialized plugin ./evm/events
2021-05-09T22:09:46.449Z - {"description":"CategoryCreatedUpdated","topic":"CategoryCreatedUpdated(uint64,label,address)","abi":{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"categoryId","type":"uint64"},{"indexed":false,"internalType":"string","name":"label","type":"string"},{"indexed":false,"internalType":"address","name":"_changedBy","type":"address"}],"name":"CategoryCreatedUpdated","type":"event"},"address":"0x89Fea6A7F283cd348fBf6524ce6eC577749E41B4","tableName":"CategoryCreatedUpdated"}
  1. In EventSynch table I see an entry for the plugin I created. However table was not created.

  2. Under Jobs there is a job called synchCategoryCreatedUpdated. Not sure how this was created. I cannot edited it or otherwise see its definition.

  3. frpc.ini

  server_addr = 51x9pnsvopbn.moralis.io
  server_port = 7000
  token = o22ZrETiTN
[ganache]
  type = http
  local_port = 7545
  custom_domains = 51x9pnsvopbn.moralis.io
  1. frpc start up:
F:\Projects\1155project\frp>frpc.exe -c frpc.ini
2021/05/09 08:46:31 [I] [service.go:304] [8e436e93787086be] login to server success, get run id [8e436e93787086be], server udp port [0]
2021/05/09 08:46:31 [I] [proxy_manager.go:144] [8e436e93787086be] proxy added: [ganache]
2021/05/09 08:46:31 [I] [control.go:180] [8e436e93787086be] [ganache] start proxy success
  1. In Moralis Admin Dev Proxy shows connected:
    devproxyconnected

  2. Event footprint and hash:

truffle(development)> web3.utils.sha3("CategoryCreatedUpdated(uint64,string,address)")
'0xd0ed9a9656b63055fd06e97eb58f2da370dcdc0c7adf751044de8271998d2cbe'
  1. The EventSync record shows the topic as the event footprint. I tried cloning this row and changing the topic to the hex value shown in #7 and re-ran the sync. No result.

Anything look obviously wrong in the above? Any further ideas to try?

Thank you,

David

UPDATE - I created a watcher for a different event. When I ran the transaction in the dApp the table was created and a row for the new transaction was created. So the connection to my Ganache instance via frpc is good.

Still looking for ideas about the first event though.

Thank you,

David

I’ve had same issues you mention of event working great, then i have to stop for whatever reason (say I need to sleep) and then have to restart the events to see them running. I have found that sometimes takes a bit to get the synching to happen (don’t know why). However, now the frpc that worked really good is working no more… and given I’ve been down the frpc road a few times where it runs great and then it just decided one day it no longer wants to play, i gave up on it entirely.

My solution (albeit a horrible one at early stage of development) is to focus on DB components where I don’t need to watch on chain data and do that locally, then deploy on test net and finalize the on chain stuff…

So not really an answer per se to your question, but maybe it sparks an idea

1 Like