Sei中文文档(Sei Docs CHN)-by Chainguys
  • 导览(INTRODUCTION)
    • 版权声明(Copyright Notice)
    • 概览 (Overview)
    • Sei 设计空间 (Sei Design Space)
    • DEX 优化 (DEX Optimizations)
    • Sei 生态系统 (Sei Ecosystem)
  • 智能合约和本地开发 (Smart contracts & local development)
    • Sei工具指南 (Sei Tool Guide)
    • 设置一个本地节点 (Set up a local network)
    • 本地 Sei 脚本部署 (Local Sei script deployment)
    • Sei.go
    • CosmWasm合约测试 (CosmWasm Contract Testing)
    • 部署通用合约 (Deploy a generic contract)
    • 部署交易合约 (Deploy an exchange contract)
    • 非完整节点下部署和开发 (Deploy & develop without Full Node)
    • Dex 模块教程 (Dex Module Tutorial)
    • 代币工厂模块教程 (Tokenfactory Module Tutorial)
    • IBC转账 (IBC Transfers)
  • 订单匹配(order match)
    • 并行性 (Parallelism)
    • 资格 (Eligibility)
    • DEX 合约间依赖 (DEX Inter—Contract Dependencies)
    • 白名单商店 (Whitelisted Store)
  • 节点&验证者 (NODES&VALIDATORS)
    • 加入测试网 (Joining Testnets)
    • 更新 (Upgrades)
    • Seinami激励测试网 (Seinami Incentivized Testnet)
      • 加入激励测试网 (Joining Incentivized Testnet)
      • 所有测试任务 (All Testnet Missions)
      • 行为准则 (Code of Conduct)
      • 奖励发放详情 (Rewards Distribution Details)
  • 基础API端点 (Basic API Endpoints)
  • 模块化端点 (Module Endpoints)
  • 状态同步 (Statesync)
  • 恢复操作(Recovery Operations)
  • 治理(GOVERNANCE)
    • 创建提案 (Creating Proposals)
    • 管理质押 (Managing Staking)
    • 对提案投票表决 (Voting on Proposals)
  • 预言机(ORACLE)
    • 预言机参与 (Oracle Participation)
  • 钱包(WALLETS)
    • 钱包集成(Wallet Integration)
    • 转账 (Transfers)
  • 更多(More)
    • 推特(Twitter)
由 GitBook 提供支持
在本页
  • 1.安装Seid工具 (Install Seid Tool)
  • 2.创建 Sei 帐户 + 密钥 (Create Sei Account + Key)
  • 3.向您的帐户注资 (Fund your account)
  • 4.4.构建 Cosmwasm 合约 (Build Cosmwasm contract)
  • 5.上传 Wasm 合约 (Upload Wasm Contract)
  • 6.与 Wasm 合约交互 (Interact with Wasm Contract)
  1. 智能合约和本地开发 (Smart contracts & local development)

非完整节点下部署和开发 (Deploy & develop without Full Node)

如何使用 devnet 上全节点的公共 rpc 端点来上传合约,而无需自己运行全节点。 How to use public rpc endpoints of full nodes on devnet to upload contracts without needing to run a full node yourself.

Public Endpoint for sei-devnet-1 sei-devnet-1 的公共端点

tcp://54.67.88.181:26657

export ENDPOINT=tcp://54.67.88.181:26657

export CHAIN_ID=sei-devnet-1

The crucial step in this runbook is to use the --node flag in the seid command and point that to a public rpc endpoint.**`` 本 Runbook 中的关键步骤是在 seid 命令中使用 --node 标志并将其指向公共 rpc 端点。

1.安装Seid工具 (Install Seid Tool)

Clone the sei-chain repo, make install and make sure the seid tool and cli is installed properly. Also make sure the seid tool is accessible by adding it to $PATH. This DOES NOT require running a full node on any network

克隆 sei-chain 存储库,进行安装并确保正确安装了 seid 工具和 cli。还要确保可以通过将 seid 工具添加到$PATH 来访问它。这不需要在任何网络上运行完整节点

2.创建 Sei 帐户 + 密钥 (Create Sei Account + Key)

Create and configure your account: 创建和配置您的帐户:

export ACCOUNT_NAME="<YOUR_ACCOUNT_NAME_HERE>"

seid keys add $ACCOUNT_NAME

This should create a new account locally and display its address and mnemonic:

这应该在本地创建一个新帐户并显示其地址和助记词:

- name: $ACCOUNT_NAME
  type: local
  address: sei1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ai3obIQZXAmdgDSw7p1awFIPGK9b7cu/SfJM6nbc+hV/"}'
  mnemonic: ""


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
some mnemonic words some mnemonic words some mnemonic words some mnemonic words some mnemonic words 
Store the shown account address into local env variable and add it as the genesis account to the chain:
export ACCOUNT_ADDRESS="<ADDRESS_OF_YOUR_ACCOUNT>"

3.向您的帐户注资 (Fund your account)

Use the devnet faucet (on Discord) to fund your account. It may be possible that your account needs more funds, in which case please reach out to our team on Discord.

使用 devnet 水龙头(在 Discord 上)为您的帐户注资。您的帐户可能需要更多资金,在这种情况下,请联系我们的 Discord 团队。

Verify your devnet balance

验证您的 devnet 余额

seid q bank balances $ACCOUNT_ADDRESS --node $ENDPOINT --chain-id $CHAIN_ID

4.4.构建 Cosmwasm 合约 (Build Cosmwasm contract)

Build the image. Note that the following steps are run from your contract directory, so they assume seid is in your $PATH. This should generate a .wasm file

构建图像。请注意,以下步骤是从您的合约目录运行的,因此它们假定 seid 在您的 $PATH 中。这应该会生成一个 .wasm 文件

cargo build
docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.5

5.上传 Wasm 合约 (Upload Wasm Contract)

NOTE: The following steps for uploading a contract may require more sei in your account than is attainable via faucet. Please reach out to our team over Discord if there are issues with balances.

注意:以下上传合约的步骤可能需要您帐户中的 sei 比通过 faucet 获得的更多。如果有余额问题,请通过 Discord 联系我们的团队。

--node $ENDPOINT flag MUST be included

--node $ENDPOINT 标志必须包括在内

seid tx wasm store $CONTRACT_WASM_BINARY -y --from=$ACCOUNT_NAME --chain-id=$CHAIN_ID --node $ENDPOINT --gas=10000000 --fees=10000000usei --broadcast-mode=block

6.与 Wasm 合约交互 (Interact with Wasm Contract)

Henceforth, once your Contract has been uploaded, please follow the instructions under Deploy a generic contract to interact (instantiate, execute, etc). CRUCIALLY, all commands must be accompanied by the --node $ENDPOINT flag which allows sending in tx's to public endpoints on devnet.

此后,一旦您的合约被上传,请按照“部署通用合约”下的说明进行交互(实例化、执行等)。 这至关重要,所有命令都必须附有 --node $ENDPOINT 标志,该标志允许将 tx(交易) 发送到 devnet 上的公共端点。

上一页部署交易合约 (Deploy an exchange contract)下一页Dex 模块教程 (Dex Module Tutorial)

最后更新于2年前

Reference for more details on each of the flags and details about contract instantiation/execution.

您还可参考 ,了解有关每个标志和有关合约实例化/执行的详细信息。

https://docs.cosmwasm.com/tutorials/governance/#submit-proposal
https://docs.cosmwasm.com/tutorials/governance/#submit-proposal