Skip to content Search Apps Documentation Source Content 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.

v0 state

Back to all declarations

regNames

[32]string

regNames are the ABI names, because nobody reading a register dump thinks in x-numbers and every compiler's output is annotated with these.

Open
OID
0b5e0a…b122:112
regNames details

Inspect array

Render

func(path string) string

Render is the realm's gnoweb view. - "/" the samples, the instance list, and what the numbers mean. - "/\<id>" one instance: its status, fuel, output and register file.

Open
OID
0b5e0a…b122:113
Render details

Inspect func

renderInstance

func(id string) string
Open
OID
0b5e0a…b122:116
renderInstance details

Inspect func

renderRegisters

func(inst *v0.Instance) string

renderRegisters restores the snapshot to read the register file out of it. The hart is not kept between transactions, only its snapshot is, so this is the only place the state is legible, and it is the thing worth seeing: a program that wrote nothing still computed something.

Open
OID
0b5e0a…b122:117
renderRegisters details

Inspect func

hexDigits

untyped string

Value

"0123456789abcdef"

hexDump

func(b []uint8, max int) string

hexDump shows the image as words, which is how anyone reading RV32 reads it.

Open
OID
0b5e0a…b122:119
hexDump details

Inspect func

printable

func(b []uint8, max int) string

printable renders guest output for a code fence: printable ASCII as itself, everything else as an escape. A guest writes arbitrary bytes, so this is the only form of it that is safe to show.

Open
OID
0b5e0a…b122:120
printable details

Inspect func

codeCell

func(s string) string

codeCell puts already-printable text in a code span inside a table cell. Inside backticks markdown escapes are not applied, so ui.Cell's backslashes would reach the reader verbatim ("Hello, gno\\.land"); the one character a table cell still needs escaped there is the pipe. printable has already removed the backtick and the newline, the other two that could break out.

Open
OID
0b5e0a…b122:121
codeCell details

Inspect func

MaxInstances

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(64 <untyped> bigint)

MaxImage

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(8192 <untyped> bigint)

MaxOutput

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(4096 <untyped> bigint)

MaxInput

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(1024 <untyped> bigint)

DefaultFuel

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(100000 <untyped> bigint)

MaxSliceFuel

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(100000 <untyped> bigint)

idgen

v0.ID

Value

<zero>

count

int

Value

6

host

type

host is the realm-backed [vmkit.Host](/gno.land/p/nym-moultest123/x/vm/vmkit/v0#Host). One is built per call, wrapping the instance being stepped, so a guest's output and authority are scoped to it and nothing ambient leaks in.

Value

v0.host

Upload

func(hexImage string, input string, budget int64) string

Upload stores a hex-encoded text image as a new instance and returns its id. The image is loaded here rather than at the first Step, so a misaligned or oversized one is rejected by the transaction that submitted it instead of costing somebody else the gas later.

Open
OID
0b5e0a…b122:132
Upload details

Inspect func

UploadSample

func(name string, input string, budget int64) string

UploadSample stores one of the programs the front page offers. Writing RV32IM by hand is not the point of this realm, and without this nobody without a cross compiler could press a button.

Open
OID
0b5e0a…b122:134
UploadSample details

Inspect func

upload

func(img []uint8, input string, budget int64) string
Open
OID
0b5e0a…b122:135
upload details

Inspect func

Step

func(id string, fuel int64) string

Step runs one slice of the instance: up to \`fuel\` guest instructions, then stop and keep the snapshot. Anyone may pay for a slice, not only the owner: a paused program that only its owner can advance is a worse demo and no safer, since the program and its budget were both fixed at upload.

Open
OID
0b5e0a…b122:136
Step details

Inspect func

Remove

func(id string)

Remove deletes an instance. Owner only.

Open
OID
0b5e0a…b122:137
Remove details

Inspect func

decodeHex

func(s string) ([]uint8, bool)

decodeHex accepts the output of any hexdump: an even number of hex digits, with an optional 0x prefix, and whitespace anywhere. Whitespace is allowed because that is what a pasted hexdump has in it; anything else is refused, because a silently mangled image would trap somewhere unrelated later.

Open
OID
0b5e0a…b122:139
decodeHex details

Inspect func

hexVal

func(c uint8) (uint8, bool)
Open
OID
0b5e0a…b122:140
hexVal details

Inspect func

sample

type

The programs the front page offers, as the machine words a cross compiler would have emitted. They are assembled outside this repo and pinned here, and riscvdemo\_test.gno runs every one of them to the expected answer, so a wrong word is a failing test rather than a page that traps when clicked.

Value

v0.sample

sampleByName

func(slug string) *v0.sample
Open
OID
0b5e0a…b122:153
sampleByName details

Inspect func
regNames : [32]string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderInstance : func(id string) string Inspect
renderRegisters : func(inst *v0.Instance) string Inspect
fuelText : func(n int64) string Inspect
hexDigits : untyped string ="0123456789abcdef"
hexDump : func(b []uint8, max int) string Inspect
printable : func(b []uint8, max int) string Inspect
codeCell : func(s string) string Inspect
MaxInstances : untyped bigint =(64 <untyped> bigint)
MaxImage : untyped bigint =(8192 <untyped> bigint)
MaxOutput : untyped bigint =(4096 <untyped> bigint)
MaxInput : untyped bigint =(1024 <untyped> bigint)
DefaultFuel : untyped bigint =(100000 <untyped> bigint)
MaxSliceFuel : untyped bigint =(100000 <untyped> bigint)
store : *v0.Store Inspect
inputs : *v0.Tree Inspect
idgen : v0.ID =<zero>
count : int =6
host : type =v0.host
Upload : func(hexImage string, input string, budget int64) string Inspect
UploadSample : func(name string, input string, budget int64) string Inspect
upload : func(img []uint8, input string, budget int64) string Inspect
Step : func(id string, fuel int64) string Inspect
Remove : func(id string) Inspect
inputOf : func(id string) string Inspect
decodeHex : func(s string) ([]uint8, bool) Inspect
hexVal : func(c uint8) (uint8, bool) Inspect
sample : type =v0.sample
samples : []v0.sample (len=6) Inspect
sampleByName : func(slug string) *v0.sample Inspect