gnoverse / dsocial

Experimental: Social apps, tools, researchs and dApps on Gno.land
8 stars 4 forks source link

Chore: Save the state of home posts and add RefreshHomePosts #45

Closed jefft0 closed 7 months ago

jefft0 commented 7 months ago

Currently, GetHomePosts computes the home posts (including all followed posts) each time it is called. This is necessary because we want to call it with QEval (no gas fee) which can't update the realm data to save the result. But this is not scalable. This PR solves the problem by saving the state of the home posts. This is returned by GetHomePosts, but we add a separate RefreshHomePosts which is requires gas and adds the followed posts since the last call.