Search Apps Documentation Source Content File Folder Download Copy Actions Download

private.gno

1.39 Kb · 52 lines
 1package private
 2
 3import "strings"
 4
 5// Documentation for private realms in Gno.
 6func Render(path string) string {
 7	output := `# Private Realms
 8
 9## Introduction
10
11This document describes the ±private± flag in ±gnomod.toml±.  
12This flag is **optional** and can only be used by **realms**.
13
14> [!NOTE]
15> The ±private± flag does not make a realm secret or hidden.  
16> All code remains open-source and visible on-chain.
17
18## Declaring a Private Realm
19
20To mark a realm as private, add the following ±private± value in your ±gnomod.toml± file:
21
22±±±toml
23module = "gno.land/r/demo/privaterealm"
24gno = "0.9"
25private = true
26±±±
27
28## Rules of a Private Realm
29
30A realm marked as private follows strict rules:
31
32- It cannot be imported by other packages.
33- It can be re-uploaded and the new version fully overwrites the old one.
34- Memory, pointers, or types defined in this package cannot be stored elsewhere.
35
36These restrictions aim to achieve one main goal:
37
38> [!TIP]
39> **Private realms are swappable.**  
40> You can redeploy or update them without impacting other realms.  
41
42## Use Cases
43
44Private realms are useful when:
45
46- The realm represents a **home realm** for a specific user (±r/username/home±).
47- The realm is **designed to evolve** and may need to be replaced later.
48- You want to ensure that no external state depends on its internal types or values.
49`
50	output = strings.ReplaceAll(output, "±", "`")
51	return output
52}