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

docs: namespaces concepts page #1909

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/concepts/namespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: namespaces
---

# Namespaces

Namespaces provide users with the capability to publish contracts under their designated namespaces, similar to GitHub's user and organization model.
harry-hov marked this conversation as resolved.
Show resolved Hide resolved

This feature is currently a work in progress (WIP). To learn more about namespaces, please checkout https://github.com/gnolang/gno/issues/1107.

# Package Path
harry-hov marked this conversation as resolved.
Show resolved Hide resolved

A package path is a unique identifier for each package/realm. It specifies the location of the package's source code and helps differentiate it from others. You can use a package path to:
harry-hov marked this conversation as resolved.
Show resolved Hide resolved

- Call a specific function from a package/realm (e.g using `gnokey maketx call`)
- Import it in other packages/realms.

Here's a breakdown of the structure of a package path:

- Domain: The domain of the blockchain where the package is deployed. Currently, only `gno.land` is supported.
harry-hov marked this conversation as resolved.
Show resolved Hide resolved
- Type: Defines the type of package
harry-hov marked this conversation as resolved.
Show resolved Hide resolved
- `p/`: [Package](packages.md)
- `r/`: [Realm](realms.md)
- Namespace: A namespace might be included here (e.g., user or organization). Namespaces are a way to group related packages or realms, but currently ownership cannot be claimed. (see [Issue #1107](https://github.com/gnolang/gno/issues/1107) for more info)
harry-hov marked this conversation as resolved.
Show resolved Hide resolved
- Remaining Path: The remaining part of the path.
- No Special Characters (except underscore)
harry-hov marked this conversation as resolved.
Show resolved Hide resolved
- Cannot consist solely of underscores. It must have at least one alphanumeric character (letters and numbers).
- Cannot start with a number. It should begin with a letter.
leohhhn marked this conversation as resolved.
Show resolved Hide resolved
- Cannot end with a trailing slash (`/`). A slash is used as a separator between path components.
harry-hov marked this conversation as resolved.
Show resolved Hide resolved

Examples:
- `gno.land/p/demo/avl`: This signifies a standard package named `avl` within the `demo` namespace.
- `gno.land/r/demo/users`: This signifies a realm named `users` within the `demo` namespace.
Loading