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.

game33 package

Function

MigrateBatch

func MigrateBatch(cur realm, batchId string, kind string, rowsJson string) int
Ask AI Claude ChatGPT

── Migration (game31 → game32) ──────────────────────────────────────────────

MigrateBatch(batchId, kind, rowsJson) imports one batch. rowsJson is a JSON array of string arrays. Kinds and row shapes:

Example
1balance  [addr, coinId, amount]       → balances (SET, not add)
2lifetime [addr, coinId, amount]       → lifetimeMined (SET) + miners total
3tools    [addr, "t1,t2,..."]          → ownedTools (SET, unknown ids dropped)
4toollife [addr, toolId, life]         → toolLife (SET, clamped to max)
5skill    [addr, skillId, rank]        → skillRanks (SET, clamped to max)
6medal    [addr, achievementId]        → achievements (allowlisted ids only)
7pass     [addr, expiryUnix]           → gnomePasses (SET)
8guild    [guildId, name, leader, "m1,m2,..."] → guilds + members
9ban      [addr, reason, expiryUnix]   → blacklist (expiry 0 = permanent)

A batchId that was already applied is skipped, and every write is a SET, so re-running a whole migration is a no-op. FinalizeMigration locks it forever. Every unique player address in a batch is recorded in migrationAddrs so that MigrationStatus can report how many distinct players were migrated.

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/g1algwpj0dch4stpy7pd87n7a3cwx3pjymlpexn7/game33" -func "MigrateBatch" -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/g1algwpj0dch4stpy7pd87n7a3cwx3pjymlpexn7/game33" -func "MigrateBatch" -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