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: Implement ./contribs/gnodev command #1386

Merged
merged 38 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f376198
feat: move gnoweb into his own package
gfanton Nov 6, 2023
895bf8a
wip: add `gno dev` command
gfanton Nov 6, 2023
2ea43f7
wip: gno dev iteration 2
gfanton Nov 27, 2023
6814998
fix: fixup rebase
gfanton Nov 27, 2023
18aa12e
wip: iteration 3
gfanton Nov 27, 2023
6e43265
wip: iteration 4
gfanton Nov 27, 2023
1a2bdc9
wip: iteration 5
gfanton Nov 29, 2023
d17775c
wip: iteration 6
gfanton Nov 29, 2023
9829fe3
chore: lint
gfanton Nov 29, 2023
4c9a748
chore: organize and cleanup
gfanton Nov 29, 2023
6a5134f
chore: cleanup
gfanton Nov 29, 2023
0fd4413
chore: move gnodev to `/contribs` folder
gfanton Nov 29, 2023
92c2e60
chore: reset main go.mod
gfanton Nov 29, 2023
e30488e
chore: add install gnodev rules to contrib makefile
gfanton Nov 29, 2023
563b343
chore: cleanup & lint
gfanton Nov 30, 2023
abee336
fix: revert repl change
gfanton Nov 30, 2023
a16d3d5
fix: chore lint
gfanton Nov 30, 2023
a773f26
Merge remote-tracking branch 'origin/master' into feat/gno-dev
gfanton Dec 4, 2023
64118aa
fix: gnoweb test
gfanton Dec 4, 2023
8f73283
chore: update comment
gfanton Dec 4, 2023
ccb3143
fix: `gnodev` go.mod
gfanton Dec 4, 2023
c07b07b
feat: add gnodev readme
gfanton Dec 7, 2023
c186145
wip: fixes
gfanton Dec 7, 2023
5fafea3
chore: lint
gfanton Dec 9, 2023
517deed
chore: add 'make tidy' in contribs/
moul Dec 12, 2023
383d3af
chore: disable tx-archive to prevent diamond dependency issue with go…
moul Dec 12, 2023
abdd420
chore: more verbose ci check
moul Dec 12, 2023
bbd8b1e
chore: fixup
moul Dec 12, 2023
8069ab4
chore: fixup
moul Dec 13, 2023
19cb498
chore: fixup
moul Dec 13, 2023
a6de147
Merge branch 'master' into feat/gno-dev
gfanton Dec 13, 2023
62fc493
fix: go mod issue
gfanton Dec 13, 2023
4d33260
chore: clenaup main
gfanton Dec 13, 2023
ceadafa
chore: rename `WaitForNodeReadiness` to `GetNodeReadiness`
gfanton Dec 14, 2023
840c839
Merge branch 'master' into feat/gno-dev
gfanton Dec 14, 2023
6035359
chore: rename `WaitForNodeReadiness` to `GetNodeReadiness`
gfanton Dec 14, 2023
4792290
chore: cleanup
gfanton Dec 14, 2023
5173c05
feat: add missing example load folder
gfanton Dec 15, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Check go.mods
run: |
set -e
set -xe
# Find all go.mod files
gomods=$(find . -type f -name go.mod)

Expand Down
14 changes: 12 additions & 2 deletions contribs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ help:
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'

.PHONY: install
install: install.gnomd
install: install.gnomd install.gnodev

install.gnomd:; cd gnomd && go install .
install.gnomd:; cd gnomd && go install .
install.gnodev:; $(MAKE) -C ./gnodev install

.PHONY: clean
clean:
Expand All @@ -21,6 +22,15 @@ GOFMT_FLAGS ?= -w
fmt:
$(rundep) mvdan.cc/gofumpt $(GOFMT_FLAGS) .

.PHONY: tidy
tidy:
@for gomod in `find . -name go.mod`; do ( \
dir=`dirname $$gomod`; \
set -xe; \
cd $$dir; \
go mod tidy -v; \
); done

########################################
# Test suite
GOTEST_FLAGS ?= -v -p 1 -timeout=30m
Expand Down
9 changes: 9 additions & 0 deletions contribs/gnodev/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
GNOROOT_DIR ?= $(abspath $(lastword $(MAKEFILE_LIST))/../../../)

GOBUILD_FLAGS := -ldflags "-X github.com/gnolang/gno/gnovm/pkg/gnoenv._GNOROOT=$(GNOROOT_DIR)"

install:
go install $(GOBUILD_FLAGS) .

build:
go build $(GOBUILD_FLAGS) -o build/gnodev ./cmd/gno
24 changes: 24 additions & 0 deletions contribs/gnodev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## `gnodev`: Your Gno Companion Tool

`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 ...**]

### 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.

### Commands
- **H**: Display help information.
- **R**: Reload the node.
- **Ctrl+R**: Reset the current node state.
- **Ctrl+C**: Exit the command.

### 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.

### Installation
Run `make install` to install `gnodev`.
60 changes: 60 additions & 0 deletions contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module github.com/gnolang/gno/contribs/gnodev

go 1.20

replace github.com/gnolang/gno => ../..

require (
github.com/fsnotify/fsnotify v1.7.0
github.com/gnolang/gno v0.0.0-00010101000000-000000000000
golang.org/x/term v0.15.0
)

require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dgraph-io/badger/v3 v3.2103.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/gnolang/goleveldb v0.0.9 // indirect
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gotuna/gotuna v0.6.0 // indirect
github.com/jaekwon/testify v1.6.1 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/peterbourgon/ff/v3 v3.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.22.5 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading