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: gnodev reference #1599

Merged
merged 13 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 11 additions & 7 deletions contribs/gnodev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@
`gnodev` is designed to be a robust and user-friendly tool in your realm package development journey, streamlining your workflow and enhancing productivity.

### Synopsis
**gnodev** [**-minimal**] [**-no-watch**] [**PKGS_PATH ...**]
**gnodev** [**-minimal**] [**-no-watch**] [**PKG_PATH ...**]

### Features
- **In-Memory Node**: Automatically loads the **example** folder and any user-specified paths.
- **Web Interface Server**: Starts a gno.land web server on `:8888`.
- **Hot Reload**: Monitors the example packages folder and additional directories for file changes, reloading the package and restarting the node as needed.
- **State Maintenance**: Ensures the current state is maintained by reapplying all previous blocks.
- **In-Memory Node**: Gnodev starts an in-memory node, and automatically loads
the **examples** folder and any user-specified paths.
- **Web Interface Server**: Starts a `gnoweb` server on `localhost:8888`.
- **Hot Reload**: Monitors the example packages folder and specified directories for file changes,
reloading the package and automatically restarting the node as needed.
- **State Maintenance**: Ensures the current state is preserved by replaying all transactions.

### Commands
While `gnodev` is running, the user can trigger specific actions by pressing
the following combinations:
- **H**: Display help information.
- **R**: Reload the node.
- **R**: Reload the node, without resetting the state.
- **Ctrl+R**: Reset the current node state.
- **Ctrl+C**: Exit the command.
- **Ctrl+C**: Exit `gnodev`.

### Example Folder Loading
The **example** package folder is loaded automatically. If working within this folder, you don't have to specify any additional paths to `gnodev`. Use `--minimal` to prevent this.
Expand Down
Binary file added docs/assets/gno-tooling/gnodev/gnodev.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions docs/gno-tooling/cli/gnodev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: gno-tooling-gnodev
---

# gnodev

Gnodev allows for quick and efficient development of Gno code.

By watching your development directory, gnodev detects changes in your Gno
code, reflecting them in the state of the node immediately. Gnodev also runs a
local instance of `gnoweb`, allowing you to see the rendering of your Gno code instantly.

## Features
- **In-Memory Node**: Gnodev starts an in-memory node, and automatically loads
the **examples** folder and any user-specified paths.
- **Web Interface Server**: Gnodev automatically starts a `gnoweb` server on
[`localhost:8888`](https://localhost:8888).
- **Hot Reload**: Gnodev monitors the **examples** folder and any specified for file changes,
reloading and automatically restarting the node as needed.
- **State Maintenance**: Gnodev replays all transactions in between reloads,
ensuring the previous node state is preserved.

## Installation
Gnodev can be found in the `contribs` folder in the monorepo.
waymobetta marked this conversation as resolved.
Show resolved Hide resolved
To install `gnodev`, run `make install`.
waymobetta marked this conversation as resolved.
Show resolved Hide resolved

## Usage
Gnodev can be run from anywhere on the machine it was installed on, and it will
automatically load the examples folder, providing all the packages and realms found in it for use.

![gnodev_usage](../../assets/gno-tooling/gnodev/gnodev.gif)

For hot reloading, `gnodev` watches the examples folder, as well as any specified folder:
```
gnodev ./myrealm
```

While `gnodev` is running, the following shortcuts are available:
- To reload manually, press `R`.
- To reset the state of the node, press `CMD+R`.
- To see help, press `H`.
- To stop `gnodev`, press `CMD+C`.

### Options

| Flag | Effect |
|------------|-----------------------------------------------------|
| --minimal | Start `gnodev` without loading the examples folder. |
| --no-watch | Disable hot reload. |
3 changes: 2 additions & 1 deletion misc/docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ const sidebars = {
items: [
'gno-tooling/cli/gno-tooling-gno',
'gno-tooling/cli/gno-tooling-gnokey',
'gno-tooling/cli/gno-tooling-gnofaucet',
'gno-tooling/cli/gno-tooling-gnodev',
'gno-tooling/cli/gno-tooling-gnoland',
'gno-tooling/cli/gno-tooling-gnofaucet',
'gno-tooling/cli/gno-tooling-tm2txsync',
]
},
Expand Down
Loading