-
Notifications
You must be signed in to change notification settings - Fork 379
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: add 'gnokey maketx run' #1001
Conversation
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1001 +/- ##
==========================================
+ Coverage 55.98% 56.31% +0.32%
==========================================
Files 420 422 +2
Lines 65443 68166 +2723
==========================================
+ Hits 36640 38389 +1749
- Misses 25940 26816 +876
- Partials 2863 2961 +98 ☔ View full report in Codecov by Sentry. |
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: moul <94029+moul@users.noreply.github.com>
$ cat /tmp/script.gno
package main
import (
"std"
"gno.land/r/demo/tests"
"gno.land/r/demo/users"
)
func Main() {
println("HELLO WORLD3x!")
println("render", users.Render(""))
println("tests.CurrentRealmPath", tests.CurrentRealmPath())
println("tests.IsOriginCall", tests.IsOriginCall())
println("tests.GetPrevRealm", tests.GetPrevRealm())
println("std.GetOrigCaller", std.GetOrigCaller())
println("std.PrevRealm", std.PrevRealm())
} $ go run ./gno.land/cmd/gnokey maketx run moul -gas-wanted 10000000 -gas-fee 10000000ugnot -broadcast /tmp/script.gno
Enter password.
HELLO WORLD3x!
render * [administrator](/r/demo/users:administrator)
* [anarcher](/r/demo/users:anarcher)
* [ideamour](/r/demo/users:ideamour)
* [manfred](/r/demo/users:manfred)
* [piupiu](/r/demo/users:piupiu)
* [zo_oma](/r/demo/users:zo_oma)
tests.CurrentRealmPath gno.land/r/demo/tests
tests.IsOriginCall false
tests.GetPrevRealm (struct{("g1vp3uusf5txt06lx76x7qq70nldh5n2hcjqcs88" std.Address),("gno.land/r/main" string)} std.Realm)
std.GetOrigCaller g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq
std.PrevRealm (struct{("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq" std.Address),("" string)} std.Realm)
OK!
GAS WANTED: 10000000
GAS USED: 401843 |
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: 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: 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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i didn't review every line but generally looks great!
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I started reviewing individual files and added a few comments but didn't finish.
Essentially, my take on this is that we should have only one of run or call.
Call could be an alias for run, so that what is implicitly sent to the chain is package main; func main() { FunctionCall(args...) }
.
Wdyt?
I had the same feeling. However, the 1st Another thing that’s different is that |
This PR adds a `contribs/gnomd` binary. Please review PR #1001 for the `maketx run`. Additionally, this PR introduces the `contribs/` folder. It allows the creation of `contribs/gno*` Go packages, Python/Rust/Shell/… scripts. This approach keeps the main `gno`, `gnokey`, and `gnoland` simple while adhering to the Unix philosophy and incorporating several specific gno commands. ![CleanShot 2023-10-19 at 09 17 40@2x](https://github.com/gnolang/gno/assets/94029/9b92bf18-f923-4f70-aea7-a88f185f2342) --------- Signed-off-by: moul <94029+moul@users.noreply.github.com> Co-authored-by: Morgan <morgan@morganbaz.com>
This PR adds a `contribs/gnomd` binary. Please review PR gnolang#1001 for the `maketx run`. Additionally, this PR introduces the `contribs/` folder. It allows the creation of `contribs/gno*` Go packages, Python/Rust/Shell/… scripts. This approach keeps the main `gno`, `gnokey`, and `gnoland` simple while adhering to the Unix philosophy and incorporating several specific gno commands. ![CleanShot 2023-10-19 at 09 17 40@2x](https://github.com/gnolang/gno/assets/94029/9b92bf18-f923-4f70-aea7-a88f185f2342) --------- Signed-off-by: moul <94029+moul@users.noreply.github.com> Co-authored-by: Morgan <morgan@morganbaz.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: moul <94029+moul@users.noreply.github.com>
The summary of how I think we should be going:
|
With the
gnokey maketx run
command, you can execute any code directly on the chain from your user realm. It's convenient because it doesn't require uploading a whole new package - it simply creates a temporarymemfile
.After merging this pull request, our next goal is to develop a client that enables a chain-backed REPL, providing a shell experience similar to Unix. This client will utilize
q_eval
for reading andrun
for writing, enabling seamless interaction with the chain directly from a Go shell. However, for now, let's focus on the current plan.package main
tests.GetPrevRealm(struct{("g1vp3uusf5txt06lx76x7qq70nldh5n2hcjqcs88" std.Address),("gno.land/r/g123456/run", string)} std.Realm)
-> finally won't fix it; we want it to be seen as "gno.land/r/{caller.Addr()}/run"main
instead ofMain
addpkg -pkgpath gno.land/r/main
(reserved)Bonuses and notes for later -> #1283