-
Notifications
You must be signed in to change notification settings - Fork 397
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
Added smart contract does not run #581
Comments
Try with Have a look here for example: https://test3.gno.land/r/demo/foo20?help |
Added unknown address error These is build/gnokey list
0. test1 (local) - addr: g1tm8a6g4ptpt823llnjnk096t6s7jclq3exlcjz pub: gpub1pgfj7ard9eg82cjtv4u4xetrwqer2dntxyfzxz3pqtesk5kgc4lkw9adtxr6uvf0qajnylc2x8yx3a24ytwwgl38rtkgzcdkaa8, path: <nil> |
Try using the address before the flags Here is a typical command that I would use: |
This worked before big-huge CLI refactor. Now order of parameters is different. build/gnokey maketx call -h
USAGE
call [flags] <key-name or address>
Keyname or address is the last argument. |
I have tried both keybase name and address. Same issue: unknown address error. |
With the new cli for me this works:
I had to add `-args "foo". |
@grepsuzette is right. Due to the CLI library we're using, it requires that command arguments be left at the end (after flags), there is really no way around this: I'm sorry this refactor is causing headaches now, especially when some guides are still using the old syntax, but it was a necessary step in standardizing the way people use gno, and write commands |
Hello function has no arguments. |
More details to this issue. Address is in the list of all the other addresses reported via
First addpkg and then call is made for gnoland reports this:
|
Sorry I tinkered a bit of everything on my localhost in the beginning, I should revert that. I think your account is added into Easy way to check it:
If so, you must have reset the blockchain in some ways. You can add yourself to the genesis file using this tuto https://github.com/grepsuzette/gnoland-tutorials/blob/restart-to-read-genesis/docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md. This requires you manually addpkg the modules you want. Or use a faucet (it must be explained somewhere there https://github.com/onbloc/gnoland-tutorials). |
BTW I also found this was the biggest obstacle to start working on GNO in the beginning |
Thanks grepsuzette. ./gnokey query auth/accounts/g1u4f3dj5psnjh4efywl4yhz4ah864wnww4eealw height: 0
data: {
"BaseAccount": {
"address": "g1u4f3dj5psnjh4efywl4yhz4ah864wnww4eealw",
"coins": "10000000000ugnot",
"public_key": null,
"account_number": "53",
"sequence": "0"
}
I perform |
It's a very good start. |
nope. Still same error. Tried few different variations including change to smart contract itself accept 1 parameter. |
Can you indicate the full line you type? |
./gnokey maketx addpkg -deposit "1ugnot" -gas-fee "1ugnot" -gas-wanted "5000000" -remote "localhost:26657" -chainid "dev" -pkgdir "/home/tad/sage/gno/build" -pkgpath "gno.land/r/demo/hello" test1
./gnokey maketx call -gas-fee "1ugnot" -gas-wanted "5000000" -remote "localhost:26657" -chainid "dev" -pkgpath "gno.land/r/demo/hello" -broadcast -func Hello -args "" test1 package hello
var root int
func Render(path string) string {
root += 1
return fmt.Sprintf("Hello: %d", root)
}
func Hello(path string) string {
root += 1
// panic(ufmt.Sprintf("worked: %d", root))
return fmt.Sprintf("Hello: %d", root)
} test1 exists with valid address. gnoland does not produce any error in the output. gnokey maketx call result: "internal error". |
Note the first call to When you add the |
So there's no bug, so far it's expected behaviour. To make your example work, I suggest to |
Added -broadcast option: ./gnokey maketx addpkg -deposit "1ugnot" -gas-fee "1ugnot" -gas-wanted "5000000" -remote "localhost:26657" -broadcast -chainid "dev" -pkgdir "/home/tad/sage/gno/build" -pkgpath "gno.land/r/demo/hello" test1 Now getting different error:
|
Based on the command you typed, you're trying to push all your gno binaries in |
ok. I have moved code into separate dir: ./gnokey maketx addpkg -deposit "1ugnot" -gas-fee "1ugnot" -gas-wanted "5000000" -remote "localhost:26657" -broadcast -chainid "dev" -pkgdir "/home/tad/sage/gno/build/hello" -pkgpath "gno.land/r/demo/hello" test1 Getting internal error again. |
Tip: when you get |
solved. This time it was an issue in the smart contract code. |
Description
Commit# 469b97a
Can not run added smart contract. Call does not execute.
addpkg appears to work. No errors reported.
Output
hello.gno source code:
Uncommenting panic above does not produce panics.
The text was updated successfully, but these errors were encountered: