FabricSharp (hash) project is a variant of Hyperledger Fabric 2.2, a permissioned blockchain platform from Hyperledger. Compared with the vanilla version, FabricSharp supports fine-grained secure data provenance, sharding, smart transaction management, use of trusted hardware (eg. SGX), and a blockchain native storage engine called ForkBase, to boost system performance.
Thanks to colleagues from MediLOT, NUS, SUTD, BIT, Zhejiang University, MZH Technologies and other organizations for their contributions.
- Build the peer docker image
make peer-docker # Will build an image hyperledger/fabric-sharp-peer:2.2.0
- Build the orderer docker image
make orderer-docker # Will build an image hyperledger/fabric-sharp-orderer:2.2.0
If docker run hyperledger/fabric-sharp-peer:2.2.0 peer version
shows a line of Version: 2.2.0(SHARP)
, then the building process is successful. And so is the orderer image.
NOTE: FabricSharp relies on ForkBase[3] as the storage engine, which is close-sourced. Hence FabricSharp can only be built and run within the docker container.
This chaincode demonstrates a Golang contract on token management. It captures and queries the provenance information.
Note that we instrument the original shim package for the provenance managenent. So the imported package is our github.com/RUAN0007/fabric-chaincode-go
, instead of the official github.com/hyperledger/fabric-chaincode-go
.
We require users to set bash environment variable $CC_TYPE
for each run of orderer
and peer
.
There are five optional value for $CC_TYPE
, each corresponding to a transaction scheduler described in branch sigmod20.
original
: the original FIFO schedulerfpp
: the scheduler proposed by Fabric++.occ-standard
: one of the schedulers migrated from the OCC databaseocc-latest
: one of the schedulers migrated from the OCC databaseocc-sharp
: our state-of-the-art scheduler.
We add two options for STATEDATABASE
: Provleveldb
and UstoreDB
. Both support provenance-dependent smart contracts and five schedulers. Provleveldb
extends the existing leveldb to store the data provenance. Ustoredb
relies on ForkBase.
FabricSharp is compatible with the existing two options: goleveldb
and CouchDB
. But both do not support provenance management. And both are only compatible with original
scheduler.
To work with any occ-*
-typed scheduler, users must set a directory path $MV_STORE_PATH
for the LevelDB instance.
The instance implements the multi-versioned storage, used to compute the transaction dependency.
The directory will be emptied every time that the docker container runs
When CC_TYPE=occ-sharp
, users may set $TXN_SPAN_LIMIT
to restrict the max block span of a transaction. By default, it is 10.
For any cases, users can optionally control the block size by setting $BLOCK_SIZE
. Otherwise, the transactions per block is configured at configtx.yaml.
The current master branch incorporates the optimization from [2] and [7] on the basis of Fabric v2.2.0. We dedicate another branch vldb19, which, based on v1.3.1, shows more details only about [2], including the experimental baseline, scripts, chaincode examples and so on. Similarly, branch sigmod20, also based on v1.3.1, is dedicated for [7].
We will soon merge the optimization in [1] to this master branch and similarly dedicate another branch for [1].
Refer to YCSB and Smallbank for contract codes utilized in [6] to benchmark the original Fabric v2.2.
- [1] H. Dang, A. Dinh, D. Lohgin, E.-C. Chang, Q. Lin, B.C. Ooi: Towards Scaling Blockchain Systems via Sharding. ACM SIGMOD 2019
- [2] P. Ruan, G. Chen, A. Dinh, Q. Lin, B.C. Ooi, M. Zhang: FineGrained, Secure and Efficient Data Provenance on Blockchain Systems. VLDB 2019. The morning paper review.
- [3] S. Wang, T. T. A . Dinh, Q. Lin, Z. Xie, M. Zhang, Q. Cai, G. Chen, B.C. Ooi, P. Ruan: ForkBase: An Efficient Storage Engine for Blockchain and Forkable Applications. VLDB 2018. The morning paper review.
- [4] A. Dinh, R. Liu, M. Zhang, G. Chen, B.C. Ooi, J. Wang: Untangling Blockchain: A Data Processing View of Blockchain Systems. IEEE Transactions on Knowledge and Data Engineering, July 2018.
- [5] A. Dinh, J. Wang, G. Chen, R. Liu, B. C. Ooi, K.-L. Tan: BLOCKBENCH: A Framework for Analysing Private Blockchains. ACM SIGMOD 2017. The morning paper review.
- [6] P. Ruan, G. Chen, A. Dinh, Q. Lin, D. Loghin, B. C. Ooi, M. Zhang: Blockchains vs. Distributed Databases: Dichotomy and Fusion. To appear in ACM SIGMOD 2021.
- [7] P. Ruan, D. Loghin, Q.-T. Ta, M Zhang, G. Chen, B. C. Ooi: A Transactional Perspective on Execute-Order-Validate Blockchains, ACM SIGMOD 2020.
- [8] C. Yue. Z. Xue, M. Zhang, G. Chen, B. C. Ooi, S. Wang, X. Xiao: Analysis of Indexing Structures for Immutable Data. ACM SIGMOD 2020.
- [9] Q. Lin et al. ForkBase: Immutable, Tamper-evident Storage Substrate for Branchable Applications. IEEE International Conference on Data Engineering, 2020
- [10] P. Ruan, A. Dinh, Q. Lin, M. Zhang, G. Chen, B. C. Ooi: Revealing Every Story of Data in Blockchain Systems. ACM SIGMOD Highlight Award paper, 2020.