SuperAPI AI 工具集

injective-cli

部署与运维

查看项目

更新于 10-16 06:19

技能介绍

用途:通过 injectived 二进制对 Injective 链执行查询和交易,统一管理钱包、端点选择与 gas 设置,并结合捆绑的 CLI 命令映射与参考文档快速查找子命令和标志。

安装与使用:优先使用本地已有的 injectived;若不在 PATH 中,可执行 npm i -g injective-core@latest,单次命令可用 npx injective-core,例如 npx injective-core --version。用 injectived <path> --help 校验 query、tx、keys 等关键路径。命令映射应跟随已安装的二进制;若文档与本地二进制不一致,可用 scripts/map_injectived_cli.py 重新生成再与现有映射做 diff,例如 python3 scripts/map_injectived_cli.py --output /tmp/injectived-cli-map.new.md 后 diff -u references/injectived-cli-map.md /tmp/injectived-cli-map.new.md。

账户与端点约定:默认以 ~/.injectived 作为配置与密钥材料的主目录;从 ~/.injectived/config/client.toml 读取 node 与 chain-id。默认主网端点为 https://sentry.tm.injective.network:443,chain-id 为 injective-1;测试网端点为 https://testnet.sentry.tm.injective.network:443,chain-id 为 injective-888。

密钥环与签名:默认使用带口令保护的文件密钥环,口令可管道输入,例如 yes "passphrase" | timeout 10s injectived tx ... 或 cat ~/.injectived/keystore_password.txt | timeout 10s injectived tx ...。仅当用户明确同意将口令存盘时才使用 ~/.injectived/keystore_password.txt,文件权限设为 600,且不得在命令输出或日志中打印口令内容;涉及密钥环的命令保留 timeout 10s 以防卡在解锁输入。--keyring-backend test 可跳过口令但不安全、会暴露私钥,仅限本地一次性流程。原始以太坊私钥的导入导出使用 injectived keys unsafe-export-eth-key <key_name> 与 injectived keys unsafe-import-eth-key <key_name> <hex_private_key>,这些命令被标记为不安全,但为原始 HEX 私钥工作流的必经路径,切勿在公开渠道分享私钥。Ledger 签名使用 --ledger,例如 injectived tx bank send <from> <to> <amount> --ledger --chain-id injective-1 --gas auto --gas-prices 160000000inj --yes。交易使用 --yes 跳过交互确认,费用估算用 --gas auto --gas-adjustment 1.5 --gas-prices 160000000inj,广播后可用 injectived q tx <tx_hash> 验证。新建密钥环时,将口令存入 ~/.injectived/new_keystore_password.txt,提醒用户牢记并在使用后删除该文件。

资源:scripts/map_injectived_cli.py 递归运行 injectived <cmd> --help 刷新命令映射;references/injectived-cli-map.md 为 injectived 的命令映射表。

限制:调用本技能任何脚本即表示同意 TERMS_OF_USE;除资料所述外,其他平台、收费或效果信息暂未提供。