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.

hlmailbox package

Overview

Package hlmailbox is the gno.land end of the bridge's message layer (bridge/PLAN.md §5.1): realms send messages to other chains through it and take the messages other chains send them from it. Messages, ids and the merkle tree are Hyperlane's byte for byte (gno.land/p/…/hyperlane/v0), so the Solana side runs Hyperlane's own programs.

Out. Dispatch takes a message from the realm that calls it, numbers it, puts its id in the merkle tree, keeps the message, and emits the Dispatch event the Solana light client proves from LastResultsHash (§13: id, nonce, origin, destination, sender, recipient, hash). Reemit emits it again from a fresh block, by anyone.

In. A recipient realm pulls its own messages: it calls Process with the message and the verifier's metadata; Process checks the caller is the recipient, that the message is for this chain and was never delivered, marks it delivered, and only then asks the active verifier — a realm that registered itself here, chosen by GovDAO by pkgpath — whether the message is genuine; a verifier's error is a panic, so the transaction and the mark revert together and a refused message stays deliverable.

Who may change what. Nobody holds an admin key: every setting moves by a decision made with this realm's builders (gov.gno), at once or after 7 days (§5.3), and nothing but Launch and cancel before the one-shot Launch. Who decides is the governor's (M1k): the compiled launchGovernor alone, by its own call through Govern, until it yields (Yield, once, for every bridge realm at once), and GovDAO's proposals from then on — or from the first block, when no governor was compiled. The guardians and watch keys (flags.gno) can only pause: three flags per key per route — sends, credits, payouts — which the routes ask about with Paused. Every launch value is compiled in below and written by init.

Function

AddRoute

func AddRoute(cur realm, path string)
Ask AI Claude ChatGPT

AddRoute registers a successor route realm (a route's migrate names it), so flags can be set on it too, and records the succession both ways (AQ1): the caller's `successor`, the new route's `predecessor`, which is what lets the successor take a message addressed to the predecessor (Process) — the burns name the predecessor until kind 6 enrolls the successor. The path is a deployed realm's: a sub-identity's (`host#subpath`) is refused, since the route powers are keyed by exact pkgpath (mustBeRoute) and such a path would hand them to a token its host mints for free; a path that is a route already is refused (a chain never cycles). A route that migrated already re-points its migration (AR2): its migrate decision names another successor while the first pulled nothing — the route's own state refuses once page 0 moved, and a first successor that migrated on holds the lock, so it is refused here too — and the first's registration is dropped with the flags copied to it, the new path taking its place with the flags standing on the route now.

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/g1zdaz6sypk5tdsjc2fzsqrrn4ttn8qzmnl4waqp/hlmailbox" -func "AddRoute" -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/g1zdaz6sypk5tdsjc2fzsqrrn4ttn8qzmnl4waqp/hlmailbox" -func "AddRoute" -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