-
Notifications
You must be signed in to change notification settings - Fork 2
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
Nebula's contract search engine #104
Comments
Maybe the feature you are looking for is in quasar which allows indexing of contracts. Quasar does not have a UI, so maybe Nebula can call Quasar API? |
It looks promising, thanks for linking the issue ! What kind of data do you think would be fair to serve from Quasar ? i.e maybe contract wasm hashes + their respective |
This is what we already have: pub struct Contract {
#[sea_orm(primary_key, auto_increment = false)]
pub address: String,
#[sea_orm(unique)]
pub hash: String,
pub key: String,
pub r#type: String,
pub last_modified: i32,
pub created_at: DateTimeWithTimeZone,
} We could just add a metadata field of type JSON. |
From docs:
This should be straight forward in the ingestion process. |
Thanks for the information @geofmureithi , i have updated the description with an initial UI design mock based on the provided information. |
I have been thinking about this and am curious if we are open to reversing the roles (make people bring contracts to us - think crates.io). This would help us with several things:
I am just thinking out loud here, and I may be wrong. I am also not sure we have enough community engagement to go this direction. |
IMO, you just 🎯 . What would be the motivation for a team to make a PR (and keep it up to date) to our repo ? There should be something here, like a free 🍬 offer. The same happens, with current propsal ( |
This is a research issue for studying the addition of a generic Soroban smart contract search engine to the nebula Wizard UI. This issue does not contemplate an studied plan, but to transmit an idea that aims to generate a discussion and research.
Motivation
We would like to provide a better smart contract search and categorisation tool, that will enable Nebula users to quickly find what they are looking for in our contract catalog. Also, reducing maintenance efforts when new contracts are added to the catalog.
The Soroban smart contract platform is growing fast, approaching
mainnet
at the time of this write. Currently, finding smart contracts like examples or production grade ones its only practically possible by knowing the projects in advance and looking into their repositories. We want to promote the knowledge transfer by increasing the visibility of the contracts, helping the community to quickly find references. So boosting overall ecosystem growth.UI design
The initial idea is to be a tag based search bar that an be embedded and re-used:
Notes:
Introducing search tags in our contract
The very first step would be to make the contracts visible to any form of search engine. For doing that, and as many other search engines work, we need to introduce the search metadata in our contracts.
Actually there is a Soroban macro we could try to use for this called contractmeta! that would allow us to add certain tags to contracts:
We could study if such contract tags could be used for categorising Soroban contracts not only in our catalog, but also in other information channels, as we will see in next sections.
Gathering contracts in an VCS
To put an example, currently Github supports a really powerful search system. Question here would be, til what point we could make use of it ? Could we query Github periodically in search of smart contracts with a query similar to this one, that has into account
contractmeta!
? How effective would that be ?https://github.com/search?q=contractmeta%21&type=code
Gathering contracts in the blockchain
Looks like the metadata stored with the previously commented contractmeta! its being saved in the custom section of the wasm file. That could mean we can reach the wasm contracts directly from the blockchain and parse their custom section, nurturing the search engine database.
Another possible idea, would be to use Quasar (our indexer) for subscribing to contract upload and indexing their metadata as they are uploaded. If that's not too annoying.
The search engine backend
Depending how far we want to go, its possible the search engine to need backend. Specially, if we want it to be able to look for contracts outside the nebula repository.
Looking for all the commented information on the different information layers needs crawlers, data de-duplication systems and more to conform a sanitised model the Nebula UI can query in an efficient way.
It would be somehow an intersection of the data coming from the different channels.
Some initial questions to answer
In order of importance.
contractmeta!
?Final conclusion
Waiting for feedback and research ⌛
The text was updated successfully, but these errors were encountered: