Realm detail
guestbook
gno.land/r/g1cz86tl8vnh9956cpuu43ksjy7kmur745wdjxsc/guestbook
Indexed deployment identity with independently loaded latest RPC source, functions, and Render.
Indexed deployment
Identity
- Package path
- gno.land/r/g1cz86tl8vnh9956cpuu43ksjy7kmur745wdjxsc/guestbook
- Block
- 270043
- Deployed (UTC)
- Transaction
- 10flPo8vJl0HxTgMD/bLQriXmW1bkCLeLgq0YdvzGqI=
Latest RPC state
Source
package guestbook
import "strconv"
var entries []string
// Sign adds a message to the on-chain guestbook.
func Sign(cur realm, msg string) {
if msg == "" {
panic("message required")
}
if len(msg) > 200 {
panic("message too long")
}
entries = append(entries, msg)
}
// Render draws the public guestbook page.
func Render(path string) string {
out := "# Guestbook\n\n"
out += "A simple on-chain guestbook. Call `Sign(\"your message\")` to add an entry.\n\n"
out += "## Entries (" + strconv.Itoa(len(entries)) + ")\n\n"
if len(entries) == 0 {
out += "_No entries yet._\n"
return out
}
for i := len(entries) - 1; i >= 0; i-- {
out += "- " + entries[i] + "\n"
}
return out
}
Latest RPC state
Exported functions
- Sign(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, msg string)
- Render(path string) string
Latest RPC state · Realm Render
Guestbook
A simple on-chain guestbook. Call Sign("your message") to add an entry.
Entries (0)
No entries yet.