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

feat: gnobro, a terminal-based realm browser #2608

Merged
merged 70 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
59c930f
wip: gnobro
gfanton Feb 2, 2024
2ad1adf
feat: update model
gfanton Jun 20, 2024
91ebeba
wip: gnobro
gfanton Jun 20, 2024
c24fca4
feat: make gno link clickable
gfanton Jun 20, 2024
390f687
feat: add ssh support
gfanton Jun 20, 2024
602c867
feat: add banner + some fixup
gfanton Jun 20, 2024
14890fc
feat: new banner
gfanton Jun 20, 2024
253418c
fix: banner offset
gfanton Jun 21, 2024
4b415df
feat: add default realm
gfanton Jun 21, 2024
e6105f4
feat: add history
gfanton Jun 23, 2024
3f3fbf4
fix: fixup nav
gfanton Jun 23, 2024
4570f56
feat: add accesscontrol
gfanton Jun 23, 2024
a46bcdb
feat: gnoweb export alias and redirect
gfanton Jun 23, 2024
1e525ec
fix: align banner
gfanton Jun 23, 2024
3602784
feat: update style
gfanton Jun 24, 2024
57b6ea6
wip: gnodev events endpoint
gfanton Jun 24, 2024
8774e45
feat: add readonly
gfanton Jun 25, 2024
e6ba807
feat: readonly
gfanton Jun 25, 2024
d8f6b55
fix: key move
gfanton Jun 25, 2024
d571be5
fix: unfocus command and path change
gfanton Jun 26, 2024
854943e
feat: move gnobro into gnodev
gfanton Jul 18, 2024
79fbcbe
chore: delete banner file
gfanton Jul 21, 2024
4fb71d4
chore: lint
gfanton Jul 21, 2024
74f3d65
Merge branch 'master' into feat/contribs-gnobro
gfanton Jul 21, 2024
e4f86cc
fix: remote dial
gfanton Jul 22, 2024
e24688b
chore(lint): remvoe unsed function
gfanton Jul 22, 2024
2c562ab
chore: only build gnodev by default
gfanton Jul 23, 2024
c0c0117
feat: add cool banner
gfanton Jul 23, 2024
393c119
chore: update gno mod
gfanton Jul 23, 2024
a127e20
fix: empty banner
gfanton Jul 23, 2024
d457be4
fix: banner faster
gfanton Jul 23, 2024
f80245b
fix: encapsulate banner
gfanton Jul 23, 2024
a9952bf
wip: gnodev readme doc
gfanton Jul 28, 2024
018bab2
chore: update doc
gfanton Jul 28, 2024
fec2042
chore: banner file
gfanton Jul 28, 2024
281190c
fix: new model
gfanton Jul 29, 2024
988ff34
feat: update banner
gfanton Jul 30, 2024
1caf376
fix: client
gfanton Jul 30, 2024
4e5b806
fix: middleware order
gfanton Jul 30, 2024
a8b8f36
chore: cleanup
gfanton Jul 30, 2024
d003747
Merge remote-tracking branch 'origin/master' into feat/contribs-gnobro
gfanton Aug 2, 2024
37d4b47
chore: remove patch & toolchain in gnomod
gfanton Aug 8, 2024
599903f
chore: rename bl -> cl
gfanton Aug 8, 2024
7e15baa
fix: use remove `Must` unmarshal amino
gfanton Aug 8, 2024
8c6b2c5
chore: have return explicit
gfanton Aug 8, 2024
5e8e30a
chore: use default gnoland prefix const
gfanton Aug 8, 2024
b9dfedc
fix: use remote instead of target
gfanton Aug 8, 2024
b480108
chore: user `port` instead `port1`
gfanton Aug 8, 2024
2bfc106
feat: better handle routine in gnobro main
gfanton Aug 8, 2024
93f0742
fix: typo
gfanton Aug 8, 2024
99d55ca
fix: path command
gfanton Aug 8, 2024
ea8a2a9
chore: cleanup
gfanton Aug 8, 2024
a50d521
chore: cleanup
gfanton Aug 8, 2024
faf16a0
chore: lint
gfanton Aug 8, 2024
9c787d6
fix: use Is instead of As
gfanton Aug 9, 2024
40fecb3
Merge branch 'master' into feat/contribs-gnobro
gfanton Aug 9, 2024
94d1d03
chore: use `contain` instead of `index`
gfanton Aug 20, 2024
0f9b411
chore: fixupy banner name
gfanton Aug 20, 2024
253ebaf
chore: fix typo
gfanton Aug 20, 2024
4fd1f60
chore: single argument
gfanton Aug 20, 2024
7d7775c
chore: update banner method name
gfanton Aug 20, 2024
0c2ba5d
chore: add dev mode toogle flag
gfanton Aug 20, 2024
339e7bf
fix: handle app by context
gfanton Aug 20, 2024
d216a86
Merge branch 'master' into feat/contribs-gnobro
gfanton Aug 20, 2024
b1c9183
chore: lint
gfanton Aug 20, 2024
15d8a28
Merge branch 'master' into feat/contribs-gnobro
gfanton Aug 22, 2024
d7af192
fix: simply model logic
gfanton Aug 22, 2024
0a12aca
Merge branch 'master' into feat/contribs-gnobro
gfanton Aug 22, 2024
c0cdc09
chore: lint
gfanton Aug 22, 2024
3ad927c
fix: signer infos
gfanton Aug 22, 2024
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
8 changes: 5 additions & 3 deletions contribs/gnodev/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ GOTEST_FLAGS ?= $(GOBUILD_FLAGS) -v -p 1 -timeout=5m
rundep := go run -modfile ../../misc/devdeps/go.mod
golangci_lint := $(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint

install:
install: install.gnodev
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
install.gnodev:
go install $(GOBUILD_FLAGS) ./cmd/gnodev

build:
go build $(GOBUILD_FLAGS) -o build/gnodev ./cmd/gnodev
# keep gnobro out the default install for now
install.gnobro:
gfanton marked this conversation as resolved.
Show resolved Hide resolved
go install $(GOBUILD_FLAGS) ./cmd/gnobro

lint:
$(golangci_lint) --config ../../.github/golangci.yml run ./...
Expand Down
73 changes: 55 additions & 18 deletions contribs/gnodev/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,67 @@
## `gnodev`: Your Gno Companion Tool
## `gnodev`: Your Gno Development Companion

`gnodev` is designed to be a robust and user-friendly tool in your realm package development journey, streamlining your workflow and enhancing productivity.
`gnodev` is a robust tool designed to streamline your Gno package development process, enhancing productivity
by providing immediate feedback on code changes.

We will only give a quick overview below. You may find the official documentation at [docs/gno-tooling/gnodev.md](../../docs/gno-tooling/cli/gnodev.md).
Please note that this is a quick overview. For a more detailed guide, refer to the official documentation at
[docs/gno-tooling/gnodev.md](../../docs/gno-tooling/cli/gnodev.md).

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

### Features
- **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.
- **In-Memory Node**: Gnodev starts an in-memory node, automatically loading the **examples** folder and any
user-specified paths.
- **Web Interface Server**: Gnodev starts a `gnoweb` server on [`localhost:8888`](https://localhost:8888).
- **Balances and Keybase Customization**: Set account balances, load them from a file, or add new accounts via a flag.
- **Hot Reload**: Monitors the **examples** folder and specified directories for file changes, reloading the
package and automatically restarting the node as needed.
- **State Maintenance**: Ensures the previous node state is preserved by replaying all transactions.
- **Transaction Manipulation**: Allows for interactive cancellation and redoing of transactions.
- **State Export**: Export the current state at any time in a genesis doc format.

### Commands
While `gnodev` is running, the user can trigger specific actions by pressing
the following combinations:
- **H**: Display help information.
- **R**: Reload the node, without resetting the state.
- **Ctrl+R**: Reset the current node state.
- **Ctrl+C**: Exit `gnodev`.
While `gnodev` is running, trigger specific actions by pressing the following combinations:
- **H**: Display help information.
- **A**: Display account balances.
- **R**: Reload the node manually.
- **P**: Cancel the last action.
- **N**: Redo the last cancelled action.
- **Ctrl+S**: Save the current state.
- **Ctrl+R**: Restore the saved state.
- **E**: Export the current state to a genesis file.
- **Cmd+R**: Reset the current node state.
- **Cmd+C**: Exit `gnodev`.

### Usage
Run `gnodev` followed by any specific options and/or package paths. The **examples** directory is loaded
automatically. Use `--minimal` to prevent this.

Example:
```
gnodev --add-account <bech32/name1>[:<amount1>] ./myrealm
```

### `gnobro`: realm interface
`gnobro` is a terminal user interface (TUI) that allows you to browse realms within your terminal. It
gfanton marked this conversation as resolved.
Show resolved Hide resolved
automatically connects to `gnodev` for real-time development. In addition to hot reload, it also has the
ability to execute commands and interact with your realm.


#### Usage
**gnobro** [**options**] [**PKG_PATH **]

Run gnobro followed by any specific options and/or a target pacakge path.

Use `gnobro -h` for a detailed list of options.

Example:
```
gnobro gno.land/r/demo/home
```

### Loading 'examples'
The **examples** directory is loaded automatically. If working within this folder, you don't have to specify any additional paths to `gnodev`. Use `--minimal` to prevent this.

### Installation
Run `make install` to install `gnodev`.

Run `make install.gnobro` to install `gnobro`.
19 changes: 19 additions & 0 deletions contribs/gnodev/cmd/gnobro/assets/banner_land_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
. +
+ . Hello %s, Welcome to
.
+ .,-:::::/ :::. :::. ... .
. ,;;-'````' `;;;;, `;;; .;;;;;;;.
[[[ [[[[[[/ [[[[[. '[[ ,[[ \[[,
"$$c. "$$ + $$$ "Y$c$$ $$$, $$$
`Y8bo,,,o88o 888 Y88 "888,_ _,88P
. `'YMUP"YMM MMM . YM "YMMMMMP" +
. .
::: + :::. :::. :::. :::::::-.
;;; ;;`;; `;;;;, `;;; ;;, `';,
+ [[[ ,[[ '[[, + [[[[[. '[[ `[[ [[
$$' c$$$cc$$$c $$$ "Y$c$$ $$, $$
o88oo,.__ 888 888, 888 Y88 888_,o8P'
""""YUMMM YMM ""` MMM + YM MMMMP"` +
.
+
press <enter> to continue
25 changes: 25 additions & 0 deletions contribs/gnodev/cmd/gnobro/assets/gn_hc1.utf8ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
 · . · ·
. * . . * . ·
· · · · . . .
· . . . . · *
. · . . ·
░░ ░░ ░ ░░ ░ ░░ ░ ░░ ░░░ ░░░░░░ ░░░ ░░░░ ░ ░░
░░▒▒░░░▒▒░░░░░▒░░░░░░▒▒░░▒░░▒▒░▒░░░░░░░ ░░░░░░▒▒░▒▒▒░▒▒▒▒▒▒░░▒▒▒░░░▒▒▒▒░▒░░▒▒░░
▒▒▓▓▒▒▒▓▓▒▒▒▒▒▓▒▒▒▒▒▒▓▓▒▒▓▒▒▓▓▒▓▒▒▒▒▒▒▒░▒▒▒▒▒▒▓▓▒▓▓▓▒▓▓▓▓▓▓▒▒▓▓▓▒▒▒▓▓▓▓▒▓▒▒▓▓▒▒
▓▓██▓▓▓██▓▓▓▓▓█▓▓▓▓▓▓██▓▓█▓▓██▓█▓▓▓▓▓▓▓▒▓▓▓▓▓▓██▓███▓██████▓▓███▓▓▓████▓█▓▓██▓▓
▀██▒███ █████ ██████▌▐██▒██▌██▒███████▓███▓██▌▐██▒██▌██▒█████▒████ ███▒███ ██
 ▐▒▒▒█ █▒█▌ ▐▒███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███▌███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███ █▒▒▒█▌ ▐▒
 ▒▒▒▒▄ ▄▒█ ▒█▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒██▐ █▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒ █▄ ▄▒▒ ▒ ▒
 ░ ░ ▄ ▄▄▒▌ ▒█▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒▄▀▀▄▐▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒ █ ▄ ▄▄▄▀▀▄ ▒
 ▀░ ▒░▒▄░ ▀▄▒▀▒▒ ▀█▒▄▄ ▄■▄▒▒▀ ▒▌░░▐░▀ ▒ ▀ ▄ ■▒░▀ ▒ ▀░ ▒░▌░░▐░ ▀▄
▌░░▐ ▌░░▐
▄▄▀▀▀▀▀▀▀▄▄▀▀▄▀▀▀▀▀▄ ▄▀▀▀▀▀▄ ▌▒▒▐ ▄▄▀▀▀▀▀▄ ▄▀▄▄▀▀▀▀▀▄ ▄▄▄▄▄▌▒▒▐
▌▄▓▓▓▓▓▓▓▄ ▓▓▄▓▓▓▓▓▄▀▀▄▓▓▓▓▓▄▀▄ ▌▓▓▐ ▌▄▓▓▓▓▓▄▀▌▓▌▄▓▓▓▓▓▄▀▀▄▄▄▄▄▄▓▓▐
▌█▌ ██ ███▀▄▄▀██ ▐██▀▀▀██▌▐ ▌██▐ ▐▐██▀▀▀██▌ ███▀▄▄▀██ ▐██▀▀▀███▐
▌▀░░░░░░░░ ░░▌▌ ▌░░ ░░ ░░▐ ▌░░▐ ▌░░ ░░ ░░▌█ ▌░░ ░░▌ ▐░░▐
▐ ▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐▄▀▄▌▒▒▐ ▌▒▒▌ ▐▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐
▌▄▄ ▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▓▓▓ ▄▓▄ ▓▓ ▀▀ ▓▓▓ ▐▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▐▓▓▐
░ ▌▀███████▀ ███▐ ▐▐██ ▄▀█████▀▄▄▀█▀▄▀████ ▄▀████▀██ ███▐ ▐▐██ ▄▀████▀██▐ ░
▒ ▓▓▄▄▄▄▄▄▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▄▀ ▀▄▀ ▀▄▄▄▄▀ ▀▄▄▄▄▀▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▀▄▄▓ ▒
▓ ▓
█▓▒░ ░▒▓█
25 changes: 25 additions & 0 deletions contribs/gnodev/cmd/gnobro/assets/gn_hc2.utf8ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
 · . · ·
. + . . + . ·
· · · · . . .
· . . . . · +
. · . . ·
░░ ░░ ░ ░░ ░ ░░ ░ ░░ ░░░ ░░░░░░ ░░░ ░░░░ ░ ░░
░░▒▒░░░▒▒░░░░░▒░░░░░░▒▒░░▒░░▒▒░▒░░░░░░░ ░░░░░░▒▒░▒▒▒░▒▒▒▒▒▒░░▒▒▒░░░▒▒▒▒░▒░░▒▒░░
▒▒▓▓▒▒▒▓▓▒▒▒▒▒▓▒▒▒▒▒▒▓▓▒▒▓▒▒▓▓▒▓▒▒▒▒▒▒▒░▒▒▒▒▒▒▓▓▒▓▓▓▒▓▓▓▓▓▓▒▒▓▓▓▒▒▒▓▓▓▓▒▓▒▒▓▓▒▒
▓▓██▓▓▓██▓▓▓▓▓█▓▓▓▓▓▓██▓▓█▓▓██▓█▓▓▓▓▓▓▓▒▓▓▓▓▓▓██▓███▓██████▓▓███▓▓▓████▓█▓▓██▓▓
▀██▒███ █████ ██████▌▐██▒██▌██▒███████▓███▓██▌▐██▒██▌██▒█████▒████ ███▒███ ██
 ▐▒▒▒█ █▒█▌ ▐▒███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███▌███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███ █▒▒▒█▌ ▐▒
 ▒▒▒▒▄ ▄▒█ ▒█▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒██▐ █▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒ █▄ ▄▒▒ ▒ ▒
 ░ ░ ▄ ▄▄▒▌ ▒█▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒▄▀▀▄▐▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒ █ ▄ ▄▄▄▀▀▄ ▒
 ▀░ ▒░▒▄░ ▀▄▒▀▒▒ ▀█▒▄▄ ▄■▄▒▒▀ ▒▌░░▐░▀ ▒ ▀ ▄ ■▒░▀ ▒ ▀░ ▒░▌░░▐░ ▀▄
▌░░▐ ▌░░▐
▄▄▀▀▀▀▀▀▀▄▄▀▀▄▀▀▀▀▀▄ ▄▀▀▀▀▀▄ ▌▒▒▐ ▄▄▀▀▀▀▀▄ ▄▀▄▄▀▀▀▀▀▄ ▄▄▄▄▄▌▒▒▐
▌▄▓▓▓▓▓▓▓▄ ▓▓▄▓▓▓▓▓▄▀▀▄▓▓▓▓▓▄▀▄ ▌▓▓▐ ▌▄▓▓▓▓▓▄▀▌▓▌▄▓▓▓▓▓▄▀▀▄▄▄▄▄▄▓▓▐
▌█▌ ██ ███▀▄▄▀██ ▐██▀▀▀██▌▐ ▌██▐ ▐▐██▀▀▀██▌ ███▀▄▄▀██ ▐██▀▀▀███▐
▌▀░░░░░░░░ ░░▌▌ ▌░░ ░░ ░░▐ ▌░░▐ ▌░░ ░░ ░░▌█ ▌░░ ░░▌ ▐░░▐
▐ ▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐▄▀▄▌▒▒▐ ▌▒▒▌ ▐▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐
▌▄▄ ▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▓▓▓ ▄▓▄ ▓▓ ▀▀ ▓▓▓ ▐▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▐▓▓▐
░ ▌▀███████▀ ███▐ ▐▐██ ▄▀█████▀▄▄▀█▀▄▀████ ▄▀████▀██ ███▐ ▐▐██ ▄▀████▀██▐ ░
▒ ▓▓▄▄▄▄▄▄▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▄▀ ▀▄▀ ▀▄▄▄▄▀ ▀▄▄▄▄▀▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▀▄▄▓ ▒
▓ ▓
█▓▒░ ░▒▓█
Loading
Loading