Parallel Relay-and-Execution Distributed Architecture (PREDA) is the smart contract language for defining states and transaction logic that are executed on a parallel multi-chain architecture with relayed execution.
- PREDA: A General Programming Language for Parallel Execution of Smart Contract Transactions
Sharding blockchains allow payment transactions to be executed in parallel by multiple shards of the chains. In this way, sharding blockchains can improve the transaction throughput and state capacity for payment transactions. In order to extend such capability to general smart contract transactions, we introduce PREDA, Parallel Relay Execution Distributed Architecture, and its language to define how contract states can be efficiently divided into shards and how logic flow of contract functions can be executed asynchronously across all shards. Programmers can use PREDA to implement smart contracts and the sharding blockchain systems that support PREDA can execute transactions invoking PREDA smart contracts in parallel.
git submodule update --init
- cmake_minimum_required: 3.18.6+
- See https://cmake.org/cmake/help/latest/command/install.html#install for more detail
-
install visual studio 2019
-
install windows sdk
-
set the compile parameters:
cmake -S ./ -B ./build -G "Visual Studio 16 2019" -DDOWNLOAD_IPP=ON -DDOWNLOAD_3RDPARTY=ON -DBUNDLE_OPS=ON
-
compile:
cmake --build ./build --config Release
-
install dependencies:
sudo apt install p7zip-full pkg-config cmake libx11-dev uuid-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev g++-9 gcc-9
-
set the compile parameters:
cmake -S ./ -B ./build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DDOWNLOAD_IPP=ON -DDOWNLOAD_3RDPARTY=ON -DBUNDLE_OPS=ON
-
compile:
cmake --build ./build
-
install 7zip
brew install p7zip
-
install xcode and clang
-
set the compile parameters:
cmake -S ./ -B ./build -G "Xcode" -DDOWNLOAD_IPP=ON -DDOWNLOAD_3RDPARTY=ON -DBUNDLE_OPS=ON
-
compile:
cmake --build ./build --config Release
OS | Tools | Links |
---|---|---|
Windows | Inno Setup | https://jrsoftware.org/isinfo.php |
Linux | dpkg-deb | Come with System |
Mac | Packages | http://s.sudre.free.fr/Software/Packages/about.html |
you can find the package under the bundle
folder with the following command while -DBUNDLE_OPS=ON
cmake --build ./build --target bundle_package
cmake --build ./build --target clean
or
del .\build
del %USERPROFILE%\.cmake
cmake --build ./build --target clean
or
rm -rf ./build
rm -rf ~/.cmake
you can run the preda-toolchain after build it or install the preda-toolchain package.
you can find the preda-toolchain at the bundle/PREDA/bin
folder after you build it.
➜ cd bundle/PREDA/bin
➜ pwd
./bundle/PREDA/bin
➜ ./chsimu ../examples/Ballot.prdts -count:100
...
...
Order: 2, TPS:25250, uTPS:27500
Shd#g: h:5 txn:0/0/6 addr:0
Shd#0: h:5 txn:0/0/26 addr:25
Shd#1: h:5 txn:0/0/26 addr:25
Shd#2: h:5 txn:0/0/28 addr:25
Shd#3: h:5 txn:0/0/26 addr:25
Total Txn:0/112
Learn more about how to use it through the documentation at docs
.
PREDA uses the following open source libraries as the components. The acknowledgements pertain to the corresponding software license.
https://www.intel.com/content/www/us/en/developer/tools/oneapi/ipp.html
License: Intel Simplified Software License
Copyright 1999-2020 Intel Corporation
https://github.com/dantmnf/7-zip
License: Public Domain
Author: Igor Pavlov
https://www.ttmath.org/
License: BSD licence
Copyright (c) 2006-2012, Tomasz Sowa
https://botan.randombit.net/
License: Simplified BSD License
(C) 1999-2020 The Botan Authors
https://github.com/cameron314/concurrentqueue
License: Simplified BSD License
Copyright (c) 2013-2016, Cameron Desrochers
http://www.partow.net/programming/exprtk/index.html
License: MIT License
Copyright Arash Partow (1999-2018)
https://github.com/facebook/rocksdb
License: GPLv2 and Apache 2.0 License
Copyright (c) 2011-present, Facebook, Inc
https://github.com/sparsehash/sparsehash
License: BSD-3-Clause license
Copyright (c) 2007, Google Inc
https://github.com/sparsehash/sparsehash
License: zlib License
Copyright (C) 1995-2007 Mark Adler
https://github.com/jedisct1/libsodium
License: ISC License
Copyright (c) 2013-2015, Frank Denis j@pureftpd.org
https://github.com/antlr/antlr4
License: BSD-3-Clause license
Copyright (c) 2012-2022 The ANTLR Project.
https://github.com/iamkun/dayjs
License: MIT License
Copyright (c) 2018-present, iamkun
https://github.com/mde/ejs
License: Apache License
Copyright 2112 mde@fleegix.org
https://github.com/jprichardson/node-fs-extra
License: MIT License
Copyright (c) 2011-2017 JP Richardson
https://github.com/janl/mustache.js
License: MIT License
Copyright (c) 2010-2015 The mustache.js community