Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
0ce46a61
Commit
0ce46a61
authored
Apr 01, 2021
by
袁兴强
Committed by
33cn
Apr 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tutorial of query wasm contracts
parent
fc769ff1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
README.md
plugin/dapp/wasm/contracts/README.md
+16
-0
No files found.
plugin/dapp/wasm/contracts/README.md
View file @
0ce46a61
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
```
bash
```
bash
git clone https://github.com/juj/emsdk.git
git clone https://github.com/juj/emsdk.git
cd
emsdk
cd
emsdk
git checkout 6adb624e04b0c6a0f4c5c06d3685f4ca2be7691d
# 用旧版本
./emsdk
install
latest
./emsdk
install
latest
./emsdk activate latest
./emsdk activate latest
...
@@ -59,6 +60,12 @@ wabt/bin/wasm2wat dice.wasm
...
@@ -59,6 +60,12 @@ wabt/bin/wasm2wat dice.wasm
./chain33-cli send wasm create
-n
指定合约名
-p
wasm合约路径
-k
用户私钥
./chain33-cli send wasm create
-n
指定合约名
-p
wasm合约路径
-k
用户私钥
```
```
### 检查合约发布结果
```
bash
# 检查链上是否存在该合约
./chain33-cli wasm check
-n
合约名
```
### 更新合约
### 更新合约
```
bash
```
bash
# 更新合约要求合约已存在,且只有合约创建者有更新权限
# 更新合约要求合约已存在,且只有合约创建者有更新权限
...
@@ -71,6 +78,15 @@ wabt/bin/wasm2wat dice.wasm
...
@@ -71,6 +78,15 @@ wabt/bin/wasm2wat dice.wasm
./chain33-cli send wasm call
-n
发布合约时指定的合约
-m
调用合约方法名
-p
参数
-v
字符串参数
-k
用户私钥
./chain33-cli send wasm call
-n
发布合约时指定的合约
-m
调用合约方法名
-p
参数
-v
字符串参数
-k
用户私钥
```
```
### 查询合约数据
```
bash
# 查询statedb
./chain33-cli wasm query state
-n
合约名
-k
数据库key
# 查询localdb
./chain33-cli wasm query
local
-n
合约名
-k
数据库key
```
### 转账及提款
### 转账及提款
```
bash
```
bash
#部分合约调用可能需要在合约中有余额,需要先转账到 wasm 合约
#部分合约调用可能需要在合约中有余额,需要先转账到 wasm 合约
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment