-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1851 from ctianming/main
完成task2,新增一次参与直播答疑,两次笔记对外输出和群里分享
- Loading branch information
Showing
18 changed files
with
939 additions
and
18 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
mover/ctianming/co-learn-2411/project/move_coin/.network_config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NETWORK=devnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Sui 项目 Makefile | ||
# 项目路径设置 | ||
MOVE_PATH := . | ||
BUILD_PATH := $(MOVE_PATH)/build | ||
SUI_CLI := sui | ||
|
||
# 默认网络为 devnet,可通过 `make <target> NETWORK=<network>` 来覆盖 | ||
NETWORK := $(or $(NETWORK), mainnet) | ||
GAS_BUDGET := $(or $(GAS_BUDGET), 2000000) | ||
|
||
# 默认目标 | ||
all: build | ||
|
||
# 切换网络 | ||
switch: | ||
@echo "Switching to network: $(NETWORK)..." | ||
@if [ -z "$(NETWORK)" ]; then \ | ||
echo "Error: No network specified. Please set NETWORK."; \ | ||
exit 1; \ | ||
fi | ||
$(SUI_CLI) client switch --env $(NETWORK) | ||
@echo "Switched to network: $(NETWORK)" | ||
export NETWORK=$(NETWORK) | ||
# 编译 Move 代码 | ||
build: | ||
@echo "Building the Sui Move package..." | ||
@if [ -n "$(NETWORK)" ] && [ "$(NETWORK)" != "devnet" ]; then \ | ||
echo "Switching to network: $(NETWORK)"; \ | ||
$(SUI_CLI) client switch --env $(NETWORK); \ | ||
elif [ "$(NETWORK)" = "devnet" ]; then \ | ||
echo "Using the current network $(NETWORK)"; \ | ||
fi | ||
$(SUI_CLI) move build --path $(MOVE_PATH) | ||
|
||
# 运行测试 | ||
test: | ||
@echo "Running tests on Sui Move package..." | ||
@if [ -n "$(NETWORK)" ] && [ "$(NETWORK)" != "devnet" ]; then \ | ||
echo "Switching to network: $(NETWORK)"; \ | ||
$(SUI_CLI) client switch --env $(NETWORK); \ | ||
elif [ "$(NETWORK)" = "devnet" ]; then \ | ||
echo "Using the current network $(NETWORK)"; \ | ||
fi | ||
$(SUI_CLI) move test --path $(MOVE_PATH) | ||
|
||
# 发布合约到 Devnet | ||
publish: | ||
@echo "Publishing the package to $(SUI_NETWORK)..." | ||
@if [ -n "$(NETWORK)" ] && [ "$(NETWORK)" != "devnet" ]; then \ | ||
echo "Switching to network: $(NETWORK)"; \ | ||
$(SUI_CLI) client switch --env $(NETWORK); \ | ||
elif [ "$(NETWORK)" = "devnet" ]; then \ | ||
echo "Using the current network $(NETWORK)"; \ | ||
fi | ||
$(SUI_CLI) client publish --gas-budget $(GAS_BUDGET) | ||
|
||
# 清理生成的文件 | ||
clean: | ||
@echo "Cleaning up the build directory..." | ||
rm -rf $(BUILD_PATH) | ||
|
||
# 此命令仅适用于使用 brew 下载 sui 的用户 | ||
update: | ||
@echo "Updating brew and sui" | ||
brew update | ||
brew upgrade sui | ||
|
||
# 查看合约状态 | ||
# 这里我只添加了三个命令,可以根据自己的需要增减 | ||
status: | ||
@echo "Checking the status of the Sui project..." | ||
$(SUI_CLI) client active-env | ||
$(SUI_CLI) client active-address | ||
$(SUI_CLI) client balance | ||
|
||
# 帮助信息 | ||
help: | ||
@echo "使用 Makefile 中的以下命令进行常见操作:" | ||
@echo " make build - 编译 Move 包" | ||
@echo " make test - 测试 Move 包" | ||
@echo " make publish - 发布合约到网络" | ||
@echo " make clean - 清理生成的文件" | ||
@echo " make status - 查看合约状态" | ||
|
||
.PHONY: all build test publish clean status help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# @generated by Move, please check-in and do not edit manually. | ||
|
||
[move] | ||
version = 3 | ||
manifest_digest = "7939B02BAC007BE8A79319E49B6498399658A0F5C3481E61DFB6AAD342CC6A3B" | ||
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" | ||
dependencies = [ | ||
{ id = "Sui", name = "Sui" }, | ||
] | ||
|
||
[[move.package]] | ||
id = "MoveStdlib" | ||
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/move-stdlib" } | ||
|
||
[[move.package]] | ||
id = "Sui" | ||
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" } | ||
|
||
dependencies = [ | ||
{ id = "MoveStdlib", name = "MoveStdlib" }, | ||
] | ||
|
||
[move.toolchain-version] | ||
compiler-version = "1.37.3" | ||
edition = "2024.beta" | ||
flavor = "sui" | ||
|
||
[env] | ||
|
||
[env.mainnet] | ||
chain-id = "35834a8a" | ||
original-published-id = "0x2a6acc6295f89f9b4c8b93fd84dfe29f010e9fd279265d93d8ab51fd3fb5338d" | ||
latest-published-id = "0x2a6acc6295f89f9b4c8b93fd84dfe29f010e9fd279265d93d8ab51fd3fb5338d" | ||
published-version = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[package] | ||
name = "move_coin" | ||
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move | ||
# license = "" # e.g., "MIT", "GPL", "Apache 2.0" | ||
# authors = ["..."] # e.g., ["Joe Smith ([email protected])", "John Snow ([email protected])"] | ||
|
||
[dependencies] | ||
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" } | ||
|
||
# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. | ||
# Revision can be a branch, a tag, and a commit hash. | ||
# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } | ||
|
||
# For local dependencies use `local = path`. Path is relative to the package root | ||
# Local = { local = "../path/to" } | ||
|
||
# To resolve a version conflict and force a specific version for dependency | ||
# override use `override = true` | ||
# Override = { local = "../conflicting/version", override = true } | ||
|
||
[addresses] | ||
move_coin = "0x0" | ||
|
||
# Named addresses will be accessible in Move as `@name`. They're also exported: | ||
# for example, `std = "0x1"` is exported by the Standard Library. | ||
# alice = "0xA11CE" | ||
|
||
[dev-dependencies] | ||
# The dev-dependencies section allows overriding dependencies for `--test` and | ||
# `--dev` modes. You can introduce test-only dependencies here. | ||
# Local = { local = "../path/to/dev-build" } | ||
|
||
[dev-addresses] | ||
# The dev-addresses section allows overwriting named addresses for the `--test` | ||
# and `--dev` modes. | ||
# alice = "0xB0B" |
Oops, something went wrong.