Gnolang comes with cli toolsuite to help developers test their code and interact with the chain:
gnodev
which provides multiple utilities to develop in Gnolang
$ gnodev --help available subcommands: build - build a gno package precompile - precompile .gno to .go test - test a gno package repl - start a GnoVM REPL
gnokey
to create local wallets, sign/broadcast transactions and make RPC queries
$ gnokey --help available subcommands: add - add key to keybase delete - delete key from keybase generate - generate a new private key list - list all known keys sign - sign a document verify - verify a document signature broadcast - broadcast a signed document query - make an ABCI query maketx - compose a tx document to sign
$ git clone git@github.com:gnolang/gno.git ... $ cd ./gno $ make install Installing gnodev go install ./cmd/gnodev Installing gnokey go install ./cmd/gnokey
This will install gnodev
and gnokey
on your system. Run gnodev --help
and gnokey --help
to verify the installation.
To test deployments and interact with your contract locally, it is recommended to run a local gnoland node.
$ git clone git@github.com:gnolang/gno.git ... $ cd ./gno $ make ... $ ./build/gnoland
Note that your local gnoland node cache is stored in the gno/testdir
directory. You can rm
it to clean your cache (and therefore all deployments and actions made in your local environment)
In this example, we will deploy locally a Realm we developed and interact with using CLI and Gnoland web interface. For this setup we will have the following structure:
$ ls gno # official gno repo gno-test # our playground
gnokey add test --recover # Use the following mnemonic: # source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
./gno/build/gnoland
gno-test/hello/hello.gno
filepackage hello func world() string { return "world!" } func Render(path string) string { return "Hello, " + world() }
gnokey maketx addpkg test --pkgpath "gno.land/r/test/hello" --pkgdir "gno-test/hello/" --gas-fee 5000000ugnot --gas-wanted 1000000 --broadcast true --chainid "dev" --remote localhost:26657
cd gno && go run ./gnoland/website/main.go
Previous doc: Gnolang Introduction
Next doc: Realms Development
Gnoland Space is a community initiative.
Disclaimer