Skip to content
Andy Colosimo edited this page Jun 12, 2026 · 1 revision

Mover on Polygon — complete working example

This is the finished project built in the wiki's Mover tutorial (Part 1, Part 2, Part 3). It was built, run, and tested live against Polygon mainnet.

Contents:

  • mover/ — the official Mover example from libxayagame (MIT licensed, Xaya developers), with the Chain::POLYGON case added in logic.cpp.
  • docker/ — Dockerfile (builds the moverd GSP daemon) and docker-compose.yml (runs XayaX + moverd).
  • scripts/ — Node.js scripts (viem) to register a Xaya name and send moves on Polygon.

Quick start:

cd docker
docker compose --profile xayax up -d --build
# wait ~2 minutes, then:
curl -s -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getnullstate","params":[]}' \
  http://127.0.0.1:8602

To play:

cd scripts
npm install
PRIVATE_KEY=0x... node register-name.mjs myname   # needs 1 WCHI + gas
PRIVATE_KEY=0x... node send-move.mjs myname k 2   # move up 2 steps

Before launching, check that the Docker subnet pinned in docker/docker-compose.yml (172.16.0.0/24) does not collide with your own networks (ip route), and adjust if needed.

Clone this wiki locally