Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

eightball/v0 package

Overview

Package eightball is a Magic 8-Ball realm: ask a yes/no question and the block height decides your fate. Deterministic (no real randomness on-chain).

Functions

Ask

func Ask(cur realm, question string) string

Ask poses a question to the Magic 8-Ball and returns its answer. Crossing function: it mutates persistent state, so it takes `cur realm` (gno 0.9).

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/eightball/v0" -func "Ask" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/eightball/v0" -func "Ask" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Asked

func Asked() int

Asked returns how many questions have been asked. Read-only.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/eightball/v0.Asked()"

Result

Render

func Render(path string) string

Render is the gnoweb Markdown view.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/eightball/v0.Render()"

Result