github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/docs/getting-started/local-setup/browsing-gnoland.md (about)

     1  ---
     2  id: browsing-gnoland
     3  ---
     4  
     5  # Browsing Gno.land
     6  
     7  ## Overview
     8  In this tutorial, you will learn how to browse [realms](../../concepts/realms.md)
     9  and [packages](../../concepts/packages.md) deployed to a Gno.land chain. 
    10  You will understand how the `Render` method is utilized to achieve realm state
    11  visibility, and you will learn how to easily access realm APIs.
    12  
    13  ## Prerequisites
    14  - **`gnodev` installed.** Reference the 
    15  [Local Setup](installation.md#3-installing-other-gno-tools) guide for steps
    16  
    17  ## 1. Start `gnodev`
    18  To browse Gno source code, we need two components:
    19  - a running `gno.land` node,
    20  - a gno.land source code viewer, like `gnoweb`
    21  
    22  Luckily, `gnodev` comes prepackaged with both. To start, simply run `gnodev` in
    23  your terminal.
    24  
    25  `gnodev` will start an in-memory node, as well as a `gnoweb` server:
    26  
    27  ![gnodev](../../assets/getting-started/local-setup/browsing-gno-source-code/gnodev.gif)
    28  
    29  `gnodev` remembers the folder where it was installed, and loads the
    30  [`examples/`](https://github.com/gnolang/gno/tree/master/examples) subfolder by default. By visiting 
    31  [`http://localhost:8888`](http://localhost:8888), you will be able to see the
    32  gno.land home page:
    33  
    34  ![homepage](../../assets/getting-started/local-setup/browsing-gno-source-code/gnoland-homepage.png)
    35  
    36  ## 2. Browsing Gno.land
    37  
    38  ### Package source code
    39  Packages in Gno.land usually have names resembling `gno.land/p/<name>`. Since 
    40  packages do not contain state, only their source code can be viewed on-chain. To
    41  learn more about packages, check out the [Packages](../../concepts/packages.md) 
    42  concept page.
    43  
    44  Let's take a specific example: the `avl` package, deployed at `gno.land/p/demo/avl`. 
    45  To access the source code of the `avl` package, we can append the `/p/demo/avl`
    46  to our browser URL (from the homepage).
    47  
    48  The final URL for the `avl` package source could be viewable at 
    49  [`http://127.0.0.1:8888/p/demo/avl`](http://127.0.0.1:8888/p/demo/avl),
    50  if we followed default setup params, as we did in this guide.
    51  
    52  ![gnoweb avl](../../assets/getting-started/local-setup/browsing-gno-source-code/gnoweb-avl.png)
    53  
    54  From here, we can open any source code file of the deployed on-chain package
    55  and inspect its API.
    56  
    57  ### Realm source code & state
    58  In contrast to Packages, Realms in Gno.land usually have names resembling
    59  `gno.land/r/<name>`.
    60  
    61  Realms _do_ contain state, and in addition to being able to view their source 
    62  code on-chain, users can also view their internal state representation in the 
    63  form of the `Render()` output. To learn more about realms, please check out the
    64  [Realms](../../concepts/realms.md) concept page.
    65  
    66  We can browse the realm `Render()` method output and source code in our browser.
    67  For example, the `gnoland/blog` realm is deployed at `gno.land/r/gnoland/blog`.
    68  
    69  To view the internal realm state of the `blog` realm, we can append the
    70  `/r/gnoland/blog` to our browser URL (from the homepage).
    71  
    72  The final URL for the `blog` realm internal state could be viewable at
    73  [`http://127.0.0.1:8888/r/gnoland/blog`](http://127.0.0.1:8888/r/gnoland/blog),
    74  if we followed default setup params, as we did in this guide.
    75  
    76  ![blog_render](../../assets/getting-started/local-setup/browsing-gno-source-code/blog_render.png)
    77  
    78  :::info Render() is not required
    79  Internal realm state does not have to be exposed through the `Render()` method
    80  of the realm, as it is not a requirement for deploying a Realm.
    81  :::
    82  
    83  Additionally, to view the source code for the realm, we have two options:
    84  - append `/` to the full realm path - [`http://127.0.0.1:8888/r/gnoland/blog/`](http://127.0.0.1:8888/r/gnoland/blog/)
    85  - click on the `[source]` button in the top-right corner
    86  
    87  ![blog_source](../../assets/getting-started/local-setup/browsing-gno-source-code/blog_source.png)
    88  
    89  Finally, the `[help]` button takes us to the realm help page, where you will
    90  be able to see the user-facing API of the realm. 
    91  
    92  ![blog_help](../../assets/getting-started/local-setup/browsing-gno-source-code/blog_help.png)
    93  
    94  This page will allow you to easily generate `gnokey` commands for interacting 
    95  with the realm in question. 
    96  
    97  ## Conclusion
    98  
    99  That's it 🎉
   100  
   101  You have successfully inspected the source code of a package and realm, and seen
   102  the on-chain state of the blog app. You have also learned about the `[help]` page
   103  that `gnoweb` provides.
   104