DeclareTriggers
Ask AI
DeclareTriggers sets the realm's triggers in the gnotif registry. Admin only, and the first call has what the registry's Open requires: the namespace owner's own key (not a session), in a call sent straight to the realm; so the deployer sends it once the realm is deployed (on gnodev, the make notif script sends it as test1). The triggers keep their ids from one call to the next. Every call makes the registry emit each trigger again (TriggerDeclared), which is what a gnotif server reads them from: the registry emits nothing for a trigger set as it already is, so each is first set with a nudged body, then as it should be. That is for gnodev, whose reload puts the earlier call in the genesis, where no indexer serves its events: the script calls again after each reload and the triggers reach gnotifd anew.
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/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/v0" -func "DeclareTriggers" -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/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/v0" -func "DeclareTriggers" -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