非完整节点下部署和开发 (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

Reference https://docs.cosmwasm.com/tutorials/governance/#submit-proposal for more details on each of the flags and details about contract instantiation/execution.

您还可参考 https://docs.cosmwasm.com/tutorials/governance/#submit-proposal ,了解有关每个标志和有关合约实例化/执行的详细信息。

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 上的公共端点。

最后更新于