Skip to content

Commit

Permalink
update tableTest usage (#856)
Browse files Browse the repository at this point in the history
Co-authored-by: cyjseagull <yujiechen_hust@163.com>
  • Loading branch information
bxq2011hust and cyjseagull committed Jun 12, 2020
1 parent 717849e commit 1e5b1df
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
16 changes: 0 additions & 16 deletions docs/manual/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -990,22 +990,6 @@ transaction hash:0xa7c7d5ef8d9205ce1b228be1fe90f8ad70eeb6a5d93d3f526f30d8f431cb1
[group:1]> call HelloWorld.sol 0xc0ce097a5757e2b6e189aa70c7d55770ace47767 get
Hello, FISCO BCOS
# 调用TableTest的create接口创建用户表t_test,该接口返回了值并调用了CreateResult event,交易执行成功后通过解析output输出返回值,通过解析log输出event log信息。
# Output: 包含调用的接口签名,返回类型,返回值。
# Event logs: 包含由event 签名,event调用顺序号和event的变量值。CreateResult event记录的是create接口创建表返回的值count。
[group:1]> call TableTest.sol 0xd653139b9abffc3fe07573e7bacdfd35210b5576 create
transaction hash:0x895980dd6ef37004bb32a7f417daa3b5d0bdb1f16e8a62cc9251e5948c612bb5
---------------------------------------------------------------------------------------------
Output
function: create()
return type: (int256)
return value: (0)
---------------------------------------------------------------------------------------------
Event logs
event signature: CreateResult(int256) index: 0
event value: (0)
---------------------------------------------------------------------------------------------
# 调用TableTest的insert接口插入记录,字段为name, item_id, item_name
[group:1]> call TableTest.sol 0xd653139b9abffc3fe07573e7bacdfd35210b5576 insert "fruit" 1 "apple"
transaction hash:0x6393c74681f14ca3972575188c2d2c60d7f3fb08623315dbf6820fc9dcc119c1
Expand Down
21 changes: 7 additions & 14 deletions docs/manual/distributed_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mysql --help | grep 'Default options' -A 1

```
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
```
### 配置my.cnf
mysql依次从/etc/mysql/my.cnf,/etc/my.cnf,~/.my.cnf中加载配置。依次查找这几个文件,找到第一个存在的文件,在[mysqld]段中新增如下内容(如果存在则修改值)。
Expand Down Expand Up @@ -116,7 +116,7 @@ cat > ipconf << EOF
EOF

# 查看配置文件
cat ipconf
cat ipconf
127.0.0.1:1 agencyA 1
127.0.0.1:1 agencyB 1,2
127.0.0.1:1 agencyC 2
Expand Down Expand Up @@ -292,13 +292,6 @@ show tables;
12 rows in set (0.02 sec)
```

在控制台中调用create接口。
```bash
#创建表
call TableTest 0x8c17cf316c1063ab6c89df875e96c9f0f5b2f744 create
0xab1160f0c8db2742f8bdb41d1d76d7c4e2caf63b6fdcc1bbfc69540a38794429
```

查看数据库中的表情况
```bash
show tables;
Expand Down Expand Up @@ -390,7 +383,7 @@ cat > ipconf << EOF
EOF

# 查看配置文件
cat ipconf
cat ipconf
127.0.0.1:1 agencyA 1
127.0.0.1:1 agencyB 1,2
127.0.0.1:1 agencyC 2
Expand Down Expand Up @@ -418,7 +411,7 @@ Group:2 has 2 nodes
```
#### 修改节点ini文件
#### 修改节点ini文件
##### 修改node0下的group.1.ini配置
修改~/fisco/nodes/127.0.0.1/node0/conf/group.1.ini文件中[storage]段的内容,设置为如下内容
Expand Down Expand Up @@ -459,7 +452,7 @@ Group:2 has 2 nodes
### 准备amdb代理
#### 源码获取
```bash
cd ~/fisco;
cd ~/fisco;
git clone https://github.com/FISCO-BCOS/amdb-proxy.git
```
Expand Down Expand Up @@ -639,7 +632,7 @@ drwxrwxr-x 4 fisco fisco 4096 May 7 15:08 nodes
<property name="groupId" value="2" />
<property name="orgID" value="fisco" />
<property name="allChannelConnections" ref="groupChannelConnectionsConfig"></property>

<!-- communication topic configuration of the node -->
<property name="topics">
<list>
Expand Down Expand Up @@ -681,7 +674,7 @@ drwxrwxr-x 4 fisco fisco 4096 May 7 15:08 nodes
<property name="groupId" value="2" />
<property name="orgID" value="fisco" />
<property name="allChannelConnections" ref="groupChannelConnectionsConfig"></property>

<!-- communication topic configuration of the node -->
<property name="topics">
<list>
Expand Down
1 change: 1 addition & 0 deletions en/docs/manual/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,7 @@ Run create sql statement to create a user table in mysql statement form.
[group:1]> create table t_demo(name varchar, item_id varchar, item_name varchar, primary key(name))
Create 't_demo' Ok.
```

**Note:**
- The field types for creating table are all string types. Even if other field types of the database are provided, the field types have to be set according to the string type.
- The primary key field must be specified. For example, to create a t_demo table with the primary key field as name.
Expand Down
12 changes: 2 additions & 10 deletions en/docs/manual/distributed_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ show tables;
12 rows in set (0.02 sec)
```

call the create interface in the console

```bash
#create table
call TableTest 0x8c17cf316c1063ab6c89df875e96c9f0f5b2f744 create
0xab1160f0c8db2742f8bdb41d1d76d7c4e2caf63b6fdcc1bbfc69540a38794429
```

view the table in the database

```bash
Expand Down Expand Up @@ -627,7 +619,7 @@ modify ~/fisco/dist_Group2_B/conf/applicationContext.xml to the following config
<property name="groupId" value="2" />
<property name="orgID" value="fisco" />
<property name="allChannelConnections" ref="groupChannelConnectionsConfig"></property>
<!-- communication topic configuration of the node -->
<property name="topics">
<list>
Expand Down Expand Up @@ -671,7 +663,7 @@ modify ~/fisco/dist_Group2_C/conf/applicationContext.xml to the following config
<property name="groupId" value="2" />
<property name="orgID" value="fisco" />
<property name="allChannelConnections" ref="groupChannelConnectionsConfig"></property>
<!-- communication topic configuration of the node -->
<property name="topics">
<list>
Expand Down

0 comments on commit 1e5b1df

Please sign in to comment.