Skip to content

Commit

Permalink
update content of index
Browse files Browse the repository at this point in the history
  • Loading branch information
vita-dounai committed Mar 24, 2021
1 parent 447fc00 commit b868b0b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 34 deletions.
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
html_logo = "images\logo.svg"
html_theme_options = {
'logo_only': True,
'display_version': False,
'display_version': True,
}


Expand Down
6 changes: 6 additions & 0 deletions docs/quickstart/example.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Hello World!

```eval_rst
.. admonition:: 注意
为了能够更好地使用Liquid进行智能合约开发,我们强烈建议提前参考 `Rust语言官方教程 <https://doc.rust-lang.org/book/>`_ ,掌握Rust语言的基础知识,尤其借用、生命周期、属性等关键概念。
```

本节将以简单的 HelloWorld 合约为示例,帮助读者快速建立对 Liquid 合约的直观认识。

```eval_rst
Expand Down
6 changes: 6 additions & 0 deletions docs/quickstart/prerequisite.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ registry = "git://mirrors.ustc.edu.cn/crates.io-index"
cargo install --git https://github.com/WeBankBlockchain/cargo-liquid --force
```

```eval_rst
.. admonition:: 注意
若无法正常访问GitHub,则请执行 ``cargo install --git https://gitee.com/WeBankBlockchain/cargo-liquid --force`` 命令进行安装。
```

## 安装 Binaryen(可选)

Binaryen 项目中包含了一系列 Wasm 字节码分析及优化工具,其中如 `wasm-opt` 等工具会在 Liquid 智能合约的构建过程中使用。目前 Binaryen 仅提供了编译安装的方式,请参考其[官方文档](https://github.com/WebAssembly/binaryen#building),根据所使用的操作系统选择对应的编译安装方式。
45 changes: 12 additions & 33 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,6 @@ Liquid

Liquid由微众银行区块链团队开发并完全开源,是一种基于 `Rust语言 <https://www.rust-lang.org/>`_ 的 `嵌入式领域特定语言 <http://wiki.haskell.org/Embedded_domain_specific_language>`_ ( embedded Domain Specific Language,eDSL),能够用于编写在 `FISCO BCOS <https://github.com/FISCO-BCOS/FISCO-BCOS>`_ 区块链底层平台上运行的智能合约。

智能合约开发者可以通过Liquid提供的特殊属性标注来表达智能合约中特有的语义,例如在下列的代码片段中,分别通过 ``#[liquid(storage)]`` 及 ``#[liquid(methods)]`` 属性标注对智能合约的状态变量及外部方法进行了定义:

.. code-block:: rust
:linenos:
:emphasize-lines: 3,8
...
#[liquid(storage)]
struct HelloWorld {
name: storage::Value<String>,
}
#[liquid(methods)]
impl HelloWorld {
pub fn new(&mut self) {
self.name.initialize(String::from("Alice"));
}
...
在编译阶段,Liquid会通过Rust语言中的宏系统对智能合约代码进行展开,并将其变换为区块链底层平台对应的具体实现,开发者则完全无需关这些细节,因而能够更高效地进行智能合约开发。同时,Liquid还提供专有开发工具,能够将Liquid智能合约编译为 `Wasm <https://webassembly.org/>`_ 格式字节码,从而使得Liquid智能合约能够在搭载有Wasm虚拟机的区块链底层平台中运行。使用Liquid编写的智能合约,其自身也是合法的Rust语言代码,在整个软件开发周期中均能够结合现有的Rust语言标准工具链进行开发。

.. hint::

为了能够更好地使用Liquid进行智能合约开发,我们强烈建议提前参考 `Rust语言官方教程 <https://doc.rust-lang.org/book/>`_ 掌握Rust语言的基础知识,尤其借用、生命周期、属性等关键概念。

微众银行区块链团队秉承多方参与、资源共享、友好协作和价值整合的理念,将Liquid项目完全向公众开源,并专设有智能合约编译技术专项兴趣小组(CTSC-SIG),欢迎广大企业及技术爱好者踊跃参与Liquid项目共建。

* `GitHub主页 <https://github.com/FISCO-BCOS/liquid>`_
* `公众号 <_static/images/public_account.png>`_

--------
关键特性
--------
Expand Down Expand Up @@ -124,6 +91,18 @@ Liquid由微众银行区块链团队开发并完全开源,是一种基于 `Rus
</div>
</div>

--------
合作共建
--------

微众银行区块链团队秉承多方参与、资源共享、友好协作和价值整合的理念,将Liquid项目完全向公众开源,并专设有智能合约编译技术专项兴趣小组(CTSC-SIG),欢迎广大企业及技术爱好者踊跃参与Liquid项目共建。

* `GitHub主页 <https://github.com/FISCO-BCOS/liquid>`_
* `公众号 <_static/images/public_account.png>`_
* `CTSC-SIG <https://mp.weixin.qq.com/s/NfBZtPWxXdnP0XLLGrQKow>`_



.. toctree::
:hidden:
:caption: 快速开始
Expand Down

0 comments on commit b868b0b

Please sign in to comment.