Skip to content

Commit

Permalink
Merge pull request #1851 from ctianming/main
Browse files Browse the repository at this point in the history
完成task2,新增一次参与直播答疑,两次笔记对外输出和群里分享
  • Loading branch information
Sifotd authored Nov 15, 2024
2 parents a8fbcde + 5c6b8ee commit ca17cd6
Show file tree
Hide file tree
Showing 18 changed files with 939 additions and 18 deletions.
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.
11 changes: 10 additions & 1 deletion mover/ctianming/co-learn-2411/images/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@
task1 scan截图

![alt text](image.png)
第一篇笔记分享
第一篇笔记分享

![alt text](image.png)
第二篇笔记分享

![](4d3d657e522ba9661a03afff9ecba50.png)
11.11会议

![alt text](image.png)
第三篇笔记分享
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NETWORK=devnet
85 changes: 85 additions & 0 deletions mover/ctianming/co-learn-2411/project/move_coin/Makefile
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
34 changes: 34 additions & 0 deletions mover/ctianming/co-learn-2411/project/move_coin/Move.lock
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"
36 changes: 36 additions & 0 deletions mover/ctianming/co-learn-2411/project/move_coin/Move.toml
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"
Loading

0 comments on commit ca17cd6

Please sign in to comment.