Skip to content

Commit

Permalink
Merge pull request #117 from FISCO-BCOS/revert-109-revert-107-release…
Browse files Browse the repository at this point in the history
…-1.0.3

Revert "Revert "merge release 1.0.3""
  • Loading branch information
bxq2011hust authored Jun 17, 2019
2 parents ef791ba + afa80f6 commit 96a7133
Show file tree
Hide file tree
Showing 49 changed files with 6,042 additions and 4,485 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ before_install:
- gradle wrapper

script: |
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/release-2.0.0-rc2/tools/build_chain.sh && chmod u+x build_chain.sh
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/release-2.0.0-rc2/tools/ci/download_bin.sh) -b release-2.0.0-rc2
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/release-2.0.0-rc3/tools/build_chain.sh && chmod u+x build_chain.sh
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) -b release-2.0.0-rc3
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0-rc2
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0-rc3
./nodes/127.0.0.1/fisco-bcos -v
./nodes/127.0.0.1/start_all.sh
cp nodes/127.0.0.1/sdk/* src/main/resources/
mv src/main/resources/applicationContext-sample.xml src/main/resources/applicationContext.xml
./gradlew build
./gradlew verifyGoogleJavaFormat
./gradlew build
./gradlew test
14 changes: 13 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ Go to [issues page](https://github.com/FISCO-BCOS/console/issues)
7. Wait the community to review the code
8. Merged !!!!

## Code formatting

The code formatting tool are described by the [google-java-format-gradle-plugin](https://github.com/sherter/google-java-format-gradle-plugin).

Execute the task `googleJavaFormat` to format all *.java files in the project
```
./gradlew goJF
```
Execute the task `verifyGoogleJavaFormat` to verify that all *.java files are formatted properly
```
./gradlew verGJF
```

## Continous integration

Expand All @@ -50,6 +62,6 @@ Go to [issues page](https://github.com/FISCO-BCOS/console/issues)

**Code quality**

* [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)
* Codacy: [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)


22 changes: 17 additions & 5 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
### v1.0.3

(2019-05-28)

* 增加

1. 增加操作用户表的sql命令,包括`create`, `insert` , `update`, `delete`, `select`, `desc`命令。
2. 增加账户生成脚本`get_accounts.sh`,支持加载账户文件登录控制台。
3. 支持`call`, `callByCNS``getTransactionReceipt`对event log进行解析输出。
4. 发送交易后,交易哈希值前面加`transaction hash:`


### v1.0.2

(2019-04-19)

* Update
* 更新

1. `console/conf`目录下移除`applicationContext.xml`配置文件和`ca.crt``node.crt``node.key`文件。新增`applicationContext-sample.xml`配置文件。
2. 一个控制台部署合约,另一个控制台可以直接调用合约。
3. `callByCNS`支持在不传合约版本号时调用最新版本合约。传入版本号时,其合约名与版本号使用英文冒号分隔,例如`HelloWorld:1.0`
4. 重复创建用户表会提示表已存在的错误信息,无权限的账号对用户表进行增删改操作会提示无权限信息。(适配fisco bcos 2.0.0-rc2)
5. 调用合约时,传入错误合约地址会获取错误提示信息。(适配fisco bcos 2.0.0-rc2)
6. 部署合约后,显示的合约地址前面加字符串`contract address:`
6. 部署合约后,显示的合约地址前面加字符串`contract 增加ress:`
7. 合约地址只能省略前缀0,不能省略`0x`。例如`0x000ac78`可以简写成`0xac78`
8. `help`命令显示的命令列表进行了字典排序。

Expand All @@ -18,13 +30,13 @@

(2019-04-08)

* Add
* 增加

1. 提供`getDeployLog`(查询部署的合约地址),`exit`(退出控制台)命令。
2. 提供下载控制台脚本`download_console.sh`
3. `start.sh`脚本中增加对Java版本检测。

* Update
* 更新

1. 支持合约引入Solidity library库。
2. 支持合约地址可以省略前缀0。例如,`0x000ac78`可以简写成`0xac78`
Expand All @@ -34,7 +46,7 @@

(2019-03-18)

* Add
* 增加

1. 提供区块链状态查询命令。
2. 提供管理区块链节点的命令。
Expand Down
83 changes: 34 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
plugins {
id 'com.github.sherter.google-java-format' version '0.8'
}
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'eclipse'
Expand All @@ -15,58 +18,45 @@ repositories {
mavenCentral()
}

List alibaba = [
'com.alibaba:druid:1.0.29',
'com.alibaba:fastjson:1.2.29'
]

List logger = [
'org.slf4j:slf4j-log4j12:1.7.25'
]
googleJavaFormat {
options style: 'AOSP'
}

def spring_version="4.1.8.RELEASE"
List spring =[
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-tx:$spring_version",
"org.springframework:spring-jdbc:$spring_version",
"org.springframework:spring-test:$spring_version"
]
check.dependsOn.remove(test)
check.dependsOn.remove(verifyGoogleJavaFormat)

// In this section you declare the dependencies for your production and test code
dependencies {
compile logger,spring
runtime logger,spring

compile group:"org.fisco-bcos", name:"web3sdk", version:"2.0.3-SNAPSHOT", changing: true
// compile 'org.fisco-bcos:web3sdk:2.0.0-rc1'
compile 'org.jline:jline:3.10.0'
compile 'io.bretty:console-table-builder:1.2'
testCompile 'junit:junit:4.12'
// compile group: "org.fisco-bcos", name: "web3sdk", version: "2.0.31-SNAPSHOT", changing: true
compile group: 'org.fisco-bcos', name: 'web3sdk', version: '2.0.3'
compile group: 'org.slf4j', name:'slf4j-log4j12', version:'1.7.25'
compile group: 'org.jline', name: 'jline', version: '3.11.0'
compile group: 'io.bretty', name: 'console-table-builder', version: '1.2'
compile group: 'com.github.jsqlparser', name: 'jsqlparser', version: '2.0'
testCompile group: 'junit', name: 'junit', version: '4.1'
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
}
}

jar {
destinationDir file('dist/apps')
archiveName project.name + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
exclude '**/*.crt'
exclude '**/*.key'
destinationDir file('dist/apps')
archiveName project.name + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
exclude '**/*.crt'
exclude '**/*.key'

doLast {
copy {
Expand All @@ -75,26 +65,21 @@ jar {
}
copy {
from file('src/main/resources/applicationContext-sample.xml')
from file('src/main/resources/log4j.properties')
from file('src/main/resources/privateKey.properties')
from file('src/main/resources/log4j.properties')
into 'dist/conf'
}
copy {
from file('tools/start.sh')
from file('tools/replace_solc_jar.sh')
into 'dist/'
}
copy {
from file('tools/get_account.sh')
from file('tools/sol2java.sh')
into 'dist/tools/'
into 'dist/'
}
copy {
from file('src/main/resources/contract/')
into 'dist/solidity/contracts/'
}
copy {
from file('src/main/resources/contract/Table.sol')
into 'dist/tools/contracts/'
into 'dist/contracts/solidity/'
}
new File('dist/contracts/console').mkdirs()
new File('dist/contracts/sdk').mkdirs()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pragma solidity ^0.4.2;

contract HelloWorld{
string name;
bytes32 item;

function HelloWorld(){
name = "Hello, World!";
Expand All @@ -11,7 +12,16 @@ contract HelloWorld{
return name;
}

function get1()constant returns(bytes32){
return item;
}

function set(string n){
name = n;
}

function set(string a, bytes32 b){
name = a;
item = b;
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
pragma solidity ^0.4.24;

import "./Table.sol";

contract TableTest {
event selectResult(bytes32 name, int item_id, bytes32 item_name);
event insertResult(int count);
event updateResult(int count);
event removeResult(int count);
event CreateResult(int count);
event InsertResult(int count);
event UpdateResult(int count);
event RemoveResult(int count);

//create table
function create() public returns(int) {
function create() public returns(int){
TableFactory tf = TableFactory(0x1001); //The fixed address is 0x1001 for TableFactory

int count = tf.createTable("t_test", "name", "item_id,item_name");
// createResult(count);
return count;
emit CreateResult(count);

return count;
}

//select records
Expand All @@ -20,7 +24,6 @@ contract TableTest {
Table table = tf.openTable("t_test");

Condition condition = table.newCondition();
//condition.EQ("name", name);

Entries entries = table.select(name, condition);
bytes32[] memory user_name_bytes_list = new bytes32[](uint256(entries.size()));
Expand All @@ -33,7 +36,6 @@ contract TableTest {
user_name_bytes_list[uint256(i)] = entry.getBytes32("name");
item_id_list[uint256(i)] = entry.getInt("item_id");
item_name_bytes_list[uint256(i)] = entry.getBytes32("item_name");
selectResult(user_name_bytes_list[uint256(i)], item_id_list[uint256(i)], item_name_bytes_list[uint256(i)]);
}

return (user_name_bytes_list, item_id_list, item_name_bytes_list);
Expand All @@ -49,7 +51,7 @@ contract TableTest {
entry.set("item_name", item_name);

int count = table.insert(name, entry);
insertResult(count);
emit InsertResult(count);

return count;
}
Expand All @@ -66,7 +68,7 @@ contract TableTest {
condition.EQ("item_id", item_id);

int count = table.update(name, entry, condition);
updateResult(count);
emit UpdateResult(count);

return count;
}
Expand All @@ -80,8 +82,8 @@ contract TableTest {
condition.EQ("item_id", item_id);

int count = table.remove(name, condition);
removeResult(count);
emit RemoveResult(count);

return count;
}
}
}
15 changes: 14 additions & 1 deletion doc/CONTRIBUTING_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
7. 等待社区review这个PR
8. PR合入,特性开发完成!

## 代码格式化

代码格式化gradle插件[google-java-format-gradle-plugin](https://github.com/sherter/google-java-format-gradle-plugin).

执行任务 `googleJavaFormat`格式化java文件。
```
./gradlew goJF
```
执行任务 `verifyGoogleJavaFormat`验证java文件是否格式化完成
```
./gradlew verGJF
```

## 持续集成(CI)

持续集成框架
Expand All @@ -49,7 +62,7 @@

代码质量

* [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)
* Codacy: [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)



2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.2
v1.0.3
Loading

0 comments on commit 96a7133

Please sign in to comment.