MeshJS / mesh

An open-source library to advance Web3 development on Cardano
https://meshjs.dev
Apache License 2.0
209 stars 57 forks source link

Scrolls / Kupo2 / Freeloaderz based providers #30

Closed matiwinnetou closed 7 months ago

matiwinnetou commented 1 year ago

Hi guys, there are likely many ideas how to evolve this application moving forward. My idea was to actually help to decentralise apps on Cardano. How?

Wouldn't it be nice to select other providers than Blockfrost, Kois, effectively self hosted more decentralised ones?

We could have scrolls / kupo2 and FreeLoaderz based providers. This would require splitting providers into reading and writing ones.

Reading:

  1. We could write or use existing reducers on scrolls (https://github.com/txpipe/scrolls) to read the data from redis (other dbs planned in the future as well)
  2. Alternatively one could try to make it work with KUPO2 but I have never used it

Writing:

  1. Why submit via blockfrost or Koios, we could actually submit via distributed network of servers. If you explore: https://www.freeloaderz.io/ you can see there are many urls to submit transactions, e.g. in europe, america etc.

Tell me what you think, I could perhaps help with scrolls / redis integration.

At the end if this works out we could have dApps using completely decentralised data stores without relying on koios / blockfrost at all.

abdelkrimdev commented 1 year ago

Hey @matiwinnetou 👋 Thanks for your feedback!! Yeah, regarding splitting providers into two categories (Reading/Writing). Mesh exposes two interfaces, the IFetcher and the ISubmitter.

https://github.com/MartifyLabs/mesh/blob/main/packages/module/src/common/contracts/fetcher.ts https://github.com/MartifyLabs/mesh/blob/main/packages/module/src/common/contracts/submitter.ts

In the case of Blockfrost and Koios, they can do both readings from and writing to the blockchain. , They implement both IFetcher and ISubmitter. but it's not a requirement to have both. Adding more providers is something we are very keen on doing, if you can help with that we would really appreciate that 😁 To get started you can take a look at how Blockfrost and Koios providers are implemented here:

https://github.com/MartifyLabs/mesh/tree/main/packages/module/src/providers

rdlrt commented 1 year ago

@matiwinnetou - Not sure what you mean, but just to be clear, koios isn't some central provider (yes, there is a common monitoring layer that still is open for users to string in to - but the whole point for Koios is to "string in" community instances rather than individuals running it without any sort of collaboration, at the same time giving freedom for folks to run local instances that are exact replica, or define their own custom clusters). The only reason to have common monitoring URLs is for consumption from end user's pov - UX would not really be good otherwise.

For instance, eternl and tosidrop run their own Koios clusters. As regards dbsync -> it's primarily because other's dont really work with ledger-state, which is fine for smaller use cases - but not chain-wide (especially historical) view

Ofcourse - would be happy to see others added and adopted, just want to be clarify - as this is something I saw defined in a wrong way at multiple occassions

vladimirvolek commented 1 year ago

@matiwinnetou You can run your own Blockfrost. See: https://github.com/blockfrost/blockfrost-backend-ryo.