Skip to content

Instantly share code, notes, and snippets.

@afa7789
Created September 24, 2025 13:17
Show Gist options
  • Select an option

  • Save afa7789/6f142a279c615d85302cdf42d4dc43fb to your computer and use it in GitHub Desktop.

Select an option

Save afa7789/6f142a279c615d85302cdf42d4dc43fb to your computer and use it in GitHub Desktop.
how to use gno gist. First Draft.

Gno Package Deployment and Call Process

Prerequisites

  • 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.

1. Prepare the Package Directory

  • Ensure your Gno source code is in the directory example/p.
  • Example file: hello_world.gno with:
package hello_world

func Hello() string {
  return "Hello, world!"
}

2. Create gnomod.toml

  • Required fields:
gno_version = "0.9"
module = "gno.land/p/hello_world"
package = "gno.land/p/hello_world"
  • Place this file in the example/p directory.

3. Deploy the Package

  • 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.

4. Call the Deployed Function

  • To call the Hello function 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.

Notes

  • The process requires a running Gno.land node at http://127.0.0.1:26657.
  • All commands assume you have a key named MyKey configured.
  • Errors about missing fields or incorrect versions in gnomod.toml must be fixed before deployment will succeed.

This document was generated based on your session history and actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment