# Introduction to Peking University

- - -

## What is a BDContract?

BDContract is a trusted computing framework where the computation logic is expressed as a smart contract. Through “random” and “redundant computation” to achieve the trusted execution of smart contract. BDContract focuses on improving execution efficiency and security while ensuring the availability and reliability of smart contracts.


- - -

## The characteristics of

1. Support multiple execution modes, balancing availability, reliability, correctness, and efficiency.
2. Access to various data sources.
3. Support for fine-grained monitoring of contracts.
4. Support the state of the contract.
5. Access control.
6. Support for cross-language invocation.

- - -

## Update log

* **v1.7.5** April 29, 2022
  - Updated some features of nodeportal.html
  - Supports YPK deploy Tool
  - Optimized the view keyword
  - Optimized the startContract log output
  - Docker image script support

* **v1.7.0** March 7, 2022
    - The submission algorithm is plug-in
    - Cp is stripped from the mirror image
    - ArgSchema annotations are supported.

* **v1.6.7** January 6, 2022
    - Cp supports MultiTagTimeIndexUtil
    

* **v1.6.6** January 4, 2022
    - Update DOIP — SDK

* **v1.6.0** December 20, 2021
    - Merge feature DS branch and support PBFT algorithm.
    - Upgrade Log4j2 to 2.1.17

* **v1.5.0** October 1, 2021
    - It is divided into two modules: cp-bundle and bdcontract-bundle
    - Network optimization: NetworkManager is used to manage Agent-cluster/Agent-Agent connections.

* **v1.4.5** June 29, 2021
    - Improvement of stability
    - Optimize URIPath for the HTTP server
    - Supports static resource file loading using Http

* **v1.4.4** June 15, 2021
    - Fixed an issue with getContractMeta that does not prioritise RUNNING/HANGED contracts
    - The logic of HomomorphicEncrypt is implemented

* **v1.4.3** June 9, 2021
    - Fix the SSL Renegotiate Bug
    - Implement automatic hangup-resume when memory is insufficient
    - Implement hard disk persistence for Contract Meta

* **v1.4.1** May 26, 2021
    - Implement event semantics in event mechanism, support “at least once”, “at most once” and “only once”
    - Optimized contract templates
    - Example Add a template configuration file
    - Optimized the MockTemplate annotation

* **v1.4.0** May 9, 2021
    - Optimize the ACTemplate
    - Improved configuration linkage for DoRepo

* **v1.3.9** April 22, 2021
    - Fixed a bug where doipConfig was not supported in updateConfig
    - Test-tool supports SUdo
    - Optimized the ACTemplate template in Contract-Template

* **v1.3.6** April 21, 2021
    - Fixed an issue in Docker where CPUID could not be obtained

* **v1.3.6** April 16, 2021
    - Fixed some bugs
    - Fixed a bug that caused queuing due to insufficient GRPCPool threads
    - Fixed a bug where the requestID assignment could duplicate under stress testing

* **v1.3.5** March 31, 2021
    - Fixed some bugs
    - Simple congestion control policies have been added to the contract invocation part of HTTP
    - Improvement of stability

* **v1.3.0** February 1, 2021
    - Optimizing heartbeat Mechanism
    - Fixed some bugs
    - SM2 update/SM3 library
    - Update the front-end signature calculation method

* **v1.2.0** December 11, 2020
    - Optimized multi-node execution mode
    - Optimized the logic of the contract master route
    - Fixed some bugs
    - Fix file system related vulnerabilities

* **v1.1.0** September 2020
    - Support for HTTPS, and updated this part of the documentation


* **v1.0.9** August 27, 2020
    - Improve the documentation of IO related tools
    - Optimize contract template: DAC persistence


* **v1.0.7** August 13, 2020
    - Optimized the contract log and ledger interfaces
    - Optimize documentation for interfaces
    - Provides the WebSocket interface for the contract template
    - Automatic compilation of bug fixes

* **v1.0.5** July 25, 2020
    - Weaken the centralization of NC, and cluster point-to-point connection.
    - Optimize bdwareclient
    - TODO MemoryDurable

* **v1.0.2** July 22, 2020
    - Fixed Bug in CentOS7 Too Many Opened Files
    - Fix permissions bugs
    - Adding a Permission
    - Fixed bugs in MySQLUtil
    - Upgrade the BDLedger version

* **v1.0.1** July 5, 2020
    - Updated NodePortal/CenterPortal UI.
    - The compilation process has been modified so that the compilation results can be viewed in NodePortal and compiled manually/startup in OnlineIDE
    - Modified the contract distribution logic to use compiled YPk as the distribution file
    - When YPK in the public directory is executed in multi-node mode, contract faults can be automatically recovered

* **v0.99** June 22, 2020
    - Billing for custom contract methods
    - Add GasExample, Incentives examples
    - On the client side, “check multipoint result” is implemented, and the method of result return is optimized
    - Repair Disconnection No permission prompt after reconnection

* **v0.97** May 25, 2020
    - CPU metering: GAS mechanism
    - Onlineide.html supports uploading multiple files
    - Multi-point Execution in UDP Mode [Unordered messages]
    - Bdwareclient.html, fixes a call example generation prefix error that contains only computational logic

* **v0.95** May 19, 2020
    - Fixed bug where onlineide.html could not jump to Bdwareclient correctly when the pathname was prefixed.
    - Fixed a bug where Bdwareclient automatically extracted urls when the pathname was prefixed.
    - Permissions for contracts are enabled
    - Increased NodePortal. HTML/OnlineIDE. HTML and bdwareclient. HTML has no right to limit the warning

* **v0.90** May 9, 2020
    - Changed the way yjs.jar/bdserver.jar is packaged
    - Updated the sh/update. Sh
    - OnlineIDE post modification reminder
    - OnlineIDE tag adaptive width
    - File interface isolation


* **v0.8** April 26, 2020
    - Improve the documentation interface and optimize the way SDK is provided
    - Rui Web client, all the data processing in the client and how to render the processed data are from the contract call, to achieve a trusted Web application.

* **v0.78** April 13, 2020
    - Contract call DAC example
    - Supports dynamic change of I/O permissions
    - Supports custom backup (periodic) policies for contract status
    - Fixed some page bugs
    - Log Display Optimization
    - Optimized ledger log presentation
    - Enable partial access control


* **v0.7** March 25, 2020
    - Support access control for multiple roles
    - Updated the UI

* **v0.6** February 14, 2020
    - Optimized communication between contract processes
    - Try to access a P2P network

* **v0.5** December 10, 2019
    - Improved three smart contract state record-playback strategies
    - Supports the simplest multi-point execution algorithm (unsynchronized)

* **v0.45** September 2, 2019
    - Preliminary implementation of PBFT algorithm

* **v0.4** May 10, 2019
    - Support the memory dump

* **v0.35** April 26, 2019
    - Implement a static analysis framework for contracts
    - Support for publish-subscribe events

* **v0.3** January 8, 2019
    - Support ledger data access
    - Contract status on the chain

* **v0.2** October 9, 2018
    - Support for automatic Python package generation
    - Contracts can be packaged as YPK
    - Supports data access, such as files and databases

* **v0.1** August 6, 2018
    - Defines the syntax for smart contracts
    - Based on Nashorn engine, smart contract execution is realized

- - -


## Use open source project instructions
The BDWare project stands on the shoulders of many giants, thanks to these open source projects.

The smart contract backend of this project uses the following open source libraries.

| 名称 |Licence type| 说明 |
| ------ | ---------- | ---- |
| [Project Nashorn](https://openjdk.java.net/projects/nashorn/) |[GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)| 使用了该项目的编译器，可以将js函数编译为java字节码 |
| [ASM OW2](https://projects.ow2.org/view/asm/) |[BSD](https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)) with attribution| 基于asm的TreeAPI与VisitorAPI实现合约的静态分析框架 |
| [Netty](https://netty.io/) |[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)| 使用netty作为Http/Websocket的服务端 |
| [gRPC](https://grpc.io/) |[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)| 使用gRPC与BDWareLedger通讯 |
| [RocksDB](https://github.com/facebook/rocksdb) |[GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)| 后台数据库 |
| [ANTLR](https://github.com/antlr/antlr4) |[BSD](https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22))| 对合约脚本的词法分析与语法分析 |
| [SM2Java](https://github.com/PopezLotado/SM2Java) |[无](https://github.com/PopezLotado/SM2Java/blob/master/README.md)| 国密SM2 Java语言实现 |



The smart contract front-end of this project uses the following open source libraries.

| 名称 |Licence type| 说明 |
| ------ | ---------- | ---- |
| [Bootstrap](https://getbootstrap.com/) |[MIT](https://github.com/twbs/bootstrap/blob/master/LICENSE)| 前端的排版、样式 |
| [jQuery](https://jquery.org/) |[MIT](https://jquery.org/license/)| 用于操作DOM的javascript库 |
| [jQueryUI](https://jqueryui.com/) |[MIT](https://jquery.org/license/)| 前端UI构件库 |
| [DataTables](https://datatables.net/) |[MIT](https://datatables.net/license/mit)| 表格样式 |
|[CodeMirror](https://codemirror.net/)| [MIT](https://codemirror.net/LICENSE) | 代码编辑框样式 |
|[eCharts](https://echarts.apache.org/zh/index.html)| [ApacheV2](https://www.apache.org/licenses/) | 统计图表 |
| [sm-crypto](https://github.com/JuneAndGreen/sm-crypto) |[MIT](https://github.com/JuneAndGreen/sm-crypto/blob/master/LICENCE_MIT)| 国密SM2 javascript语言实现 |

The document for this project was generated using [Sphinx](https://www.sphinx-doc.org/en/master/), thanks to [readthedocs](https://readthedocs.org/) for providing the document style.