aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
3 stars 4 forks source link

MessageCache and LightNode #59

Open MHHukiewitz opened 1 year ago

MHHukiewitz commented 1 year ago

Reopened with smaller scope from #31. Depends on #54.

Problem

Some apps require access to the same messages over and over again. This puts unnecessary strain on the CCN API and increases the latency of apps using Aleph Messages.

Solution

This pull request proposes a solution by introducing a message cache implemented with Peewee and an SQLite database in the Aleph SDK. The message cache effectively stores frequently accessed messages, eliminating the need for repetitive CCN API calls. With the message cache in place, apps utilizing the Aleph SDK will experience enhanced efficiency and responsiveness in accessing messages.

MHHukiewitz commented 1 year ago

I started using v1 posts instead of v0 posts. I wonder why we did not earlier, as it seems a cleaner, albeit minimalistic, endpoint for getting posts. There should be no problem in changing back to v0 posts though.

MHHukiewitz commented 11 months ago

A few points on my ToDo list:

MHHukiewitz commented 10 months ago

Implemented all of the suggested changes by @odesenfans, highlights:

github-actions[bot] commented 9 months ago

Failed to retrieve llama text: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

MHHukiewitz commented 9 months ago

Failed to retrieve llama text: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Context size not enough, I rate this PR manually as BLACK

hoh commented 7 months ago

This PR adds +1,937 and -16 lines of code to the project.

What is the impact of this PR on the test coverage ?

MHHukiewitz commented 7 months ago

What is the impact of this PR on the test coverage ?

It actually improved relatively, as the new code has more coverage than the existing one.