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

/dev

The chain as a Plan 9 device tree. Each file is a function: reading it runs code, so /dev/height is never stale.

Posted to r/moul/x/plan9/ns's /srv at deploy time, so no realm has to import this one to use it:

bind /srv/dev /dev
device contents
caller pkgpath of the realm that crossed into this read
domain the chain domain
drivers this table
height current block height
null always empty; the bit bucket
random sha256 of chain id and height, hex; block-deterministic, NOT unpredictable
session the calling key's session scope, one AllowPath per line
sysname the chain id
time block time, RFC3339
user the origin caller's address
zero endless NUL bytes; reads exactly what you ask for

Design and analysis: moul/gno-contracts#136.

Not affiliated with Plan 9. Plan 9 from Bell Labs is the work of the Computing Science Research Center at Bell Labs; the name and the marks are theirs, and the copyright is held by the Plan 9 Foundation. This realm borrows the vocabulary and none of the code: it is an homage, asking what that ecosystem's spirit looks like on a chain.