-
Notifications
You must be signed in to change notification settings - Fork 388
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
feat: adding home realm for r/n2p5/home and supporting packages #3183
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool! Thanks for adding more things to your namespace.
About mgroup
; we currently have authorizable
, but we also have acl
. They serve different purposes, but it might make sense to unify them somehow, or not. WDYT?
Also please just check why the CI is failing.
Yeah, |
…ang#3183) # TLDR There's no place like [home](https://gno.land/r/n2p5/home). This PR is for `gno` code in [/r/n2p5/home](https://gno.land/r/n2p5/home) and its supporting packages and realms. This is a more extensive PR than I'd hoped, but it is because I ended up structuring out two new little packages [chonk]() and [group](), as well as a [config]() pattern that works for my home realm, but is reusable as well. If you like this, vote for me on [Leon's Hall of Fame](https://gno.land/r/leon/hof) # Summary of changes ## [/p/n2p5/chonk](https://gno.land/p/n2p5/chonk/) `chonk` is a linked-list based string chunker. This allows for arbitrarily large strings to be stored on-chain across multiple transactions. The original idea for this was to be able to support large `Render(path string) string` calls. You can think of this as supporting a "static site generator" pattern, where Markdown can be broken up into chunks and then rendered as one large payload. It is used directly in `/r/n2p5/home`. ## [/p/n2p5/mgroup](https://gno.land/p/n2p5/mgroup/) `mgroup` (Managed Group) is a bit like `authorizable,` but the goals are a bit different. I wanted a "managed group" with a single `ownable` owner, but I wanted an arbitrary list of "backup owners," which are accounts that could "claim" ownership if the owner account became unavailable. I also wanted to be able to manage the group members themselves. Another difference here is has the ability to return information about the group such as - a list of all backup owners (there is a method for the complete list, but also a method for an offset and max count iterator for large groups) - a list of all members (there is a method for the complete list, but also a method for an offset and max count iterator for large groups) ## [/r/n2p5/config](https://gno.land/r/n2p5/config) Inspired by the config work done by @moul and @leohhhn for their home realms, I decided to take a crack at it as well. This config allows me to use `mgroup` to manage the config auth. This allows me to power cross-realm auth using this config realm, and it powers the auth for my home realm. ## [/r/n2p5/home](https://gno.land/r/n2p5/home) Bringing this all together, the home realm uses `chonk` and `/r/n2p5/config` to Render the Markdown stored in the chonk data store. Because you might submit data over multiple transactions, I've added the ability to "preview" and "promote" render data, you can see this in the two variations on the URL: - https://gno.land/r/n2p5/home - https://gno.land/r/n2p5/home:preview <details><summary>Contributors' checklist...</summary> - [X] Added new tests, or not needed, or not feasible - [X] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [X] Updated the official documentation or not needed - [X] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [X] Added references to related issues and PRs - [X] Provided any useful hints for running manual tests </details>
TLDR
There's no place like home. This PR is for
gno
code in /r/n2p5/home and its supporting packages and realms. This is a more extensive PR than I'd hoped, but it is because I ended up structuring out two new little packages chonk and group, as well as a config pattern that works for my home realm, but is reusable as well.If you like this, vote for me on Leon's Hall of Fame
Summary of changes
/p/n2p5/chonk
chonk
is a linked-list based string chunker. This allows for arbitrarily large strings to be stored on-chain across multiple transactions. The original idea for this was to be able to support largeRender(path string) string
calls. You can think of this as supporting a "static site generator" pattern, where Markdown can be broken up into chunks and then rendered as one large payload. It is used directly in/r/n2p5/home
./p/n2p5/mgroup
mgroup
(Managed Group) is a bit likeauthorizable,
but the goals are a bit different. I wanted a "managed group" with a singleownable
owner, but I wanted an arbitrary list of "backup owners," which are accounts that could "claim" ownership if the owner account became unavailable. I also wanted to be able to manage the group members themselves. Another difference here is has the ability to return information about the group such as/r/n2p5/config
Inspired by the config work done by @moul and @leohhhn for their home realms, I decided to take a crack at it as well. This config allows me to use
mgroup
to manage the config auth. This allows me to power cross-realm auth using this config realm, and it powers the auth for my home realm./r/n2p5/home
Bringing this all together, the home realm uses
chonk
and/r/n2p5/config
to Render the Markdown stored in the chonk data store. Because you might submit data over multiple transactions, I've added the ability to "preview" and "promote" render data, you can see this in the two variations on the URL:Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description