github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/docs/gno-tooling/cli/gnodev.md (about)

     1  ---
     2  id: gno-tooling-gnodev
     3  ---
     4  
     5  # gnodev
     6  
     7  Gnodev allows for quick and efficient development of Gno code.
     8  
     9  By watching your development directory, gnodev detects changes in your Gno
    10  code, reflecting them in the state of the node immediately. Gnodev also runs a
    11  local instance of `gnoweb`, allowing you to see the rendering of your Gno code instantly. 
    12  
    13  ## Features
    14  - **In-Memory Node**: Gnodev starts an in-memory node, and automatically loads
    15    the **examples** folder and any user-specified paths.
    16  - **Web Interface Server**: Gnodev automatically starts a `gnoweb` server on
    17  [`localhost:8888`](https://localhost:8888).
    18  - **Balances and Keybase Customization**: Users can set account balances, load them from a file, or add new
    19    accounts via a flag.
    20  - **Hot Reload**: Gnodev monitors the **examples** folder, as well as any folder specified as an argument for
    21    file changes, reloading and automatically restarting the node as needed.
    22  - **State Maintenance**: Gnodev replays all transactions in between reloads,
    23    ensuring the previous node state is preserved.
    24  
    25  ## Installation
    26  
    27  Gnodev can be found in the `contribs` folder in the monorepo.
    28  To install `gnodev`, run `make install`.
    29  
    30  ## Usage
    31  Gnodev can be run from anywhere on the machine it was installed on, and it will
    32  automatically load the examples folder, providing all the packages and realms found in it for use.
    33  
    34  ![gnodev_usage](../../assets/gno-tooling/gnodev/gnodev.gif)
    35  
    36  For hot reloading, `gnodev` watches the examples folder, as well as any specified folder:
    37  ```
    38  gnodev ./myrealm
    39  ```
    40  
    41  ## Keybase and Balance
    42  
    43  Gnodev will, by default, load the keybase located in your GNOHOME directory, pre-mining `10e12` amount of
    44  ugnot to all of them. This way, users can interact with Gnodev's in-memory node out of the box. The addresses
    45  and their respective balance can be shown at runtime by pressing `A` to display accounts interactively.
    46  
    47  ### Adding or Updating Accounts
    48  
    49  Utilize the `--add-account` flag to add a new account or update an existing one in your local Keybase,
    50  following the format `<bech32/name>[:<amount>]`. The `<bech32/name>` represents the specific key name or
    51  address, and `<amount>` is an optional limitation on the account.
    52  
    53  Example of use:
    54  
    55  ```
    56  gnodev --add-account <bech32/name1>[:<amount1>] --add-account <bech32/name2>[:<amount2>] ...
    57  ```
    58  
    59  Please note: If the address exists in your local Keybase, the `--add-account` flag will only update its amount,
    60  instead of creating a duplicate.
    61  
    62  ### Balance file
    63  
    64  You can specify a balance file using `--balance-file`. The file should contain a
    65  list of Bech32 addresses with their respective amounts:
    66  
    67  ```
    68  # Accounts:
    69  g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5=10000000000000ugnot # test1
    70  g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj=10000000000000ugnot # test2
    71  
    72  # ...
    73  ```
    74  
    75  ### Deploy
    76  
    77  All realms and packages will be deployed to the in-memory node by the address passed in with the
    78  `--deploy-key` flag. The `deploy-key` address can be changed for a specific package or realm by passing in
    79  the desired address (or a known key name) using with the following pattern:
    80  
    81  ```
    82  gnodev ./myrealm?creator=g1....
    83  ```
    84  
    85  A specific deposit amount can also be set with the following pattern:
    86  
    87  ```
    88  gnodev ./myrealm?deposit=42ugnot
    89  ```
    90  
    91  This patten can be expanded to accommodate both options:
    92  
    93  ```
    94  gnodev ./myrealm?creator=<addr>&deposit=<amount>
    95  ```
    96  
    97  ## Interactive Usage
    98  
    99  While `gnodev` is running, the following shortcuts are available:
   100  - To see help, press `H`.
   101  - To display accounts balances, press `A`.
   102  - To reload manually, press `R`.
   103  - To reset the state of the node, press `CMD+R`.
   104  - To stop `gnodev`, press `CMD+C`.
   105  
   106  ### Options
   107  
   108  | Flag                | Effect                                                     |
   109  |---------------------|------------------------------------------------------------|
   110  | --minimal           | Start `gnodev` without loading the examples folder.        |
   111  | --no-watch          | Disable hot reload.                                        |
   112  | --add-account       | Pre-add account(s) in the form `<bech32>[=<amount>]`       |
   113  | --balances-file     | Load a balance for the user(s) from a balance file.        |
   114  | --chain-id          | Set node ChainID                                           |
   115  | --deploy-key        | Default key name or Bech32 address for uploading packages. |
   116  | --home              | Set the path to load user's Keybase.                       |
   117  | --max-gas           | Set the maximum gas per block                              |
   118  | --no-replay         | Do not replay previous transactions upon reload            |
   119  | --node-rpc-listener | listening address for GnoLand RPC node                     |
   120  | --root              | gno root directory                                         |
   121  | --server-mode       | disable interaction, and adjust logging for server use.    |
   122  | --verbose           | enable verbose output for development                      |
   123  | --web-listener      | web server listening address                               |