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

Conversation

gfanton
Copy link
Member

@gfanton gfanton commented Nov 20, 2023

Introducing gnodev Command

This PR introduces the gnodev command, designed to facilitate the development and iteration of realms package. Its primary role is to operate an in-memory node along a gnoweb server.

Key features of this command include:

  • Recursive Monitoring: It continuously monitors the example packages folder for any file changes. Moreover, it offers the flexibility for users to monitor and add directories outside the example folder by specifying them as arguments.

  • Dynamic File Change Response: When a file change is detected, gnodev endeavors to reload the affected package and restart the node. In an effort to maintain the current state, it will try to reapply all previous blocks.

  • Interactive Controls: Users have the ability to reload the node at any moment by pressing R and can reset the current node state using Ctrl+R.

  • Command Flags:

    • The -minimal flag, which prevents the node from loading the example folder.
    • The -no-watch flag, used to disable the automatic file change monitoring feature.

Additionally, any raw arguments passed to the command will be considered as packages path and will be loaded into the node.

ref: #1174

GnoWeb package

This PR also introduce GnoWeb package since it's now running in gnoweb and gnodev command.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added 📦 🤖 gnovm Issues or PRs gnovm related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Nov 20, 2023
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 167 lines in your changes are missing coverage. Please review.

Comparison is base (eef0c98) 56.32% compared to head (5173c05) 56.30%.

Files Patch % Lines
gno.land/pkg/gnoweb/gnoweb.go 62.76% 125 Missing and 18 partials ⚠️
gno.land/pkg/gnoland/node_inmemory.go 0.00% 21 Missing ⚠️
gno.land/pkg/gnoland/genesis.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1386      +/-   ##
==========================================
- Coverage   56.32%   56.30%   -0.02%     
==========================================
  Files         422      422              
  Lines       65699    65699              
==========================================
- Hits        37003    36993      -10     
- Misses      25815    25821       +6     
- Partials     2881     2885       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
gnovm/cmd/gno/dev.go Outdated Show resolved Hide resolved
gnovm/pkg/dev/node.go Outdated Show resolved Hide resolved
gnovm/pkg/dev/node.go Outdated Show resolved Hide resolved
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this PR and recommend gathering community feedback and iterating on it.

It would be helpful to move most of the new logic to contribs/ and create a separate go.mod file. This enables further optimizations while keeping gnovm and gno.land minimalistic.

After moving to contribs/, we should thoroughly review the changes in gnovm/ and gno.land/, and perform a light round of checks on the contribs/ folder before merging and iterating.

@gfanton
Copy link
Member Author

gfanton commented Nov 29, 2023

@moul that's make perfect sense, I will move this to /contribs

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton changed the title feat: Implemented ./contribs/gnodev command feat: Implement ./contribs/gnodev command Dec 9, 2023
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@moul moul mentioned this pull request Dec 12, 2023
9 tasks
Signed-off-by: moul <94029+moul@users.noreply.github.com>
….mod

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
@moul
Copy link
Member

moul commented Dec 12, 2023

@zivkovicmilos @ajnavarro, just wanted to let you know that we encountered a problem while importing tx-archive. It seems that tx-archive imports gno. I suggest we relocate all the tx-archive logic to this repository and reserve the tx-archive repository for specific purposes like releases, or delete it.

moul and others added 6 commits December 12, 2023 18:49
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@zivkovicmilos
Copy link
Member

zivkovicmilos commented Dec 15, 2023

@zivkovicmilos @ajnavarro, just wanted to let you know that we encountered a problem while importing tx-archive. It seems that tx-archive imports gno. I suggest we relocate all the tx-archive logic to this repository and reserve the tx-archive repository for specific purposes like releases, or delete it.

We'll consider opening a PR to migrate out both tx-archive and the faucet repo to their respective places in the gno repo, since they both utilize the main gno repo heavily.
@gfanton mentioned utilizing Go workspaces, so it should make our lives easier in the future in the monorepo

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton merged commit 9262c1a into gnolang:master Dec 15, 2023
179 checks passed
@gfanton gfanton mentioned this pull request Dec 16, 2023
7 tasks
@gfanton gfanton mentioned this pull request Dec 22, 2023
gfanton added a commit to moul/gno that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: No status
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants