Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

dokimi/v1 package

Overview

Package dokimi is a public registry of pre-registered experiments.

Before a test starts, its owner locks a plan here: the hypothesis, the one metric that decides it, the size of change that counts as a win and the number of people each arm must reach. The block height and a fingerprint of the plan are stored with it. From then on the plan cannot be edited.

While the test runs the owner reports running totals. Every report is kept and totals can only go up. A mistake is fixed by adding a correction, which is marked as one and never replaces the report it corrects. Closing the experiment judges the last report against the plan with the rules in gno.land/p/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.

An owner is whoever called Register: a person's account, or another realm that wants its own experiments on the public record.

Functions

AddCorrection

func AddCorrection(cur realm, id uint64, controlExposures, controlConversions, variantExposures, variantConversions int64, reason string)
Ask AI Claude ChatGPT

AddCorrection replaces the running totals after a mistake, for example a mistyped count. Unlike AddReport it may lower a total, so it asks for a reason and is shown on the page as a correction. The mistaken report stays on the record: a correction is added after it, never written over it. Only the owner can correct, and only while the experiment is open.

Params

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/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddCorrection" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddCorrection" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

AddNote

func AddNote(cur realm, id uint64, text string)
Ask AI Claude ChatGPT

AddNote attaches a public remark to an experiment. Only the owner can add one, at any time, including after the experiment is closed.

Params

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/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddNote" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddNote" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

AddReport

func AddReport(cur realm, id uint64, controlExposures, controlConversions, variantExposures, variantConversions int64, source string)
Ask AI Claude ChatGPT

AddReport records the running totals for both arms. Only the owner can report, only while the experiment is open, and no total may go down. source says where the numbers came from, for example a dashboard link.

Params

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/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddReport" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "AddReport" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Close

func Close(cur realm, id uint64) string
Ask AI Claude ChatGPT

Close ends an experiment and stores the verdict of its last report judged against the locked plan. Only the owner can close, once, and only after at least one report. It returns the outcome: "met", "missed" or "inconclusive".

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/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "Close" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "Close" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Count

func Count() int
Ask AI Claude ChatGPT

Count returns how many experiments have been registered.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.Count()"

Result

DigestOf

func DigestOf(id uint64) string
Ask AI Claude ChatGPT

DigestOf returns the fingerprint of the locked plan.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.DigestOf()"

Result

LiftOf

func LiftOf(id uint64) (liftBps int64, ok bool)
Ask AI Claude ChatGPT

LiftOf returns the lift of the latest report in basis points. ok is false when there is no report yet or the lift is undefined.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.LiftOf()"

Result

Matches

func Matches(id uint64, title, hypothesis, metric, control, variant, direction, target string, minSample int64) bool
Ask AI Claude ChatGPT

Matches reports whether the given plan text is exactly what was locked under id. It recomputes the fingerprint from the arguments, so anyone can check a plan they were shown against the public record.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.Matches(,,,,,,,,)"

Result

Register

func Register(cur realm, title, hypothesis, metric, control, variant, direction, target string, minSample int64) uint64
Ask AI Claude ChatGPT

Register locks a new plan and returns its id. The caller becomes the owner.

direction is "increase" or "decrease". target is the smallest relative change that counts as a win, as a percentage such as "15" or "12.5". minSample is the number of exposures each arm must reach before the result can count.

Params

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/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "Register" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1" -func "Register" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render draws the registry for gnoweb.

Example
1""      the home page: the list and the form to lock a new plan
2"<id>"  one experiment: its plan, reports, notes and verdict

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.Render()"

Result

Status

func Status(id uint64) string
Ask AI Claude ChatGPT

Status returns "open" while an experiment is running, and afterwards its outcome: "met", "missed" or "inconclusive". Other realms can call it to act on a result, for example to release a reward only when a target was met.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1.Status()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1, for example a function call with arguments.