Structs Economy
Procedure
- 1. Assess position — Query player, reactor, provider, agreement state via
structsd query structs player/reactor/provider/agreement [id]. - Reactor staking — Stake Alpha Matter:
structsd tx structs reactor-infuse [player-address] [reactor-address] [amount] TX_FLAGS. The amount must include the denomination, e.g. 60000000ualpha (not just 60000000). This automatically increases the player's capacity — no allocation setup needed. The reactor's commission rate determines the split: player receives power * (1 - commission), reactor keeps the rest. Unstake: reactor-defuse [reactor-id] (cooldown applies). Cancel cooldown: reactor-cancel-defusion [reactor-id]. Migrate: reactor-begin-migration [player-address] [source-validator-address] [dest-validator-address] [amount]. - Generator infusion —
structsd tx structs struct-generator-infuse [struct-id] [amount] TX_FLAGS. IRREVERSIBLE — Alpha cannot be recovered. Higher conversion rates than reactors (2-10x) but generator is vulnerable to raids. - Provider lifecycle — Create:
provider-create [substation-id] [rate] [access-policy] [provider-penalty] [consumer-penalty] [cap-min] [cap-max] [dur-min] [dur-max] TX_FLAGS. Valid access-policy values: open-market (anyone can buy), guild-market (guild members with sufficient rank can buy -- managed via guild rank permissions on the provider), closed-market (only players with explicit PermProviderOpen on the provider). Update capacity/duration/access via provider-update-capacity-maximum, provider-update-duration-minimum, etc. Delete: provider-delete [provider-id]. Withdraw earnings: provider-withdraw-balance [provider-id]. To grant guild members access to a guild-market provider: permission-guild-rank-set [provider-id] [guild-id] 262144 [rank] (PermProviderOpen). - Agreements — Open:
agreement-open [provider-id] [duration] [capacity] TX_FLAGS. Close: agreement-close [agreement-id]. Adjust: agreement-capacity-increase/decrease, agreement-duration-increase. - Allocations — Create:
allocation-create [source-id] [power] --allocation-type static|dynamic|automated TX_FLAGS. The --controller flag accepts a PlayerId (e.g., 1-42). If omitted, the creating player is the default controller. Update: allocation-update [allocation-id] [new-power]. Delete: allocation-delete [allocation-id] — only the controlling player can delete an allocation. Transfer: allocation-transfer [allocation-id] [new-controller].
Allocation Type Comparison
| Type | Updatable | Deletable | Auto-grows | Limit | Use Case |
|---|
| INLINECODE31 | No | No (while connected) | No | Unlimited | Fixed capacity routing |
| INLINECODE32 |
Yes | Yes | No | Unlimited | Flexible, managed routing |
|
automated | Yes | No | Yes (scales with source capacity) | One per source | Energy commerce (recommended) |
|
provider-agreement | System-managed | System-managed | System-managed | System-created | Auto-created when agreements open; never create manually |
Automated allocation limit: Only one automated allocation per source is allowed. Attempting to create a second from the same source will error. Use dynamic type if you need multiple allocations from one source.
Recommended for energy sales: Use automated allocations. When you infuse more alpha into a reactor, your capacity grows, and automated allocations proportionally increase energy flowing to your substations with no manual intervention.
- 7. Token transfer —
player-send [from-address] [to-address] [amount] TX_FLAGS.
Commands Reference
| Action | Command |
|---|
| Reactor infuse | INLINECODE38 (validator = structsvaloper1..., NOT reactor ID) |
| Reactor defuse |
structsd tx structs reactor-defuse [reactor-id] |
| Reactor migrate |
structsd tx structs reactor-begin-migration [player-addr] [src-validator-addr] [dest-validator-addr] [amount] |
| Reactor cancel defusion |
structsd tx structs reactor-cancel-defusion [reactor-id] |
| Generator infuse |
structsd tx structs struct-generator-infuse [struct-id] [amount] |
| Provider create |
structsd tx structs provider-create [substation-id] [rate] [access] [prov-penalty] [cons-penalty] [cap-min] [cap-max] [dur-min] [dur-max] |
| Provider delete |
structsd tx structs provider-delete [provider-id] |
| Provider withdraw |
structsd tx structs provider-withdraw-balance [provider-id] |
| Agreement open |
structsd tx structs agreement-open [provider-id] [duration] [capacity] |
| Agreement close |
structsd tx structs agreement-close [agreement-id] |
| Allocation create |
structsd tx structs allocation-create [source-id] [power] --allocation-type [type] |
| Allocation update |
structsd tx structs allocation-update [allocation-id] [power] |
| Allocation delete |
structsd tx structs allocation-delete [allocation-id] |
| Player send |
structsd tx structs player-send [from] [to] [amount] |
TX_FLAGS: INLINECODE53
Important: Entity IDs containing dashes (like 3-1, 4-5) are misinterpreted as flags by the CLI parser. Always place -- between flags and positional args: INLINECODE57
Verification
- - Reactor:
structsd query structs reactor [id] — check infusedAmount, defusionCooldown. - Provider:
structsd query structs provider [id] — verify capacity, rate, active agreements. - Agreement:
structsd query structs agreement [id] — check status, capacity, duration. - Allocation:
structsd query structs allocation [id] — confirm power, source, destination. - Player balance:
structsd query structs player [id] — verify Alpha Matter after transfers.
Error Handling
- - Insufficient balance: Check player Alpha Matter before infuse/send. Refine ore first.
- Provider capacity exceeded: Query provider
capacityMaximum; reduce agreement capacity or create new provider. - Defusion cooldown: Use
reactor-cancel-defusion to re-stake during cooldown, or wait. - Generator infuse failed: Cannot undo. Verify struct is a generator type and amount is correct before submitting.
See Also
Structs 经济系统
操作流程
- 1. 评估位置 — 通过 structsd query structs player/reactor/provider/agreement [id] 查询玩家、反应堆、提供商、协议状态。
- 反应堆质押 — 质押阿尔法物质:structsd tx structs reactor-infuse [玩家地址] [反应堆地址] [数量] TXFLAGS。数量 必须包含面额,例如 60000000ualpha(不能仅写 60000000)。这将自动增加玩家的容量——无需设置分配。反应堆的佣金率决定分配比例:玩家获得 能量 * (1 - 佣金),反应堆保留剩余部分。解除质押:reactor-defuse [反应堆ID](有冷却时间)。取消冷却:reactor-cancel-defusion [反应堆ID]。迁移:reactor-begin-migration [玩家地址] [源验证者地址] [目标验证者地址] [数量]。
- 发生器注入 — structsd tx structs struct-generator-infuse [结构ID] [数量] TXFLAGS。不可逆——阿尔法物质无法回收。转化率高于反应堆(2-10倍),但发生器易受袭击。
- 提供商生命周期 — 创建:provider-create [变电站ID] [费率] [访问策略] [提供商罚金] [消费者罚金] [最小容量] [最大容量] [最小时长] [最大时长] TXFLAGS。有效的 访问策略 值:open-market(任何人可购买)、guild-market(公会成员达到足够等级可购买——通过提供商上的公会等级权限管理)、closed-market(仅拥有该提供商显式 PermProviderOpen 权限的玩家可购买)。通过 provider-update-capacity-maximum、provider-update-duration-minimum 等更新容量/时长/访问权限。删除:provider-delete [提供商ID]。提取收益:provider-withdraw-balance [提供商ID]。授予公会成员访问 guild-market 提供商的权限:permission-guild-rank-set [提供商ID] [公会ID] 262144 [等级](PermProviderOpen)。
- 协议 — 开启:agreement-open [提供商ID] [时长] [容量] TXFLAGS。关闭:agreement-close [协议ID]。调整:agreement-capacity-increase/decrease、agreement-duration-increase。
- 分配 — 创建:allocation-create [源ID] [能量] --allocation-type static|dynamic|automated TX_FLAGS。--controller 标志接受一个玩家ID(例如 1-42)。如果省略,创建玩家为默认控制者。更新:allocation-update [分配ID] [新能量]。删除:allocation-delete [分配ID]——只有控制玩家可以删除分配。转移:allocation-transfer [分配ID] [新控制者]。
分配类型对比
| 类型 | 可更新 | 可删除 | 自动增长 | 限制 | 用例 |
|---|
| static | 否 | 否(连接时) | 否 | 无限制 | 固定容量路由 |
| dynamic |
是 | 是 | 否 | 无限制 | 灵活、可管理的路由 |
| automated | 是 | 否 | 是(随源容量缩放) | 每个源一个 | 能源交易(推荐) |
| provider-agreement | 系统管理 | 系统管理 | 系统管理 | 系统创建 | 协议开启时自动创建;切勿手动创建 |
自动化分配限制:每个源仅允许一个自动化分配。尝试从同一源创建第二个将报错。如果需要一个源的多个分配,请使用 dynamic 类型。
能源销售推荐:使用 automated 分配。当你向反应堆注入更多阿尔法物质时,你的容量会增长,自动化分配会按比例增加流向你变电站的能源,无需手动干预。
- 7. 代币转移 — player-send [发送地址] [接收地址] [数量] TX_FLAGS。
命令参考
| 操作 | 命令 |
|---|
| 反应堆注入 | structsd tx structs reactor-infuse [玩家地址] [验证者地址] [数量](验证者 = structsvaloper1...,不是反应堆ID) |
| 反应堆解除质押 |
structsd tx structs reactor-defuse [反应堆ID] |
| 反应堆迁移 | structsd tx structs reactor-begin-migration [玩家地址] [源验证者地址] [目标验证者地址] [数量] |
| 反应堆取消解除 | structsd tx structs reactor-cancel-defusion [反应堆ID] |
| 发生器注入 | structsd tx structs struct-generator-infuse [结构ID] [数量] |
| 提供商创建 | structsd tx structs provider-create [变电站ID] [费率] [访问权限] [提供商罚金] [消费者罚金] [最小容量] [最大容量] [最小时长] [最大时长] |
| 提供商删除 | structsd tx structs provider-delete [提供商ID] |
| 提供商提取 | structsd tx structs provider-withdraw-balance [提供商ID] |
| 协议开启 | structsd tx structs agreement-open [提供商ID] [时长] [容量] |
| 协议关闭 | structsd tx structs agreement-close [协议ID] |
| 分配创建 | structsd tx structs allocation-create [源ID] [能量] --allocation-type [类型] |
| 分配更新 | structsd tx structs allocation-update [分配ID] [能量] |
| 分配删除 | structsd tx structs allocation-delete [分配ID] |
| 玩家发送 | structsd tx structs player-send [发送方] [接收方] [数量] |
TX_FLAGS:--from [密钥名称] --gas auto --gas-adjustment 1.5 -y
重要提示:包含连字符的实体ID(如 3-1、4-5)会被CLI解析器误认为标志。始终在标志和位置参数之间放置 --:structsd tx structs command TX_FLAGS -- [实体ID] [其他参数]
验证
- - 反应堆:structsd query structs reactor [ID] — 检查 infusedAmount、defusionCooldown。
- 提供商:structsd query structs provider [ID] — 验证容量、费率、活跃协议。
- 协议:structsd query structs agreement [ID] — 检查状态、容量、时长。
- 分配:structsd query structs allocation [ID] — 确认能量、源、目标。
- 玩家余额:structsd query structs player [ID] — 转账后验证阿尔法物质。
错误处理
- - 余额不足:在注入/发送前检查玩家阿尔法物质。先精炼矿石。
- 提供商容量超限:查询提供商 capacityMaximum;减少协议容量或创建新提供商。
- 解除质押冷却中:使用 reactor-cancel-defusion 在冷却期间重新质押,或等待。
- 发生器注入失败:无法撤销。提交前确认结构是发生器类型且数量正确。
参见