Skip to content

Commit

Permalink
添加和修改组件引导页 (#1213)
Browse files Browse the repository at this point in the history
* add smartdev

* MCGF & smartdev intro

* style

* compress intro

* webank blockchain component title

* fix smartdev errors
  • Loading branch information
dalaocu committed Apr 22, 2021
1 parent 754d6d3 commit d59c50b
Show file tree
Hide file tree
Showing 24 changed files with 346 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/governance/img.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ FISCO BCOS引入开发部署工具、交互式控制台、区块链浏览器等

- <font color=blue>**[区块链数据治理组件解决方案](https://data-doc.readthedocs.io/zh_CN/latest/)**</font>:稳定、高效、安全的区块链数据治理组件解决方案,分别从底层数据存储层、智能合约数据解析层和应用层三个方面,提供了区块链数据挖掘、裁剪、扩容、可信存储、抽取、分析、审计、对账、监管等数据治理方面的关键能力。

- <font color=blue>**[区块链多方协作治理组件解决方案](https://governance-doc.readthedocs.io/zh_CN/latest/)**</font>:可无缝适配FISCO BCOS的区块链治理组件解决方案。首批开源的四个组件分别从私钥丢失重置、合约权限细粒度管控、私钥和证书的全生命周期管控等方面着手,提供了可部署的智能合约代码、易于使用的SDK和可参考的落地实践Demo等交付物。

- <font color=blue>**[区块链应用开发组件解决方案](https://smartdev-doc.readthedocs.io/zh_CN/latest/)**</font>:一套开放、轻量的开发组件集,覆盖智能合约的开发、调试、应用开发等环节,包含了Solidity智能合约开发工具库、 智能合约Gradle编译插件、应用开发脚手架。

- <font color=blue>**[ChainIDE](https://fiscoide.com/)**</font>:提供智能合约云端开发工具,帮助开发者节约边际成本,加速推送区块链应用落地。

- <font color=blue>**[FISCO BCOS区块链工具箱](https://github.com/SUIBE-Blockchain/FISCO_BCOS_Toolbox/)**</font>:与WeBase/Remix/VSCode/ChainIDE等IDE协同工作,提升开发体验与开发效率。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WeBankBlockchain-Data已在金融、公益、农牧产品溯源、司法存证

WeBankBlockchain-Data 从底层数据存储层、智能合约数据解析层和应用层等多个层次入手,提供区块链数据挖掘、裁剪、扩容、可信存储、抽取、分析、审计、对账、监管等数据治理方面的关键能力,满足数据治理全流程开发场景的需求,如下图所示:

![](../../images/governance/data-comp-design.png)
![](../../images/governance/data/data-comp-design.png)

区块链数据经过区块链共识节点的多方共识,一旦生成就不会被修改。

Expand All @@ -47,13 +47,13 @@ WeBankBlockchain-Data 从底层数据存储层、智能合约数据解析层和
## 组件简介
目前,WeBankBlockchain-Data由数据仓库组件(Data-Stash)、数据导出组件(Data-Export)、数据对账组件(Data-Reconcile)三个相互独立、可插拔、可灵活组装的组件构成,后续会根据业务和场景诉求提供更多的功能和解决方案子组件。

![](../../images/governance/data-gov.png)
![](../../images/governance/data/data-gov.png)

### WeBankBlockchain-Data-Stash 数据仓库组件
提供FISCO BCOS节点数据扩容、备份和裁剪的能力。
可基于binlog协议同步区块链底层节点数据,支持断点续传,数据可信验证,并提供快速同步机制。

![](../../images/governance/Data-Stash.png)
![](../../images/governance/data/Data-Stash.png)

请参考
- [Github地址](https://github.com/WeBankBlockchain/Data-Stash)
Expand All @@ -65,7 +65,7 @@ WeBankBlockchain-Data 从底层数据存储层、智能合约数据解析层和
支持将链上数据导出到MySQL等结构化存储中,解决区块链数据复杂查询、分析和处理的问题。
只需简单配置、无需开发、即可实时导出个性化的业务数据,实现将裸数据转化为标准化、结构化、有序化、可视化的高价值数据。

![](../../images/governance/Data-Export.png)
![](../../images/governance/data/Data-Export.png)

请参考
- [Github地址](https://github.com/WeBankBlockchain/Data-Export)
Expand All @@ -77,7 +77,7 @@ WeBankBlockchain-Data 从底层数据存储层、智能合约数据解析层和
提供区块链数据的对账解决方案。
灵活配置、无需开发,支持自定义对账数据和对账格式,支持定时对账和触发对账,对账处理模块可插拔可扩展。

![](../../images/governance/Data-Reconcile.png)
![](../../images/governance/data/Data-Reconcile.png)

请参考
- [Github地址](https://github.com/WeBankBlockchain/Data-Reconcile)
Expand Down
183 changes: 183 additions & 0 deletions docs/webank_blockchain/governance_index.md

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions docs/webank_blockchain/smartdev_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# 区块链应用开发组件

标签:``WeBankBlockchain-SmartDev`` ``应用开发`` ``通用组件`` ``智能合约库`` ``智能合约编译插件`` ``应用开发脚手架``

----

## 组件定位

区块链技术在经历了十余年的发展历程以后,渐呈“燎原之势”,不断在各行业落地生根。但同时,从技术角度看,区块链应用开发仍然有着较高的门槛,存在不少痛点,在应用开发各个环节上的用户体验有待提升。

WeBankBlockchain-SmartDev应用开发组件的初衷是全方位助力开发者高效、敏捷地开发区块链应用。SmartDev包含了一套开放、轻量的开发组件集,覆盖智能合约的开发、调试、应用开发等环节,开发者可根据自己的情况自由选择相应的开发工具,提升开发效率。

## 设计目标
区块链技术在经历了十余年的发展后,渐呈“燎原之势”,不断在各行业落地生根。但同时,从技术的角度看,区块链应用开发仍然有着较高的门槛,存在不少痛点,在应用开发各个环节上的用户体验、效率及安全有待提升。

在社区中,我们也经常听到关于区块链应用开发的诸多问题:
如何在solidity代码中将账户地址和字符串互转?
现有的solidity代码是否支持高级语言中常用但相对复杂的数据结构,例如可迭代的mapping?
是否可以提供一套基于明确应用场景的可供复用、参考的智能合约代码?
solidity智能合约如何快速编译为abi和binary文件?
如何在使用gradle构建的区块链应用中快速编译智能合约代码,而不必使用编译脚本?
写完智能合约后,如何编写区块链应用?
是否可以提供一个便于开发的区块链应用代码生成器?
编程小白如何快速上手区块链应用开发?
...

这些问题既有与合约开发相关的,也有与应用开发相关的。基于此类场景问题,结合自身实践经验,微众银行区块链正式开源区块链应用开发组件WeBankBlockchain-SmartDev,期望从区块链应用开发中的各个环节入手,多维度地提高区块链应用的开发效率,帮助开发者成为区块链应用开发的“10倍工程师”。目前,整个组件基于solidity语言开发。近期微众银行区块链还开源了Liquid合约语言,未来我们也会适配Liquid语言。

区块链应用开发组件WeBankBlockchain-SmartDev的研发初衷在于打造低代码开发的组件库,全方位助力开发者高效、敏捷地开发区块链应用。WeBankBlockchain-SmartDev包含了一套开放、轻量的开发组件集,覆盖合约的开发、编译、应用开发等环节,开发者可根据自己的情况选择相应开发工具,提升开发效率。

从合约开发的视角来看,对于常用的功能,不必再重复造轮子,只需按需引用,参考“智能合约库”中的代码,就可以引入相应功能,为合约开发的效率和安全保驾护航。对于非基础性功能,例如业务场景,我们也提供了代码模板供参考复用。

从合约编译的视角来看,对于正在开发中的区块链应用,不必再依赖控制台对合约代码进行编译,只需使用合约gradle编译插件就地编译,便可立即得到abi、bin和java合约。这些编译物直接被输出到Java项目中,省去了拷贝的步骤,提供了如开发原生java程序一样迅捷、丝滑的体验。

从应用开发的视角来看,从智能合约到项目搭建,包含了大量机械而重复的工作,如创建项目、引入依赖、编写配置代码、访问智能合约、编写相关实体类等。相形之下,通过WeBankBlockchain-SmartDev,开发者可以选用应用开发脚手架。脚手架会根据智能合约自动生成项目工程。工程中已经包含了上述逻辑代码,开发者只需基于该工程继续添加业务逻辑代码,聚焦在自身的业务上即可。

![](../../images/governance/SmartDev/compare.png)

## 组件简介
SmartDev包含了一套开放、轻量的开发组件集,覆盖智能合约的开发、调试、应用开发等环节,包括智能合约库(SmartDev-Contract)、智能合约编译插件(SmartDev-SCGP)和应用开发脚手架(SmartDev-Scaffold)。开发者可根据自己的情况自由选择相应的开发工具,提升开发效率。

![](../../images/governance/SmartDev/smartdev_overview.png)

### SmartDev-Contract 智能合约库
solidity智能合约代码库。包含基础类型、数据结构、通用功能、上层业务等智能合约库。用户可根据实际需求进行参考、复用。

![](../../images/governance/SmartDev/contract_lib.png)

请参考

- [Github地址](https://github.com/WeBankBlockchain/SmartDev-Contract)

- [gitee地址](https://gitee.com/WeBankBlockchain/SmartDev-Contract)

- [文档地址](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-Contract/index.html)

- [快速开始](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-Contract/quick_start.html)


### SmartDev-SCGP (Solidity Compiler Gradle Plugin) 智能合约编译插件
将solidity智能合约代码编译为Java代码的gradle插件,可以编译项目中的智能合约,生成对应的Java文件,并自动拷贝到对应包目录下。

![](../../images/governance/SmartDev/compile_plugin.png)

请参考

- [Github地址](https://github.com/WeBankBlockchain/SmartDev-SCGP)

- [gitee地址](https://gitee.com/WeBankBlockchain/SmartDev-SCGP)

- [文档地址](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-SCGP/index.html)

- [快速开始](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-SCGP/quick_start.html)

### SmartDev-Scaffold 应用开发脚手架
基于配置的智能合约文件,自动生成应用项目的脚手架代码,包含了智能合约所对应的实体类、服务类等内容,帮助用户只需要修改和编写较少量的代码,即可实现一个应用,大大简化了智能合约开发。

![](../../images/governance/SmartDev/scaffold.png)

请参考

- [Github地址](https://github.com/WeBankBlockchain/SmartDev-Scaffold)

- [gitee地址](https://gitee.com/WeBankBlockchain/SmartDev-Scaffold)

- [文档地址](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-Scaffold/index.html)

- [快速开始](https://smartdev-doc.readthedocs.io/zh_CN/latest/docs/WeBankBlockchain-SmartDev-Scaffold/quick_start.html)


## 使用场景

### 场景1:智能合约开发

在智能合约开发中,从基础的四则运算到上层的业务场景,都可以使用成熟的、可复用的库。

以四则运算为例,需要判断是否存在溢出的风险,此时可以使用数学相关库LibSafeMathForUint256Utils。

以数据结构为例,在solidity中,mapping类型的key不可被迭代,此时若需要使用对key进行迭代的映射,可以使用mapping相关的库LibBytesMap。

以通用功能为例,如果希望引入哈希、验签等密码学功能,则可以使用Crypto库。

以业务场景为例,如果想实现存证功能,可以参考场景模板Evidence,模板中纳入了相关实现,起到抛砖引玉的效果。

### 场景2:合约修改与调试

在区块链应用开发、调试过程中,通常需要在项目中用到abi、bin、java合约等内容,并基于这些内容进行相应的调试。如果合约出于调整等原因而需要重新编译,此时不必将合约拷入控制台编译,只需运行相应的gradle指令,就可以生成新的编译物。同时,这些编译物直接嵌在了项目中。如下图示例中,对HelloWorld合约编译后,产生的编译物示例:

![](../../images/governance/SmartDev/example.png)

### 场景3:区块链应用开发

假如用户已经写好了智能合约,需要基于智能合约,开发一个提供rest接口的web项目。在这种情况下,用户可以将合约拖入脚手架,一键生成项目。下图是生成的样例工程,包含了必要的配置类、DAO(Data Access Object)相关代码。开发者只需对项目进行必要的配置,并添加相应的controller等代码,就可以轻松实现上述需求。



Binary file added images/governance/MCGF/MCGF_overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/MCGF/governance_account.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/MCGF/governance_authority.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/MCGF/governance_cert.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/MCGF/governance_key.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/compare.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/compile_plugin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/contract_lib.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/dir.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/scaffold.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/governance/SmartDev/smartdev_overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
41 changes: 38 additions & 3 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,46 @@ FISCO BCOS 是一个稳定、高效、安全的区块链底层平台,经过多
.. raw:: html

<div class="tools-holder">
<h style="font-size: 18px;"><b><a href="./docs/governanc/index.html">数据治理通用组件:</a></b></h>
<h style="font-size: 18px;"><b><a href="./docs/webank_blockchain/data_index.html">数据治理通用组件:释放数据价值 </a></b></h>
<br><br>
<p>数据治理通用组件的全名是“WeBankBlockchain-Data数据治理通用组件”,它是一套稳定、高效、安全的区块链数据治理组件解决方案,可无缝适配FISCO BCOS区块链底层平台。它由数据导出组件(Data-Export)、数据仓库组件(Data-Stash)、数据对账组件(Data-Reconcile)这三款相互独立、可插拔、可灵活组装的组件所组成,开箱即用,灵活便捷,易于二次开发。</p>
</div>
<img src="_images/governance.jpg" class="card-holder">
<img src="_images/data-gov.png" class="card-holder">
<div style="clear:both"></div>

.. raw:: html

<hr>

.. container:: tools

.. raw:: html

<img src="_images/MCGF_overview.png" class="card-holder">
<div class="tools-holder">
<h style="font-size: 18px;"><b><a href="./docs/webank_blockchain/governance_index.html">区块链多方协作治理组件:开启治理实践新起点</a></b></h>
<br><br>
<p>WeBankBlockchain-Governance区块链多方协作治理组件是一套轻量解耦、简洁易用、通用场景和一站式的区块链治理组件解决方案。 首批开源的有账户治理组件(Governance-Account)、权限治理组件(Governance-Auth)、 私钥管理组件(Governance-Key)和证书管理组件(Governance-Cert)。上述组件都提供了可部署的智能合约代码、易于使用的SDK和可参考的落地实践Demo等交付物。</p>
</div>
<div style="clear:both"></div>

.. raw:: html

<hr>

.. container:: tools

.. raw:: html

<div class="tools-holder">
<h style="font-size: 18px;"><b><a href="./docs/webank_blockchain/smartdev_index.html">区块链应用开发组件:助力低代码开发</a></b></h>
<br><br>
<p>WeBankBlockchain-SmartDev应用开发组件包含了一套开放、轻量的开发组件集,覆盖智能合约的开发、调试、应用开发等环节,包括智能合约库(SmartDev-Contract)、智能合约编译插件(SmartDev-SCGP)和应用开发脚手架(SmartDev-Scaffold)。开发者可根据自己的情况自由选择相应的开发工具,提升开发效率。</p>
</div>
<img src="_images/smartdev_overview.png" class="card-holder">
<div style="clear:both"></div>


.. container:: card-holder

.. container:: card ref
Expand Down Expand Up @@ -229,7 +262,9 @@ FISCO BCOS 是一个稳定、高效、安全的区块链底层平台,经过多
docs/webase/webase.md
docs/browser/index.rst
docs/enterprise_tools/index.md
docs/governance/index.md
docs/webank_blockchain/data_index.md
docs/webank_blockchain/governance_index.md
docs/webank_blockchain/smartdev_index.md

.. toctree::
:hidden:
Expand Down

0 comments on commit d59c50b

Please sign in to comment.