Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSS: Load channels, messages, certificates into OrbitDB during LAUNCH_COMMUNITY #2407

Open
leblowl opened this issue Apr 4, 2024 · 1 comment

Comments

@leblowl
Copy link
Collaborator

leblowl commented Apr 4, 2024

Add functions in the storage service to support this and call these functions from launchCommunity.

On the backend launchCommunity connects to the storage service and downloads the JSON object from /invite. Once the object has been retrieved, it can then use data from the invite property to connect to peers via p2p. We can also store the data in the invite property (psk, ownerOrbitDbIdentity, peerList) in the Community model when creating the community. Then we can load the CommunityMetadata into OrbitDB. See #2190 for how to do this. Then we can load the Certificates. Then we can load Channels. Then we can load the Messages. Loading the messages depends on having the channel DBs created, which is async, so perhaps we can wait on the CHANNEL_REPLICATED/CREATED event before loading messages.

And I think that should be it. I think the ‘replicated’ event fires when loading into OrbitDB, so all other event-based actions should work as if we had connected to a peer and downloaded this data.

We will need to add functions in communityMetadata.store, certificates.store, etc. for loading entries into the OrbitDB databases.

@leblowl leblowl added this to Quiet Mar 4, 2024
@leblowl leblowl converted this from a draft issue Apr 4, 2024
@leblowl leblowl moved this from Next Sprint to Sprint in Quiet Apr 4, 2024
@EmiM
Copy link
Contributor

EmiM commented May 10, 2024

Not directly connected but rather pre-work: #2493
Reason: we use similar or identical methods across all our stores so I introduced simple abstractions. This structure will ensure that we will implement all necessary functionalities in our stores.
Next step would be to add something like loadData to abstract base class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog - Desktop & Backend
Development

No branches or pull requests

2 participants