it doesnât seem that hardhat node offers a way to save a blockchain state.
ok, how complicated would be to start a new Moralis dev server, test there and if it works there to delete the previous one that you used?
It is not that complicated, but if I need to do this everry work session then it will be really hard
But iâll try to see if it fixes the problem.
Hey so I just tried out what you proposed and indeed it seems the root problem is when you restart a blockchain to block 0 once the link has been done.
After the server instance was ready i tried the event it was syncing fine but when i restarted the devchain it stopped working.
Are there any solutions ?
Please donât tell me I have to create a new server instance on each session
I usually use Ganache and I can keep a Ganache instance few days without restarting it, I donât know a better solution for now other then starting a new Moralis dev server. In the future it should be a button to reset Moralis server instance, but we donât have it yet from what I know.
Isnât there any way to save a blockchain in local and restart from the saved state?
Do you any infos about when the fix will be available ?
To be truthful I love the product youâre building itâs amazing and I really want to purchase the pro plan but with this kind of issue it makes development really complicatedâŚ
Arenât there any way to either save the blockchain state or tricking the system into resetting the sync with moralis?
I donât know about saving state with Hardhat, maybe it has. Yes, we should have a button to reset a Moraris dev instance.
Do you have any deadlines/roadmap available to know when this feature will be ready ?
Oh and by the way it seems that i cannot restrict public edit/writing in sync events table but there could be an exploit as someone could write a fake event no ?
You should be able to set Class Level Permissions from Moralis Dashboard on security in top right of the page. And this way you could remove write permissions for public. You say that it doesnât work?
It works bbut then i get logs saying that the sync events has no rights to write on the table
ok, got it, Iâll have to take a closer look on how that could be fixed
Also you where talking about the fact that the idea was to remove beforeConsume, but right now there are no other hooks that can be triggered when an event is being synced and that is bloody useful. So please provide a âonEventSyncâ hook then!
You have beforeSave and afterSave
Yes but beforeSave is not fired sync events saves right ?
It should be, only for original historical sync it isnât
Yes but so you canât define you scheme as precisely than with beforeConsume I guess
You can use a one time job to reprocess the events that were added with historical sync and for new ones you can use beforeSave
Thanks for the workaround!
It is your choice to make in the end but please consider providing a simple onEventSync trigger it would allow anyone to handle events the way they want without having a table dedicated to the event itself, it would make this whole part way more flexible than it is right now in my opinion.