Stand-alone application example
Run browser, Node.js and Go access.
Three examples that do not rely on games#
Fresh deployments from 2026-10-24: Recruit 100 (default admission mining power, configurable per game) → Warrior 300 → Chief 2,700 → Retirement 8,100 mining power, paid on each actual milestone, totaling 11,200 per full cycle at the default. Later paid cycles earn real promotions again. Free seed warriors receive no admission or initial warrior reward. Taking over a seat (paid takeover or accepted transfer) pays the admission and warrior amounts on that seat's first handover (after an accepted transfer, once the new holder fills the seat); later paid takeovers pay only admission and later transfers pay nothing. Replacement is not retirement.
All mining power uses this game’s 6-decimal Honor.goldBalance ledger. Admission, promotion, retirement and the once-only profile reward increase lifetime combat power. Tasks, wars, sales and ordinary extensions only credit mining power. Spending never reduces power. Country creation/joining cost 10,000 / 20 mining power. Initial prestige imports lifetime power; leaving removes it and rejoining imports it once again.
Each game has its own mining power redemption pool. Availability, claim times and actual redemption results are determined by the game page and on-chain transactions.
Standalone integration examples are in the Nodejs SDK’s examples directory and the Go SDK’s examples/social directory. They use only social contract addresses and RPC, and contain no website, backend or contract implementations.
Both SDKs retain all capabilities. These examples demonstrate runtimes, not feature restrictions. The browser example uses HTTP RPC and a wallet; the Node.js index defaults to HTTP with optional WSS. Go supports the same queries, transactions and events.
| Example | Documentation | Function |
|---|---|---|
| Browser independent community | node_modules/@x404/sdk/examples/browser.html | Wallet registration, posting, page reading |
| Node.js Event Index | node_modules/@x404/sdk/examples/indexer.mjs | HTTP replay, optional WSS wakeup and atomic JSON checkpoints |
| Go independent service entrance | vendor-src/x404-go-sdk/examples/social/main.go | Verify protocol, read posts, optional event scanning |
Node.js running#
npm install ethers@^6.17.0 https://x404.app/downloads/x404-sdk-0.1.0.tgz
RPC_URL=http://127.0.0.1:YOUR_RPC_PORT SOCIAL_ADDRESS=0xYOUR_SOCIAL CHAIN_ID=1337 START_BLOCK=0 node node_modules/@x404/sdk/examples/indexer.mjsOptional WSS_URL wakes up synchronization in advance; CONFIRMATIONS defaults to 12, and isolation testing can be set to 0; STATE_PATH points to its own checkpoint file. This example saves the event log for demonstration. Production should use database projection and paging query instead, and the JSON file cannot grow infinitely.
Browser running#
npm install ethers@^6.17.0 https://x404.app/downloads/x404-sdk-0.1.0.tgz
node node_modules/@x404/sdk/examples/serve-browser.mjs
# Open http://localhost:4173Browser examples are loaded from local node_modules with the built ESM SDK, no third-party CDN. Fill in the chainId, social address and HTTP RPC that allows your site to access the page; first switch the wallet to the target chain, then register and post.
Go Run#
cd vendor-src/x404-go-sdk
RPC_URL=http://127.0.0.1:YOUR_RPC_PORT SOCIAL_ADDRESS=0xYOUR_SOCIAL CHAIN_ID=1337 go run ./examples/social
# Optional START_BLOCK=0: scan through the current confirmed head; CONFIRMATIONS=0 is only for isolated tests.An example of custom contract combination is inCustom applications. SDK automated tests verify real registration, following, posting, replying, liking, paging and event playback on new deployments, and the two languages read the same data.
Asset and country extension examples#
Downloads now include examples/extensions.mjs and Go's examples/extensions/main.go. Both examples only read state, without reading private keys or sending transactions. After checking chain ID, they read mining power, item 0, extension budgets, personal allowances and country membership. The Node.js example also reads inventory and its valuation.
RPC_URL=https://YOUR_RPC CHAIN_ID=56 GAME_ADDRESS=0xYOUR_GAME \
MEMBER_ADDRESS=0xYOUR_MEMBER EXTENSION_ADDRESS=0xYOUR_EXTENSION \
node node_modules/@x404/sdk/examples/extensions.mjscd vendor-src/x404-go-sdk RPC_URL=https://YOUR_RPC CHAIN_ID=56 GAME_ADDRESS=0xYOUR_GAME \ MEMBER_ADDRESS=0xYOUR_MEMBER EXTENSION_ADDRESS=0xYOUR_EXTENSION \ go run ./examples/extensions
Use a current game deployment supporting the multi-asset interfaces. For governance proposals, single-transaction participation and asset allowances, see [Game characters and item extensions](/docs/game-extensions). The protocol provides empty character, equipment, item and attribute containers. Specific crafting, shops, class effects and country construction are not deployed automatically.