Structs Onboarding
Personal Files
Before starting, check if SOUL.md, IDENTITY.md, TOOLS.md, COMMANDER.md, or USER.md already have content. If so, read and merge — do not overwrite. These files may contain a previous agent's identity, a human operator's preferences, or your own prior configuration. Add your identity to the existing content.
Important: Entity IDs containing dashes (like 1-42, 5-10) are misinterpreted as flags by the CLI parser. All transaction commands in this skill use -- before positional arguments to prevent this. Always include -- when running structsd tx structs commands with entity IDs.
Procedure
Step 0: Key Management
If using Path B (guild signup) below, the create-player.mjs script can generate a mnemonic automatically — you can skip ahead to Step 1 and let the script handle key creation.
If using Path A (agent has $alpha) or need a key in the local structsd keyring:
CODEBLOCK0
If no key exists, create or recover one:
- - Create new key:
structsd keys add [key-name] — outputs a mnemonic. Save it securely. - Recover from mnemonic:
structsd keys add [key-name] --recover — prompts for mnemonic input.
Get your address:
CODEBLOCK1
Mnemonic security: Store the mnemonic in an environment variable (STRUCTS_MNEMONIC), a .env file (excluded from git), or let the commander provide it. Never commit mnemonics or private keys to the repository.
Warning: structsd keys add --output json outputs the mnemonic in plaintext to stdout. Avoid using --output json unless you are redirecting output to a secure location.
Step 1: Check Player Status
CODEBLOCK2
If the result shows a player ID other than 1-0, a player already exists. Skip to Step 3: Explore Planet (or later steps if planet already explored).
If the player ID is 1-0, no player exists — proceed to Step 2.
Step 2: Create Player
Two paths depending on whether the agent has $alpha (the native token).
Path A: Agent has $alpha
If the address already holds $alpha tokens, delegate to a reactor (validator). This automatically creates a player record.
- 1. Choose a validator/reactor to delegate to
- Run: INLINECODE15
- Poll until player exists:
structsd query structs address [your-address] — repeat every 10 seconds until player ID is not INLINECODE17
Path B: Agent has no $alpha (guild signup)
Join a guild that supports programmatic signup. The bundled create-player.mjs script handles the entire flow: mnemonic generation, proxy message signing, guild API POST, and polling for player creation. It returns a single JSON object with everything you need.
1. Choose a guild
The commander may specify a guild via TOOLS.md or environment config. Otherwise, query available guilds from a reference node:
CODEBLOCK3
INLINECODE19 is a reliable Structs network node run by the Slow Ninja team (Orbital Hydro guild).
2. Get the guild's API endpoint
Each guild record has an endpoint URL pointing to its configuration. Fetch it and look for services.guild_api and services.reactor_api. Not all guilds provide these — if empty, that guild does not support programmatic signup.
Note: Some guild configs may use guildApi (camelCase) instead of guild_api (snake_case). Check both fields when parsing programmatically.
Example guild config:
CODEBLOCK4
3. Run the create-player script
Requirements: Node.js 18+ (for built-in fetch). Install dependencies once:
CODEBLOCK5
Then run (from workspace root):
CODEBLOCK6
The script will:
- 1. Generate a new mnemonic (or use
--mnemonic "..." to recover an existing one) - Derive the address and pubkey
- Check if a player already exists for this address
- Sign the guild-join proxy message and POST to the guild API
- Poll the reactor API until the player ID is confirmed (default 120s timeout)
- Output JSON to stdout with all results
Note: When a player joins a guild, they receive a default guild rank of 101. Guild leadership can later promote members to lower (higher-privilege) ranks. See the structs-guild skill for rank management.
Output format (parse this JSON):
CODEBLOCK7
Immediately save the mnemonic to a secure location (.env, environment variable, or secret store). If you need the key in the local structsd keyring for later commands, recover it: structsd keys add [key-name] --recover and enter the mnemonic.
Important: If the script was given no --mnemonic, it generated a fresh one. The mnemonic is only printed in this output — store it now or it is lost.
Encoding warning: Do NOT attempt to implement the guild signup signing manually. The guild API requires hex-encoded compressed secp256k1 pubkey (66 hex chars) and hex-encoded raw R||S signature (128 hex chars) — NOT base64, NOT Amino. The script handles this correctly. Agents who try to sign manually almost always fail because they use base64 encoding.
Step 3: Explore Planet
Always the first action after player creation:
CODEBLOCK8
New planets start with 5 ore and 4 slots per ambit (space, air, land, water).
Step 4: Check Command Ship
New players receive a Command Ship (type 1) at creation. It may start offline if insufficient power.
CODEBLOCK9
Fleet ID matches player index: player 1-18 has fleet 9-18. Check for existing structs in the fleet.
Step 5: Build Command Ship (only if not gifted)
CODEBLOCK10
Type 1 = Command Ship; must be in fleet, not on planet. Then compute in background:
CODEBLOCK11
Build difficulty 200; wait ~17 min for D=3, hash completes instantly. Compute auto-submits the complete transaction. The struct auto-activates after build-complete — no manual activation needed.
Step 6: Build Ore Extractor
Fleet must be on station, Command Ship online.
CODEBLOCK12
Type 14 = Ore Extractor; ambits: land or water. Then compute in background:
CODEBLOCK13
Build difficulty 700; wait ~57 min for D=3. Auto-activates after build-complete.
Step 7: Build Ore Refinery
CODEBLOCK14
Type 15 = Ore Refinery; ambits: land or water. Compute same as above. Build difficulty 700. Auto-activates after build-complete.
Step 8: Verify
Query player, planet, fleet, and structs. Confirm all online.
Proof-of-Work Notes
The struct-build-compute command is a helper that calculates the hash AND automatically submits struct-build-complete with the results. You do not need to run struct-build-complete separately after compute.
Auto-activation: Structs automatically activate after build-complete. You do not need to run struct-activate after building. Use struct-activate only to re-activate a struct that was previously deactivated.
The -D flag (range 1-64) tells compute to wait until the difficulty drops to that level before starting. Use -D 3 — at D=3 the hash is trivially instant with zero wasted CPU. Lower values wait longer but waste less compute.
| Struct | Type ID | Build Difficulty | Wait to D=3 |
|---|
| Command Ship | 1 | 200 | ~17 min |
| Ore Extractor |
14 | 700 | ~57 min |
| Ore Refinery | 15 | 700 | ~57 min |
| Ore Bunker | 18 | 3,600 | ~4.6 hr |
Charge
Build operations cost 8 charge. Charge accumulates at 1 per block (~6 seconds). Wait at least 48 seconds (8 blocks) between successive build-initiate actions on the same struct. During onboarding, charge is rarely a bottleneck since each struct is different. See knowledge/mechanics/building for the full charge cost table.
Async strategy: Initiate all planned builds immediately — this starts the age clock. While waiting for difficulty to drop, scout the galaxy, assess neighbors, or plan guild membership. Launch compute in a background terminal and check back later. See awareness/async-operations.
One key, one compute at a time. Never run two concurrent *-compute jobs with the same signing key. Both may reach target difficulty simultaneously and submit conflicting sequence numbers — one fails silently, leaving the struct stuck. Sequence compute jobs for the same player.
Ambit Encoding
Struct types have a possibleAmbit bit-flag field:
8 |
| Land | 4 |
| Water | 2 |
Values are combined: 6 = land + water, 30 = all ambits. Check possibleAmbit before choosing an operating ambit.
Commands Reference
| Action | CLI Command |
|---|
| List keys | INLINECODE44 |
| Create key |
structsd keys add [name] |
| Recover key |
structsd keys add [name] --recover |
| Show address |
structsd keys show [name] -a |
| Discover player |
structsd query structs address [address] |
| Query player |
structsd query structs player [id] |
| Reactor infuse |
structsd tx structs reactor-infuse --from [key] --gas auto -y -- [player-addr] [reactor-addr] [amount] |
| Create player (guild signup) |
node .cursor/skills/structs-onboarding/scripts/create-player.mjs --guild-id "..." --guild-api "..." --reactor-api "..." [--mnemonic "..."] [--username "..."] |
| Explore planet |
structsd tx structs planet-explore --from [key] --gas auto -y -- [player-id] |
| Initiate build |
structsd tx structs struct-build-initiate --from [key] --gas auto -y -- [player-id] [struct-type-id] [operating-ambit] [slot] |
| Build compute (PoW + auto-complete + auto-activate) |
structsd tx structs struct-build-compute -D [difficulty] --from [key] --gas auto -y -- [struct-id] |
| Re-activate struct (only if previously deactivated) |
structsd tx structs struct-activate --from [key] --gas auto -y -- [struct-id] |
| Query planet |
structsd query structs planet [id] |
| Query fleet |
structsd query structs fleet [id] |
| Query struct |
structsd query structs struct [id] |
Build order: Command Ship (type 1, fleet) → Ore Extractor (type 14, planet) → Ore Refinery (type 15, planet). Common tx flags: --from [key-name] --gas auto --gas-adjustment 1.5 -y.
Verification
- -
structsd query structs address [address] — player exists (ID is not 1-0) - INLINECODE62 — player online
- INLINECODE63 — planet claimed, ore present
- INLINECODE64 — fleet on station
- INLINECODE65 — struct status = Online
Error Handling
- - Player ID is
1-0 — Player doesn't exist. Follow Step 2 (Path A or Path B). - create-player.mjs fails — Check that
--guild-api and --reactor-api URLs are correct and reachable. Verify the guild supports programmatic signup (services.guild_api exists). If providing a --mnemonic, verify it is a valid 24-word BIP39 mnemonic. - Guild API returns HTML or 404 — The URL is wrong or you are not using the script. The signup endpoint (
/auth/signup) is POST only. Always use create-player.mjs which handles the POST, signing, and polling automatically. - Signup succeeds but player never appears — Re-run the script with the same
--mnemonic to resume polling. The guild may be slow to process. If it still fails after 120s, the guild's proxy may be down. - "insufficient resources" — Check player Alpha Matter balance.
- "fleet not on station" — Wait for fleet or move fleet before planet builds.
- "invalid slot" — Use slot 0-3 per ambit; check planet structs for occupancy.
- "power overload" — Not enough capacity to activate. Add power sources or connect to a substation with more capacity.
See Also
Structs 入门指南
个人文件
开始前,检查 SOUL.md、IDENTITY.md、TOOLS.md、COMMANDER.md 或 USER.md 是否已有内容。如有,请阅读并合并——不要覆盖。这些文件可能包含先前代理的身份、人类操作员的偏好设置,或您自己的先前配置。将您的身份添加到现有内容中。
重要提示:包含连字符的实体ID(如 1-42、5-10)会被CLI解析器误识别为标志。本技能中的所有交易命令在位置参数前使用 -- 以防止此问题。运行带有实体ID的 structsd tx structs 命令时,务必包含 --。
操作流程
第0步:密钥管理
如果使用下面的路径B(公会注册),create-player.mjs 脚本可以自动生成助记词——您可以跳到第1步,让脚本处理密钥创建。
如果使用路径A(代理拥有 $alpha)或需要在本地 structsd 密钥环中拥有密钥:
structsd keys list
如果没有密钥,创建或恢复一个:
- - 创建新密钥:structsd keys add [密钥名称]——输出助记词。请安全保存。
- 从助记词恢复:structsd keys add [密钥名称] --recover——提示输入助记词。
获取您的地址:
structsd keys show [密钥名称] -a
助记词安全:将助记词存储在环境变量(STRUCTS_MNEMONIC)、.env 文件(排除在git之外)中,或让指挥官提供。切勿将助记词或私钥提交到代码仓库。
警告:structsd keys add --output json 会以明文形式将助记词输出到标准输出。除非将输出重定向到安全位置,否则避免使用 --output json。
第1步:检查玩家状态
structsd query structs address [您的地址]
如果结果显示的玩家ID不是 1-0,则玩家已存在。跳到第3步:探索星球(如果星球已探索,则跳到后续步骤)。
如果玩家ID是 1-0,则玩家不存在——继续第2步。
第2步:创建玩家
根据代理是否拥有 $alpha(原生代币)有两种路径。
路径A:代理拥有 $alpha
如果地址已持有 $alpha 代币,委托给反应堆(验证者)。这将自动创建玩家记录。
- 1. 选择要委托的验证者/反应堆
- 运行:structsd tx structs reactor-infuse --from [密钥名称] --gas auto --gas-adjustment 1.5 -y -- [您的地址] [反应堆地址] [数量]
- 轮询直到玩家存在:structsd query structs address [您的地址]——每10秒重复一次,直到玩家ID不是 1-0
路径B:代理没有 $alpha(公会注册)
加入支持程序化注册的公会。附带的 create-player.mjs 脚本处理整个流程:助记词生成、代理消息签名、公会API POST以及轮询玩家创建。它返回一个包含所有所需信息的JSON对象。
1. 选择公会
指挥官可能通过 TOOLS.md 或环境配置指定公会。否则,从参考节点查询可用公会:
curl http://reactor.oh.energy:1317/structs/guild
reactor.oh.energy 是由 Slow Ninja 团队(Orbital Hydro 公会)运行的可靠 Structs 网络节点。
2. 获取公会的API端点
每条公会记录都有一个指向其配置的 endpoint URL。获取它并查找 services.guildapi 和 services.reactorapi。并非所有公会都提供这些——如果为空,则该公会不支持程序化注册。
注意:某些公会配置可能使用 guildApi(驼峰式)而不是 guild_api(蛇形式)。程序化解析时请检查两个字段。
公会配置示例:
json
{
guild: {
id: 0-1,
name: Orbital Hydro,
tag: OH,
services: {
guild_api: http://crew.oh.energy/api/,
reactor_api: http://reactor.oh.energy:1317/,
client_websocket: ws://reactor.oh.energy:26657
}
}
}
3. 运行创建玩家脚本
要求:Node.js 18+(用于内置 fetch)。一次性安装依赖:
cd .cursor/skills/structs-onboarding/scripts && npm install
然后运行(从工作区根目录):
node .cursor/skills/structs-onboarding/scripts/create-player.mjs \
--guild-id 0-1 \
--guild-api http://crew.oh.energy/api/ \
--reactor-api http://reactor.oh.energy:1317 \
--username 您选择的名称
脚本将:
- 1. 生成新的助记词(或使用 --mnemonic ... 恢复现有助记词)
- 派生地址和公钥
- 检查此地址是否已存在玩家
- 签署加入公会的代理消息并POST到公会API
- 轮询反应堆API直到玩家ID被确认(默认120秒超时)
- 将所有结果以JSON格式输出到标准输出
注意:当玩家加入公会时,他们会获得默认公会等级101。公会领导层稍后可以将成员提升到更低(更高权限)的等级。等级管理请参见 structs-guild 技能。
输出格式(解析此JSON):
json
{
success: true,
mnemonic: word1 word2 ... word24,
address: structs1...,
pubkey: a1b2c3...,
player_id: 1-42,
guild_id: 0-1,
username: your-chosen-name,
created: true,
next_step: structsd tx structs planet-explore --from [key-name] --gas auto --gas-adjustment 1.5 -y -- 1-42
}
立即将 mnemonic 保存到安全位置(.env、环境变量或密钥存储)。如果后续命令需要在本地 structsd 密钥环中使用密钥,请恢复它:structsd keys add [密钥名称] --recover 并输入助记词。
重要提示:如果脚本没有提供 --mnemonic,它会生成一个新的。助记词仅在此输出中打印——请立即保存,否则将丢失。
编码警告:不要尝试手动实现公会注册签名。公会API需要十六进制编码的压缩secp256k1公钥(66个十六进制字符)和十六进制编码的原始R||S签名(128个十六进制字符)——不是base64,不是Amino。脚本正确处理此问题。尝试手动签名的代理几乎总是失败,因为他们使用了base64编码。
第3步:探索星球
始终是创建玩家后的第一个操作:
structsd tx structs planet-explore --from [密钥名称] --gas auto --gas-adjustment 1.5 -y -- [玩家ID]
新星球在每个领域(太空、空中、陆地、水域)有5个矿石和4个槽位。
第4步:检查指挥舰
新玩家在创建时会获得一艘指挥舰(类型1)。如果电力不足,它可能处于离线状态。
structsd query structs fleet [舰队ID]
舰队ID与玩家索引匹配:玩家 1-18 拥有舰队 9-18。检查舰队中现有的结构体。
第5步:建造指挥舰(仅在未赠送时)
structsd tx structs struct-build-initiate --from [密钥名称] --gas auto --gas-adjustment 1.5 -y -- [玩家ID] 1 space 0
类型1 = 指挥舰;必须在舰队中,不在星球上。然后在后台计算:
structsd tx structs struct-build-compute -D 3 --from [密钥名称] --gas auto --gas-adjustment 1.5 -y -- [结构体ID]
建造难度200;D=3时等待约17分钟,哈希计算瞬间完成。计算会自动提交完成交易。结构体在建造完成后自动激活——无需手动激活。
第6步:建造矿石