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

validators/v2 package

Overview

Package validators implements the on-chain validator set management through Proof of Contribution. The Realm exposes only a public executor for govdao proposals, that can suggest validator set changes.

Functions

GetChanges

func GetChanges(from, to int64) []validators.Validator
Ask AI Claude ChatGPT

GetChanges returns the validator changes stored on the realm, for blocks in the [from, to] range (inclusive on both ends). If to >= math.MaxInt64, it is clamped to math.MaxInt64-1 to avoid overflow. Panics if from > to (after clamping). This function is intended to be called by gno.land through the GnoSDK.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/validators/v2.GetChanges(,)"

Result

GetValidator

func GetValidator(addr address) validators.Validator
Ask AI Claude ChatGPT

GetValidator returns the typed validator

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/validators/v2.GetValidator()"

Result

GetValidators

func GetValidators() []validators.Validator
Ask AI Claude ChatGPT

GetValidators returns the typed validator set

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/validators/v2.GetValidators()"

Result

IsValidator

func IsValidator(addr address) bool
Ask AI Claude ChatGPT

IsValidator returns a flag indicating if the given bech32 address is part of the validator set

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/validators/v2.IsValidator()"

Result

NewPropRequest

func NewPropRequest(cur realm, changesFn func() []validators.Validator, title, description string) dao.ProposalRequest
Ask AI Claude ChatGPT

NewPropRequest creates a new proposal request that wraps a changes closure proposal. This wrapper is required to ensure the GovDAO Realm actually executed the callback.

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/sys/validators/v2" -func "NewPropRequest" -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/sys/validators/v2" -func "NewPropRequest" -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(_ string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/validators/v2.Render()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/sys/validators/v2, for example a function call with arguments.