- Make sure you have Gno CLI tools installed (
gnokey,gnodev, etc). - Start a local Gno node for development:
gnodev start --chainid dev- Create and fund a key for signing transactions:
gnokey add MyKey
# Fund MyKey with test tokens if needed- Confirm your node is running and accessible at
http://127.0.0.1:26657.
This document summarizes the steps and commands used to deploy and interact with a Gno package on a local Gno.land blockchain.
- Ensure your Gno source code is in the directory
example/p. - Example file:
hello_world.gnowith:
package hello_world
func Hello() string {
return "Hello, world!"
}- Required fields:
gno_version = "0.9"
module = "gno.land/p/hello_world"
package = "gno.land/p/hello_world"- Place this file in the
example/pdirectory.
- Use the following command to deploy the package:
gnokey maketx addpkg \
-pkgpath "gno.land/p/hello_world" \
-pkgdir "example/p" \
-gas-fee 10000000ugnot \
-gas-wanted 8000000 \
-broadcast \
-chainid dev \
-remote "http://127.0.0.1:26657" \
MyKey- Enter your password when prompted.
- If you see errors about missing or invalid
gnomod.toml, ensure the file exists and contains all required fields.
- To call the
Hellofunction in your package:
gnokey maketx call \
-pkgpath "gno.land/p/hello_world" \
-func "Hello" \
-gas-fee 10000000ugnot \
-gas-wanted 2000000 \
-chainid dev \
-remote "http://127.0.0.1:26657" \
MyKey- The output will show the transaction details. If successful, your function is callable on-chain.
- The process requires a running Gno.land node at
http://127.0.0.1:26657. - All commands assume you have a key named
MyKeyconfigured. - Errors about missing fields or incorrect versions in
gnomod.tomlmust be fixed before deployment will succeed.
This document was generated based on your session history and actions.