README.md
1.75 Kb · 34 lines
gno.land/r/moul/demo/hello
Step 1 of the r/moul/demo walkthrough: the smallest realm that can be
deployed and called.
1func Hello() string { return "Hello World!" }
2func privateMethod() string { return "I'm private" } // not callable
The point is the capitalization rule. Hello is exported, so it is part of the
realm's transaction surface and can be called with gnokey maketx call.
privateMethod is not exported, so nothing outside the package can reach it,
on chain or off.
1gnokey maketx call -pkgpath gno.land/r/moul/demo/hello \
2 -func Hello -gas-fee 20000ugnot -gas-wanted 2000000 -broadcast moul
Next: args adds a parameter.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.