You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@resilientdb.apache.org by da...@apache.org on 2024/08/15 01:20:25 UTC

(incubator-resilientdb) branch hotstuff-1 created (now 3274821c)

This is an automated email from the ASF dual-hosted git repository.

dakaikang pushed a change to branch hotstuff-1
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git


      at 3274821c hotstuff-1 w/wo slotting

This branch includes the following new commits:

     new 3274821c hotstuff-1 w/wo slotting

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-resilientdb) 01/01: hotstuff-1 w/wo slotting

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dakaikang pushed a commit to branch hotstuff-1
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git

commit 3274821cd80d38cc99367bd4a55487ec0641f04b
Author: DakaiKang <49...@qq.com>
AuthorDate: Thu Aug 15 01:19:10 2024 +0000

    hotstuff-1 w/wo slotting
---
 .asf.yaml                                          |   40 +
 .bazelrc                                           |    4 +
 .clang-format                                      |  168 ++
 .gitignore                                         |   14 +
 BUILD.bazel                                        |   16 +
 CHANGELOG.md                                       |  129 +
 CNAME                                              |    1 +
 CODE_OF_CONDUCT.md                                 |   76 +
 Docker/Dockerfile                                  |   37 +
 Docker/Dockerfile_mac                              |   34 +
 INSTALL.sh                                         |   42 +
 INSTALL_MAC.sh                                     |   21 +
 LICENSE                                            |  201 ++
 MODULE.bazel                                       |    6 +
 MODULE.bazel.lock                                  | 1632 +++++++++++
 NOTICE                                             |    5 +
 README.md                                          |  336 +++
 WORKSPACE                                          |  226 ++
 action.yml                                         |   53 +
 benchmark/protocols/cassandra/BUILD                |   16 +
 .../protocols/cassandra/kv_server_performance.cpp  |   89 +
 benchmark/protocols/cassandra/kv_service_tools.cpp |   57 +
 benchmark/protocols/fairdag/BUILD                  |   16 +
 .../protocols/fairdag/kv_server_performance.cpp    |   88 +
 benchmark/protocols/hs/BUILD                       |   16 +
 benchmark/protocols/hs/kv_server_performance.cpp   |   88 +
 benchmark/protocols/hs1/BUILD                      |   16 +
 benchmark/protocols/hs1/kv_server_performance.cpp  |   88 +
 benchmark/protocols/hs2/BUILD                      |   16 +
 benchmark/protocols/hs2/kv_server_performance.cpp  |   88 +
 benchmark/protocols/ooo_hs/BUILD                   |   16 +
 .../protocols/ooo_hs/kv_server_performance.cpp     |   88 +
 benchmark/protocols/pbft/BUILD                     |   25 +
 benchmark/protocols/pbft/kv_server_performance.cpp |   81 +
 benchmark/protocols/pbft/kv_service_tools.cpp      |   51 +
 benchmark/protocols/poe/BUILD                      |   16 +
 benchmark/protocols/poe/kv_server_performance.cpp  |   89 +
 benchmark/protocols/poe/kv_service_tools.cpp       |   57 +
 benchmark/protocols/rcc/BUILD                      |   16 +
 benchmark/protocols/rcc/CPUProfile                 |  Bin 0 -> 258560 bytes
 benchmark/protocols/rcc/example.png                |  Bin 0 -> 20371 bytes
 benchmark/protocols/rcc/gmon.out                   |  Bin 0 -> 1192 bytes
 benchmark/protocols/rcc/info.prof                  |  Bin 0 -> 61565 bytes
 benchmark/protocols/rcc/kv_server_performance.cpp  |   89 +
 benchmark/protocols/rcc/kv_service_tools.cpp       |   57 +
 benchmark/protocols/rcc/test                       |  Bin 0 -> 18128 bytes
 benchmark/protocols/rcc/test.cpp                   |   79 +
 benchmark/protocols/slot_hs1/BUILD                 |   16 +
 .../protocols/slot_hs1/kv_server_performance.cpp   |   88 +
 benchmark/protocols/tusk/BUILD                     |   16 +
 benchmark/protocols/tusk/kv_server_performance.cpp |   89 +
 benchmark/protocols/tusk/kv_service_tools.cpp      |   57 +
 chain/state/BUILD                                  |   20 +
 chain/state/chain_state.cpp                        |   44 +
 chain/state/chain_state.h                          |   42 +
 chain/state/chain_state_test.cpp                   |   65 +
 chain/storage/BUILD                                |   64 +
 chain/storage/kv_storage_test.cpp                  |  232 ++
 chain/storage/leveldb.cpp                          |  290 ++
 chain/storage/leveldb.h                            |   81 +
 chain/storage/memory_db.cpp                        |  170 ++
 chain/storage/memory_db.h                          |   88 +
 chain/storage/mock_storage.h                       |   56 +
 chain/storage/proto/BUILD                          |   36 +
 chain/storage/proto/kv.proto                       |   13 +
 chain/storage/proto/leveldb_config.proto           |    9 +
 chain/storage/proto/rocksdb_config.proto           |   11 +
 chain/storage/rocksdb.cpp                          |  291 ++
 chain/storage/rocksdb.h                            |   80 +
 chain/storage/setting/BUILD                        |   31 +
 chain/storage/storage.h                            |   60 +
 common/BUILD                                       |   60 +
 common/crypto/BUILD                                |   85 +
 common/crypto/hash.cpp                             |   54 +
 common/crypto/hash.h                               |   37 +
 common/crypto/hash_test.cpp                        |   56 +
 common/crypto/key_generator.cpp                    |  162 ++
 common/crypto/key_generator.h                      |   37 +
 common/crypto/mock_signature_verifier.h            |   41 +
 common/crypto/signature_utils.cpp                  |  153 ++
 common/crypto/signature_utils.h                    |   46 +
 common/crypto/signature_verifier.cpp               |  285 ++
 common/crypto/signature_verifier.h                 |   89 +
 common/crypto/signature_verifier_interface.cpp     |   35 +
 common/crypto/signature_verifier_interface.h       |   43 +
 common/crypto/signature_verifier_test.cpp          |  166 ++
 common/proto/BUILD                                 |   20 +
 common/proto/signature_info.proto                  |   61 +
 common/test/BUILD                                  |   43 +
 common/test/json_test.cpp                          |   61 +
 common/test/test.proto                             |   15 +
 common/test/test_macros.h                          |   53 +
 common/utils/BUILD                                 |    7 +
 common/utils/utils.cpp                             |   42 +
 common/utils/utils.h                               |   34 +
 documents/doxygen/.gitignore                       |    2 +
 documents/doxygen/Doxyfile                         | 2780 +++++++++++++++++++
 documents/doxygen/DoxygenLayout.xml                |  240 ++
 documents/doxygen/doxygen_html_style.css           |    4 +
 documents/doxygen/header                           |   60 +
 documents/doxygen/logo.png                         |  Bin 0 -> 71672 bytes
 documents/file/Nexres-1654906717062.json           | 2893 ++++++++++++++++++++
 documents/file/prometheus.yml                      |   47 +
 documents/image/dashboard/import.png               |  Bin 0 -> 11682 bytes
 documents/image/dashboard/resolution.png           |  Bin 0 -> 38037 bytes
 documents/image/dashboard/target list.png          |  Bin 0 -> 138486 bytes
 documents/image/dashboard/target.png               |  Bin 0 -> 40734 bytes
 documents/image/dashboard/yml_config.png           |  Bin 0 -> 61559 bytes
 documents/image/dashboard/yml_interval.png         |  Bin 0 -> 17770 bytes
 entrypoint.sh                                      |    4 +
 executor/common/BUILD                              |   26 +
 executor/common/custom_query.h                     |   36 +
 executor/common/mock_transaction_manager.h         |   43 +
 executor/common/transaction_manager.cpp            |   98 +
 executor/common/transaction_manager.h              |   66 +
 executor/contract/executor/BUILD                   |   27 +
 executor/contract/executor/contract_executor.cpp   |  121 +
 executor/contract/executor/contract_executor.h     |   50 +
 .../contract/executor/contract_executor_test.cpp   |  264 ++
 executor/contract/executor/test_data/BUILD         |    1 +
 executor/contract/executor/test_data/contract.json |   19 +
 executor/contract/manager/BUILD                    |   53 +
 executor/contract/manager/address_manager.cpp      |   54 +
 executor/contract/manager/address_manager.h        |   47 +
 executor/contract/manager/address_manager_test.cpp |   51 +
 executor/contract/manager/contract_manager.cpp     |  148 +
 executor/contract/manager/contract_manager.h       |   60 +
 .../contract/manager/contract_manager_test.cpp     |  252 ++
 executor/contract/manager/test_data/BUILD          |    1 +
 executor/contract/manager/test_data/contract.json  |   19 +
 executor/contract/manager/utils.h                  |   30 +
 executor/kv/BUILD                                  |   26 +
 executor/kv/kv_executor.cpp                        |  197 ++
 executor/kv/kv_executor.h                          |   63 +
 executor/kv/kv_executor_test.cpp                   |  343 +++
 executor/utxo/executor/BUILD                       |   28 +
 executor/utxo/executor/utxo_executor.cpp           |   79 +
 executor/utxo/executor/utxo_executor.h             |   57 +
 executor/utxo/executor/utxo_executor_test.cpp      |   80 +
 executor/utxo/manager/BUILD                        |   64 +
 executor/utxo/manager/transaction.cpp              |  190 ++
 executor/utxo/manager/transaction.h                |   56 +
 executor/utxo/manager/transaction_test.cpp         |  117 +
 executor/utxo/manager/tx_mempool.cpp               |  128 +
 executor/utxo/manager/tx_mempool.h                 |   55 +
 executor/utxo/manager/tx_mempool_test.cpp          |  196 ++
 executor/utxo/manager/wallet.cpp                   |   38 +
 executor/utxo/manager/wallet.h                     |   41 +
 executor/utxo/manager/wallet_test.cpp              |   40 +
 img/apache-incubator.png                           |  Bin 0 -> 30207 bytes
 img/apache-resdb.png                               |  Bin 0 -> 98785 bytes
 img/nexres.jpg                                     |  Bin 0 -> 71181 bytes
 img/nexres.pdf                                     |  Bin 0 -> 35993 bytes
 img/nexres.png                                     |  Bin 0 -> 72738 bytes
 img/resdb-v2.png                                   |  Bin 0 -> 41784 bytes
 img/resdb.png                                      |  Bin 0 -> 36015 bytes
 interface/common/BUILD                             |   55 +
 interface/common/mock_resdb_txn_accessor.h         |   37 +
 interface/common/resdb_state_accessor.cpp          |   72 +
 interface/common/resdb_state_accessor.h            |   47 +
 interface/common/resdb_state_accessor_test.cpp     |  114 +
 interface/common/resdb_txn_accessor.cpp            |  150 +
 interface/common/resdb_txn_accessor.h              |   53 +
 interface/common/resdb_txn_accessor_test.cpp       |  159 ++
 interface/contract/BUILD                           |   14 +
 interface/contract/contract_client.cpp             |  121 +
 interface/contract/contract_client.h               |   47 +
 interface/kv/BUILD                                 |   11 +
 interface/kv/kv_client.cpp                         |  148 +
 interface/kv/kv_client.h                           |   66 +
 interface/rdbc/BUILD                               |   59 +
 interface/rdbc/mock_net_channel.h                  |   42 +
 interface/rdbc/mock_resdb_txn_accessor.h           |   37 +
 interface/rdbc/net_channel.cpp                     |  231 ++
 interface/rdbc/net_channel.h                       |  109 +
 interface/rdbc/net_channel_test.cpp                |  214 ++
 interface/rdbc/transaction_constructor.cpp         |   89 +
 interface/rdbc/transaction_constructor.h           |   51 +
 interface/rdbc/transaction_constructor_test.cpp    |  160 ++
 interface/utxo/BUILD                               |   12 +
 interface/utxo/utxo_client.cpp                     |   98 +
 interface/utxo/utxo_client.h                       |   40 +
 monitoring/README.md                               |   34 +
 monitoring/prometheus/prometheus.yml               |   55 +
 node_modules/@actions/core/README.md               |  146 +
 node_modules/@actions/core/lib/command.d.ts        |   16 +
 node_modules/@actions/core/lib/command.js          |   78 +
 node_modules/@actions/core/lib/command.js.map      |    1 +
 node_modules/@actions/core/lib/core.d.ts           |  116 +
 node_modules/@actions/core/lib/core.js             |  209 ++
 node_modules/@actions/core/lib/core.js.map         |    1 +
 node_modules/@actions/core/package.json            |   67 +
 node_modules/badgen/LICENSE.md                     |    5 +
 node_modules/badgen/README.md                      |   83 +
 node_modules/badgen/dist/calc-text-width.d.ts      |    1 +
 node_modules/badgen/dist/color-presets.d.ts        |   14 +
 node_modules/badgen/dist/index.d.ts                |   19 +
 node_modules/badgen/dist/index.js                  |    2 +
 node_modules/badgen/dist/index.js.map              |    1 +
 node_modules/badgen/package.json                   |   65 +
 node_modules/badgen/tsconfig.json                  |   18 +
 node_modules/balanced-match/.npmignore             |    5 +
 node_modules/balanced-match/LICENSE.md             |   21 +
 node_modules/balanced-match/README.md              |   91 +
 node_modules/balanced-match/index.js               |   59 +
 node_modules/balanced-match/package.json           |   77 +
 node_modules/brace-expansion/LICENSE               |   21 +
 node_modules/brace-expansion/README.md             |  129 +
 node_modules/brace-expansion/index.js              |  201 ++
 node_modules/brace-expansion/package.json          |   75 +
 node_modules/concat-map/.travis.yml                |    4 +
 node_modules/concat-map/LICENSE                    |   18 +
 node_modules/concat-map/README.markdown            |   62 +
 node_modules/concat-map/example/map.js             |    6 +
 node_modules/concat-map/index.js                   |   13 +
 node_modules/concat-map/package.json               |   88 +
 node_modules/concat-map/test/map.js                |   39 +
 node_modules/fs.realpath/LICENSE                   |   43 +
 node_modules/fs.realpath/README.md                 |   33 +
 node_modules/fs.realpath/index.js                  |   66 +
 node_modules/fs.realpath/old.js                    |  303 ++
 node_modules/fs.realpath/package.json              |   59 +
 node_modules/glob-gitignore/HISTORY.md             |    1 +
 node_modules/glob-gitignore/LICENSE                |   21 +
 node_modules/glob-gitignore/README.md              |  121 +
 node_modules/glob-gitignore/package.json           |   85 +
 node_modules/glob-gitignore/src/glob.js            |   68 +
 node_modules/glob-gitignore/src/index.js           |   15 +
 node_modules/glob-gitignore/src/sync.js            |   50 +
 node_modules/glob-gitignore/src/util.js            |  137 +
 node_modules/glob/LICENSE                          |   21 +
 node_modules/glob/README.md                        |  375 +++
 node_modules/glob/changelog.md                     |   67 +
 node_modules/glob/common.js                        |  240 ++
 node_modules/glob/glob.js                          |  790 ++++++
 node_modules/glob/package.json                     |   80 +
 node_modules/glob/sync.js                          |  486 ++++
 node_modules/ignore/CHANGELOG.md                   |   32 +
 node_modules/ignore/LICENSE-MIT                    |   21 +
 node_modules/ignore/README.md                      |  386 +++
 node_modules/ignore/index.d.ts                     |   63 +
 node_modules/ignore/index.js                       |  568 ++++
 node_modules/ignore/legacy.js                      |  476 ++++
 node_modules/ignore/package.json                   |   98 +
 node_modules/inflight/LICENSE                      |   15 +
 node_modules/inflight/README.md                    |   37 +
 node_modules/inflight/inflight.js                  |   54 +
 node_modules/inflight/package.json                 |   58 +
 node_modules/inherits/LICENSE                      |   16 +
 node_modules/inherits/README.md                    |   42 +
 node_modules/inherits/inherits.js                  |    9 +
 node_modules/inherits/inherits_browser.js          |   27 +
 node_modules/inherits/package.json                 |   61 +
 node_modules/lodash.difference/LICENSE             |   47 +
 node_modules/lodash.difference/README.md           |   18 +
 node_modules/lodash.difference/index.js            | 1170 ++++++++
 node_modules/lodash.difference/package.json        |   69 +
 node_modules/lodash.union/LICENSE                  |   47 +
 node_modules/lodash.union/README.md                |   18 +
 node_modules/lodash.union/index.js                 | 1181 ++++++++
 node_modules/lodash.union/package.json             |   69 +
 node_modules/make-array/README.md                  |   61 +
 node_modules/make-array/index.js                   |   71 +
 node_modules/make-array/package.json               |   69 +
 node_modules/minimatch/LICENSE                     |   15 +
 node_modules/minimatch/README.md                   |  209 ++
 node_modules/minimatch/minimatch.js                |  923 +++++++
 node_modules/minimatch/package.json                |   63 +
 node_modules/once/LICENSE                          |   15 +
 node_modules/once/README.md                        |   79 +
 node_modules/once/once.js                          |   42 +
 node_modules/once/package.json                     |   67 +
 node_modules/path-is-absolute/index.js             |   20 +
 node_modules/path-is-absolute/license              |   21 +
 node_modules/path-is-absolute/package.json         |   75 +
 node_modules/path-is-absolute/readme.md            |   59 +
 node_modules/util.inherits/HISTORY.md              |    1 +
 node_modules/util.inherits/README.md               |   45 +
 node_modules/util.inherits/index.js                |   47 +
 node_modules/util.inherits/package.json            |   81 +
 node_modules/wrappy/LICENSE                        |   15 +
 node_modules/wrappy/README.md                      |   36 +
 node_modules/wrappy/package.json                   |   59 +
 node_modules/wrappy/wrappy.js                      |   33 +
 package-lock.json                                  |   11 +
 platform/common/data_comm/BUILD                    |   17 +
 platform/common/data_comm/data_comm.h              |   39 +
 platform/common/data_comm/network_comm.h           |   32 +
 platform/common/network/BUILD                      |   40 +
 platform/common/network/mock_socket.h              |   43 +
 platform/common/network/network_utils.cpp          |   50 +
 platform/common/network/network_utils.h            |   32 +
 platform/common/network/network_utils_test.cpp     |   43 +
 platform/common/network/socket.h                   |   51 +
 platform/common/network/tcp_socket.cpp             |  237 ++
 platform/common/network/tcp_socket.h               |   59 +
 platform/common/network/tcp_socket_test.cpp        |   94 +
 platform/common/queue/BUILD                        |   47 +
 platform/common/queue/batch_queue.h                |   79 +
 platform/common/queue/batch_queue_test.cpp         |   98 +
 platform/common/queue/blocking_queue.h             |  106 +
 platform/common/queue/lock_free_queue.h            |   78 +
 platform/common/queue/lock_free_queue_test.cpp     |   50 +
 platform/config/BUILD                              |   38 +
 platform/config/resdb_config.cpp                   |  280 ++
 platform/config/resdb_config.h                     |  163 ++
 platform/config/resdb_config_test.cpp              |  126 +
 platform/config/resdb_config_utils.cpp             |  157 ++
 platform/config/resdb_config_utils.h               |   43 +
 platform/config/resdb_poc_config.cpp               |   74 +
 platform/config/resdb_poc_config.h                 |   71 +
 platform/consensus/checkpoint/BUILD                |   18 +
 platform/consensus/checkpoint/checkpoint.h         |   32 +
 platform/consensus/checkpoint/mock_checkpoint.h    |   33 +
 platform/consensus/execution/BUILD                 |  114 +
 platform/consensus/execution/duplicate_manager.cpp |  143 +
 platform/consensus/execution/duplicate_manager.h   |   69 +
 .../consensus/execution/geo_global_executor.cpp    |  131 +
 platform/consensus/execution/geo_global_executor.h |   70 +
 .../execution/geo_global_executor_test.cpp         |   95 +
 .../execution/geo_transaction_executor.cpp         |  127 +
 .../consensus/execution/geo_transaction_executor.h |   58 +
 .../execution/geo_transaction_executor_test.cpp    |  150 +
 .../consensus/execution/mock_geo_global_executor.h |   37 +
 platform/consensus/execution/system_info.cpp       |   75 +
 platform/consensus/execution/system_info.h         |   54 +
 platform/consensus/execution/system_info_test.cpp  |   75 +
 .../consensus/execution/transaction_executor.cpp   |  593 ++++
 .../consensus/execution/transaction_executor.h     |  150 +
 .../execution/transaction_executor_test.cpp        |  282 ++
 .../consensus/ordering/cassandra/algorithm/BUILD   |   76 +
 .../ordering/cassandra/algorithm/cassandra.cpp     |  562 ++++
 .../ordering/cassandra/algorithm/cassandra.h       |  114 +
 .../cassandra/algorithm/proposal_graph.cpp         |  491 ++++
 .../ordering/cassandra/algorithm/proposal_graph.h  |   87 +
 .../cassandra/algorithm/proposal_manager.cpp       |  470 ++++
 .../cassandra/algorithm/proposal_manager.h         |   73 +
 .../ordering/cassandra/algorithm/proposal_state.h  |   16 +
 .../ordering/cassandra/algorithm/ranking.cpp       |   12 +
 .../ordering/cassandra/algorithm/ranking.h         |   14 +
 .../consensus/ordering/cassandra/framework/BUILD   |   16 +
 .../ordering/cassandra/framework/consensus.cpp     |  171 ++
 .../ordering/cassandra/framework/consensus.h       |   59 +
 .../cassandra/framework/consensus_test.cpp         |  179 ++
 platform/consensus/ordering/cassandra/proto/BUILD  |   16 +
 .../ordering/cassandra/proto/proposal.proto        |  119 +
 platform/consensus/ordering/common/BUILD           |   11 +
 platform/consensus/ordering/common/algorithm/BUILD |   12 +
 .../ordering/common/algorithm/protocol_base.cpp    |   53 +
 .../ordering/common/algorithm/protocol_base.h      |   64 +
 platform/consensus/ordering/common/framework/BUILD |   49 +
 .../ordering/common/framework/consensus.cpp        |  221 ++
 .../ordering/common/framework/consensus.h          |   83 +
 .../common/framework/performance_manager.cpp       |  340 +++
 .../common/framework/performance_manager.h         |  118 +
 .../ordering/common/framework/response_manager.cpp |  242 ++
 .../ordering/common/framework/response_manager.h   |   85 +
 .../common/framework/transaction_utils.cpp         |   49 +
 .../ordering/common/framework/transaction_utils.h  |   45 +
 .../ordering/common/transaction_utils.cpp          |   41 +
 .../consensus/ordering/common/transaction_utils.h  |   33 +
 platform/consensus/ordering/geo_pbft/BUILD         |   50 +
 platform/consensus/ordering/geo_pbft/README.md     |    4 +
 .../geo_pbft/consensus_manager_geo_pbft.cpp        |   45 +
 .../ordering/geo_pbft/consensus_manager_geo_pbft.h |   43 +
 .../ordering/geo_pbft/geo_pbft_commitment.cpp      |  142 +
 .../ordering/geo_pbft/geo_pbft_commitment.h        |   68 +
 .../ordering/geo_pbft/geo_pbft_commitment_test.cpp |  216 ++
 platform/consensus/ordering/geo_pbft/hash_set.h    |   70 +
 platform/consensus/ordering/hs/algorithm/BUILD     |   40 +
 platform/consensus/ordering/hs/algorithm/hs.cpp    |  198 ++
 platform/consensus/ordering/hs/algorithm/hs.h      |   62 +
 .../ordering/hs/algorithm/proposal_manager.cpp     |  176 ++
 .../ordering/hs/algorithm/proposal_manager.h       |   50 +
 platform/consensus/ordering/hs/framework/BUILD     |   28 +
 .../consensus/ordering/hs/framework/consensus.cpp  |  113 +
 .../consensus/ordering/hs/framework/consensus.h    |   56 +
 .../ordering/hs/framework/performance_manager.cpp  |   65 +
 .../ordering/hs/framework/performance_manager.h    |   46 +
 platform/consensus/ordering/hs/proto/BUILD         |   16 +
 .../consensus/ordering/hs/proto/proposal.proto     |   59 +
 platform/consensus/ordering/hs1/algorithm/BUILD    |   40 +
 platform/consensus/ordering/hs1/algorithm/hs1.cpp  |  199 ++
 platform/consensus/ordering/hs1/algorithm/hs1.h    |   62 +
 .../ordering/hs1/algorithm/proposal_manager.cpp    |  167 ++
 .../ordering/hs1/algorithm/proposal_manager.h      |   51 +
 platform/consensus/ordering/hs1/framework/BUILD    |   28 +
 .../consensus/ordering/hs1/framework/consensus.cpp |  114 +
 .../consensus/ordering/hs1/framework/consensus.h   |   56 +
 .../ordering/hs1/framework/performance_manager.cpp |  106 +
 .../ordering/hs1/framework/performance_manager.h   |   49 +
 platform/consensus/ordering/hs1/proto/BUILD        |   16 +
 .../consensus/ordering/hs1/proto/proposal.proto    |   59 +
 platform/consensus/ordering/hs2/algorithm/BUILD    |   40 +
 platform/consensus/ordering/hs2/algorithm/hs2.cpp  |  199 ++
 platform/consensus/ordering/hs2/algorithm/hs2.h    |   62 +
 .../ordering/hs2/algorithm/proposal_manager.cpp    |  180 ++
 .../ordering/hs2/algorithm/proposal_manager.h      |   51 +
 platform/consensus/ordering/hs2/framework/BUILD    |   29 +
 .../consensus/ordering/hs2/framework/consensus.cpp |  112 +
 .../consensus/ordering/hs2/framework/consensus.h   |   56 +
 .../ordering/hs2/framework/performance_manager.cpp |   65 +
 .../ordering/hs2/framework/performance_manager.h   |   46 +
 platform/consensus/ordering/hs2/proto/BUILD        |   16 +
 .../consensus/ordering/hs2/proto/proposal.proto    |   59 +
 platform/consensus/ordering/img/GeoBFT_1.png       |  Bin 0 -> 95131 bytes
 platform/consensus/ordering/img/PBFT_1.png         |  Bin 0 -> 28505 bytes
 platform/consensus/ordering/img/PBFT_2.png         |  Bin 0 -> 40103 bytes
 platform/consensus/ordering/img/PBFT_3.png         |  Bin 0 -> 49651 bytes
 platform/consensus/ordering/img/PBFT_4.png         |  Bin 0 -> 50363 bytes
 platform/consensus/ordering/img/PBFT_5.png         |  Bin 0 -> 49507 bytes
 platform/consensus/ordering/img/PBFT_6.png         |  Bin 0 -> 20268 bytes
 platform/consensus/ordering/pbft/BUILD             |  248 ++
 platform/consensus/ordering/pbft/README.md         |   31 +
 .../consensus/ordering/pbft/checkpoint_manager.cpp |  377 +++
 .../consensus/ordering/pbft/checkpoint_manager.h   |  118 +
 .../ordering/pbft/checkpoint_manager_test.cpp      |  307 +++
 platform/consensus/ordering/pbft/commitment.cpp    |  315 +++
 platform/consensus/ordering/pbft/commitment.h      |   79 +
 .../consensus/ordering/pbft/commitment_test.cpp    |  370 +++
 .../ordering/pbft/consensus_manager_pbft.cpp       |  265 ++
 .../ordering/pbft/consensus_manager_pbft.h         |   88 +
 .../ordering/pbft/lock_free_collector_pool.cpp     |   70 +
 .../ordering/pbft/lock_free_collector_pool.h       |   46 +
 .../pbft/lock_free_collector_pool_test.cpp         |   64 +
 .../consensus/ordering/pbft/message_manager.cpp    |  292 ++
 platform/consensus/ordering/pbft/message_manager.h |  144 +
 .../ordering/pbft/mock_checkpoint_manager.h        |   47 +
 .../ordering/pbft/performance_manager.cpp          |  416 +++
 .../consensus/ordering/pbft/performance_manager.h  |  118 +
 .../pbft/pre_very_consensus_service_pbft.h         |   55 +
 platform/consensus/ordering/pbft/query.cpp         |  107 +
 platform/consensus/ordering/pbft/query.h           |   48 +
 platform/consensus/ordering/pbft/query_test.cpp    |  203 ++
 .../consensus/ordering/pbft/response_manager.cpp   |  303 ++
 .../consensus/ordering/pbft/response_manager.h     |   82 +
 .../ordering/pbft/response_manager_test.cpp        |  208 ++
 .../ordering/pbft/transaction_collector.cpp        |  238 ++
 .../ordering/pbft/transaction_collector.h          |  141 +
 .../ordering/pbft/transaction_collector_test.cpp   |  397 +++
 .../consensus/ordering/pbft/transaction_utils.cpp  |   41 +
 .../consensus/ordering/pbft/transaction_utils.h    |   38 +
 .../consensus/ordering/pbft/viewchange_manager.cpp |  612 +++++
 .../consensus/ordering/pbft/viewchange_manager.h   |  158 ++
 .../ordering/pbft/viewchange_manager_test.cpp      |  124 +
 platform/consensus/ordering/poe/algorithm/BUILD    |   15 +
 platform/consensus/ordering/poe/algorithm/poe.cpp  |   80 +
 platform/consensus/ordering/poe/algorithm/poe.h    |   40 +
 platform/consensus/ordering/poe/framework/BUILD    |   16 +
 .../consensus/ordering/poe/framework/consensus.cpp |  108 +
 .../consensus/ordering/poe/framework/consensus.h   |   59 +
 .../ordering/poe/framework/consensus_test.cpp      |  179 ++
 platform/consensus/ordering/poe/proto/BUILD        |   16 +
 .../consensus/ordering/poe/proto/proposal.proto    |   28 +
 platform/consensus/ordering/rcc/algorithm/BUILD    |   35 +
 .../ordering/rcc/algorithm/proposal_manager.cpp    |   43 +
 .../ordering/rcc/algorithm/proposal_manager.h      |   22 +
 platform/consensus/ordering/rcc/algorithm/rcc.cpp  |  309 +++
 platform/consensus/ordering/rcc/algorithm/rcc.h    |   63 +
 .../rcc/algorithm/transaction_collector.cpp        |   55 +
 .../ordering/rcc/algorithm/transaction_collector.h |   71 +
 platform/consensus/ordering/rcc/framework/BUILD    |   16 +
 .../consensus/ordering/rcc/framework/consensus.cpp |  110 +
 .../consensus/ordering/rcc/framework/consensus.h   |   58 +
 platform/consensus/ordering/rcc/proto/BUILD        |   15 +
 .../consensus/ordering/rcc/proto/proposal.proto    |   43 +
 .../consensus/ordering/slot_hs1/algorithm/BUILD    |   39 +
 .../slot_hs1/algorithm/proposal_manager.cpp        |  182 ++
 .../ordering/slot_hs1/algorithm/proposal_manager.h |   51 +
 .../ordering/slot_hs1/algorithm/slot_hs1.cpp       |  240 ++
 .../ordering/slot_hs1/algorithm/slot_hs1.h         |   66 +
 .../consensus/ordering/slot_hs1/framework/BUILD    |   28 +
 .../ordering/slot_hs1/framework/consensus.cpp      |  116 +
 .../ordering/slot_hs1/framework/consensus.h        |   56 +
 .../slot_hs1/framework/performance_manager.cpp     |  168 ++
 .../slot_hs1/framework/performance_manager.h       |   51 +
 platform/consensus/ordering/slot_hs1/proto/BUILD   |   16 +
 .../ordering/slot_hs1/proto/proposal.proto         |   62 +
 platform/consensus/recovery/BUILD                  |   29 +
 platform/consensus/recovery/recovery.cpp           |  527 ++++
 platform/consensus/recovery/recovery.h             |  106 +
 platform/consensus/recovery/recovery_test.cpp      |  462 ++++
 platform/networkstrate/BUILD                       |  178 ++
 platform/networkstrate/README.md                   |   17 +
 platform/networkstrate/async_acceptor.cpp          |  164 ++
 platform/networkstrate/async_acceptor.h            |   76 +
 platform/networkstrate/async_acceptor_test.cpp     |  135 +
 platform/networkstrate/async_replica_client.cpp    |  112 +
 platform/networkstrate/async_replica_client.h      |   63 +
 .../networkstrate/async_replica_client_test.cpp    |  170 ++
 platform/networkstrate/consensus_manager.cpp       |  345 +++
 platform/networkstrate/consensus_manager.h         |  111 +
 platform/networkstrate/consensus_manager_test.cpp  |  303 ++
 platform/networkstrate/mock_async_replica_client.h |   35 +
 platform/networkstrate/mock_replica_communicator.h |   49 +
 platform/networkstrate/mock_service_interface.h    |   37 +
 platform/networkstrate/replica_communicator.cpp    |  263 ++
 platform/networkstrate/replica_communicator.h      |   98 +
 .../networkstrate/replica_communicator_test.cpp    |  139 +
 platform/networkstrate/server_comm.h               |   32 +
 platform/networkstrate/service_interface.cpp       |   38 +
 platform/networkstrate/service_interface.h         |   47 +
 platform/networkstrate/service_network.cpp         |  140 +
 platform/networkstrate/service_network.h           |   68 +
 platform/networkstrate/service_network_test.cpp    |  116 +
 platform/proto/BUILD                               |  135 +
 platform/proto/broadcast.proto                     |    7 +
 platform/proto/checkpoint_info.proto               |   25 +
 platform/proto/client_test.proto                   |   11 +
 platform/proto/logging.proto                       |   18 +
 platform/proto/network_type.proto                  |   10 +
 platform/proto/replica_info.proto                  |   63 +
 platform/proto/resdb.proto                         |  186 ++
 platform/proto/system_info_data.proto              |    8 +
 platform/proto/viewchange_message.proto            |   30 +
 platform/rdbc/BUILD                                |   16 +
 platform/rdbc/acceptor.cpp                         |   98 +
 platform/rdbc/acceptor.h                           |   57 +
 platform/statistic/BUILD                           |   31 +
 platform/statistic/README.md                       |  169 ++
 platform/statistic/prometheus_handler.cpp          |  108 +
 platform/statistic/prometheus_handler.h            |   79 +
 platform/statistic/set_random_data.cpp             |   86 +
 platform/statistic/stats.cpp                       |  719 +++++
 platform/statistic/stats.h                         |  140 +
 platform/statistic/test_server.sh                  |    8 +
 platform/test/BUILD                                |   19 +
 platform/test/proto/BUILD                          |   14 +
 platform/test/proto/resdb_test.proto               |   10 +
 platform/test/resdb_test.cpp                       |  168 ++
 platform/test/test_data/BUILD                      |    6 +
 platform/test/test_data/admin.key.pri              |    2 +
 platform/test/test_data/admin.key.pub              |    2 +
 platform/test/test_data/cert_1.cert                |    7 +
 platform/test/test_data/cert_2.cert                |  Bin 0 -> 167 bytes
 platform/test/test_data/cert_3.cert                |    8 +
 platform/test/test_data/cert_4.cert                |    6 +
 platform/test/test_data/cert_5.cert                |    7 +
 platform/test/test_data/cert_6.cert                |    7 +
 platform/test/test_data/kv_config.config           |   27 +
 platform/test/test_data/node1.key.pri              |    2 +
 platform/test/test_data/node1.key.pub              |    3 +
 platform/test/test_data/node2.key.pri              |    2 +
 platform/test/test_data/node2.key.pub              |    2 +
 platform/test/test_data/node3.key.pri              |  Bin 0 -> 36 bytes
 platform/test/test_data/node3.key.pub              |    3 +
 platform/test/test_data/node4.key.pri              |  Bin 0 -> 36 bytes
 platform/test/test_data/node4.key.pub              |    2 +
 platform/test/test_data/node5.key.pri              |    2 +
 platform/test/test_data/node5.key.pub              |    3 +
 platform/test/test_data/server.config              |   27 +
 proto/contract/BUILD                               |   49 +
 proto/contract/account.proto                       |    9 +
 proto/contract/contract.proto                      |   11 +
 proto/contract/func_params.proto                   |   21 +
 proto/contract/rpc.proto                           |   31 +
 proto/kv/BUILD                                     |   14 +
 proto/kv/kv.proto                                  |   53 +
 proto/utxo/BUILD                                   |   36 +
 proto/utxo/config.proto                            |   15 +
 proto/utxo/rpc.proto                               |   25 +
 proto/utxo/utxo.proto                              |   23 +
 repositories.bzl                                   |   90 +
 scripts/deploy/README.md                           |   46 +
 scripts/deploy/config/cassandra.config             |   10 +
 scripts/deploy/config/fair.config                  |   10 +
 scripts/deploy/config/hs.config                    |   12 +
 scripts/deploy/config/hs1.config                   |   12 +
 scripts/deploy/config/hs2.config                   |   12 +
 scripts/deploy/config/key_example.conf             |    2 +
 scripts/deploy/config/kv_performance_server.conf   |   39 +
 .../deploy/config/kv_performance_server_128.conf   |  262 ++
 .../config/kv_performance_server_128_small.conf    |  261 ++
 .../deploy/config/kv_performance_server_16.conf    |   37 +
 .../deploy/config/kv_performance_server_16_2.conf  |   53 +
 .../deploy/config/kv_performance_server_32.conf    |   69 +
 .../deploy/config/kv_performance_server_64.conf    |  133 +
 scripts/deploy/config/kv_performance_server_8.conf |   13 +
 .../config/kv_performance_server_small_128.conf    |  261 ++
 .../config/kv_performance_server_small_16.conf     |   37 +
 .../config/kv_performance_server_small_32.conf     |   69 +
 .../config/kv_performance_server_small_64.conf     |  133 +
 .../config/kv_performance_server_small_8.conf      |   20 +
 .../config/kv_performance_server_test_5.conf       |   10 +
 scripts/deploy/config/kv_server.conf               |    8 +
 scripts/deploy/config/ooo_hs.config                |   11 +
 scripts/deploy/config/poe.config                   |   10 +
 scripts/deploy/config/rcc.config                   |   10 +
 scripts/deploy/config/slot_hs1.config              |   12 +
 scripts/deploy/config/template.config              |   10 +
 scripts/deploy/data/cert/admin.key.pri             |    2 +
 scripts/deploy/data/cert/admin.key.pub             |    2 +
 scripts/deploy/data/cert/cert_1.cert               |  Bin 0 -> 166 bytes
 scripts/deploy/data/cert/cert_2.cert               |    7 +
 scripts/deploy/data/cert/cert_3.cert               |    7 +
 scripts/deploy/data/cert/cert_4.cert               |    6 +
 scripts/deploy/data/cert/cert_5.cert               |    8 +
 scripts/deploy/data/cert/cert_6.cert               |  Bin 0 -> 166 bytes
 scripts/deploy/data/cert/cert_7.cert               |    6 +
 scripts/deploy/data/cert/cert_8.cert               |  Bin 0 -> 166 bytes
 scripts/deploy/data/cert/cert_9.cert               |    7 +
 scripts/deploy/data/cert/node1.key.pri             |    2 +
 scripts/deploy/data/cert/node1.key.pub             |    3 +
 scripts/deploy/data/cert/node2.key.pri             |    2 +
 scripts/deploy/data/cert/node2.key.pub             |    2 +
 scripts/deploy/data/cert/node3.key.pri             |  Bin 0 -> 36 bytes
 scripts/deploy/data/cert/node3.key.pub             |    3 +
 scripts/deploy/data/cert/node4.key.pri             |  Bin 0 -> 36 bytes
 scripts/deploy/data/cert/node4.key.pub             |    2 +
 scripts/deploy/data/cert/node5.key.pri             |    2 +
 scripts/deploy/data/cert/node5.key.pub             |    3 +
 scripts/deploy/data/cert/node6.key.key.pri         |    2 +
 scripts/deploy/data/cert/node6.key.key.pub         |    2 +
 scripts/deploy/data/cert/node6.key.pri             |    2 +
 scripts/deploy/data/cert/node6.key.pub             |    2 +
 scripts/deploy/data/cert/node7.key.key.pri         |    2 +
 scripts/deploy/data/cert/node7.key.key.pub         |    2 +
 scripts/deploy/data/cert/node7.key.pri             |    2 +
 scripts/deploy/data/cert/node7.key.pub             |    2 +
 scripts/deploy/data/cert/node8.key.key.pri         |    2 +
 scripts/deploy/data/cert/node8.key.key.pub         |    2 +
 scripts/deploy/data/cert/node8.key.pri             |    2 +
 scripts/deploy/data/cert/node8.key.pub             |    2 +
 scripts/deploy/data/cert/node9.key.key.pri         |    2 +
 scripts/deploy/data/cert/node9.key.key.pub         |    2 +
 scripts/deploy/data/cert/node9.key.pri             |    2 +
 scripts/deploy/data/cert/node9.key.pub             |    2 +
 scripts/deploy/performance/calculate_result.py     |  113 +
 .../deploy/performance/cassandra_performance.sh    |    4 +
 scripts/deploy/performance/fair_performance.sh     |    4 +
 scripts/deploy/performance/hs1_performance.sh      |    4 +
 scripts/deploy/performance/hs2_performance.sh      |    4 +
 scripts/deploy/performance/hs_performance.sh       |    4 +
 scripts/deploy/performance/ooohs_performance.sh    |   59 +
 scripts/deploy/performance/pbft_performance.sh     |    6 +
 scripts/deploy/performance/poe_performance.sh      |    6 +
 scripts/deploy/performance/rcc_performance.sh      |    6 +
 scripts/deploy/performance/run_performance.sh      |   53 +
 scripts/deploy/performance/slot_hs1_performance.sh |    4 +
 scripts/deploy/performance/tusk_performance.sh     |    5 +
 scripts/deploy/poe_performance.sh                  |    6 +
 scripts/deploy/script/deploy.sh                    |  148 +
 scripts/deploy/script/env.sh                       |   27 +
 scripts/deploy/script/generate_config.sh           |   77 +
 scripts/deploy/script/generate_key.sh              |   16 +
 scripts/deploy/script/load_config.sh               |    8 +
 scripts/format.sh                                  |    2 +
 scripts/null                                       |    1 +
 service/contract/BUILD                             |   12 +
 service/contract/contract_service.cpp              |   70 +
 service/kv/BUILD                                   |   25 +
 service/kv/kv_service.cpp                          |   88 +
 service/tools/config/interface/service.config      |    3 +
 service/tools/config/interface/service0.config     |    3 +
 service/tools/config/server/server.config          |   38 +
 service/tools/config/server/utxo_config.config     |   12 +
 service/tools/contract/README.md                   |   19 +
 service/tools/contract/api_tools/BUILD             |   12 +
 .../tools/contract/api_tools/client_config.config  |    1 +
 .../contract/api_tools/config/server_config.config |   28 +
 .../tools/contract/api_tools/contract_tools.cpp    |  141 +
 .../contract/api_tools/example_contract/compile.sh |    2 +
 .../contract/api_tools/example_contract/token.json |   15 +
 .../contract/api_tools/example_contract/token.sol  |   31 +
 .../service_tools/start_contract_service.sh        |   14 +
 service/tools/data/cert/admin.key.pri              |    2 +
 service/tools/data/cert/admin.key.pub              |    2 +
 service/tools/data/cert/cert_1.cert                |  Bin 0 -> 166 bytes
 service/tools/data/cert/cert_2.cert                |    7 +
 service/tools/data/cert/cert_3.cert                |    7 +
 service/tools/data/cert/cert_4.cert                |    6 +
 service/tools/data/cert/cert_5.cert                |    8 +
 service/tools/data/cert/cert_6.cert                |  Bin 0 -> 166 bytes
 service/tools/data/cert/cert_7.cert                |    6 +
 service/tools/data/cert/cert_8.cert                |  Bin 0 -> 166 bytes
 service/tools/data/cert/cert_9.cert                |    7 +
 service/tools/data/cert/node1.key.pri              |    2 +
 service/tools/data/cert/node1.key.pub              |    3 +
 service/tools/data/cert/node2.key.pri              |    2 +
 service/tools/data/cert/node2.key.pub              |    2 +
 service/tools/data/cert/node3.key.pri              |  Bin 0 -> 36 bytes
 service/tools/data/cert/node3.key.pub              |    3 +
 service/tools/data/cert/node4.key.pri              |  Bin 0 -> 36 bytes
 service/tools/data/cert/node4.key.pub              |    2 +
 service/tools/data/cert/node5.key.pri              |    2 +
 service/tools/data/cert/node5.key.pub              |    3 +
 service/tools/data/cert/node6.key.key.pri          |    2 +
 service/tools/data/cert/node6.key.key.pub          |    2 +
 service/tools/data/cert/node6.key.pri              |    2 +
 service/tools/data/cert/node6.key.pub              |    2 +
 service/tools/data/cert/node7.key.key.pri          |    2 +
 service/tools/data/cert/node7.key.key.pub          |    2 +
 service/tools/data/cert/node7.key.pri              |    2 +
 service/tools/data/cert/node7.key.pub              |    2 +
 service/tools/data/cert/node8.key.key.pri          |    2 +
 service/tools/data/cert/node8.key.key.pub          |    2 +
 service/tools/data/cert/node8.key.pri              |    2 +
 service/tools/data/cert/node8.key.pub              |    2 +
 service/tools/data/cert/node9.key.key.pri          |    2 +
 service/tools/data/cert/node9.key.key.pub          |    2 +
 service/tools/data/cert/node9.key.pri              |    2 +
 service/tools/data/cert/node9.key.pub              |    2 +
 service/tools/kv/api_tools/BUILD                   |   21 +
 service/tools/kv/api_tools/kv_client_txn_tools.cpp |   69 +
 service/tools/kv/api_tools/kv_service_tools.cpp    |  280 ++
 service/tools/kv/server_tools/start_kv_service.sh  |   14 +
 .../kv/server_tools/start_kv_service_monitoring.sh |   15 +
 service/tools/utxo/README.md                       |   36 +
 .../tools/utxo/service_tools/start_utxo_service.sh |   16 +
 service/tools/utxo/wallet_tool/cpp/BUILD           |   29 +
 service/tools/utxo/wallet_tool/cpp/addr_utils.cpp  |   46 +
 service/tools/utxo/wallet_tool/cpp/addr_utils.h    |   37 +
 .../utxo/wallet_tool/cpp/client_config.config      |    1 +
 service/tools/utxo/wallet_tool/cpp/key_utils.cpp   |   41 +
 service/tools/utxo/wallet_tool/cpp/key_utils.h     |   35 +
 .../utxo/wallet_tool/cpp/server_config0.config     |    1 +
 .../utxo/wallet_tool/cpp/utxo_client_tools.cpp     |  182 ++
 service/tools/utxo/wallet_tool/py/BUILD            |   21 +
 service/tools/utxo/wallet_tool/py/addr.py          |   32 +
 service/tools/utxo/wallet_tool/py/keys.py          |   26 +
 service/tools/utxo/wallet_tool/pybind/BUILD        |   19 +
 .../utxo/wallet_tool/pybind/wallet_tools_py.cpp    |   43 +
 service/tools/utxo/wallet_tool/test/BUILD          |   29 +
 service/tools/utxo/wallet_tool/test/key_tester.py  |   26 +
 .../utxo/wallet_tool/test/key_tester_utils.cpp     |   47 +
 service/utils/BUILD                                |   12 +
 service/utils/server_factory.cpp                   |   48 +
 service/utils/server_factory.h                     |  124 +
 service/utxo/BUILD                                 |   11 +
 service/utxo/config/server_config.config           |   28 +
 service/utxo/config/utxo_config.config             |   12 +
 service/utxo/start_contract_server.sh              |   14 +
 service/utxo/utxo_service.cpp                      |   96 +
 src/index.js                                       |  108 +
 third_party/BUILD                                  |   47 +
 third_party/asio.BUILD                             |   19 +
 third_party/civetweb.BUILD                         |   30 +
 third_party/crow.BUILD                             |   19 +
 third_party/date.BUILD                             |   11 +
 third_party/eEVM.BUILD                             |   36 +
 third_party/json.BUILD                             |   10 +
 third_party/leveldb.BUILD                          |   31 +
 third_party/prometheus.BUILD                       |   11 +
 third_party/rapidjson.BUILD                        |    8 +
 third_party/rocksdb.BUILD                          |   98 +
 third_party/snappy.BUILD                           |   53 +
 third_party/z.BUILD                                |   16 +
 third_party/zlib.BUILD                             |   41 +
 third_party/zstd.BUILD                             |    5 +
 tools/BUILD                                        |   60 +
 tools/certificate_tools.cpp                        |  137 +
 tools/certificate_tools_test.cpp                   |   95 +
 tools/generate_certificate.sh                      |   37 +
 tools/generate_client.sh                           |    4 +
 tools/generate_cluster.sh                          |   12 +
 tools/generate_key.sh                              |    3 +
 tools/generate_mulregion_config.py                 |   69 +
 tools/generate_region_config.py                    |   84 +
 tools/key_generator_tools.cpp                      |   82 +
 tools/resdb_state_accessor_tools.cpp               |   45 +
 tools/resdb_txn_accessor_tools.cpp                 |   58 +
 761 files changed, 63471 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 00000000..cfb2ed0e
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+github:
+  description: Global-Scale Sustainable Blockchain Fabric
+  #homepage: resilientdb.apache.org
+  labels:
+    - crypto 
+    - smart-contracts 
+    - blockchain 
+    - solidity 
+    - distributed-database 
+    - key-value-database 
+    - distributed-ledger 
+    - blockchain-platform
+    - utxo
+  enabled_merge_buttons:
+    squash: true
+    merge: false
+    rebase: false
+  protected_branches:
+    master:
+  
+notifications:
+  commits:      commits@resilientdb.apache.org
+  issues:       commits@resilientdb.apache.org
+  pullrequests: commits@resilientdb.apache.org
diff --git a/.bazelrc b/.bazelrc
new file mode 100644
index 00000000..0566a7c9
--- /dev/null
+++ b/.bazelrc
@@ -0,0 +1,4 @@
+build --cxxopt='-std=c++17' --copt=-O3 --jobs=40 
+#build --action_env=PYTHON_BIN_PATH="/usr/bin/python3.10"
+#build --action_env=PYTHON_LIB_PATH="/usr/include/python3.10"
+
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 00000000..f2dd0de3
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,168 @@
+---
+Language:        Cpp
+# BasedOnStyle:  Google
+AccessModifierOffset: -1
+AlignAfterOpenBracket: Align
+AlignConsecutiveMacros: false
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
+AllowAllConstructorInitializersOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: Yes
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DeriveLineEnding: true
+DerivePointerAlignment: true
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeBlocks:   Regroup
+IncludeCategories:
+  - Regex:           '^<ext/.*\.h>'
+    Priority:        2
+    SortPriority:    0
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+    SortPriority:    0
+  - Regex:           '^<.*'
+    Priority:        2
+    SortPriority:    0
+  - Regex:           '.*'
+    Priority:        3
+    SortPriority:    0
+IncludeIsMainRegex: '([-_](test|unittest))?$'
+IncludeIsMainSourceRegex: ''
+IndentCaseLabels: true
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Never
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+RawStringFormats:
+  - Language:        Cpp
+    Delimiters:
+      - cc
+      - CC
+      - cpp
+      - Cpp
+      - CPP
+      - 'c++'
+      - 'C++'
+    CanonicalDelimiter: ''
+    BasedOnStyle:    google
+  - Language:        TextProto
+    Delimiters:
+      - pb
+      - PB
+      - proto
+      - PROTO
+    EnclosingFunctions:
+      - EqualsProto
+      - EquivToProto
+      - PARSE_PARTIAL_TEXT_PROTO
+      - PARSE_TEST_PROTO
+      - PARSE_TEXT_PROTO
+      - ParseTextOrDie
+      - ParseTextProtoOrDie
+    CanonicalDelimiter: ''
+    BasedOnStyle:    google
+ReflowComments:  true
+SortIncludes:    true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 2
+SpacesInAngles:  false
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+Standard:        Auto
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        8
+UseCRLF:         false
+UseTab:          Never
+...
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..d6dc6e11
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+deps/*/
+scripts/deploy/config/key.conf
+scripts/deploy/config_out/
+deploy/kv_server/output/
+.idea/
+.vscode/
+.DS_Store
+bazel-*
+*.log
+*.bak
+venv
+sdk_validator/venv
+__pycache__
+scripts/deploy/result_*_log
\ No newline at end of file
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 00000000..ef108781
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:public"])
+
+load("@rules_foreign_cc//foreign_cc:defs.bzl", "make")
+
+make(
+    name = "cryptopp",
+    lib_source = "@cryptopp//:all_srcs",
+    out_static_libs = ["libcryptopp.a"],
+)
+
+cc_library(
+    name = "cryptopp_lib",
+    deps = [
+        ":cryptopp",
+    ],
+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..b470773d
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,129 @@
+# Change Log
+
+### NexRes v1.9.0 ([2023-11-29](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.9.0))
+
+Support Multi-version Key-Value Interface. ([Junchao Chen](https://github.com/cjcchen))
+
+* Get and Set need to provide a version number to fetch the correct version of the data (if exists) or write to the correct version of data (if not overwritten already), respectively.
+* Provide interfaces to obtain historical data with a specific version or a range of versions.
+
+
+### NexRes v1.8.0 ([2023-08-21](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.8.0))
+
+**Implemented Enhancements:** The view-change recovery protocol was extensively expanded to support the following Byzantine failures through primary/leader replacement and replica recovery. ([Dakai Kang](https://github.com/DakaiKang))
+
+* Byzantine primary becomes non-responsive, stopping proposing any new Pre-Prepare messages.
+* Byzantine primary equivocates, proposing two different client requests to two subsets of replicas.
+* Byzantine replicas try to keep some non-faulty replicas in the dark.
+* Byzantine new primary becomes non-responsive, refusing to broadcast New-View messages.
+
+### NexRes v1.7.0 ([2023-08-04](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.7.0))
+
+**Implemented Enhancements:** For each replica local recovery from durable storage upon system restart was added.([Junchao Chen](https://github.com/cjcchen))
+
+
+### NexRes v1.6.0 ([2023-05-30](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.6.0))
+
+**Implemented Enhancements:** Refactoring and enhancement of the codebase to highlight the entire software stack of ResilientDB consisting of the following layers ([Junchao Chen](https://github.com/cjcchen))
+
+* SDK Layer (C++, Python, Go, Solidity)
+* Interface Layer (key-value, smart contract, UTXO)
+* ResilientDB Database Connectivity (RDBC) API
+* Platform Layer (consensus, chain, network, notary)
+* Transaction Layer (execution runtime and in-memory chain state)
+* Storage Layer (chain and chain state durability)
+
+
+### NexRes v1.5.0 ([2023-04-04](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.5.0))
+
+**Implemented Enhancements:** 
+* A complete refactoring of the codebase such that (1) the core engine code is now moved to the platform folder, including the formwork architectures and protocols implementations; (2) the API/interface-related code is moved to the service folder, including UTXO, smart contract, and key-value interface;  (3) the python SDK code is moved to a different repository [here](https://github.com/resilientdb/sdk) ([Junchao Chen](https://github.com/cjcchen)).
+
+### NexRes v1.4.0 ([2023-02-28](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v.1.4.0))
+Major Changes
+* Support of UTXO model and wallet integration: [Detailed Documentation](https://blog.resilientdb.com/2023/02/12/GettingStartedOnUtxo.html) ([Junchao Chen](https://github.com/cjcchen))
+
+
+### NexRes v1.3.0 ([2023-02-22](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.3.0))
+
+**Implemented Enhancements:** 
+* Added Python SDK that supports UTXO-like transactions such as asset creation, transfer, and multi-party validations. ([Arindaam Roy](https://github.com/royari), [Glenn Chen](https://github.com/glenn-chen), and [Julieta Duarte](https://github.com/juduarte00))
+* Added REST CROW endpoints to interface with the on-chain KV service. ([Glenn Chen](https://github.com/glenn-chen) and [Julieta Duarte](https://github.com/juduarte00))
+* Extended KV service range queries. ([Glenn Chen](https://github.com/glenn-chen) and [Julieta Duarte](https://github.com/juduarte00))
+
+**Fixed Bugs:**
+* Fixed KV service queries on all values retrieving empty placeholder values ([Glenn Chen](https://github.com/glenn-chen))
+
+### NexRes v1.2.0 ([2023-01-29](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.2.0))
+
+**Implemented Enhancements:** 
+* Support smart contract compiled from Solidity. ([Junchao Chen](https://github.com/cjcchen)) 
+* Use eEVM as a back-end service to execute the contract functions. ([Junchao Chen](https://github.com/cjcchen))
+
+### NexRes v1.1.0 ([2023-01-03](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.1.0))
+
+**Implemented Enhancements:** 
+
+* Added Geo-Scale Byzantine Fault-tolerant consensus protocol, referred to as GeoBFT. It is designed for excellent scalability by using a topological-aware grouping of replicas in local clusters, giving rise to parallelization of consensus at the local level and by minimizing communication between clusters. ([WayneWang](https://github.com/WayneJa))
+
+ResilientDB: Global Scale Resilient Blockchain Fabric, VLDB 2020
+
+### NexRes v1.0.1 ([2022-10-13](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.0.1))
+
+**Implemented Enhancements:** 
+
+* Add node manager backend for resilientdb.com to launch NexRes locally. ([Vishnu](https://github.com/sheshavpd) and [Junchao Chen](https://github.com/cjcchen))
+
+### NexRes v1.0.0 ([2022-09-30](https://github.com/resilientdb/resilientdb/releases/tag/nexres-v1.0.0))
+
+**Implemented Enhancements:** 
+
+* Release the next generation of RelisientDB referred to as NexRes. ([Junchao Chen](https://github.com/cjcchen))
+* NexRes supports PBFT as the default core protocol and provides a KV-Server as a service. ([Junchao Chen](https://github.com/cjcchen))
+* NexRes also supports LevelDB and RocksDB as the durable storage layer. ([Junchao Chen](https://github.com/cjcchen))
+* Add SDK endpoints. ([Junchao Chen](https://github.com/cjcchen))
+* Add implementation of Dashboard. ([Jianxio](https://github.com/jyu25utk))
+* Add the recovery protocol and checkpoint on PBFT. ([Junchao Chen](https://github.com/cjcchen) and [Vishnu](https://github.com/sheshavpd))
+
+
+### NexRes v1.0.0-alpha ([2022-09-22](https://github.com/resilientdb/resilientdb/releases/tag/nexres-alpha))
+
+**Implemented Enhancements:** 
+* Release the next generation of RelisientDB, a complete rewrite and re-architecting, referred to as NexRes. ([Junchao Chen](https://github.com/cjcchen))
+* NexRes supports PBFT as the default core protocol and provides a KV-Server as a service. ([Junchao Chen](https://github.com/cjcchen))
+* NexRes also supports LevelDB and RocksDB as the durable storage layer. ([Glenn Chen](https://github.com/glenn-chen), [Julieta Duarte](https://github.com/juduarte00), and [Junchao Chen](https://github.com/cjcchen))
+
+
+### v3.0 ([2021-09-30](https://github.com/resilientdb/resilientdb/releases/tag/v3.0))
+
+**Implemented Enhancements:** 
+* GeoBFT Protocol Added ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+* Work Queue structure changed ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+* Refactoring, and added Statistics and Scripts ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+
+
+### v2.0 ([2020-02-29](https://github.com/resilientdb/resilientdb/releases/tag/v2.0))
+
+**Implemented Enhancements:** 
+* A GUI display for ResilientDB to ease user interaction and analysis. [#9](https://github.com/resilientdb/resilientdb/issues/9) ([Sajjad Rahnama](https://github.com/sajjadrahnama) and [RohanSogani](https://github.com/RohanSogani))
+* Added support for Smart Contracts with a Banking use case. [#7](https://github.com/resilientdb/resilientdb/issues/7) ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+* Monitoring results for visualizing graphs using influxdb. [#8](https://github.com/resilientdb/resilientdb/issues/8) ([Sajjad Rahnama](https://github.com/sajjadrahnama), [Dhruv Krishnan](https://github.com/DhruvKrish) and [Priya Holani](https://github.com/Holani))
+* Added support for SQLite and provided a new representation for in-memory storage. [#6](https://github.com/resilientdb/resilientdb/issues/6) ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+
+**Fixed Bugs:**
+* Bug in the Chain Initialization [#5](https://github.com/resilientdb/resilientdb/issues/5) ([Sajjad Rahnama](https://github.com/sajjadrahnama))
+
+
+### v1.1 ([2019-12-05](https://github.com/resilientdb/resilientdb/releases/tag/v1.1)) 
+
+**Implemented Enhancements:**
+* Defined class to represent ledger. [6b0fdc5](https://github.com/resilientdb/resilientdb/commit/56f500fe5e4749c45f57dc8e62d12bc7a218ce69) ([Suyash Gupta](https://github.com/gupta-suyash))
+
+**Fixed Bugs:**
+* Docker script fails to run for multiple client [#1](https://github.com/resilientdb/resilientdb/issues/1) ([RohanSogani](https://github.com/RohanSogani))	
+
+### v1.0 ([2019-11-24](https://github.com/resilientdb/resilientdb/releases/tag/v1.0)) 
+
+Launched ResilientDB ([Suyash Gupta](https://github.com/gupta-suyash) and [Sajjad Rahnama](https://github.com/sajjadrahnama))
+
+
diff --git a/CNAME b/CNAME
new file mode 100644
index 00000000..f53fa6a9
--- /dev/null
+++ b/CNAME
@@ -0,0 +1 @@
+api.resilientdb.com
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..3c938500
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at support@resilientdb.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
new file mode 100644
index 00000000..31571586
--- /dev/null
+++ b/Docker/Dockerfile
@@ -0,0 +1,37 @@
+FROM ubuntu:20.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+# Update package lists and install required dependencies
+RUN apt-get update && apt-get install -y \
+    apt-transport-https \
+    curl \
+    gnupg \
+    protobuf-compiler \
+    rapidjson-dev \
+    build-essential \
+    openjdk-11-jdk \
+    zip \
+    unzip \
+    clang-format
+
+# Install Bazel
+RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg \
+    && mv bazel.gpg /etc/apt/trusted.gpg.d/ \
+    && echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
+    && curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \
+    && apt-get update && apt-get install -y bazel=5.0.0 \
+    && rm /etc/apt/sources.list.d/bazel.list
+
+# Set the working directory
+WORKDIR /app
+
+# Copy your project files to the container
+COPY . /app
+
+# Build the project with Bazel 
+RUN bazel --version
+RUN bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier
+RUN bazel build service/tools/kv/api_tools/kv_service_tools
+
+ENTRYPOINT ["./entrypoint.sh"]
\ No newline at end of file
diff --git a/Docker/Dockerfile_mac b/Docker/Dockerfile_mac
new file mode 100644
index 00000000..211976d8
--- /dev/null
+++ b/Docker/Dockerfile_mac
@@ -0,0 +1,34 @@
+# Use a base image for ARM64 architecture
+FROM arm64v8/ubuntu:20.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+# Update package lists and install required dependencies
+RUN apt-get update && apt-get install -y \
+    apt-transport-https \
+    curl \
+    gnupg \
+    protobuf-compiler \
+    rapidjson-dev \
+    build-essential \
+    openjdk-11-jdk \
+    zip \
+    unzip \
+    clang-format
+
+# Install Bazelisk
+RUN curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64 \
+    && chmod +x /usr/local/bin/bazel
+
+# Set the working directory
+WORKDIR /app
+
+# Copy your project files to the container
+COPY . /app
+
+# Build the project with Bazel
+RUN bazel --version
+RUN bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier
+RUN bazel build service/tools/kv/api_tools/kv_service_tools
+
+ENTRYPOINT ["./entrypoint.sh"]
diff --git a/INSTALL.sh b/INSTALL.sh
new file mode 100755
index 00000000..d9079d58
--- /dev/null
+++ b/INSTALL.sh
@@ -0,0 +1,42 @@
+sudo apt update
+sudo apt install apt-transport-https curl gnupg -y
+sudo apt-get install protobuf-compiler -y
+sudo apt-get install rapidjson-dev -y
+
+curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
+sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ 
+echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
+curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
+sudo apt update && sudo apt install bazel=6.3.2 -y
+sudo apt install clang-format -y
+rm $PWD/.git/hooks/pre-push
+ln -s $PWD/hooks/pre-push $PWD/.git/hooks/pre-push
+
+bazel --version
+ret=$?
+
+if [[ $ret != "0" ]]; then
+
+sudo apt-get install build-essential openjdk-11-jdk zip unzip -y
+rm bazel-6.0.0-dist.zip
+rm -rf bazel_build
+wget wget https://releases.bazel.build/6.0.0/release/bazel-6.0.0-dist.zip
+mkdir -p bazel_build
+mv bazel-6.0.0-dist.zip bazel_build/
+cd bazel_build
+
+unzip bazel-6.0.0-dist.zip
+
+export JAVA_HOME='/usr/lib/jvm/java-1.11.0-openjdk-arm64/'
+env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
+sudo cp output/bazel /usr/local/bin/
+cd ..
+rm -rf bazel_build
+
+fi
+
+# install buildifier
+bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier
+
+sudo apt-get install python3.10-dev -y
+sudo apt-get install python3-dev -y
diff --git a/INSTALL_MAC.sh b/INSTALL_MAC.sh
new file mode 100644
index 00000000..b6d8b76d
--- /dev/null
+++ b/INSTALL_MAC.sh
@@ -0,0 +1,21 @@
+!/bin/sh
+
+sudo apt update
+sudo apt install g++ -y
+sudo apt install apt-transport-https curl gnupg -y
+sudo apt install protobuf-compiler -y
+
+wget https://github.com/bazelbuild/bazelisk/releases/download/v1.8.1/bazelisk-linux-arm64
+chmod +x bazelisk-linux-arm64
+sudo mv bazelisk-linux-arm64 /usr/local/bin/bazel
+
+sudo apt install clang-format -y
+rm -rf $PWD/.git/hooks/pre-push
+ln -s $PWD/hooks/pre-push $PWD/.git/hooks/pre-push
+
+bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier
+
+# for jemalloc
+sudo apt-get install autoconf automake libtool -y
+
+sudo apt install rapidjson-dev -y
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..261eeb9e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 00000000..00bb1836
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,6 @@
+###############################################################################
+# Bazel now uses Bzlmod by default to manage external dependencies.
+# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
+#
+# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
+###############################################################################
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
new file mode 100644
index 00000000..11bf37a4
--- /dev/null
+++ b/MODULE.bazel.lock
@@ -0,0 +1,1632 @@
+{
+  "lockFileVersion": 6,
+  "moduleFileHash": "0e3e315145ac7ee7a4e0ac825e1c5e03c068ec1254dd42c3caaecb27e921dc4d",
+  "flags": {
+    "cmdRegistries": [
+      "https://bcr.bazel.build/"
+    ],
+    "cmdModuleOverrides": {},
+    "allowedYankedVersions": [],
+    "envVarAllowedYankedVersions": "",
+    "ignoreDevDependency": false,
+    "directDependenciesMode": "WARNING",
+    "compatibilityMode": "ERROR"
+  },
+  "localOverrideHashes": {
+    "bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0"
+  },
+  "moduleDepGraph": {
+    "<root>": {
+      "name": "",
+      "version": "",
+      "key": "<root>",
+      "repoName": "",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      }
+    },
+    "bazel_tools@_": {
+      "name": "bazel_tools",
+      "version": "",
+      "key": "bazel_tools@_",
+      "repoName": "bazel_tools",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "@local_config_cc_toolchains//:all",
+        "@local_config_sh//:local_sh_toolchain"
+      ],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl",
+          "extensionName": "cc_configure_extension",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 18,
+            "column": 29
+          },
+          "imports": {
+            "local_config_cc": "local_config_cc",
+            "local_config_cc_toolchains": "local_config_cc_toolchains"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl",
+          "extensionName": "xcode_configure_extension",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 22,
+            "column": 32
+          },
+          "imports": {
+            "local_config_xcode": "local_config_xcode"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@rules_java//java:extensions.bzl",
+          "extensionName": "toolchains",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 25,
+            "column": 32
+          },
+          "imports": {
+            "local_jdk": "local_jdk",
+            "remote_java_tools": "remote_java_tools",
+            "remote_java_tools_linux": "remote_java_tools_linux",
+            "remote_java_tools_windows": "remote_java_tools_windows",
+            "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64",
+            "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl",
+          "extensionName": "sh_configure_extension",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 36,
+            "column": 39
+          },
+          "imports": {
+            "local_config_sh": "local_config_sh"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl",
+          "extensionName": "remote_coverage_tools_extension",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 40,
+            "column": 48
+          },
+          "imports": {
+            "remote_coverage_tools": "remote_coverage_tools"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl",
+          "extensionName": "remote_android_tools_extensions",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 43,
+            "column": 42
+          },
+          "imports": {
+            "android_gmaven_r8": "android_gmaven_r8",
+            "android_tools": "android_tools"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@buildozer//:buildozer_binary.bzl",
+          "extensionName": "buildozer_binary",
+          "usingModule": "bazel_tools@_",
+          "location": {
+            "file": "@@bazel_tools//:MODULE.bazel",
+            "line": 47,
+            "column": 33
+          },
+          "imports": {
+            "buildozer_binary": "buildozer_binary"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "rules_cc": "rules_cc@0.0.9",
+        "rules_java": "rules_java@7.4.0",
+        "rules_license": "rules_license@0.0.7",
+        "rules_proto": "rules_proto@5.3.0-21.7",
+        "rules_python": "rules_python@0.22.1",
+        "buildozer": "buildozer@6.4.0.2",
+        "platforms": "platforms@0.0.7",
+        "com_google_protobuf": "protobuf@21.7",
+        "zlib": "zlib@1.3",
+        "build_bazel_apple_support": "apple_support@1.5.0",
+        "local_config_platform": "local_config_platform@_"
+      }
+    },
+    "local_config_platform@_": {
+      "name": "local_config_platform",
+      "version": "",
+      "key": "local_config_platform@_",
+      "repoName": "local_config_platform",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_"
+      }
+    },
+    "rules_cc@0.0.9": {
+      "name": "rules_cc",
+      "version": "0.0.9",
+      "key": "rules_cc@0.0.9",
+      "repoName": "rules_cc",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "@local_config_cc_toolchains//:all"
+      ],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl",
+          "extensionName": "cc_configure_extension",
+          "usingModule": "rules_cc@0.0.9",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel",
+            "line": 9,
+            "column": 29
+          },
+          "imports": {
+            "local_config_cc_toolchains": "local_config_cc_toolchains"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"
+          ],
+          "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=",
+          "strip_prefix": "rules_cc-0.0.9",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_java@7.4.0": {
+      "name": "rules_java",
+      "version": "7.4.0",
+      "key": "rules_java@7.4.0",
+      "repoName": "rules_java",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "//toolchains:all",
+        "@local_jdk//:runtime_toolchain_definition",
+        "@local_jdk//:bootstrap_runtime_toolchain_definition",
+        "@remotejdk11_linux_toolchain_config_repo//:all",
+        "@remotejdk11_linux_aarch64_toolchain_config_repo//:all",
+        "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all",
+        "@remotejdk11_linux_s390x_toolchain_config_repo//:all",
+        "@remotejdk11_macos_toolchain_config_repo//:all",
+        "@remotejdk11_macos_aarch64_toolchain_config_repo//:all",
+        "@remotejdk11_win_toolchain_config_repo//:all",
+        "@remotejdk11_win_arm64_toolchain_config_repo//:all",
+        "@remotejdk17_linux_toolchain_config_repo//:all",
+        "@remotejdk17_linux_aarch64_toolchain_config_repo//:all",
+        "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all",
+        "@remotejdk17_linux_s390x_toolchain_config_repo//:all",
+        "@remotejdk17_macos_toolchain_config_repo//:all",
+        "@remotejdk17_macos_aarch64_toolchain_config_repo//:all",
+        "@remotejdk17_win_toolchain_config_repo//:all",
+        "@remotejdk17_win_arm64_toolchain_config_repo//:all",
+        "@remotejdk21_linux_toolchain_config_repo//:all",
+        "@remotejdk21_linux_aarch64_toolchain_config_repo//:all",
+        "@remotejdk21_macos_toolchain_config_repo//:all",
+        "@remotejdk21_macos_aarch64_toolchain_config_repo//:all",
+        "@remotejdk21_win_toolchain_config_repo//:all"
+      ],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@rules_java//java:extensions.bzl",
+          "extensionName": "toolchains",
+          "usingModule": "rules_java@7.4.0",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel",
+            "line": 19,
+            "column": 27
+          },
+          "imports": {
+            "remote_java_tools": "remote_java_tools",
+            "remote_java_tools_linux": "remote_java_tools_linux",
+            "remote_java_tools_windows": "remote_java_tools_windows",
+            "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64",
+            "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64",
+            "local_jdk": "local_jdk",
+            "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo",
+            "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo",
+            "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo",
+            "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo",
+            "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo",
+            "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo",
+            "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo",
+            "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo",
+            "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo",
+            "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo",
+            "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo",
+            "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo",
+            "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo",
+            "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo",
+            "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo",
+            "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo",
+            "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo",
+            "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo",
+            "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo",
+            "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo",
+            "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "rules_cc": "rules_cc@0.0.9",
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_proto": "rules_proto@5.3.0-21.7",
+        "rules_license": "rules_license@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz"
+          ],
+          "integrity": "sha256-l27wi0nJKXQfIBeQ5Z44B8cq2B9CjIvJU82+/1/tFes=",
+          "strip_prefix": "",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_license@0.0.7": {
+      "name": "rules_license",
+      "version": "0.0.7",
+      "key": "rules_license@0.0.7",
+      "repoName": "rules_license",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz"
+          ],
+          "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=",
+          "strip_prefix": "",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_proto@5.3.0-21.7": {
+      "name": "rules_proto",
+      "version": "5.3.0-21.7",
+      "key": "rules_proto@5.3.0-21.7",
+      "repoName": "rules_proto",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "com_google_protobuf": "protobuf@21.7",
+        "rules_cc": "rules_cc@0.0.9",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz"
+          ],
+          "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=",
+          "strip_prefix": "rules_proto-5.3.0-21.7",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_python@0.22.1": {
+      "name": "rules_python",
+      "version": "0.22.1",
+      "key": "rules_python@0.22.1",
+      "repoName": "rules_python",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "@bazel_tools//tools/python:autodetecting_toolchain"
+      ],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@rules_python//python/extensions/private:internal_deps.bzl",
+          "extensionName": "internal_deps",
+          "usingModule": "rules_python@0.22.1",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel",
+            "line": 14,
+            "column": 30
+          },
+          "imports": {
+            "pypi__build": "pypi__build",
+            "pypi__click": "pypi__click",
+            "pypi__colorama": "pypi__colorama",
+            "pypi__importlib_metadata": "pypi__importlib_metadata",
+            "pypi__installer": "pypi__installer",
+            "pypi__more_itertools": "pypi__more_itertools",
+            "pypi__packaging": "pypi__packaging",
+            "pypi__pep517": "pypi__pep517",
+            "pypi__pip": "pypi__pip",
+            "pypi__pip_tools": "pypi__pip_tools",
+            "pypi__setuptools": "pypi__setuptools",
+            "pypi__tomli": "pypi__tomli",
+            "pypi__wheel": "pypi__wheel",
+            "pypi__zipp": "pypi__zipp",
+            "pypi__coverage_cp310_aarch64-apple-darwin": "pypi__coverage_cp310_aarch64-apple-darwin",
+            "pypi__coverage_cp310_aarch64-unknown-linux-gnu": "pypi__coverage_cp310_aarch64-unknown-linux-gnu",
+            "pypi__coverage_cp310_x86_64-apple-darwin": "pypi__coverage_cp310_x86_64-apple-darwin",
+            "pypi__coverage_cp310_x86_64-unknown-linux-gnu": "pypi__coverage_cp310_x86_64-unknown-linux-gnu",
+            "pypi__coverage_cp311_aarch64-unknown-linux-gnu": "pypi__coverage_cp311_aarch64-unknown-linux-gnu",
+            "pypi__coverage_cp311_x86_64-apple-darwin": "pypi__coverage_cp311_x86_64-apple-darwin",
+            "pypi__coverage_cp311_x86_64-unknown-linux-gnu": "pypi__coverage_cp311_x86_64-unknown-linux-gnu",
+            "pypi__coverage_cp38_aarch64-apple-darwin": "pypi__coverage_cp38_aarch64-apple-darwin",
+            "pypi__coverage_cp38_aarch64-unknown-linux-gnu": "pypi__coverage_cp38_aarch64-unknown-linux-gnu",
+            "pypi__coverage_cp38_x86_64-apple-darwin": "pypi__coverage_cp38_x86_64-apple-darwin",
+            "pypi__coverage_cp38_x86_64-unknown-linux-gnu": "pypi__coverage_cp38_x86_64-unknown-linux-gnu",
+            "pypi__coverage_cp39_aarch64-apple-darwin": "pypi__coverage_cp39_aarch64-apple-darwin",
+            "pypi__coverage_cp39_aarch64-unknown-linux-gnu": "pypi__coverage_cp39_aarch64-unknown-linux-gnu",
+            "pypi__coverage_cp39_x86_64-apple-darwin": "pypi__coverage_cp39_x86_64-apple-darwin",
+            "pypi__coverage_cp39_x86_64-unknown-linux-gnu": "pypi__coverage_cp39_x86_64-unknown-linux-gnu"
+          },
+          "devImports": [],
+          "tags": [
+            {
+              "tagName": "install",
+              "attributeValues": {},
+              "devDependency": false,
+              "location": {
+                "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel",
+                "line": 15,
+                "column": 22
+              }
+            }
+          ],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@rules_python//python/extensions:python.bzl",
+          "extensionName": "python",
+          "usingModule": "rules_python@0.22.1",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel",
+            "line": 50,
+            "column": 23
+          },
+          "imports": {
+            "pythons_hub": "pythons_hub"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_proto": "rules_proto@5.3.0-21.7",
+        "com_google_protobuf": "protobuf@21.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_python/releases/download/0.22.1/rules_python-0.22.1.tar.gz"
+          ],
+          "integrity": "sha256-pWQP3dS+sD6MH95e1xYMC6a9R359BIZhwwwGk2om/WM=",
+          "strip_prefix": "rules_python-0.22.1",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/rules_python/0.22.1/patches/module_dot_bazel_version.patch": "sha256-3+VLDH9gYDzNI4eOW7mABC/LKxh1xqF6NhacLbNTucs="
+          },
+          "remote_patch_strip": 1
+        }
+      }
+    },
+    "buildozer@6.4.0.2": {
+      "name": "buildozer",
+      "version": "6.4.0.2",
+      "key": "buildozer@6.4.0.2",
+      "repoName": "buildozer",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@buildozer//:buildozer_binary.bzl",
+          "extensionName": "buildozer_binary",
+          "usingModule": "buildozer@6.4.0.2",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel",
+            "line": 7,
+            "column": 33
+          },
+          "imports": {
+            "buildozer_binary": "buildozer_binary"
+          },
+          "devImports": [],
+          "tags": [
+            {
+              "tagName": "buildozer",
+              "attributeValues": {
+                "sha256": {
+                  "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e",
+                  "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d",
+                  "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119",
+                  "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa",
+                  "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b"
+                },
+                "version": "6.4.0"
+              },
+              "devDependency": false,
+              "location": {
+                "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel",
+                "line": 8,
+                "column": 27
+              }
+            }
+          ],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz"
+          ],
+          "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=",
+          "strip_prefix": "buildozer-6.4.0.2",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU="
+          },
+          "remote_patch_strip": 1
+        }
+      }
+    },
+    "platforms@0.0.7": {
+      "name": "platforms",
+      "version": "0.0.7",
+      "key": "platforms@0.0.7",
+      "repoName": "platforms",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "rules_license": "rules_license@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz"
+          ],
+          "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=",
+          "strip_prefix": "",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "protobuf@21.7": {
+      "name": "protobuf",
+      "version": "21.7",
+      "key": "protobuf@21.7",
+      "repoName": "protobuf",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@rules_jvm_external//:extensions.bzl",
+          "extensionName": "maven",
+          "usingModule": "protobuf@21.7",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel",
+            "line": 22,
+            "column": 22
+          },
+          "imports": {
+            "maven": "maven"
+          },
+          "devImports": [],
+          "tags": [
+            {
+              "tagName": "install",
+              "attributeValues": {
+                "name": "maven",
+                "artifacts": [
+                  "com.google.code.findbugs:jsr305:3.0.2",
+                  "com.google.code.gson:gson:2.8.9",
+                  "com.google.errorprone:error_prone_annotations:2.3.2",
+                  "com.google.j2objc:j2objc-annotations:1.3",
+                  "com.google.guava:guava:31.1-jre",
+                  "com.google.guava:guava-testlib:31.1-jre",
+                  "com.google.truth:truth:1.1.2",
+                  "junit:junit:4.13.2",
+                  "org.mockito:mockito-core:4.3.1"
+                ]
+              },
+              "devDependency": false,
+              "location": {
+                "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel",
+                "line": 24,
+                "column": 14
+              }
+            }
+          ],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_python": "rules_python@0.22.1",
+        "rules_cc": "rules_cc@0.0.9",
+        "rules_proto": "rules_proto@5.3.0-21.7",
+        "rules_java": "rules_java@7.4.0",
+        "rules_pkg": "rules_pkg@0.7.0",
+        "com_google_abseil": "abseil-cpp@20211102.0",
+        "zlib": "zlib@1.3",
+        "upb": "upb@0.0.0-20220923-a547704",
+        "rules_jvm_external": "rules_jvm_external@4.4.2",
+        "com_google_googletest": "googletest@1.11.0",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip"
+          ],
+          "integrity": "sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=",
+          "strip_prefix": "protobuf-21.7",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel.patch": "sha256-q3V2+eq0v2XF0z8z+V+QF4cynD6JvHI1y3kI/+rzl5s=",
+            "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel_for_examples.patch": "sha256-O7YP6s3lo/1opUiO0jqXYORNHdZ/2q3hjz1QGy8QdIU=",
+            "https://bcr.bazel.build/modules/protobuf/21.7/patches/relative_repo_names.patch": "sha256-RK9RjW8T5UJNG7flIrnFiNE9vKwWB+8uWWtJqXYT0w4=",
+            "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_missing_files.patch": "sha256-Hyne4DG2u5bXcWHNxNMirA2QFAe/2Cl8oMm1XJdkQIY="
+          },
+          "remote_patch_strip": 1
+        }
+      }
+    },
+    "zlib@1.3": {
+      "name": "zlib",
+      "version": "1.3",
+      "key": "zlib@1.3",
+      "repoName": "zlib",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "rules_cc": "rules_cc@0.0.9",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz"
+          ],
+          "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=",
+          "strip_prefix": "zlib-1.3",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=",
+            "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "apple_support@1.5.0": {
+      "name": "apple_support",
+      "version": "1.5.0",
+      "key": "apple_support@1.5.0",
+      "repoName": "build_bazel_apple_support",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "@local_config_apple_cc_toolchains//:all"
+      ],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl",
+          "extensionName": "apple_cc_configure_extension",
+          "usingModule": "apple_support@1.5.0",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel",
+            "line": 17,
+            "column": 35
+          },
+          "imports": {
+            "local_config_apple_cc": "local_config_apple_cc",
+            "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz"
+          ],
+          "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=",
+          "strip_prefix": "",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "bazel_skylib@1.3.0": {
+      "name": "bazel_skylib",
+      "version": "1.3.0",
+      "key": "bazel_skylib@1.3.0",
+      "repoName": "bazel_skylib",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [
+        "//toolchains/unittest:cmd_toolchain",
+        "//toolchains/unittest:bash_toolchain"
+      ],
+      "extensionUsages": [],
+      "deps": {
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz"
+          ],
+          "integrity": "sha256-dNVE2W9KW7Yw1GXKi7z+Ix41lOWq5X4e2/F6brPKJQY=",
+          "strip_prefix": "",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_pkg@0.7.0": {
+      "name": "rules_pkg",
+      "version": "0.7.0",
+      "key": "rules_pkg@0.7.0",
+      "repoName": "rules_pkg",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "rules_python": "rules_python@0.22.1",
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_license": "rules_license@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz"
+          ],
+          "integrity": "sha256-iimOgydi7aGDBZfWT+fbWBeKqEzVkm121bdE1lWJQcI=",
+          "strip_prefix": "",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/rules_pkg/0.7.0/patches/module_dot_bazel.patch": "sha256-4OaEPZwYF6iC71ZTDg6MJ7LLqX7ZA0/kK4mT+4xKqiE="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "abseil-cpp@20211102.0": {
+      "name": "abseil-cpp",
+      "version": "20211102.0",
+      "key": "abseil-cpp@20211102.0",
+      "repoName": "abseil-cpp",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "rules_cc": "rules_cc@0.0.9",
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz"
+          ],
+          "integrity": "sha256-3PcbnLqNwMqZQMSzFqDHlr6Pq0KwcLtrfKtitI8OZsQ=",
+          "strip_prefix": "abseil-cpp-20211102.0",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/patches/module_dot_bazel.patch": "sha256-4izqopgGCey4jVZzl/w3M2GVPNohjh2B5TmbThZNvPY="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "upb@0.0.0-20220923-a547704": {
+      "name": "upb",
+      "version": "0.0.0-20220923-a547704",
+      "key": "upb@0.0.0-20220923-a547704",
+      "repoName": "upb",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_proto": "rules_proto@5.3.0-21.7",
+        "com_google_protobuf": "protobuf@21.7",
+        "com_google_absl": "abseil-cpp@20211102.0",
+        "platforms": "platforms@0.0.7",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz"
+          ],
+          "integrity": "sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=",
+          "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/patches/module_dot_bazel.patch": "sha256-wH4mNS6ZYy+8uC0HoAft/c7SDsq2Kxf+J8dUakXhaB0="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "rules_jvm_external@4.4.2": {
+      "name": "rules_jvm_external",
+      "version": "4.4.2",
+      "key": "rules_jvm_external@4.4.2",
+      "repoName": "rules_jvm_external",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [
+        {
+          "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl",
+          "extensionName": "non_module_deps",
+          "usingModule": "rules_jvm_external@4.4.2",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel",
+            "line": 9,
+            "column": 32
+          },
+          "imports": {
+            "io_bazel_rules_kotlin": "io_bazel_rules_kotlin"
+          },
+          "devImports": [],
+          "tags": [],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        },
+        {
+          "extensionBzlFile": "@rules_jvm_external//:extensions.bzl",
+          "extensionName": "maven",
+          "usingModule": "rules_jvm_external@4.4.2",
+          "location": {
+            "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel",
+            "line": 16,
+            "column": 22
+          },
+          "imports": {
+            "rules_jvm_external_deps": "rules_jvm_external_deps"
+          },
+          "devImports": [],
+          "tags": [
+            {
+              "tagName": "install",
+              "attributeValues": {
+                "name": "rules_jvm_external_deps",
+                "artifacts": [
+                  "com.google.cloud:google-cloud-core:1.93.10",
+                  "com.google.cloud:google-cloud-storage:1.113.4",
+                  "com.google.code.gson:gson:2.9.0",
+                  "org.apache.maven:maven-artifact:3.8.6",
+                  "software.amazon.awssdk:s3:2.17.183"
+                ],
+                "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json"
+              },
+              "devDependency": false,
+              "location": {
+                "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel",
+                "line": 18,
+                "column": 14
+              }
+            }
+          ],
+          "hasDevUseExtension": false,
+          "hasNonDevUseExtension": true
+        }
+      ],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "io_bazel_stardoc": "stardoc@0.5.1",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.4.2.zip"
+          ],
+          "integrity": "sha256-c1YC9QgT6y6pPKP15DsZWb2AshO4NqB6YqKddXZwt3s=",
+          "strip_prefix": "rules_jvm_external-4.4.2",
+          "remote_patches": {},
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "googletest@1.11.0": {
+      "name": "googletest",
+      "version": "1.11.0",
+      "key": "googletest@1.11.0",
+      "repoName": "googletest",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "com_google_absl": "abseil-cpp@20211102.0",
+        "platforms": "platforms@0.0.7",
+        "rules_cc": "rules_cc@0.0.9",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz"
+          ],
+          "integrity": "sha256-tIcL8SH/d5W6INILzdhie44Ijy0dqymaAxwQNO3ck9U=",
+          "strip_prefix": "googletest-release-1.11.0",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/googletest/1.11.0/patches/module_dot_bazel.patch": "sha256-HuahEdI/n8KCI071sN3CEziX+7qP/Ec77IWayYunLP0="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    },
+    "stardoc@0.5.1": {
+      "name": "stardoc",
+      "version": "0.5.1",
+      "key": "stardoc@0.5.1",
+      "repoName": "stardoc",
+      "executionPlatformsToRegister": [],
+      "toolchainsToRegister": [],
+      "extensionUsages": [],
+      "deps": {
+        "bazel_skylib": "bazel_skylib@1.3.0",
+        "rules_java": "rules_java@7.4.0",
+        "bazel_tools": "bazel_tools@_",
+        "local_config_platform": "local_config_platform@_"
+      },
+      "repoSpec": {
+        "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+        "ruleClassName": "http_archive",
+        "attributes": {
+          "urls": [
+            "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz"
+          ],
+          "integrity": "sha256-qoFNrgrEALurLoiB+ZFcb0fElmS/CHxAmhX5BDjSwj4=",
+          "strip_prefix": "",
+          "remote_patches": {
+            "https://bcr.bazel.build/modules/stardoc/0.5.1/patches/module_dot_bazel.patch": "sha256-UAULCuTpJE7SG0YrR9XLjMfxMRmbP+za3uW9ONZ5rjI="
+          },
+          "remote_patch_strip": 0
+        }
+      }
+    }
+  },
+  "moduleExtensions": {
+    "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": {
+      "general": {
+        "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=",
+        "recordedFileInputs": {},
+        "recordedDirentsInputs": {},
+        "envVariables": {},
+        "generatedRepoSpecs": {
+          "local_config_apple_cc": {
+            "bzlFile": "@@apple_support~//crosstool:setup.bzl",
+            "ruleClassName": "_apple_cc_autoconf",
+            "attributes": {}
+          },
+          "local_config_apple_cc_toolchains": {
+            "bzlFile": "@@apple_support~//crosstool:setup.bzl",
+            "ruleClassName": "_apple_cc_autoconf_toolchains",
+            "attributes": {}
+          }
+        },
+        "recordedRepoMappingEntries": [
+          [
+            "apple_support~",
+            "bazel_tools",
+            "bazel_tools"
+          ]
+        ]
+      }
+    },
+    "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": {
+      "general": {
+        "bzlTransitiveDigest": "PHpT2yqMGms2U4L3E/aZ+WcQalmZWm+ILdP3yiLsDhA=",
+        "recordedFileInputs": {},
+        "recordedDirentsInputs": {},
+        "envVariables": {},
+        "generatedRepoSpecs": {
+          "local_config_cc": {
+            "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl",
+            "ruleClassName": "cc_autoconf",
+            "attributes": {}
+          },
+          "local_config_cc_toolchains": {
+            "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl",
+            "ruleClassName": "cc_autoconf_toolchains",
+            "attributes": {}
+          }
+        },
+        "recordedRepoMappingEntries": [
+          [
+            "bazel_tools",
+            "bazel_tools",
+            "bazel_tools"
+          ]
+        ]
+      }
+    },
+    "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": {
+      "general": {
+        "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=",
+        "recordedFileInputs": {},
+        "recordedDirentsInputs": {},
+        "envVariables": {},
+        "generatedRepoSpecs": {
+          "local_config_xcode": {
+            "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl",
+            "ruleClassName": "xcode_autoconf",
+            "attributes": {
+              "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m",
+              "remote_xcode": ""
+            }
+          }
+        },
+        "recordedRepoMappingEntries": []
+      }
+    },
+    "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": {
+      "general": {
+        "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=",
+        "recordedFileInputs": {},
+        "recordedDirentsInputs": {},
+        "envVariables": {},
+        "generatedRepoSpecs": {
+          "local_config_sh": {
+            "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl",
+            "ruleClassName": "sh_config",
+            "attributes": {}
+          }
+        },
+        "recordedRepoMappingEntries": []
+      }
+    },
+    "@@rules_java~//java:extensions.bzl%toolchains": {
+      "general": {
+        "bzlTransitiveDigest": "tJHbmWnq7m+9eUBnUdv7jZziQ26FmcGL9C5/hU3Q9UQ=",
+        "recordedFileInputs": {},
+        "recordedDirentsInputs": {},
+        "envVariables": {},
+        "generatedRepoSpecs": {
+          "remotejdk21_linux_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_21\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"21\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_linux_s390x_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_macos_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk21_macos_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_21\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"21\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_linux_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk21_macos_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "e8260516de8b60661422a725f1df2c36ef888f6fb35393566b00e7325db3d04e",
+              "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk17_linux_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_macos_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remote_java_tools_windows": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "fe2f88169696d6c6fc6e90ba61bb46be7d0ae3693cbafdf336041bf56679e8d1",
+              "urls": [
+                "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_windows-v13.4.zip",
+                "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_windows-v13.4.zip"
+              ]
+            }
+          },
+          "remotejdk11_win": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83",
+              "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip",
+                "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip"
+              ]
+            }
+          },
+          "remotejdk11_win_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de",
+              "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk17_linux": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk11_linux_s390x_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_macos": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd",
+              "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk11_win_arm64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2",
+              "strip_prefix": "jdk-11.0.13+8",
+              "urls": [
+                "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip"
+              ]
+            }
+          },
+          "remotejdk17_macos": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk21_macos": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "3ad8fe288eb57d975c2786ae453a036aa46e47ab2ac3d81538ebae2a54d3c025",
+              "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk21_macos_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_21\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"21\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_macos_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_win": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip"
+              ]
+            }
+          },
+          "remotejdk11_macos_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux_ppc64le_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk21_linux": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "5ad730fbee6bb49bfff10bf39e84392e728d89103d3474a7e5def0fd134b300a",
+              "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz"
+              ]
+            }
+          },
+          "remote_java_tools_linux": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "ba10f09a138cf185d04cbc807d67a3da42ab13d618c5d1ce20d776e199c33a39",
+              "urls": [
+                "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_linux-v13.4.zip",
+                "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_linux-v13.4.zip"
+              ]
+            }
+          },
+          "remotejdk21_win": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "f7cc15ca17295e69c907402dfe8db240db446e75d3b150da7bf67243cded93de",
+              "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-win_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip",
+                "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip"
+              ]
+            }
+          },
+          "remotejdk21_linux_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "ce7df1af5d44a9f455617c4b8891443fbe3e4b269c777d8b82ed66f77167cfe0",
+              "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64",
+              "urls": [
+                "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk11_linux_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux_s390x": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b",
+              "strip_prefix": "jdk-11.0.15+10",
+              "urls": [
+                "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz",
+                "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz"
+              ]
+            }
+          },
+          "remotejdk17_linux_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk17_win_arm64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c",
+              "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk11_macos_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_linux_ppc64le_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk17_win_arm64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85",
+              "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip",
+                "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip"
+              ]
+            }
+          },
+          "remote_java_tools_darwin_arm64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "076a7e198ad077f8c7d997986ef5102427fae6bbfce7a7852d2e080ed8767528",
+              "urls": [
+                "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_arm64-v13.4.zip",
+                "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_arm64-v13.4.zip"
+              ]
+            }
+          },
+          "remotejdk17_linux_ppc64le": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd",
+              "strip_prefix": "jdk-17.0.8.1+1",
+              "urls": [
+                "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz",
+                "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz"
+              ]
+            }
+          },
+          "remotejdk21_linux_aarch64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_21\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"21\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_win_arm64_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_11\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"11\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "local_jdk": {
+            "bzlFile": "@@rules_java~//toolchains:local_java_repository.bzl",
+            "ruleClassName": "_local_java_repository_rule",
+            "attributes": {
+              "java_home": "",
+              "version": "",
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+            }
+          },
+          "remote_java_tools_darwin_x86_64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "4523aec4d09c587091a2dae6f5c9bc6922c220f3b6030e5aba9c8f015913cc65",
+              "urls": [
+                "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_x86_64-v13.4.zip",
+                "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_x86_64-v13.4.zip"
+              ]
+            }
+          },
+          "remote_java_tools": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "e025fd260ac39b47c111f5212d64ec0d00d85dec16e49368aae82fc626a940cf",
+              "urls": [
+                "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools-v13.4.zip",
+                "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools-v13.4.zip"
+              ]
+            }
+          },
+          "remotejdk17_linux_s390x": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37",
+              "strip_prefix": "jdk-17.0.8.1+1",
+              "urls": [
+                "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz",
+                "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz"
+              ]
+            }
+          },
+          "remotejdk17_win_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_17\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"17\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          },
+          "remotejdk11_linux_ppc64le": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f",
+              "strip_prefix": "jdk-11.0.15+10",
+              "urls": [
+                "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz",
+                "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz"
+              ]
+            }
+          },
+          "remotejdk11_macos_aarch64": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n    name = \"jre\",\n    srcs = glob(\n        [\n            \"jre/bin/**\",\n            \"jre/lib/**\",\n        ],\n        allow_empty = True,\n        # In some configurations, Java browser plugin is considered harmful and\n        # common antivirus software blocks ac [...]
+              "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885",
+              "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64",
+              "urls": [
+                "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz",
+                "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz"
+              ]
+            }
+          },
+          "remotejdk21_win_toolchain_config_repo": {
+            "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl",
+            "ruleClassName": "_toolchain_config",
+            "attributes": {
+              "build_file": "\nconfig_setting(\n    name = \"prefix_version_setting\",\n    values = {\"java_runtime_version\": \"remotejdk_21\"},\n    visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n    name = \"version_setting\",\n    values = {\"java_runtime_version\": \"21\"},\n    visibility = [\"//visibility:private\"],\n)\nalias(\n    name = \"version_or_prefix_version_setting\",\n    actual = select({\n        \":version_setting\": \":version_setting\",\n        \"/ [...]
+            }
+          }
+        },
+        "recordedRepoMappingEntries": [
+          [
+            "rules_java~",
+            "bazel_tools",
+            "bazel_tools"
+          ],
+          [
+            "rules_java~",
+            "remote_java_tools",
+            "rules_java~~toolchains~remote_java_tools"
+          ]
+        ]
+      }
+    }
+  }
+}
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 00000000..311b4360
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache ResilientDB
+Copyright 2023-2024 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (/).
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..9e14458a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,336 @@
+![](https://img.shields.io/github/v/release/resilientdb/resilientdb)
+![](https://img.shields.io/badge/language-c++-orange.svg)
+![](https://img.shields.io/badge/platform-Ubuntu20.0+-lightgrey.svg)
+![GitHub](https://img.shields.io/github/license/resilientdb/resilientdb)
+![Generated Button](https://raw.githubusercontent.com/resilientdb/resilientdb/image-data/badge.svg)
+![build](https://github.com/resilientdb/resilientdb/workflows/bazel-build%20CI/badge.svg)
+![build](https://github.com/resilientdb/resilientdb/workflows/Unite%20Test/badge.svg)
+
+
+
+# ResilientDB: Global-Scale Sustainable Blockchain Fabric
+
+**[ResilientDB](https://resilientdb.com/)** is a **High Throughput Yielding Permissioned Blockchain Fabric** founded by **[ExpoLab](https://expolab.org/)** at **[UC Davis](https://www.ucdavis.edu/)** in 2018. ResilientDB advocates a **system-centric** design by adopting a **multi-threaded architecture** that encompasses **deep pipelines**. Further, ResilientDB **separates** the ordering of client transactions from their execution, which allows it to **process messages out-of-order**.
+
+### Quick Facts on ResilientDB
+1. ResilientDB orders client transactions through a highly optimized implementation of the  **[PBFT](https://pmg.csail.mit.edu/papers/osdi99.pdf)** [Castro and Liskov, 1998] protocol, which helps to achieve consensus among its replicas. ResilientDB also supports deploying other state-of-the-art consensus protocols *[release are planned]* such as **[GeoBFT](http://www.vldb.org/pvldb/vol13/p868-gupta.pdf)** [**[blog](https://blog.resilientdb.com/2023/03/07/GeoBFT.html), [released](https:// [...]
+2. ResilientDB requires deploying at least **3f+1** replicas, where **f (f > 0)** is the maximum number of arbitrary (or malicious) replicas.
+3. ResilientDB supports primary-backup architecture, which designates one of the replicas as the **primary** (replica with identifier **0**). The primary replica initiates consensus on a client transaction, while backups agree to follow a non-malicious primary.
+4. ResilientDB exposes a wide range of interfaces such as a **Key-Value** store, **Smart Contracts**, **UTXO**, and **Python SDK**. Following are some of the decentralized applications (DApps) built on top of ResilientDB: **[NFT Marketplace](https://nft.resilientdb.com/)** and **[Debitable](https://debitable.resilientdb.com/)**.
+5. To persist blockchain, chain state, and metadata, ResilientDB provides durability through  **LevelDB** and **RocksDB**.
+6. ResilientDB provides access to a seamless **GUI display** for deployment and maintenance, and supports  **Grafana** for plotting monitoring data. 
+7. **[Historial Facts]** The ResilientDB project was founded by **[Mohammad Sadoghi](https://expolab.org/)** along with his students ([Suyash Gupta](https://gupta-suyash.github.io/index.html) as the lead Architect, [Sajjad Rahnama](https://sajjadrahnama.com/) as the lead System Designer, and [Jelle Hellings](https://www.jhellings.nl/)) at **[UC Davis](https://www.ucdavis.edu/)** in 2018 and was open-sourced in late 2019. On September 30, 2021, we released ResilientDB v-3.0. In 2022, Resi [...]
+
+<div align = "center">
+<img src="./img/resdb-v2.png" width="220">
+<img src="./img/apache-resdb.png" width="80">
+<img src="./img/apache-incubator.png" width="250">
+</div>
+
+---
+
+
+## Online Documentation:
+
+The latest ResilientDB documentation, including a programming guide, is available on our **[blog repository](https://blog.resilientdb.com/archive.html?tag=NexRes)**. This README file provides basic setup instructions.
+
+#### Table of Contents
+1. Software Stack Architecture 
+   - SDK, Interface/API, Platform, Execution, and Chain Layers 
+   - Detailed API Documentation: **[Core](https://api.resilientdb.com/)** and **[SDK](https://sdk.resilientdb.com/)**
+2. **SDK Layer:** **[Python SDK](https://blog.resilientdb.com/2023/02/01/UsingPythonSDK.html)** and **[Wallet - ResVault](https://blog.resilientdb.com/2023/09/21/ResVault.html)**
+3. **Interface Layer:** **[Key-Value](https://blog.resilientdb.com/2022/09/28/GettingStartedNexRes.html)**, **[Solidity Smart Contract](https://blog.resilientdb.com/2023/01/15/GettingStartedSmartContract.html)**, **[Unspent Transaction Output (UTXO) Model](https://blog.resilientdb.com/2023/02/12/UtxoOnNexres.html)**, ResilientDB Database Connectivity (RDBC) API
+4. **Platform Layer:** **[Consensus Manager Architecture (ordering, recovery, network, chain management)](https://blog.resilientdb.com/2022/09/27/What_Is_NexRes.html)**
+   - **[Recovery & Checkpoint Design](https://blog.resilientdb.com/2023/08/22/ViewChangeInNexRes.html)**
+5. **Execution Layer:** Transaction Manager Design (Runtime) 
+6. **Chain Layer:** Chain State & Storage Manager Design (**[durability](https://blog.resilientdb.com/2023/02/15/NexResDurabilityLayer.html)**) 
+7. **[Installing & Deploying ResilientDB](https://blog.resilientdb.com/2022/09/28/GettingStartedNexRes.html)**
+   - Build Your First Application: **[KV Service](https://blog.resilientdb.com/2022/09/28/StartYourApplication.html)**, **[UTXO](https://blog.resilientdb.com/2023/02/12/GettingStartedOnUtxo.html)**
+   - Dashboard: **[Monitoring](https://blog.resilientdb.com/2022/12/06/NexResGrafanaDashboardInstallation.html)**, **[Deployment](https://blog.resilientdb.com/2022/12/06/DeployGrafanaDashboardOnOracleCloud.html)**, **[Data Pipeline](https://blog.resilientdb.com/2022/12/12/NexResGrafanaDashboardPipeline.html)**
+   - System Parameters & Configuration   
+   - Continuous Integration & Testing 
+
+<div align = "center">
+<img src="./img/nexres.png" width="600">
+</div>
+
+## OS Requirements
+Ubuntu 20+
+
+---
+
+## Build and Deploy ResilientDB
+
+Next, we show how to quickly build ResilientDB and deploy 4 replicas and 1 client proxy on your local machine. The proxy acts as an interface for all the clients. It batches client requests and forwards these batches to the replica designated as the leader. The 4 replicas participate in the PBFT consensus to order and execute these batches. Post execution, they return the response to the leader.
+
+Install dependencies:
+
+    ./INSTALL.sh
+
+
+Run ResilientDB (Providing a Key-Value Service):
+
+    ./service/tools/kv/server_tools/start_kv_service.sh
+    
+- This script starts 4 replicas and 1 client. Each replica instantiates a key-value store.
+
+Build Interactive Tools:
+
+    bazel build service/tools/kv/api_tools/kv_service_tools
+
+## Functions ##
+ResilientDB supports two types of functions: version-based and non-version-based.
+Version-based functions will leverage versions to protect each update, versions must be obtained before updating a key.
+
+***Note***: Version-based functions are not compatible with non-version-based functions. Do not use both in your applications.
+
+We show the functions below and show how to use [kv_service_tools](service/tools/kv/api_tools/kv_service_tools.cpp) to test the function.
+
+### Version-Based Functions ###
+#### Get ####
+Obtain the value of `key` with a specific version `v`.
+
+      kv_service_tools --config config_file --cmd get_with_version --key key --version v
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get_with_version |
+| key  | the key you want to obtain |
+| version | the version you want to obtain. (If the `v` is 0, it will return the latest version |
+
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get_with_version --key key1 --version 0
+
+Results:
+> get key = key1, value = value: "v2"
+> version: 2
+
+#### Set ####
+Set `value` to the key `key` based on version `v`.
+
+      kv_service_tools --config config_file --cmd set_with_version --key key --version v --value value
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | set_with_version |
+| key  | the key you want to set |
+| version | the version you have obtained. (If the version has been changed during the update, the transaction will be ignored) |
+| value | the new value |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd set_with_version --key key1 --version 0 --value v1
+
+Results:
+> set key = key1, value = v3, version = 2 done, ret = 0
+> 
+> current value = value: "v3"
+> version: 3
+
+#### Get Key History ####
+Obtain the update history of key `key` within the versions [`v1`, `v2`].
+
+      kv_service_tools --config config_file --cmd get_history --key key --min_version v1 --max_version v2
+
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get_history |
+| key  | the key you want to obtain |
+| min_version | the minimum version you want to obtain |
+| max_version | the maximum version you want to obtain |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get_history --key key1 --min_version 1 --max_version 2
+
+Results:
+
+> get history key = key1, min version = 1, max version = 2 <br>
+>  value = <br>
+> item { <br>
+>  &ensp; key: "key1" <br>
+>  &ensp; value_info { <br>
+>  &ensp;&ensp; value: "v1" <br>
+>  &ensp;&ensp; version: 2 <br>
+> &ensp;} <br>
+> } <br>
+> item { <br>
+> &ensp; key: "key1" <br>
+> &ensp; value_info { <br>
+> &ensp;&ensp; value: "v0" <br>
+> &ensp;&ensp; version: 1 <br>
+> &ensp;} <br>
+> } 
+
+#### Get Top ####
+Obtain the recent `top_number` history of the key `key`.
+
+      kv_service_tools --config config_path --cmd get_top --key key --top top_number
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get_top |
+| key  | the key you want to obtain |
+| top | the number of the recent updates |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get_top --key key1 --top 1
+
+Results:
+
+>key = key1, top 1 <br>
+> value = <br>
+> item { <br>
+>&ensp;key: "key1" <br>
+>  &ensp;value_info { <br>
+>  &ensp;&ensp;  value: "v2" <br>
+>  &ensp;&ensp;  version: 3 <br>
+>  &ensp;} <br>
+>}
+
+#### Get Key Range ####
+Obtain the values of the keys in the ranges [`key1`, `key2`]. Do not use this function in your practice code
+
+      kv_service_tools --config config_file --cmd get_key_range_with_version --min_key key1 --max_key key2
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get_key_range_with_version |
+| min_key  | the minimum key  |
+| max_key | the maximum key |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get_key_range_with_version --min_key key1 --max_key key3
+
+Results:
+
+>min key = key1 max key = key2 <br>
+> getrange value = <br>
+> item { <br>
+> &ensp; key: "key1" <br>
+> &ensp; value_info { <br>
+> &ensp;&ensp;   value: "v0" <br>
+> &ensp;&ensp;   version: 1 <br>
+> &ensp; } <br>
+> } <br>
+> item { <br>
+> &ensp; key: "key2" <br>
+> &ensp; value_info { <br>
+> &ensp;&ensp;   value: "v1" <br>
+> &ensp;&ensp;   version: 1 <br>
+> &ensp; } <br>
+>}
+
+
+### Non-Version-Based Function ###
+#### Set #####
+Set `value` to the key `key`.
+
+      kv_service_tools --config config_file --cmd set --key key --value value
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | set |
+| key  | the key you want to set |
+| value | the new value |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd set --key key1 --value value1
+
+Results:
+> set key = key1, value = v1, done, ret = 0
+
+#### Get ####
+Obtain the value of `key`.
+
+      kv_service_tools --config config_file --cmd get --key key
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get |
+| key  | the key you want to obtain |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get --key key1
+
+Results:
+> get key = key1, value = "v2"
+
+
+#### Get Key Range ####
+Obtain the values of the keys in the ranges [`key1`, `key2`]. Do not use this function in your practice code
+
+      kv_service_tools --config config_path --cmd get_key_range --min_key key1 --max_key key2
+
+|  parameters   |  descriptions |
+|  ----  | ----  |
+| config  | the path of the client config which points to the db entrance |
+| cmd  | get_key_range |
+| min_key  | the minimum key  |
+| max_key | the maximum key |
+
+Example:
+
+      bazel-bin/service/tools/kv/api_tools/kv_service_tools --config service/tools/config/interface/service.config --cmd get_key_range --min_key key1 --max_key key3
+
+Results:
+> getrange min key = key1, max key = key3 <br>
+> value = [v3,v2,v1]
+
+
+## Deployment Script
+
+We also provide access to a [deployment script](https://github.com/resilientdb/resilientdb/tree/master/scripts/deploy) that allows deployment on distinct machines.
+
+## Deploy via Docker
+
+1. **Install Docker**  
+   Before getting started, make sure you have Docker installed on your system. If you don't have Docker already, you can download and install it from the official [Docker website](https://www.docker.com/products/docker-desktop/).
+
+2. **Pull the Latest ResilientDB Image**  
+   Choose the appropriate [ResilientDB image](https://hub.docker.com/repository/docker/expolab/resdb/general) for your machine's architecture:
+
+   - For amd architecture, run:
+     ```shell
+     docker pull expolab/resdb:amd64
+     ```
+
+   - For Apple Silicon (M1/M2) architecture, run:
+     ```shell
+     docker pull expolab/resdb:arm64
+     ```
+
+3. **Run a Container with the Pulled Image**  
+   Launch a Docker container using the ResilientDB image you just pulled:
+
+   - For amd architecture, run:
+     ```shell
+     docker run -d --name myserver expolab/resdb:amd64
+     ```
+
+   - For Apple Silicon (M1/M2) architecture, run:
+     ```shell
+     docker run -d --name myserver expolab/resdb:arm64
+     ```
+
+4. **Test with Set and Get Commands**
+   Exec into the running server:
+   ```shell
+   docker exec -it myserver bash
+   ```
+
+   Verify the functionality of the service by performing set and get operations provided above [functions](README.md#functions).
diff --git a/WORKSPACE b/WORKSPACE
new file mode 100644
index 00000000..f285e83f
--- /dev/null
+++ b/WORKSPACE
@@ -0,0 +1,226 @@
+workspace(name = "com_resdb_nexres")
+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+load("//:repositories.bzl", "nexres_repositories")
+
+nexres_repositories()
+
+http_archive(
+    name = "rules_foreign_cc",
+    sha256 = "69023642d5781c68911beda769f91fcbc8ca48711db935a75da7f6536b65047f",
+    strip_prefix = "rules_foreign_cc-0.6.0",
+    url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.6.0.tar.gz",
+)
+
+load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
+
+rules_foreign_cc_dependencies()
+
+http_archive(
+    name = "rules_proto",
+    sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
+    strip_prefix = "rules_proto-4.0.0",
+    urls = [
+        "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
+        "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
+    ],
+)
+
+load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
+
+rules_proto_dependencies()
+
+rules_proto_toolchains()
+
+http_archive(
+    name = "rules_python",
+    sha256 = "ffc7b877c95413c82bfd5482c017edcf759a6250d8b24e82f41f3c8b8d9e287e",
+    strip_prefix = "rules_python-0.19.0",
+    url = "https://github.com/bazelbuild/rules_python/releases/download/0.19.0/rules_python-0.19.0.tar.gz",
+)
+
+load("@rules_python//python:pip.bzl", "pip_install")
+load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
+
+rules_proto_dependencies()
+
+rules_proto_toolchains()
+
+load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains")
+
+rules_proto_grpc_toolchains()
+
+rules_proto_grpc_repos()
+
+bind(
+    name = "gtest",
+    actual = "@com_google_googletest//:gtest",
+)
+
+bind(
+    name = "glog",
+    actual = "@com_github_google_glog//:glog",
+)
+
+http_archive(
+    name = "com_github_google_glog",
+    sha256 = "21bc744fb7f2fa701ee8db339ded7dce4f975d0d55837a97be7d46e8382dea5a",
+    strip_prefix = "glog-0.5.0",
+    urls = ["https://github.com/google/glog/archive/v0.5.0.zip"],
+)
+
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+
+git_repository(
+    name = "com_google_protobuf",
+    remote = "https://github.com/protocolbuffers/protobuf",
+    tag = "v3.10.0",
+)
+
+load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
+
+protobuf_deps()
+
+all_content = """filegroup(name = "all_srcs", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
+
+# buildifier is written in Go and hence needs rules_go to be built.
+# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
+http_archive(
+    name = "io_bazel_rules_go",
+    sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83",
+    urls = [
+        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
+        "https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
+    ],
+)
+
+load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
+
+go_rules_dependencies()
+
+load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
+
+go_register_toolchains(version = "1.19.5")
+
+http_archive(
+    name = "bazel_gazelle",
+    sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
+    urls = [
+        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
+        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
+    ],
+)
+
+load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
+
+gazelle_dependencies()
+
+http_archive(
+    name = "com_github_bazelbuild_buildtools",
+    sha256 = "518b2ce90b1f8ad7c9a319ca84fd7de9a0979dd91e6d21648906ea68faa4f37a",
+    strip_prefix = "buildtools-5.0.1",
+    urls = [
+        "https://github.com/bazelbuild/buildtools/archive/refs/tags/5.0.1.zip",
+    ],
+)
+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
+
+boost_deps()
+
+http_archive(
+    name = "net_zlib_zlib",
+    build_file = "@com_resdb_nexres//third_party:z.BUILD",
+    sha256 = "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9",
+    strip_prefix = "zlib-1.2.12",
+    urls = [
+        "https://zlib.net/zlib-1.2.12.tar.gz",
+        "https://storage.googleapis.com/bazel-mirror/zlib.net/zlib-1.2.12.tar.gz",
+    ],
+)
+
+#prometheus cpp client library
+
+http_archive(
+    name = "com_google_leveldb",
+    build_file = "@com_resdb_nexres//third_party:leveldb.BUILD",
+    sha256 = "a6fa7eebd11de709c46bf1501600ed98bf95439d6967963606cc964931ce906f",
+    strip_prefix = "leveldb-1.23",
+    url = "https://github.com/google/leveldb/archive/refs/tags/1.23.zip",
+)
+
+bind(
+    name = "snappy",
+    actual = "@com_google_snappy//:snappy",
+)
+
+http_archive(
+    name = "com_google_snappy",
+    build_file = "@com_resdb_nexres//third_party:snappy.BUILD",
+    sha256 = "e170ce0def2c71d0403f5cda61d6e2743373f9480124bcfcd0fa9b3299d428d9",
+    strip_prefix = "snappy-1.1.9",
+    url = "https://github.com/google/snappy/archive/refs/tags/1.1.9.zip",
+)
+
+bind(
+    name = "zlib",
+    actual = "@com_zlib//:zlib",
+)
+
+http_archive(
+    name = "com_zlib",
+    build_file = "@com_resdb_nexres//third_party:zlib.BUILD",
+    sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
+    strip_prefix = "zlib-1.2.11",
+    url = "https://github.com/madler/zlib/archive/v1.2.11.tar.gz",
+)
+
+bind(
+    name = "zstd",
+    actual = "//third_party:zstd",
+)
+
+http_archive(
+    name = "com_facebook_zstd",
+    build_file_content = all_content,
+    strip_prefix = "zstd-1.5.2",
+    url = "https://github.com/facebook/zstd/archive/refs/tags/v1.5.2.zip",
+)
+
+http_archive(
+    name = "com_github_facebook_rocksdb",
+    build_file = "@com_resdb_nexres//third_party:rocksdb.BUILD",
+    sha256 = "928cbd416c0531e9b2e7fa74864ce0d7097dca3f5a8c31f31459772a28dbfcba",
+    strip_prefix = "rocksdb-7.2.2",
+    url = "https://github.com/facebook/rocksdb/archive/refs/tags/v7.2.2.zip",
+)
+
+http_archive(
+    name = "pybind11_bazel",
+    strip_prefix = "pybind11_bazel-2.11.1.bzl.1",
+    urls = ["https://github.com/pybind/pybind11_bazel/archive/refs/tags/v2.11.1.bzl.1.zip"]
+)
+
+http_archive(
+    name = "pybind11",
+    build_file = "@pybind11_bazel//:pybind11.BUILD",
+    sha256 = "8ff2fff22df038f5cd02cea8af56622bc67f5b64534f1b83b9f133b8366acff2",
+    strip_prefix = "pybind11-2.6.2",
+    urls = ["https://github.com/pybind/pybind11/archive/v2.6.2.tar.gz"],
+)
+
+load("@pybind11_bazel//:python_configure.bzl", "python_configure")
+
+python_configure(
+    name = "local_config_python",
+    python_version = "3",
+)
+
+http_archive(
+    name = "nlohmann_json",
+    build_file = "@com_resdb_nexres//third_party:json.BUILD",  # see below
+    sha256 = "4cf0df69731494668bdd6460ed8cb269b68de9c19ad8c27abc24cd72605b2d5b",
+    strip_prefix = "json-3.9.1",
+    urls = ["https://github.com/nlohmann/json/archive/v3.9.1.tar.gz"],
+)
diff --git a/action.yml b/action.yml
new file mode 100644
index 00000000..1946350d
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,53 @@
+# This script is from https://github.com/shadowmoose/GHA-LoC-Badge/blob/master/action.yml
+
+name: 'lines of code Badge'
+description: 'Generate a badge to display total Lines of Code'
+inputs:
+  directory:
+    description: 'The directory to scan.'
+    required: false
+    default: './'
+  badge:
+    description: 'The output path to save the badge svg - including extension!'
+    required: false
+    default: './badge.svg'
+  patterns:
+    description: 'The file patterns to search for, separated by pipes ("|").'
+    required: false
+    default: "**"
+  ignore:
+    description: 'The file patterns to ignore, even if they matched "patterns", separated by pipes ("|").'
+    required: false
+    default: "node_modules"
+  badge_label:
+    description: "The label to use for the badge."
+    required: false
+    default: "lines of code"
+  badge_color:
+    description: "The color to use for the badge."
+    required: false
+    default: "blue"
+  badge_style:
+    description: "The body style to use for the badge. ('flat' or 'classic')"
+    required: false
+    default: "classic"
+  badge_scale:
+    description: "The scale to resize this badge"
+    required: false
+    default: "1"
+  badge_labelcolor:
+    description: "The color to use for this badge label."
+    required: false
+    default: "555"
+  debug:
+    description: 'Enable debug logging'
+    required: false
+    default: 'false'
+
+runs:
+  using: 'node12'
+  main: './src/index.js'
+
+branding:
+  icon: 'award'  
+  color: 'green'
diff --git a/benchmark/protocols/cassandra/BUILD b/benchmark/protocols/cassandra/BUILD
new file mode 100644
index 00000000..fc92a5e7
--- /dev/null
+++ b/benchmark/protocols/cassandra/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/cassandra/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/cassandra/kv_server_performance.cpp b/benchmark/protocols/cassandra/kv_server_performance.cpp
new file mode 100644
index 00000000..dcf09e16
--- /dev/null
+++ b/benchmark/protocols/cassandra/kv_server_performance.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/cassandra/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::cassandra;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+  ResConfigData config_data = config->GetConfigData();
+
+  auto performance_consens = std::make_unique<Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/cassandra/kv_service_tools.cpp b/benchmark/protocols/cassandra/kv_service_tools.cpp
new file mode 100644
index 00000000..17858ef2
--- /dev/null
+++ b/benchmark/protocols/cassandra/kv_service_tools.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <fstream>
+
+#include "common/proto/signature_info.pb.h"
+#include "interface/kv/kv_client.h"
+#include "platform/config/resdb_config_utils.h"
+
+using resdb::GenerateReplicaInfo;
+using resdb::GenerateResDBConfig;
+using resdb::KVClient;
+using resdb::ReplicaInfo;
+using resdb::ResDBConfig;
+
+int main(int argc, char** argv) {
+  if (argc < 2) {
+    printf("<config path>\n");
+    return 0;
+  }
+  std::string client_config_file = argv[1];
+  ResDBConfig config = GenerateResDBConfig(client_config_file);
+
+  config.SetClientTimeoutMs(100000);
+
+  KVClient client(config);
+
+  client.Set("start", "value");
+  printf("start benchmark\n");
+}
diff --git a/benchmark/protocols/fairdag/BUILD b/benchmark/protocols/fairdag/BUILD
new file mode 100644
index 00000000..81e6443f
--- /dev/null
+++ b/benchmark/protocols/fairdag/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/fairdag/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/fairdag/kv_server_performance.cpp b/benchmark/protocols/fairdag/kv_server_performance.cpp
new file mode 100644
index 00000000..a3ee35a6
--- /dev/null
+++ b/benchmark/protocols/fairdag/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/fairdag/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::fairdag;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<FairDAGConsensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/hs/BUILD b/benchmark/protocols/hs/BUILD
new file mode 100644
index 00000000..f1c2cb86
--- /dev/null
+++ b/benchmark/protocols/hs/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/hs/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/hs/kv_server_performance.cpp b/benchmark/protocols/hs/kv_server_performance.cpp
new file mode 100644
index 00000000..bffa725f
--- /dev/null
+++ b/benchmark/protocols/hs/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/hs/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::hs;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<hs::Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/hs1/BUILD b/benchmark/protocols/hs1/BUILD
new file mode 100644
index 00000000..a6e6d853
--- /dev/null
+++ b/benchmark/protocols/hs1/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/hs1/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/hs1/kv_server_performance.cpp b/benchmark/protocols/hs1/kv_server_performance.cpp
new file mode 100644
index 00000000..df210965
--- /dev/null
+++ b/benchmark/protocols/hs1/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/hs1/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::hs1;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<hs1::Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/hs2/BUILD b/benchmark/protocols/hs2/BUILD
new file mode 100644
index 00000000..795a4c93
--- /dev/null
+++ b/benchmark/protocols/hs2/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/hs2/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/hs2/kv_server_performance.cpp b/benchmark/protocols/hs2/kv_server_performance.cpp
new file mode 100644
index 00000000..e5e22a0a
--- /dev/null
+++ b/benchmark/protocols/hs2/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/hs2/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::hs2;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<hs2::Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/ooo_hs/BUILD b/benchmark/protocols/ooo_hs/BUILD
new file mode 100644
index 00000000..a29311c9
--- /dev/null
+++ b/benchmark/protocols/ooo_hs/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/ooo_hs/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/ooo_hs/kv_server_performance.cpp b/benchmark/protocols/ooo_hs/kv_server_performance.cpp
new file mode 100644
index 00000000..c0ea8846
--- /dev/null
+++ b/benchmark/protocols/ooo_hs/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/ooo_hs/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::ooohs;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<ooohs::Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/pbft/BUILD b/benchmark/protocols/pbft/BUILD
new file mode 100644
index 00000000..659280d9
--- /dev/null
+++ b/benchmark/protocols/pbft/BUILD
@@ -0,0 +1,25 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/pbft:consensus_manager_pbft",
+        "//service/utils:server_factory",
+    ],
+)
+
+cc_binary(
+    name = "kv_service_tools",
+    srcs = ["kv_service_tools.cpp"],
+    deps = [
+        "//common/proto:signature_info_cc_proto",
+        "//interface/kv:kv_client",
+        "//platform/config:resdb_config_utils",
+    ],
+)
diff --git a/benchmark/protocols/pbft/kv_server_performance.cpp b/benchmark/protocols/pbft/kv_server_performance.cpp
new file mode 100644
index 00000000..7a81f27c
--- /dev/null
+++ b/benchmark/protocols/pbft/kv_server_performance.cpp
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/pbft/consensus_manager_pbft.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<ConsensusManagerPBFT>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/pbft/kv_service_tools.cpp b/benchmark/protocols/pbft/kv_service_tools.cpp
new file mode 100644
index 00000000..43627b34
--- /dev/null
+++ b/benchmark/protocols/pbft/kv_service_tools.cpp
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <fstream>
+
+#include "common/proto/signature_info.pb.h"
+#include "interface/kv/kv_client.h"
+#include "platform/config/resdb_config_utils.h"
+
+using resdb::GenerateReplicaInfo;
+using resdb::GenerateResDBConfig;
+using resdb::KVClient;
+using resdb::ReplicaInfo;
+using resdb::ResDBConfig;
+
+int main(int argc, char** argv) {
+  if (argc < 2) {
+    printf("<config path>\n");
+    return 0;
+  }
+  std::string client_config_file = argv[1];
+  ResDBConfig config = GenerateResDBConfig(client_config_file);
+
+  config.SetClientTimeoutMs(100000);
+
+  KVClient client(config);
+
+  client.Set("start", "value");
+  printf("start benchmark\n");
+}
diff --git a/benchmark/protocols/poe/BUILD b/benchmark/protocols/poe/BUILD
new file mode 100644
index 00000000..e7bbde3b
--- /dev/null
+++ b/benchmark/protocols/poe/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/poe/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/poe/kv_server_performance.cpp b/benchmark/protocols/poe/kv_server_performance.cpp
new file mode 100644
index 00000000..fa13e9a9
--- /dev/null
+++ b/benchmark/protocols/poe/kv_server_performance.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/poe/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::poe;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+  ResConfigData config_data = config->GetConfigData();
+
+  auto performance_consens = std::make_unique<Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloword");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+    
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/poe/kv_service_tools.cpp b/benchmark/protocols/poe/kv_service_tools.cpp
new file mode 100644
index 00000000..17858ef2
--- /dev/null
+++ b/benchmark/protocols/poe/kv_service_tools.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <fstream>
+
+#include "common/proto/signature_info.pb.h"
+#include "interface/kv/kv_client.h"
+#include "platform/config/resdb_config_utils.h"
+
+using resdb::GenerateReplicaInfo;
+using resdb::GenerateResDBConfig;
+using resdb::KVClient;
+using resdb::ReplicaInfo;
+using resdb::ResDBConfig;
+
+int main(int argc, char** argv) {
+  if (argc < 2) {
+    printf("<config path>\n");
+    return 0;
+  }
+  std::string client_config_file = argv[1];
+  ResDBConfig config = GenerateResDBConfig(client_config_file);
+
+  config.SetClientTimeoutMs(100000);
+
+  KVClient client(config);
+
+  client.Set("start", "value");
+  printf("start benchmark\n");
+}
diff --git a/benchmark/protocols/rcc/BUILD b/benchmark/protocols/rcc/BUILD
new file mode 100644
index 00000000..987cda2e
--- /dev/null
+++ b/benchmark/protocols/rcc/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/rcc/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/rcc/CPUProfile b/benchmark/protocols/rcc/CPUProfile
new file mode 100644
index 00000000..b0273a0d
Binary files /dev/null and b/benchmark/protocols/rcc/CPUProfile differ
diff --git a/benchmark/protocols/rcc/example.png b/benchmark/protocols/rcc/example.png
new file mode 100644
index 00000000..a86cb1bd
Binary files /dev/null and b/benchmark/protocols/rcc/example.png differ
diff --git a/benchmark/protocols/rcc/gmon.out b/benchmark/protocols/rcc/gmon.out
new file mode 100644
index 00000000..70563269
Binary files /dev/null and b/benchmark/protocols/rcc/gmon.out differ
diff --git a/benchmark/protocols/rcc/info.prof b/benchmark/protocols/rcc/info.prof
new file mode 100644
index 00000000..102fc294
Binary files /dev/null and b/benchmark/protocols/rcc/info.prof differ
diff --git a/benchmark/protocols/rcc/kv_server_performance.cpp b/benchmark/protocols/rcc/kv_server_performance.cpp
new file mode 100644
index 00000000..824e1afa
--- /dev/null
+++ b/benchmark/protocols/rcc/kv_server_performance.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/rcc/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::rcc;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+  ResConfigData config_data = config->GetConfigData();
+
+  auto performance_consens = std::make_unique<Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloword");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+    
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/rcc/kv_service_tools.cpp b/benchmark/protocols/rcc/kv_service_tools.cpp
new file mode 100644
index 00000000..17858ef2
--- /dev/null
+++ b/benchmark/protocols/rcc/kv_service_tools.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <fstream>
+
+#include "common/proto/signature_info.pb.h"
+#include "interface/kv/kv_client.h"
+#include "platform/config/resdb_config_utils.h"
+
+using resdb::GenerateReplicaInfo;
+using resdb::GenerateResDBConfig;
+using resdb::KVClient;
+using resdb::ReplicaInfo;
+using resdb::ResDBConfig;
+
+int main(int argc, char** argv) {
+  if (argc < 2) {
+    printf("<config path>\n");
+    return 0;
+  }
+  std::string client_config_file = argv[1];
+  ResDBConfig config = GenerateResDBConfig(client_config_file);
+
+  config.SetClientTimeoutMs(100000);
+
+  KVClient client(config);
+
+  client.Set("start", "value");
+  printf("start benchmark\n");
+}
diff --git a/benchmark/protocols/rcc/test b/benchmark/protocols/rcc/test
new file mode 100755
index 00000000..b5a766bc
Binary files /dev/null and b/benchmark/protocols/rcc/test differ
diff --git a/benchmark/protocols/rcc/test.cpp b/benchmark/protocols/rcc/test.cpp
new file mode 100644
index 00000000..86af9c16
--- /dev/null
+++ b/benchmark/protocols/rcc/test.cpp
@@ -0,0 +1,79 @@
+ 
+ #include <iostream>
+#include <csignal> 
+#include <stdio.h>
+#include <time.h>
+#include <stdlib.h>
+#include <gperftools/profiler.h>
+#include <unistd.h>
+
+void consumeSomeCPUTime1(int input){ 
+    int i = 0;  
+    input++; 
+    while(i++ < 100000){ 
+        i--;  i++;  i--;  i++; 
+    }   
+}; 
+
+void consumeSomeCPUTime2(int input){ 
+    input++; 
+    consumeSomeCPUTime1(input); 
+    int i = 0;  
+    while(i++ < 100000){ 
+        i--;  i++;  i--;  i++; 
+    }   
+}; 
+
+int stupidComputing(int a, int b){ 
+    int i = 0;  
+    while( i++ < 1000){  
+        consumeSomeCPUTime1(i); 
+    }   
+    int j = 0;  
+    while(j++ < 5000){ 
+        consumeSomeCPUTime2(j); 
+    }   
+    return a+b; 
+}; 
+
+int smartComputing(int a, int b){ 
+    return a+b; 
+}; 
+
+void signalHandler ( int signum ) {
+  std::cout<<"out:"<<std::endl;
+  //LOG(ERROR)<<" exit ====== ";
+}
+
+int main()
+{ 
+/*
+  if (SIG_ERR == signal(SIGABRT, signalHandler)) {
+    return 1;
+  }
+  if (SIG_ERR == signal(SIGILL, signalHandler)) {
+    return 1;
+  }
+  if (SIG_ERR == signal(SIGTERM, signalHandler)) {
+    return 1;
+  }
+
+  if (SIG_ERR == signal(SIGFPE, signalHandler)) { 
+    return 1;
+  }
+  */
+
+    int i = 0;
+    printf("reached the start point of performance bottle neck\n"); 
+    sleep(5);
+   // ProfilerStart("info.prof");
+    while( i++ < 2){ 
+        printf("Stupid computing return : %d\n",stupidComputing(i, i+1)); 
+        printf("Smart computing return %d\n",smartComputing(i+1, i+2)); 
+    }   
+    printf("should teminate profiling now.\n");  
+    sleep(5);
+    //ProfilerStop();
+
+    return 0;
+}
diff --git a/benchmark/protocols/slot_hs1/BUILD b/benchmark/protocols/slot_hs1/BUILD
new file mode 100644
index 00000000..5f6fca0c
--- /dev/null
+++ b/benchmark/protocols/slot_hs1/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/slot_hs1/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/slot_hs1/kv_server_performance.cpp b/benchmark/protocols/slot_hs1/kv_server_performance.cpp
new file mode 100644
index 00000000..1beb5aa8
--- /dev/null
+++ b/benchmark/protocols/slot_hs1/kv_server_performance.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/slot_hs1/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::slot_hs1;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+
+  auto performance_consens = std::make_unique<slot_hs1::Consensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/tusk/BUILD b/benchmark/protocols/tusk/BUILD
new file mode 100644
index 00000000..bc466d04
--- /dev/null
+++ b/benchmark/protocols/tusk/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:private"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+cc_binary(
+    name = "kv_server_performance",
+    srcs = ["kv_server_performance.cpp"],
+    deps = [
+        "//chain/storage:memory_db",
+        "//executor/kv:kv_executor",
+        "//platform/config:resdb_config_utils",
+        "//platform/consensus/ordering/tusk/framework:consensus",
+        "//service/utils:server_factory",
+    ],
+)
+
diff --git a/benchmark/protocols/tusk/kv_server_performance.cpp b/benchmark/protocols/tusk/kv_server_performance.cpp
new file mode 100644
index 00000000..4f2789e1
--- /dev/null
+++ b/benchmark/protocols/tusk/kv_server_performance.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <glog/logging.h>
+
+#include "chain/storage/memory_db.h"
+#include "executor/kv/kv_executor.h"
+#include "platform/config/resdb_config_utils.h"
+#include "platform/consensus/ordering/tusk/framework/consensus.h"
+#include "platform/networkstrate/service_network.h"
+#include "platform/statistic/stats.h"
+#include "proto/kv/kv.pb.h"
+
+using namespace resdb;
+using namespace resdb::tusk;
+using namespace resdb::storage;
+
+void ShowUsage() {
+  printf("<config> <private_key> <cert_file> [logging_dir]\n");
+}
+
+std::string GetRandomKey() {
+  int num1 = rand() % 10;
+  int num2 = rand() % 10;
+  return std::to_string(num1) + std::to_string(num2);
+}
+
+int main(int argc, char** argv) {
+  if (argc < 3) {
+    ShowUsage();
+    exit(0);
+  }
+
+  // google::InitGoogleLogging(argv[0]);
+  // FLAGS_minloglevel = google::GLOG_WARNING;
+
+  char* config_file = argv[1];
+  char* private_key_file = argv[2];
+  char* cert_file = argv[3];
+
+  if (argc >= 5) {
+    auto monitor_port = Stats::GetGlobalStats(5);
+    monitor_port->SetPrometheus(argv[4]);
+  }
+
+  std::unique_ptr<ResDBConfig> config =
+      GenerateResDBConfig(config_file, private_key_file, cert_file);
+
+  config->RunningPerformance(true);
+  ResConfigData config_data = config->GetConfigData();
+
+  auto performance_consens = std::make_unique<TuskConsensus>(
+      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
+  performance_consens->SetupPerformanceDataFunc([]() {
+    KVRequest request;
+    request.set_cmd(KVRequest::SET);
+    request.set_key(GetRandomKey());
+    request.set_value("helloworld");
+    std::string request_data;
+    request.SerializeToString(&request_data);
+    return request_data;
+  });
+
+  auto server =
+      std::make_unique<ServiceNetwork>(*config, std::move(performance_consens));
+  server->Run();
+}
diff --git a/benchmark/protocols/tusk/kv_service_tools.cpp b/benchmark/protocols/tusk/kv_service_tools.cpp
new file mode 100644
index 00000000..17858ef2
--- /dev/null
+++ b/benchmark/protocols/tusk/kv_service_tools.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <fstream>
+
+#include "common/proto/signature_info.pb.h"
+#include "interface/kv/kv_client.h"
+#include "platform/config/resdb_config_utils.h"
+
+using resdb::GenerateReplicaInfo;
+using resdb::GenerateResDBConfig;
+using resdb::KVClient;
+using resdb::ReplicaInfo;
+using resdb::ResDBConfig;
+
+int main(int argc, char** argv) {
+  if (argc < 2) {
+    printf("<config path>\n");
+    return 0;
+  }
+  std::string client_config_file = argv[1];
+  ResDBConfig config = GenerateResDBConfig(client_config_file);
+
+  config.SetClientTimeoutMs(100000);
+
+  KVClient client(config);
+
+  client.Set("start", "value");
+  printf("start benchmark\n");
+}
diff --git a/chain/state/BUILD b/chain/state/BUILD
new file mode 100644
index 00000000..5bd5d118
--- /dev/null
+++ b/chain/state/BUILD
@@ -0,0 +1,20 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "chain_state",
+    srcs = ["chain_state.cpp"],
+    hdrs = ["chain_state.h"],
+    deps = [
+        "//common:comm",
+        "//platform/proto:resdb_cc_proto",
+    ],
+)
+
+cc_test(
+    name = "chain_state_test",
+    srcs = ["chain_state_test.cpp"],
+    deps = [
+        ":chain_state",
+        "//common/test:test_main",
+    ],
+)
diff --git a/chain/state/chain_state.cpp b/chain/state/chain_state.cpp
new file mode 100644
index 00000000..18eaed71
--- /dev/null
+++ b/chain/state/chain_state.cpp
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "chain/state/chain_state.h"
+
+#include <glog/logging.h>
+
+namespace resdb {
+
+ChainState::ChainState() : max_seq_(0) {}
+
+Request* ChainState::Get(uint64_t seq) {
+  std::unique_lock<std::mutex> lk(mutex_);
+  if (data_.find(seq) == data_.end()) {
+    return nullptr;
+  }
+  return data_[seq].get();
+}
+
+void ChainState::Put(std::unique_ptr<Request> request) {
+  std::unique_lock<std::mutex> lk(mutex_);
+  max_seq_ = request->seq();
+  data_[max_seq_] = std::move(request);
+}
+
+uint64_t ChainState::GetMaxSeq() { return max_seq_; }
+
+}  // namespace resdb
diff --git a/chain/state/chain_state.h b/chain/state/chain_state.h
new file mode 100644
index 00000000..697b1afc
--- /dev/null
+++ b/chain/state/chain_state.h
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <map>
+#include <unordered_map>
+
+#include "platform/proto/resdb.pb.h"
+
+namespace resdb {
+
+class ChainState {
+ public:
+  ChainState();
+  Request* Get(uint64_t seq);
+  void Put(std::unique_ptr<Request> request);
+  uint64_t GetMaxSeq();
+
+ private:
+  std::mutex mutex_;
+  std::unordered_map<uint64_t, std::unique_ptr<Request> > data_;
+  std::atomic<uint64_t> max_seq_;
+};
+
+}  // namespace resdb
diff --git a/chain/state/chain_state_test.cpp b/chain/state/chain_state_test.cpp
new file mode 100644
index 00000000..7fd3fbe1
--- /dev/null
+++ b/chain/state/chain_state_test.cpp
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "chain/state/chain_state.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "common/test/test_macros.h"
+
+namespace resdb {
+namespace {
+
+using ::resdb::testing::EqualsProto;
+using ::testing::Pointee;
+
+TEST(ChainStateTest, GetEmptyValue) {
+  ChainState db;
+  EXPECT_EQ(db.Get(1), nullptr);
+}
+
+TEST(ChainStateTest, GetValue) {
+  Request request;
+  request.set_seq(1);
+  request.set_data("test");
+
+  ChainState db;
+  db.Put(std::make_unique<Request>(request));
+  EXPECT_THAT(db.Get(1), Pointee(EqualsProto(request)));
+}
+
+TEST(ChainStateTest, GetSecondValue) {
+  Request request;
+  request.set_seq(1);
+  request.set_data("test");
+
+  ChainState db;
+  db.Put(std::make_unique<Request>(request));
+
+  request.set_seq(1);
+  request.set_data("test_1");
+  db.Put(std::make_unique<Request>(request));
+
+  EXPECT_THAT(db.Get(1), Pointee(EqualsProto(request)));
+}
+
+}  // namespace
+
+}  // namespace resdb
diff --git a/chain/storage/BUILD b/chain/storage/BUILD
new file mode 100644
index 00000000..57904291
--- /dev/null
+++ b/chain/storage/BUILD
@@ -0,0 +1,64 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "storage",
+    hdrs = ["storage.h"],
+    deps = [
+    ],
+)
+
+cc_library(
+    name = "mock_storage",
+    hdrs = ["mock_storage.h"],
+    deps = [
+        ":storage",
+    ],
+)
+
+cc_library(
+    name = "memory_db",
+    srcs = ["memory_db.cpp"],
+    hdrs = ["memory_db.h"],
+    deps = [
+        ":storage",
+        "//common:comm",
+    ],
+)
+
+cc_library(
+    name = "leveldb",
+    srcs = ["leveldb.cpp"],
+    hdrs = ["leveldb.h"],
+    deps = [
+        ":storage",
+        "//chain/storage/proto:kv_cc_proto",
+        "//chain/storage/proto:leveldb_config_cc_proto",
+        "//common:comm",
+        "//third_party:leveldb",
+    ],
+)
+
+cc_library(
+    name = "rocksdb",
+    srcs = ["rocksdb.cpp"],
+    hdrs = ["rocksdb.h"],
+    tags = ["manual"],
+    deps = [
+        ":storage",
+        "//chain/storage/proto:kv_cc_proto",
+        "//chain/storage/proto:rocksdb_config_cc_proto",
+        "//common:comm",
+        "//third_party:rocksdb",
+    ],
+)
+
+cc_test(
+    name = "kv_storage_test",
+    srcs = ["kv_storage_test.cpp"],
+    deps = [
+        ":leveldb",
+        ":memory_db",
+        ":rocksdb",
+        "//common/test:test_main",
+    ],
+)
diff --git a/chain/storage/kv_storage_test.cpp b/chain/storage/kv_storage_test.cpp
new file mode 100644
index 00000000..701dcbd9
--- /dev/null
+++ b/chain/storage/kv_storage_test.cpp
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <glog/logging.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <filesystem>
+
+#include "chain/storage/leveldb.h"
+#include "chain/storage/memory_db.h"
+#include "chain/storage/rocksdb.h"
+
+namespace resdb {
+namespace storage {
+namespace {
+
+enum StorageType {
+  MEM = 0,
+  LEVELDB = 1,
+  ROCKSDB = 2,
+};
+
+class KVStorageTest : public ::testing::TestWithParam<StorageType> {
+ protected:
+  KVStorageTest() {
+    StorageType t = GetParam();
+    switch (t) {
+      case MEM:
+        storage = NewMemoryDB();
+        break;
+      case LEVELDB:
+        Reset();
+        storage = NewResLevelDB(path_);
+        break;
+      case ROCKSDB:
+        Reset();
+        storage = NewResRocksDB(path_);
+        break;
+    }
+  }
+
+ private:
+  void Reset() { std::filesystem::remove_all(path_.c_str()); }
+
+ protected:
+  std::unique_ptr<Storage> storage;
+  std::string path_ = "/tmp/leveldb_test";
+};
+
+TEST_P(KVStorageTest, SetValue) {
+  EXPECT_EQ(storage->SetValue("test_key", "test_value"), 0);
+  EXPECT_EQ(storage->GetValue("test_key"), "test_value");
+}
+
+TEST_P(KVStorageTest, GetValue) {
+  EXPECT_EQ(storage->GetValue("test_key"), "");
+}
+
+TEST_P(KVStorageTest, GetEmptyValueWithVersion) {
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 0),
+            std::make_pair(std::string(""), 0));
+}
+
+TEST_P(KVStorageTest, SetValueWithVersion) {
+  EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value", 1), -2);
+
+  EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value", 0), 0);
+
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 0),
+            std::make_pair(std::string("test_value"), 1));
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 1),
+            std::make_pair(std::string("test_value"), 1));
+
+  EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value_v2", 2), -2);
+  EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value_v2", 1), 0);
+
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 0),
+            std::make_pair(std::string("test_value_v2"), 2));
+
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 1),
+            std::make_pair(std::string("test_value"), 1));
+
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 2),
+            std::make_pair(std::string("test_value_v2"), 2));
+
+  EXPECT_EQ(storage->GetValueWithVersion("test_key", 3),
+            std::make_pair(std::string("test_value_v2"), 2));
+}
+
+TEST_P(KVStorageTest, GetAllValueWithVersion) {
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("test_key", std::make_pair("test_value", 1))};
+
+    EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value", 0), 0);
+    EXPECT_EQ(storage->GetAllItems(), expected_list);
+  }
+
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("test_key", std::make_pair("test_value_v2", 2))};
+    EXPECT_EQ(storage->SetValueWithVersion("test_key", "test_value_v2", 1), 0);
+    EXPECT_EQ(storage->GetAllItems(), expected_list);
+  }
+
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("test_key_v1", std::make_pair("test_value1", 1)),
+        std::make_pair("test_key", std::make_pair("test_value_v2", 2))};
+    EXPECT_EQ(storage->SetValueWithVersion("test_key_v1", "test_value1", 0), 0);
+    EXPECT_EQ(storage->GetAllItems(), expected_list);
+  }
+}
+
+TEST_P(KVStorageTest, GetKeyRange) {
+  EXPECT_EQ(storage->SetValueWithVersion("1", "value1", 0), 0);
+  EXPECT_EQ(storage->SetValueWithVersion("2", "value2", 0), 0);
+  EXPECT_EQ(storage->SetValueWithVersion("3", "value3", 0), 0);
+  EXPECT_EQ(storage->SetValueWithVersion("4", "value4", 0), 0);
+
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("1", std::make_pair("value1", 1)),
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3", 1)),
+        std::make_pair("4", std::make_pair("value4", 1))};
+    EXPECT_EQ(storage->GetKeyRange("1", "4"), expected_list);
+  }
+
+  EXPECT_EQ(storage->SetValueWithVersion("3", "value3_1", 1), 0);
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("1", std::make_pair("value1", 1)),
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3_1", 2)),
+        std::make_pair("4", std::make_pair("value4", 1))};
+    EXPECT_EQ(storage->GetKeyRange("1", "4"), expected_list);
+  }
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("1", std::make_pair("value1", 1)),
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3_1", 2)),
+    };
+    EXPECT_EQ(storage->GetKeyRange("1", "3"), expected_list);
+  }
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3_1", 2)),
+        std::make_pair("4", std::make_pair("value4", 1))};
+    EXPECT_EQ(storage->GetKeyRange("2", "4"), expected_list);
+  }
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("1", std::make_pair("value1", 1)),
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3_1", 2)),
+        std::make_pair("4", std::make_pair("value4", 1))};
+    EXPECT_EQ(storage->GetKeyRange("0", "5"), expected_list);
+  }
+  {
+    std::map<std::string, std::pair<std::string, int> > expected_list{
+        std::make_pair("2", std::make_pair("value2", 1)),
+        std::make_pair("3", std::make_pair("value3_1", 2)),
+    };
+    EXPECT_EQ(storage->GetKeyRange("2", "3"), expected_list);
+  }
+}
+
+TEST_P(KVStorageTest, GetHistory) {
+  {
+    std::vector<std::pair<std::string, int> > expected_list{};
+    EXPECT_EQ(storage->GetHistory("1", 1, 5), expected_list);
+  }
+  {
+    std::vector<std::pair<std::string, int> > expected_list{
+        std::make_pair("value3", 3), std::make_pair("value2", 2),
+        std::make_pair("value1", 1)};
+
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value1", 0), 0);
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value2", 1), 0);
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value3", 2), 0);
+
+    EXPECT_EQ(storage->GetHistory("1", 1, 5), expected_list);
+  }
+
+  {
+    std::vector<std::pair<std::string, int> > expected_list{
+        std::make_pair("value5", 5), std::make_pair("value4", 4),
+        std::make_pair("value3", 3), std::make_pair("value2", 2),
+        std::make_pair("value1", 1)};
+
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value4", 3), 0);
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value5", 4), 0);
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value6", 5), 0);
+    EXPECT_EQ(storage->SetValueWithVersion("1", "value7", 6), 0);
+
+    EXPECT_EQ(storage->GetHistory("1", 1, 5), expected_list);
+  }
+
+  {
+    std::vector<std::pair<std::string, int> > expected_list{
+        std::make_pair("value7", 7), std::make_pair("value6", 6)};
+
+    EXPECT_EQ(storage->GetTopHistory("1", 2), expected_list);
+  }
+}
+
+INSTANTIATE_TEST_CASE_P(KVStorageTest, KVStorageTest,
+                        ::testing::Values(MEM, LEVELDB, ROCKSDB));
+
+}  // namespace
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/leveldb.cpp b/chain/storage/leveldb.cpp
new file mode 100644
index 00000000..2cc96fb5
--- /dev/null
+++ b/chain/storage/leveldb.cpp
@@ -0,0 +1,290 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "chain/storage/leveldb.h"
+
+#include <glog/logging.h>
+
+#include "chain/storage/proto/kv.pb.h"
+
+namespace resdb {
+namespace storage {
+
+std::unique_ptr<Storage> NewResLevelDB(const std::string& path,
+                                       std::optional<LevelDBInfo> config) {
+  if (config == std::nullopt) {
+    config = LevelDBInfo();
+  }
+  (*config).set_path(path);
+  return std::make_unique<ResLevelDB>(config);
+}
+
+std::unique_ptr<Storage> NewResLevelDB(std::optional<LevelDBInfo> config) {
+  return std::make_unique<ResLevelDB>(config);
+}
+
+ResLevelDB::ResLevelDB(std::optional<LevelDBInfo> config) {
+  std::string path = "/tmp/nexres-leveldb";
+  if (config.has_value()) {
+    write_buffer_size_ = (*config).write_buffer_size_mb() << 20;
+    write_batch_size_ = (*config).write_batch_size();
+    if (!(*config).path().empty()) {
+      LOG(ERROR) << "Custom path for ResLevelDB provided in config: "
+                 << (*config).path();
+      path = (*config).path();
+    }
+  }
+  CreateDB(path);
+}
+
+void ResLevelDB::CreateDB(const std::string& path) {
+  LOG(ERROR) << "ResLevelDB Create DB: path:" << path
+             << " write buffer size:" << write_buffer_size_
+             << " batch size:" << write_batch_size_;
+  leveldb::Options options;
+  options.create_if_missing = true;
+  options.write_buffer_size = write_buffer_size_;
+
+  leveldb::DB* db = nullptr;
+  leveldb::Status status = leveldb::DB::Open(options, path, &db);
+  if (status.ok()) {
+    db_ = std::unique_ptr<leveldb::DB>(db);
+  }
+  assert(status.ok());
+  LOG(ERROR) << "Successfully opened LevelDB";
+}
+
+ResLevelDB::~ResLevelDB() {
+  if (db_) {
+    db_.reset();
+  }
+}
+
+int ResLevelDB::SetValue(const std::string& key, const std::string& value) {
+  batch_.Put(key, value);
+
+  if (batch_.ApproximateSize() >= write_batch_size_) {
+    leveldb::Status status = db_->Write(leveldb::WriteOptions(), &batch_);
+    if (status.ok()) {
+      batch_.Clear();
+      return 0;
+    } else {
+      LOG(ERROR) << "flush buffer fail:" << status.ToString();
+      return -1;
+    }
+  }
+  return 0;
+}
+
+std::string ResLevelDB::GetValue(const std::string& key) {
+  std::string value = "";
+  leveldb::Status status = db_->Get(leveldb::ReadOptions(), key, &value);
+  if (status.ok()) {
+    return value;
+  } else {
+    return "";
+  }
+}
+
+std::string ResLevelDB::GetAllValues(void) {
+  std::string values = "[";
+  leveldb::Iterator* it = db_->NewIterator(leveldb::ReadOptions());
+  bool first_iteration = true;
+  for (it->SeekToFirst(); it->Valid(); it->Next()) {
+    if (!first_iteration) values.append(",");
+    first_iteration = false;
+    values.append(it->value().ToString());
+  }
+  values.append("]");
+
+  delete it;
+  return values;
+}
+
+std::string ResLevelDB::GetRange(const std::string& min_key,
+                                 const std::string& max_key) {
+  std::string values = "[";
+  leveldb::Iterator* it = db_->NewIterator(leveldb::ReadOptions());
+  bool first_iteration = true;
+  for (it->Seek(min_key); it->Valid() && it->key().ToString() <= max_key;
+       it->Next()) {
+    if (!first_iteration) values.append(",");
+    first_iteration = false;
+    values.append(it->value().ToString());
+  }
+  values.append("]");
+
+  delete it;
+  return values;
+}
+
+bool ResLevelDB::Flush() {
+  leveldb::Status status = db_->Write(leveldb::WriteOptions(), &batch_);
+  if (status.ok()) {
+    batch_.Clear();
+    return true;
+  }
+  LOG(ERROR) << "flush buffer fail:" << status.ToString();
+  return false;
+}
+
+int ResLevelDB::SetValueWithVersion(const std::string& key,
+                                    const std::string& value, int version) {
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return -2;
+  }
+
+  int last_v = 0;
+  if (history.value_size() > 0) {
+    last_v = history.value(history.value_size() - 1).version();
+  }
+
+  if (last_v != version) {
+    LOG(ERROR) << "version does not match:" << version
+               << " old version:" << last_v;
+    return -2;
+  }
+
+  Value* new_value = history.add_value();
+  new_value->set_value(value);
+  new_value->set_version(version + 1);
+
+  history.SerializeToString(&value_str);
+  return SetValue(key, value_str);
+}
+
+std::pair<std::string, int> ResLevelDB::GetValueWithVersion(
+    const std::string& key, int version) {
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return std::make_pair("", 0);
+  }
+  if (history.value_size() == 0) {
+    return std::make_pair("", 0);
+  }
+  if (version > 0) {
+    for (int i = history.value_size() - 1; i >= 0; --i) {
+      if (history.value(i).version() == version) {
+        return std::make_pair(history.value(i).value(),
+                              history.value(i).version());
+      }
+      if (history.value(i).version() < version) {
+        break;
+      }
+    }
+  }
+  int last_idx = history.value_size() - 1;
+  return std::make_pair(history.value(last_idx).value(),
+                        history.value(last_idx).version());
+}
+
+// Return a map of <key, <value, version>>
+std::map<std::string, std::pair<std::string, int>> ResLevelDB::GetAllItems() {
+  std::map<std::string, std::pair<std::string, int>> resp;
+
+  leveldb::Iterator* it = db_->NewIterator(leveldb::ReadOptions());
+  for (it->SeekToFirst(); it->Valid(); it->Next()) {
+    ValueHistory history;
+    if (!history.ParseFromString(it->value().ToString()) ||
+        history.value_size() == 0) {
+      LOG(ERROR) << "old_value parse fail";
+      continue;
+    }
+    const Value& value = history.value(history.value_size() - 1);
+    resp.insert(std::make_pair(it->key().ToString(),
+                               std::make_pair(value.value(), value.version())));
+  }
+  delete it;
+
+  return resp;
+}
+
+std::map<std::string, std::pair<std::string, int>> ResLevelDB::GetKeyRange(
+    const std::string& min_key, const std::string& max_key) {
+  std::map<std::string, std::pair<std::string, int>> resp;
+
+  leveldb::Iterator* it = db_->NewIterator(leveldb::ReadOptions());
+  for (it->Seek(min_key); it->Valid() && it->key().ToString() <= max_key;
+       it->Next()) {
+    ValueHistory history;
+    if (!history.ParseFromString(it->value().ToString()) ||
+        history.value_size() == 0) {
+      LOG(ERROR) << "old_value parse fail";
+      continue;
+    }
+    const Value& value = history.value(history.value_size() - 1);
+    resp.insert(std::make_pair(it->key().ToString(),
+                               std::make_pair(value.value(), value.version())));
+  }
+  delete it;
+
+  return resp;
+}
+
+// Return a list of <value, version>
+std::vector<std::pair<std::string, int>> ResLevelDB::GetHistory(
+    const std::string& key, int min_version, int max_version) {
+  std::vector<std::pair<std::string, int>> resp;
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return resp;
+  }
+
+  for (int i = history.value_size() - 1; i >= 0; --i) {
+    if (history.value(i).version() < min_version) {
+      break;
+    }
+    if (history.value(i).version() <= max_version) {
+      resp.push_back(
+          std::make_pair(history.value(i).value(), history.value(i).version()));
+    }
+  }
+
+  return resp;
+}
+
+// Return a list of <value, version>
+std::vector<std::pair<std::string, int>> ResLevelDB::GetTopHistory(
+    const std::string& key, int top_number) {
+  std::vector<std::pair<std::string, int>> resp;
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return resp;
+  }
+
+  for (int i = history.value_size() - 1;
+       i >= 0 && resp.size() < static_cast<size_t>(top_number); --i) {
+    resp.push_back(
+        std::make_pair(history.value(i).value(), history.value(i).version()));
+  }
+
+  return resp;
+}
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/leveldb.h b/chain/storage/leveldb.h
new file mode 100644
index 00000000..199f1f27
--- /dev/null
+++ b/chain/storage/leveldb.h
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <optional>
+#include <string>
+
+#include "chain/storage/proto/leveldb_config.pb.h"
+#include "chain/storage/storage.h"
+#include "leveldb/db.h"
+#include "leveldb/write_batch.h"
+
+namespace resdb {
+namespace storage {
+
+std::unique_ptr<Storage> NewResLevelDB(
+    const std::string& path, std::optional<LevelDBInfo> config = std::nullopt);
+std::unique_ptr<Storage> NewResLevelDB(
+    std::optional<LevelDBInfo> config = std::nullopt);
+
+class ResLevelDB : public Storage {
+ public:
+  ResLevelDB(std::optional<LevelDBInfo> config_data = std::nullopt);
+
+  virtual ~ResLevelDB();
+  int SetValue(const std::string& key, const std::string& value) override;
+  std::string GetValue(const std::string& key) override;
+  std::string GetAllValues(void) override;
+  std::string GetRange(const std::string& min_key,
+                       const std::string& max_key) override;
+
+  int SetValueWithVersion(const std::string& key, const std::string& value,
+                          int version) override;
+  std::pair<std::string, int> GetValueWithVersion(const std::string& key,
+                                                  int version) override;
+
+  // Return a map of <key, <value, version>>
+  std::map<std::string, std::pair<std::string, int>> GetAllItems() override;
+  std::map<std::string, std::pair<std::string, int>> GetKeyRange(
+      const std::string& min_key, const std::string& max_key) override;
+
+  // Return a list of <value, version>
+  std::vector<std::pair<std::string, int>> GetHistory(const std::string& key,
+                                                      int min_version,
+                                                      int max_version) override;
+
+  std::vector<std::pair<std::string, int>> GetTopHistory(
+      const std::string& key, int top_number) override;
+
+  bool Flush() override;
+
+ private:
+  void CreateDB(const std::string& path);
+
+ private:
+  std::unique_ptr<leveldb::DB> db_ = nullptr;
+  ::leveldb::WriteBatch batch_;
+  unsigned int write_buffer_size_ = 64 << 20;
+  unsigned int write_batch_size_ = 1;
+};
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/memory_db.cpp b/chain/storage/memory_db.cpp
new file mode 100644
index 00000000..2d5b8725
--- /dev/null
+++ b/chain/storage/memory_db.cpp
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "chain/storage/memory_db.h"
+
+#include <glog/logging.h>
+
+namespace resdb {
+namespace storage {
+
+std::unique_ptr<Storage> NewMemoryDB() { return std::make_unique<MemoryDB>(); }
+
+MemoryDB::MemoryDB() {}
+
+int MemoryDB::SetValue(const std::string& key, const std::string& value) {
+  kv_map_[key] = value;
+  return 0;
+}
+
+std::string MemoryDB::GetAllValues(void) {
+  std::string values = "[";
+  bool first_iteration = true;
+  for (auto kv : kv_map_) {
+    if (!first_iteration) values.append(",");
+    first_iteration = false;
+    values.append(kv.second);
+  }
+  values.append("]");
+  return values;
+}
+
+std::string MemoryDB::GetRange(const std::string& min_key,
+                               const std::string& max_key) {
+  std::string values = "[";
+  bool first_iteration = true;
+  for (auto kv : kv_map_) {
+    if (kv.first >= min_key && kv.first <= max_key) {
+      if (!first_iteration) values.append(",");
+      first_iteration = false;
+      values.append(kv.second);
+    }
+  }
+  values.append("]");
+  return values;
+}
+
+std::string MemoryDB::GetValue(const std::string& key) {
+  auto search = kv_map_.find(key);
+  if (search != kv_map_.end())
+    return search->second;
+  else {
+    return "";
+  }
+}
+
+int MemoryDB::SetValueWithVersion(const std::string& key,
+                                  const std::string& value, int version) {
+  auto it = kv_map_with_v_.find(key);
+  if ((it == kv_map_with_v_.end() && version != 0) ||
+      (it != kv_map_with_v_.end() && it->second.back().second != version)) {
+    LOG(ERROR) << " value version not match. key:" << key << " db version:"
+               << (it == kv_map_with_v_.end() ? 0 : it->second.back().second)
+               << " user version:" << version;
+    return -2;
+  }
+  kv_map_with_v_[key].push_back(std::make_pair(value, version + 1));
+  return 0;
+}
+
+std::pair<std::string, int> MemoryDB::GetValueWithVersion(
+    const std::string& key, int version) {
+  auto search_it = kv_map_with_v_.find(key);
+  if (search_it != kv_map_with_v_.end() && search_it->second.size()) {
+    auto it = search_it->second.end();
+    do {
+      --it;
+      if (it->second == version) {
+        return *it;
+      }
+      if (it->second < version) {
+        break;
+      }
+    } while (it != search_it->second.begin());
+    it = --search_it->second.end();
+    LOG(ERROR) << " key:" << key << " no version:" << version
+               << " return max:" << it->second;
+    return *it;
+  }
+  return std::make_pair("", 0);
+}
+
+std::map<std::string, std::pair<std::string, int>> MemoryDB::GetAllItems() {
+  std::map<std::string, std::pair<std::string, int>> resp;
+
+  for (const auto& it : kv_map_with_v_) {
+    resp.insert(std::make_pair(it.first, it.second.back()));
+  }
+  return resp;
+}
+
+std::map<std::string, std::pair<std::string, int>> MemoryDB::GetKeyRange(
+    const std::string& min_key, const std::string& max_key) {
+  LOG(ERROR) << "min key:" << min_key << " max key:" << max_key;
+  std::map<std::string, std::pair<std::string, int>> resp;
+  for (const auto& it : kv_map_with_v_) {
+    if (it.first >= min_key && it.first <= max_key) {
+      resp.insert(std::make_pair(it.first, it.second.back()));
+    }
+  }
+  return resp;
+}
+
+std::vector<std::pair<std::string, int>> MemoryDB::GetHistory(
+    const std::string& key, int min_version, int max_version) {
+  std::vector<std::pair<std::string, int>> resp;
+  auto search_it = kv_map_with_v_.find(key);
+  if (search_it == kv_map_with_v_.end()) {
+    return resp;
+  }
+
+  auto it = search_it->second.end();
+  do {
+    --it;
+    if (it->second < min_version) {
+      break;
+    }
+    if (it->second <= max_version) {
+      resp.push_back(*it);
+    }
+  } while (it != search_it->second.begin());
+  return resp;
+}
+
+std::vector<std::pair<std::string, int>> MemoryDB::GetTopHistory(
+    const std::string& key, int top_number) {
+  std::vector<std::pair<std::string, int>> resp;
+  auto search_it = kv_map_with_v_.find(key);
+  if (search_it == kv_map_with_v_.end()) {
+    return resp;
+  }
+
+  auto it = search_it->second.end();
+  do {
+    --it;
+    resp.push_back(*it);
+    if (resp.size() >= static_cast<size_t>(top_number)) {
+      break;
+    }
+  } while (it != search_it->second.begin());
+  return resp;
+}
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/memory_db.h b/chain/storage/memory_db.h
new file mode 100644
index 00000000..372f4647
--- /dev/null
+++ b/chain/storage/memory_db.h
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <list>
+#include <map>
+#include <memory>
+#include <unordered_map>
+
+#include "chain/storage/storage.h"
+
+namespace resdb {
+namespace storage {
+
+// Key Value Storage supporting two types of interfaces:
+// Non-version:
+//  It provides set and get function to set a value to a specific key
+//  Values will be set directly.
+// Version:
+//  It provides set and get function to set a value to a specific key
+//  with a version.
+//  The version inside setting function is to support OCC verification.
+//  The version value should be obtained before setting
+//  and returned back when setting a new value. If the version is not
+//  the same as the old one, return failure.
+//  If the value of a specific version does not exist or providing
+//  version 0 as parameter when accessing get
+//  it returns the current value along its version.
+//
+// Note: Only one type of interface are allowed to be used.
+//
+
+std::unique_ptr<Storage> NewMemoryDB();
+
+class MemoryDB : public Storage {
+ public:
+  MemoryDB();
+
+  int SetValue(const std::string& key, const std::string& value);
+  std::string GetValue(const std::string& key);
+
+  std::string GetAllValues() override;
+  std::string GetRange(const std::string& min_key,
+                       const std::string& max_key) override;
+
+  int SetValueWithVersion(const std::string& key, const std::string& value,
+                          int version) override;
+  std::pair<std::string, int> GetValueWithVersion(const std::string& key,
+                                                  int version) override;
+
+  // Return a map of <key, <value, version>>
+  std::map<std::string, std::pair<std::string, int>> GetAllItems() override;
+  std::map<std::string, std::pair<std::string, int>> GetKeyRange(
+      const std::string& min_key, const std::string& max_key) override;
+
+  // Return a list of <value, version>
+  std::vector<std::pair<std::string, int>> GetHistory(const std::string& key,
+                                                      int min_version,
+                                                      int max_version) override;
+
+  std::vector<std::pair<std::string, int>> GetTopHistory(const std::string& key,
+                                                         int number) override;
+
+ private:
+  std::unordered_map<std::string, std::string> kv_map_;
+  std::unordered_map<std::string, std::list<std::pair<std::string, int>>>
+      kv_map_with_v_;
+};
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/mock_storage.h b/chain/storage/mock_storage.h
new file mode 100644
index 00000000..963d92bb
--- /dev/null
+++ b/chain/storage/mock_storage.h
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include "chain/storage/storage.h"
+#include "gmock/gmock.h"
+
+namespace resdb {
+
+class MockStorage : public Storage {
+ public:
+  MOCK_METHOD(int, SetValue, (const std::string& key, const std::string& value),
+              (override));
+  MOCK_METHOD(std::string, GetValue, (const std::string& key), (override));
+  MOCK_METHOD(std::string, GetAllValues, (), (override));
+  MOCK_METHOD(std::string, GetRange, (const std::string&, const std::string&),
+              (override));
+
+  MOCK_METHOD(int, SetValueWithVersion,
+              (const std::string& key, const std::string& value, int version),
+              (override));
+
+  using ValueType = std::pair<std::string, int>;
+  using ItemsType = std::map<std::string, ValueType>;
+  using ValuesType = std::vector<ValueType>;
+
+  MOCK_METHOD(ValueType, GetValueWithVersion,
+              (const std::string& key, int version), (override));
+  MOCK_METHOD(ItemsType, GetAllItems, (), (override));
+  MOCK_METHOD(ItemsType, GetKeyRange, (const std::string&, const std::string&),
+              (override));
+  MOCK_METHOD(ValuesType, GetHistory, (const std::string&, int, int),
+              (override));
+  MOCK_METHOD(ValuesType, GetTopHistory, (const std::string&, int), (override));
+
+  MOCK_METHOD(bool, Flush, (), (override));
+};
+
+}  // namespace resdb
diff --git a/chain/storage/proto/BUILD b/chain/storage/proto/BUILD
new file mode 100644
index 00000000..1dea24a1
--- /dev/null
+++ b/chain/storage/proto/BUILD
@@ -0,0 +1,36 @@
+package(default_visibility = ["//visibility:public"])
+
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+proto_library(
+    name = "kv_proto",
+    srcs = ["kv.proto"],
+    visibility = ["//chain/storage:__subpackages__"],
+)
+
+cc_proto_library(
+    name = "kv_cc_proto",
+    visibility = ["//chain/storage:__subpackages__"],
+    deps = [":kv_proto"],
+)
+
+proto_library(
+    name = "leveldb_config_proto",
+    srcs = ["leveldb_config.proto"],
+)
+
+cc_proto_library(
+    name = "leveldb_config_cc_proto",
+    deps = [":leveldb_config_proto"],
+)
+
+proto_library(
+    name = "rocksdb_config_proto",
+    srcs = ["rocksdb_config.proto"],
+)
+
+cc_proto_library(
+    name = "rocksdb_config_cc_proto",
+    deps = [":rocksdb_config_proto"],
+)
diff --git a/chain/storage/proto/kv.proto b/chain/storage/proto/kv.proto
new file mode 100644
index 00000000..bb2e8945
--- /dev/null
+++ b/chain/storage/proto/kv.proto
@@ -0,0 +1,13 @@
+syntax = "proto3";
+
+package resdb.storage;
+
+message Value {
+    bytes value = 1;
+    int32 version = 2;
+}
+
+message ValueHistory {
+  repeated Value value = 1;
+}
+
diff --git a/chain/storage/proto/leveldb_config.proto b/chain/storage/proto/leveldb_config.proto
new file mode 100644
index 00000000..572b4a08
--- /dev/null
+++ b/chain/storage/proto/leveldb_config.proto
@@ -0,0 +1,9 @@
+syntax = "proto3";
+
+package resdb.storage;
+
+message LevelDBInfo {
+  uint32 write_buffer_size_mb = 2;
+  uint32 write_batch_size = 3;
+  string path = 4;
+}
diff --git a/chain/storage/proto/rocksdb_config.proto b/chain/storage/proto/rocksdb_config.proto
new file mode 100644
index 00000000..a1a45396
--- /dev/null
+++ b/chain/storage/proto/rocksdb_config.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+
+package resdb.storage;
+
+message RocksDBInfo {
+  uint32 num_threads = 2;
+  uint32 write_buffer_size_mb = 3;
+  uint32 write_batch_size = 4;
+  string path = 5;
+}
+
diff --git a/chain/storage/rocksdb.cpp b/chain/storage/rocksdb.cpp
new file mode 100644
index 00000000..86efd3e3
--- /dev/null
+++ b/chain/storage/rocksdb.cpp
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "chain/storage/rocksdb.h"
+
+#include <glog/logging.h>
+
+#include "chain/storage/proto/kv.pb.h"
+
+namespace resdb {
+namespace storage {
+
+std::unique_ptr<Storage> NewResRocksDB(const std::string& path,
+                                       std::optional<RocksDBInfo> config) {
+  if (config == std::nullopt) {
+    config = RocksDBInfo();
+  }
+  (*config).set_path(path);
+  return std::make_unique<ResRocksDB>(config);
+}
+
+std::unique_ptr<Storage> NewResRocksDB(std::optional<RocksDBInfo> config) {
+  return std::make_unique<ResRocksDB>(config);
+}
+
+ResRocksDB::ResRocksDB(std::optional<RocksDBInfo> config) {
+  std::string path = "/tmp/nexres-rocksdb";
+  if (config.has_value()) {
+    num_threads_ = (*config).num_threads();
+    write_buffer_size_ = (*config).write_buffer_size_mb() << 20;
+    write_batch_size_ = (*config).write_batch_size();
+    if ((*config).path() != "") {
+      LOG(ERROR) << "Custom path for RocksDB provided in config: "
+                 << (*config).path();
+      path = (*config).path();
+    }
+  }
+  CreateDB(path);
+}
+
+void ResRocksDB::CreateDB(const std::string& path) {
+  rocksdb::Options options;
+  options.create_if_missing = true;
+  if (num_threads_ > 1) options.IncreaseParallelism(num_threads_);
+  options.OptimizeLevelStyleCompaction();
+  options.write_buffer_size = write_buffer_size_;
+
+  rocksdb::DB* db = nullptr;
+  rocksdb::Status status = rocksdb::DB::Open(options, path, &db);
+  if (status.ok()) {
+    db_ = std::unique_ptr<rocksdb::DB>(db);
+    LOG(ERROR) << "Successfully opened RocksDB in path: " << path;
+  } else {
+    LOG(ERROR) << "RocksDB status fail";
+  }
+  assert(status.ok());
+  LOG(ERROR) << "Successfully opened RocksDB";
+}
+
+ResRocksDB::~ResRocksDB() {
+  if (db_) {
+    db_.reset();
+  }
+}
+
+int ResRocksDB::SetValue(const std::string& key, const std::string& value) {
+  batch_.Put(key, value);
+
+  if (batch_.Count() >= write_batch_size_) {
+    rocksdb::Status status = db_->Write(rocksdb::WriteOptions(), &batch_);
+    if (status.ok()) {
+      batch_.Clear();
+    } else {
+      LOG(ERROR) << "write value fail:" << status.ToString();
+      return -1;
+    }
+  }
+  return 0;
+}
+
+std::string ResRocksDB::GetValue(const std::string& key) {
+  std::string value = "";
+  rocksdb::Status status = db_->Get(rocksdb::ReadOptions(), key, &value);
+  if (status.ok()) {
+    return value;
+  } else {
+    return "";
+  }
+}
+
+std::string ResRocksDB::GetAllValues(void) {
+  std::string values = "[";
+  rocksdb::Iterator* itr = db_->NewIterator(rocksdb::ReadOptions());
+  bool first_iteration = true;
+  for (itr->SeekToFirst(); itr->Valid(); itr->Next()) {
+    if (!first_iteration) values.append(",");
+    first_iteration = false;
+    values.append(itr->value().ToString());
+  }
+  values.append("]");
+
+  delete itr;
+  return values;
+}
+
+std::string ResRocksDB::GetRange(const std::string& min_key,
+                                 const std::string& max_key) {
+  std::string values = "[";
+  rocksdb::Iterator* itr = db_->NewIterator(rocksdb::ReadOptions());
+  bool first_iteration = true;
+  for (itr->Seek(min_key); itr->Valid() && itr->key().ToString() <= max_key;
+       itr->Next()) {
+    if (!first_iteration) values.append(",");
+    first_iteration = false;
+    values.append(itr->value().ToString());
+  }
+  values.append("]");
+
+  delete itr;
+  return values;
+}
+
+bool ResRocksDB::Flush() {
+  rocksdb::Status status = db_->Write(rocksdb::WriteOptions(), &batch_);
+  if (status.ok()) {
+    batch_.Clear();
+    return true;
+  }
+  LOG(ERROR) << "write value fail:" << status.ToString();
+  return false;
+}
+int ResRocksDB::SetValueWithVersion(const std::string& key,
+                                    const std::string& value, int version) {
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return -2;
+  }
+
+  int last_v = 0;
+  if (history.value_size() > 0) {
+    last_v = history.value(history.value_size() - 1).version();
+  }
+
+  if (last_v != version) {
+    LOG(ERROR) << "version does not match:" << version
+               << " old version:" << last_v;
+    return -2;
+  }
+
+  Value* new_value = history.add_value();
+  new_value->set_value(value);
+  new_value->set_version(version + 1);
+
+  history.SerializeToString(&value_str);
+  return SetValue(key, value_str);
+}
+
+std::pair<std::string, int> ResRocksDB::GetValueWithVersion(
+    const std::string& key, int version) {
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return std::make_pair("", 0);
+  }
+  if (history.value_size() == 0) {
+    return std::make_pair("", 0);
+  }
+  if (version > 0) {
+    for (int i = history.value_size() - 1; i >= 0; --i) {
+      if (history.value(i).version() == version) {
+        return std::make_pair(history.value(i).value(),
+                              history.value(i).version());
+      }
+      if (history.value(i).version() < version) {
+        break;
+      }
+    }
+  }
+  int last_idx = history.value_size() - 1;
+  return std::make_pair(history.value(last_idx).value(),
+                        history.value(last_idx).version());
+}
+
+// Return a map of <key, <value, version>>
+std::map<std::string, std::pair<std::string, int>> ResRocksDB::GetAllItems() {
+  std::map<std::string, std::pair<std::string, int>> resp;
+
+  rocksdb::Iterator* it = db_->NewIterator(rocksdb::ReadOptions());
+  for (it->SeekToFirst(); it->Valid(); it->Next()) {
+    ValueHistory history;
+    if (!history.ParseFromString(it->value().ToString()) ||
+        history.value_size() == 0) {
+      LOG(ERROR) << "old_value parse fail";
+      continue;
+    }
+    const Value& value = history.value(history.value_size() - 1);
+    resp.insert(std::make_pair(it->key().ToString(),
+                               std::make_pair(value.value(), value.version())));
+  }
+  delete it;
+
+  return resp;
+}
+
+std::map<std::string, std::pair<std::string, int>> ResRocksDB::GetKeyRange(
+    const std::string& min_key, const std::string& max_key) {
+  std::map<std::string, std::pair<std::string, int>> resp;
+
+  rocksdb::Iterator* it = db_->NewIterator(rocksdb::ReadOptions());
+  for (it->Seek(min_key); it->Valid() && it->key().ToString() <= max_key;
+       it->Next()) {
+    ValueHistory history;
+    if (!history.ParseFromString(it->value().ToString()) ||
+        history.value_size() == 0) {
+      LOG(ERROR) << "old_value parse fail";
+      continue;
+    }
+    const Value& value = history.value(history.value_size() - 1);
+    resp.insert(std::make_pair(it->key().ToString(),
+                               std::make_pair(value.value(), value.version())));
+  }
+  delete it;
+
+  return resp;
+}
+
+// Return a list of <value, version>
+std::vector<std::pair<std::string, int>> ResRocksDB::GetHistory(
+    const std::string& key, int min_version, int max_version) {
+  std::vector<std::pair<std::string, int>> resp;
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return resp;
+  }
+
+  for (int i = history.value_size() - 1; i >= 0; --i) {
+    if (history.value(i).version() < min_version) {
+      break;
+    }
+    if (history.value(i).version() <= max_version) {
+      resp.push_back(
+          std::make_pair(history.value(i).value(), history.value(i).version()));
+    }
+  }
+
+  return resp;
+}
+
+// Return a list of <value, version>
+std::vector<std::pair<std::string, int>> ResRocksDB::GetTopHistory(
+    const std::string& key, int top_number) {
+  std::vector<std::pair<std::string, int>> resp;
+  std::string value_str = GetValue(key);
+  ValueHistory history;
+  if (!history.ParseFromString(value_str)) {
+    LOG(ERROR) << "old_value parse fail";
+    return resp;
+  }
+
+  for (int i = history.value_size() - 1;
+       i >= 0 && resp.size() < static_cast<size_t>(top_number); --i) {
+    resp.push_back(
+        std::make_pair(history.value(i).value(), history.value(i).version()));
+  }
+
+  return resp;
+}
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/rocksdb.h b/chain/storage/rocksdb.h
new file mode 100644
index 00000000..c3e35564
--- /dev/null
+++ b/chain/storage/rocksdb.h
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <optional>
+#include <string>
+
+#include "chain/storage/proto/rocksdb_config.pb.h"
+#include "chain/storage/storage.h"
+#include "rocksdb/db.h"
+#include "rocksdb/write_batch.h"
+
+namespace resdb {
+namespace storage {
+
+std::unique_ptr<Storage> NewResRocksDB(
+    const std::string& path, std::optional<RocksDBInfo> config = std::nullopt);
+std::unique_ptr<Storage> NewResRocksDB(
+    std::optional<RocksDBInfo> config = std::nullopt);
+
+class ResRocksDB : public Storage {
+ public:
+  ResRocksDB(std::optional<RocksDBInfo> config_data = std::nullopt);
+  virtual ~ResRocksDB();
+  int SetValue(const std::string& key, const std::string& value) override;
+  std::string GetValue(const std::string& key) override;
+  std::string GetAllValues(void) override;
+  std::string GetRange(const std::string& min_key,
+                       const std::string& max_key) override;
+
+  int SetValueWithVersion(const std::string& key, const std::string& value,
+                          int version) override;
+  std::pair<std::string, int> GetValueWithVersion(const std::string& key,
+                                                  int version) override;
+
+  // Return a map of <key, <value, version>>
+  std::map<std::string, std::pair<std::string, int>> GetAllItems() override;
+  std::map<std::string, std::pair<std::string, int>> GetKeyRange(
+      const std::string& min_key, const std::string& max_key) override;
+
+  // Return a list of <value, version>
+  std::vector<std::pair<std::string, int>> GetHistory(const std::string& key,
+                                                      int min_version,
+                                                      int max_version) override;
+  std::vector<std::pair<std::string, int>> GetTopHistory(
+      const std::string& key, int top_number) override;
+
+  bool Flush() override;
+
+ private:
+  void CreateDB(const std::string& path);
+
+ private:
+  std::unique_ptr<::rocksdb::DB> db_ = nullptr;
+  ::rocksdb::WriteBatch batch_;
+  unsigned int num_threads_ = 1;
+  unsigned int write_buffer_size_ = 64 << 20;
+  unsigned int write_batch_size_ = 1;
+};
+
+}  // namespace storage
+}  // namespace resdb
diff --git a/chain/storage/setting/BUILD b/chain/storage/setting/BUILD
new file mode 100644
index 00000000..e7f33e35
--- /dev/null
+++ b/chain/storage/setting/BUILD
@@ -0,0 +1,31 @@
+package(default_visibility = ["//visibility:public"])
+
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+
+bool_flag(
+    name = "enable_leveldb",
+    build_setting_default = False,
+    visibility = ["//visibility:public"],
+)
+
+bool_flag(
+    name = "enable_rocksdb",
+    build_setting_default = False,
+    visibility = ["//visibility:public"],
+)
+
+config_setting(
+    name = "enable_leveldb_setting",
+    values = {
+        "define": "enable_leveldb=True",
+    },
+    visibility = ["//visibility:public"],
+)
+
+config_setting(
+    name = "enable_rocksdb_setting",
+    values = {
+        "define": "enable_rocksdb=True",
+    },
+    visibility = ["//visibility:public"],
+)
diff --git a/chain/storage/storage.h b/chain/storage/storage.h
new file mode 100644
index 00000000..76e352de
--- /dev/null
+++ b/chain/storage/storage.h
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <map>
+#include <string>
+#include <vector>
+
+namespace resdb {
+
+class Storage {
+ public:
+  Storage() = default;
+  virtual ~Storage() = default;
+
+  virtual int SetValue(const std::string& key, const std::string& value) = 0;
+  virtual std::string GetValue(const std::string& key) = 0;
+  virtual std::string GetAllValues() = 0;
+  virtual std::string GetRange(const std::string& min_key,
+                               const std::string& max_key) = 0;
+
+  virtual int SetValueWithVersion(const std::string& key,
+                                  const std::string& value, int version) = 0;
+  virtual std::pair<std::string, int> GetValueWithVersion(
+      const std::string& key, int version) = 0;
+
+  // Return a map of <key, <value, version>>
+  virtual std::map<std::string, std::pair<std::string, int>> GetAllItems() = 0;
+  virtual std::map<std::string, std::pair<std::string, int>> GetKeyRange(
+      const std::string& min_key, const std::string& max_key) = 0;
+
+  // Return a list of <value, version> from a key
+  // The version list is sorted by the version value in descending order
+  virtual std::vector<std::pair<std::string, int>> GetHistory(
+      const std::string& key, int min_version, int max_version) = 0;
+
+  virtual std::vector<std::pair<std::string, int>> GetTopHistory(
+      const std::string& key, int number) = 0;
+
+  virtual bool Flush() { return true; };
+};
+
+}  // namespace resdb
diff --git a/common/BUILD b/common/BUILD
new file mode 100644
index 00000000..62d32413
--- /dev/null
+++ b/common/BUILD
@@ -0,0 +1,60 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "absl",
+    deps = [
+        "@com_google_absl//absl/status",
+        "@com_google_absl//absl/status:statusor",
+    ],
+)
+
+cc_library(
+    name = "asio",
+    deps = [
+        "@boost//:asio",
+    ],
+)
+
+cc_library(
+    name = "boost_lockfree",
+    deps = [
+        "@boost//:lockfree",
+    ],
+)
+
+cc_library(
+    name = "glog",
+    deps = [
+        "@com_github_google_glog//:glog",
+    ],
+)
+
+cc_library(
+    name = "pybind",
+    deps = [
+        "@pybind11",
+    ],
+)
+
+cc_library(
+    name = "json",
+    deps = [
+        "@nlohmann_json//:json",
+    ],
+)
+
+cc_library(
+    name = "boost_comm",
+    deps = [
+        "@boost//:algorithm",
+        "@boost//:optional",
+    ],
+)
+
+cc_library(
+    name = "comm",
+    deps = [
+        ":absl",
+        ":glog",
+    ],
+)
diff --git a/common/crypto/BUILD b/common/crypto/BUILD
new file mode 100644
index 00000000..1b7dbebe
--- /dev/null
+++ b/common/crypto/BUILD
@@ -0,0 +1,85 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "key_generator",
+    srcs = ["key_generator.cpp"],
+    hdrs = ["key_generator.h"],
+    deps = [
+        "//:cryptopp_lib",
+        "//common:comm",
+        "//common/proto:signature_info_cc_proto",
+    ],
+)
+
+cc_library(
+    name = "hash",
+    srcs = ["hash.cpp"],
+    hdrs = ["hash.h"],
+    deps = [
+        "//:cryptopp_lib",
+        "//common:comm",
+    ],
+)
+
+cc_test(
+    name = "hash_test",
+    srcs = ["hash_test.cpp"],
+    deps = [
+        ":hash",
+        "//common/test:test_main",
+    ],
+)
+
+cc_library(
+    name = "signature_utils",
+    srcs = ["signature_utils.cpp"],
+    hdrs = ["signature_utils.h"],
+    deps = [
+        "//:cryptopp_lib",
+        "//common:comm",
+        "//common/proto:signature_info_cc_proto",
+    ],
+)
+
+cc_library(
+    name = "signature_verifier_interface",
+    srcs = ["signature_verifier_interface.cpp"],
+    hdrs = ["signature_verifier_interface.h"],
+    deps = [
+        "//common:comm",
+        "//common/proto:signature_info_cc_proto",
+    ],
+)
+
+cc_library(
+    name = "signature_verifier",
+    srcs = ["signature_verifier.cpp"],
+    hdrs = ["signature_verifier.h"],
+    deps = [
+        ":signature_utils",
+        ":signature_verifier_interface",
+        "//:cryptopp_lib",
+        "//common:comm",
+        "//common/proto:signature_info_cc_proto",
+    ],
+)
+
+cc_library(
+    name = "mock_signature_verifier",
+    testonly = True,
+    hdrs = ["mock_signature_verifier.h"],
+    deps = [
+        ":signature_verifier",
+    ],
+)
+
+cc_test(
+    name = "signature_verifier_test",
+    srcs = ["signature_verifier_test.cpp"],
+    deps = [
+        ":key_generator",
+        ":signature_verifier",
+        "//:cryptopp_lib",
+        "//common/test:test_main",
+    ],
+)
diff --git a/common/crypto/hash.cpp b/common/crypto/hash.cpp
new file mode 100644
index 00000000..8173109d
--- /dev/null
+++ b/common/crypto/hash.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/hash.h"
+
+#include <cryptopp/ripemd.h>
+#include <cryptopp/sha.h>
+#include <glog/logging.h>
+
+namespace resdb {
+namespace utils {
+// Funtion to calculate hash of a string.
+std::string CalculateSHA256Hash(const std::string& str) {
+  CryptoPP::byte const* pData = (CryptoPP::byte*)str.data();
+  unsigned int nDataLen = str.size();
+  CryptoPP::byte aDigest[CryptoPP::SHA256::DIGESTSIZE];
+
+  CryptoPP::SHA256().CalculateDigest(aDigest, pData, nDataLen);
+  return std::string((char*)aDigest, CryptoPP::SHA256::DIGESTSIZE);
+}
+
+std::string CalculateRIPEMD160Hash(const std::string& str) {
+  CryptoPP::byte const* pData = (CryptoPP::byte*)str.data();
+  unsigned int nDataLen = str.size();
+  CryptoPP::byte aDigest[CryptoPP::RIPEMD160::DIGESTSIZE];
+
+  CryptoPP::RIPEMD160().CalculateDigest(aDigest, pData, nDataLen);
+  return std::string((char*)aDigest, CryptoPP::RIPEMD160::DIGESTSIZE);
+}
+
+}  // namespace utils
+}  // namespace resdb
diff --git a/common/crypto/hash.h b/common/crypto/hash.h
new file mode 100644
index 00000000..10d028cb
--- /dev/null
+++ b/common/crypto/hash.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include <string>
+
+namespace resdb {
+namespace utils {
+
+std::string CalculateSHA256Hash(const std::string& str);
+std::string CalculateRIPEMD160Hash(const std::string& str);
+
+}  // namespace utils
+}  // namespace resdb
diff --git a/common/crypto/hash_test.cpp b/common/crypto/hash_test.cpp
new file mode 100644
index 00000000..258d4a64
--- /dev/null
+++ b/common/crypto/hash_test.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/hash.h"
+
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "common/test/test_macros.h"
+
+namespace resdb {
+namespace utils {
+namespace {
+
+using ::resdb::testing::EqualsProto;
+
+TEST(SignatureVerifyTest, CalculateSHA256) {
+  std::string expected_str =
+      "\x9F\x86\xD0\x81\x88L}e\x9A/"
+      "\xEA\xA0\xC5Z\xD0\x15\xA3\xBFO\x1B+\v\x82,\xD1]l\x15\xB0\xF0\n\b";
+  EXPECT_EQ(CalculateSHA256Hash("test"), expected_str);
+}
+
+TEST(SignatureVerifyTest, CalculateRIPEMD160) {
+  std::string expected_str =
+      "^R\xFE\xE4~k\a\x5"
+      "e\xF7"
+      "CrF\x8C\xDCi\x9D\xE8\x91\a";
+  EXPECT_EQ(CalculateRIPEMD160Hash("test"), expected_str);
+}
+
+}  // namespace
+}  // namespace utils
+}  // namespace resdb
diff --git a/common/crypto/key_generator.cpp b/common/crypto/key_generator.cpp
new file mode 100644
index 00000000..89ec6971
--- /dev/null
+++ b/common/crypto/key_generator.cpp
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/key_generator.h"
+
+#include <cryptopp/aes.h>
+#include <cryptopp/cmac.h>
+#include <cryptopp/dsa.h>
+#include <cryptopp/eccrypto.h>
+#include <cryptopp/filters.h>
+#include <cryptopp/hex.h>
+#include <cryptopp/osrng.h>
+#include <cryptopp/pssr.h>
+#include <cryptopp/rsa.h>
+#include <cryptopp/sha.h>
+#include <cryptopp/whrlpool.h>
+#include <cryptopp/xed25519.h>
+#include <glog/logging.h>
+
+//#include <cryptopp/modes.h>
+//#include <iomanip>
+
+namespace resdb {
+
+namespace {
+
+//==============================================================================
+// Return a KeyPairHex for each node. This function is used by the nodes to
+// obtain their keyPair
+SecretKey RsaGenerateHexKeyPair(unsigned int key_size) {
+  SecretKey key_pair;
+  // PGP Random Pool-like generator
+  CryptoPP::AutoSeededRandomPool rng;
+
+  // generate keys
+  CryptoPP::RSA::PrivateKey private_key;
+  private_key.GenerateRandomWithKeySize(rng, key_size);
+  CryptoPP::RSA::PublicKey public_key(private_key);
+
+  // save keys
+  public_key.Save(CryptoPP::HexEncoder(
+                      new CryptoPP::StringSink(*key_pair.mutable_public_key()))
+                      .Ref());
+  private_key.Save(CryptoPP::HexEncoder(new CryptoPP::StringSink(
+                                            *key_pair.mutable_private_key()))
+                       .Ref());
+
+  return key_pair;
+}
+
+// Initialize the signer and the keys for ED25519
+SecretKey ED25519GenerateKeys() {
+  CryptoPP::ed25519::Signer signer;
+  SecretKey key_pair;
+  CryptoPP::AutoSeededRandomPool prng;
+  // Initilize signer;
+  signer.AccessPrivateKey().GenerateRandom(prng);
+
+  const CryptoPP::ed25519PrivateKey &private_key =
+      dynamic_cast<const CryptoPP::ed25519PrivateKey &>(signer.GetPrivateKey());
+
+  key_pair.mutable_private_key()->assign(
+      (char *)private_key.GetPrivateKeyBytePtr(),
+      CryptoPP::ed25519PrivateKey::SECRET_KEYLENGTH);
+  key_pair.mutable_public_key()->assign(
+      (char *)private_key.GetPublicKeyBytePtr(),
+      CryptoPP::ed25519PrivateKey::PUBLIC_KEYLENGTH);
+  return key_pair;
+}
+
+// CMAC-AES key generator
+// Return a keyPairHex where just the priv key is set
+SecretKey CmacGenerateHexKey(unsigned int key_size) {
+  SecretKey key_pair;
+  std::string private_key;
+  CryptoPP::AutoSeededRandomPool prng;
+  // int keySize = 16 ; // AES::DEFAULT_KEYLENGTH
+  CryptoPP::SecByteBlock key(key_size);
+  prng.GenerateBlock(
+      key.data(), key.size());  // Key is a SecByteBlock that contains the key.
+
+  CryptoPP::StringSource ss(key.data(), key.size(), true,
+                            new CryptoPP::HexEncoder(new CryptoPP::StringSink(
+                                private_key))  // HexEncoder
+  );                                           // StringSource
+  key_pair.set_private_key(private_key);
+  key_pair.set_public_key(private_key);
+  return key_pair;
+}
+
+SecretKey ECDSAGenerateKeys() {
+  CryptoPP::AutoSeededRandomPool prng;
+  CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::PrivateKey privateKey;
+  CryptoPP::DL_GroupParameters_EC<CryptoPP::ECP> params(
+      CryptoPP::ASN1::secp256k1());
+  privateKey.Initialize(prng, params);
+
+  CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::PublicKey publicKey;
+  privateKey.MakePublicKey(publicKey);
+
+  SecretKey key_pair;
+
+  // save keys
+  publicKey.Save(CryptoPP::HexEncoder(
+                     new CryptoPP::StringSink(*key_pair.mutable_public_key()))
+                     .Ref());
+  privateKey.Save(CryptoPP::HexEncoder(
+                      new CryptoPP::StringSink(*key_pair.mutable_private_key()))
+                      .Ref());
+  return key_pair;
+}
+
+}  // namespace
+
+SecretKey KeyGenerator::GeneratorKeys(SignatureInfo::HashType type) {
+  SecretKey key;
+  switch (type) {
+    case SignatureInfo::RSA:
+      key = RsaGenerateHexKeyPair(3072);
+      break;
+    case SignatureInfo::ED25519: {
+      key = ED25519GenerateKeys();
+      break;
+    }
+    case SignatureInfo::CMAC_AES: {
+      key = CmacGenerateHexKey(16);
+      break;
+    }
+    case SignatureInfo::ECDSA: {
+      key = ECDSAGenerateKeys();
+      break;
+    }
+    default:
+      break;
+  }
+  key.set_hash_type(type);
+  return key;
+}
+
+}  // namespace resdb
diff --git a/common/crypto/key_generator.h b/common/crypto/key_generator.h
new file mode 100644
index 00000000..846039ff
--- /dev/null
+++ b/common/crypto/key_generator.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include "common/proto/signature_info.pb.h"
+
+namespace resdb {
+
+class KeyGenerator {
+ public:
+  static SecretKey GeneratorKeys(SignatureInfo::HashType type);
+};
+
+}  // namespace resdb
diff --git a/common/crypto/mock_signature_verifier.h b/common/crypto/mock_signature_verifier.h
new file mode 100644
index 00000000..1bf88628
--- /dev/null
+++ b/common/crypto/mock_signature_verifier.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include "common/crypto/signature_verifier.h"
+
+namespace resdb {
+
+class MockSignatureVerifier : public SignatureVerifier {
+ public:
+  MockSignatureVerifier() : SignatureVerifier(KeyInfo(), CertificateInfo()) {}
+  MOCK_METHOD(absl::StatusOr<SignatureInfo>, SignMessage, (const std::string&),
+              (override));
+  MOCK_METHOD(bool, VerifyMessage,
+              (const std::string&, const SignatureInfo& sign), (override));
+};
+
+}  // namespace resdb
diff --git a/common/crypto/signature_utils.cpp b/common/crypto/signature_utils.cpp
new file mode 100644
index 00000000..e86f99b1
--- /dev/null
+++ b/common/crypto/signature_utils.cpp
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/signature_utils.h"
+
+#include <cryptopp/eccrypto.h>
+#include <cryptopp/hex.h>
+#include <cryptopp/osrng.h>
+#include <cryptopp/pssr.h>
+#include <cryptopp/rsa.h>
+#include <cryptopp/whrlpool.h>
+#include <glog/logging.h>
+
+namespace resdb {
+namespace utils {
+
+bool RsaVerifyString(const std::string& message, const std::string& public_key,
+                     const std::string& signature) {
+  try {
+    // decode and load public key (using pipeline)
+    CryptoPP::RSA::PublicKey rsa_public_key;
+    rsa_public_key.Load(
+        CryptoPP::StringSource(public_key, true, new CryptoPP::HexDecoder())
+            .Ref());
+
+    // decode signature
+    std::string decoded_signature;
+    CryptoPP::StringSource ss(
+        signature, true,
+        new CryptoPP::HexDecoder(new CryptoPP::StringSink(decoded_signature)));
+
+    // verify message
+    bool result = false;
+    CryptoPP::RSASS<CryptoPP::PSSR, CryptoPP::Whirlpool>::Verifier verifier(
+        rsa_public_key);
+    CryptoPP::StringSource ss2(
+        decoded_signature + message, true,
+        new CryptoPP::SignatureVerificationFilter(
+            verifier,
+            new CryptoPP::ArraySink((CryptoPP::byte*)&result, sizeof(result))));
+
+    return result;
+  } catch (...) {
+    LOG(ERROR) << "key not valid";
+    return false;
+  }
+}
+
+bool ECDSAVerifyString(const std::string& message,
+                       const std::string& public_key,
+                       const std::string& signature) {
+  std::string decoded;
+  std::string output;
+  CryptoPP::StringSource(
+      signature, true,
+      new CryptoPP::HexDecoder(new CryptoPP::StringSink(decoded))  // StringSink
+  );  // StringSource
+
+  CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::PublicKey dsa_public_key;
+  dsa_public_key.Load(
+      CryptoPP::StringSource(public_key, true, new CryptoPP::HexDecoder())
+          .Ref());
+  CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::Verifier verifier(
+      dsa_public_key);
+
+  bool valid = true;
+  CryptoPP::StringSource(
+      decoded + message, true,
+      new CryptoPP::SignatureVerificationFilter(
+          verifier,
+          new CryptoPP::ArraySink((CryptoPP::byte*)&valid, sizeof(valid))));
+  if (!valid) {
+    LOG(ERROR) << "signature invalid. signature len:" << signature.size()
+               << " message len:" << message.size();
+  }
+  return valid;
+}
+
+std::string RsaSignString(const std::string& private_key,
+                          const std::string& message) {
+  // decode and load private key (using pipeline)
+  CryptoPP::RSA::PrivateKey rsa_private_key;
+  rsa_private_key.Load(
+      CryptoPP::StringSource(private_key, true, new CryptoPP::HexDecoder())
+          .Ref());
+
+  // sign message
+  std::string signature;
+  CryptoPP::RSASS<CryptoPP::PSSR, CryptoPP::Whirlpool>::Signer signer(
+      rsa_private_key);
+  CryptoPP::AutoSeededRandomPool rng;
+  CryptoPP::StringSource ss(
+      message, true,
+      new CryptoPP::SignerFilter(
+          rng, signer,
+          new CryptoPP::HexEncoder(new CryptoPP::StringSink(signature))));
+  return signature;
+}
+
+std::string ECDSASignString(const std::string& private_key,
+                            const std::string& message) {
+  try {
+    CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::PrivateKey privateKey;
+    privateKey.Load(
+        CryptoPP::StringSource(private_key, true, new CryptoPP::HexDecoder())
+            .Ref());
+    CryptoPP::AutoSeededRandomPool prng;
+    std::string signature;
+
+    CryptoPP::StringSource ss1(
+        message, true /*pump all*/,
+        new CryptoPP::SignerFilter(
+            prng,
+            CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>::Signer(
+                privateKey),
+            new CryptoPP::StringSink(signature)));
+
+    std::string output;
+    CryptoPP::StringSource(signature, true,
+                           new CryptoPP::HexEncoder(
+                               new CryptoPP::StringSink(output))  // HexEncoder
+    );  // StringSource
+    return output;
+  } catch (...) {
+    LOG(ERROR) << "sign error";
+    return "";
+  }
+}
+
+}  // namespace utils
+}  // namespace resdb
diff --git a/common/crypto/signature_utils.h b/common/crypto/signature_utils.h
new file mode 100644
index 00000000..18415eaa
--- /dev/null
+++ b/common/crypto/signature_utils.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include <string>
+
+namespace resdb {
+namespace utils {
+
+bool RsaVerifyString(const std::string& message, const std::string& public_key,
+                     const std::string& signature);
+bool ECDSAVerifyString(const std::string& message,
+                       const std::string& public_key,
+                       const std::string& signature);
+
+std::string RsaSignString(const std::string& private_key,
+                          const std::string& message);
+
+std::string ECDSASignString(const std::string& private_key,
+                            const std::string& message);
+
+}  // namespace utils
+}  // namespace resdb
diff --git a/common/crypto/signature_verifier.cpp b/common/crypto/signature_verifier.cpp
new file mode 100644
index 00000000..09e81985
--- /dev/null
+++ b/common/crypto/signature_verifier.cpp
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/signature_verifier.h"
+
+#include <cryptopp/aes.h>
+#include <cryptopp/cmac.h>
+#include <cryptopp/dsa.h>
+#include <cryptopp/eccrypto.h>
+#include <cryptopp/filters.h>
+#include <cryptopp/hex.h>
+#include <cryptopp/osrng.h>
+#include <cryptopp/pssr.h>
+#include <cryptopp/rsa.h>
+#include <cryptopp/sha.h>
+#include <cryptopp/whrlpool.h>
+#include <glog/logging.h>
+
+#include "common/crypto/signature_utils.h"
+
+namespace resdb {
+
+namespace {
+
+// ================== for verify ====================================
+bool ED25519verifyString(const std::string& message,
+                         const std::string& public_key,
+                         const std::string& signature) {
+  CryptoPP::byte byteKey[CryptoPP::ed25519PrivateKey::PUBLIC_KEYLENGTH];
+  if (public_key.size() != CryptoPP::ed25519PrivateKey::PUBLIC_KEYLENGTH) {
+    LOG(ERROR) << "public key len invalid:" << public_key.size();
+    return false;
+  }
+  memcpy(byteKey, public_key.c_str(), public_key.size());
+  auto verifier = CryptoPP::ed25519::Verifier(byteKey);
+
+  bool valid = true;
+  CryptoPP::StringSource(
+      signature + message, true,
+      new CryptoPP::SignatureVerificationFilter(
+          verifier,
+          new CryptoPP::ArraySink((CryptoPP::byte*)&valid, sizeof(valid))));
+  if (!valid) {
+    LOG(ERROR) << "signature invalid. signature len:" << signature.size()
+               << " message len:" << message.size();
+  }
+  return valid;
+}
+
+bool CmacVerifyString(const std::string& message, const std::string& public_key,
+                      const std::string& signature) {
+  bool res = false;
+  // KEY TRANSFORMATION
+  // https://stackoverflow.com/questions/26145776/string-to-secbyteblock-conversion
+  CryptoPP::SecByteBlock privKey((const unsigned char*)(public_key.data()),
+                                 public_key.size());
+  CryptoPP::CMAC<CryptoPP::AES> cmac(privKey.data(), privKey.size());
+  const int flags = CryptoPP::HashVerificationFilter::HASH_AT_END |
+                    CryptoPP::HashVerificationFilter::PUT_RESULT;
+
+  // MESSAGE VERIFICATION
+  CryptoPP::StringSource ss3(
+      message + signature, true,
+      new CryptoPP::HashVerificationFilter(
+          cmac, new CryptoPP::ArraySink((CryptoPP::byte*)&res, sizeof(res)),
+          flags));  // StringSource
+  return res;
+}
+
+// ================== for sign ====================================
+
+std::string ED25519signString(const std::string& message,
+                              CryptoPP::ed25519::Signer* signer) {
+  CryptoPP::AutoSeededRandomPool prng;
+  std::string signature;
+  CryptoPP::StringSource(
+      message, true,
+      new CryptoPP::SignerFilter(CryptoPP::NullRNG(), *signer,
+                                 new CryptoPP::StringSink(signature)));
+  return signature;
+}
+
+// CMAC-AES Signature generator
+// Return a token, mac, to verify the a message.
+std::string CmacSignString(const std::string& private_key,
+                           const std::string& message) {
+  std::string mac = "";
+
+  // KEY TRANSFORMATION.
+  // https://stackoverflow.com/questions/26145776/string-to-secbyteblock-conversion
+
+  CryptoPP::SecByteBlock mac_private_key(
+      (const unsigned char*)(private_key.data()), private_key.size());
+
+  CryptoPP::CMAC<CryptoPP::AES> cmac(mac_private_key.data(),
+                                     mac_private_key.size());
+
+  CryptoPP::StringSource ss1(
+      message, true,
+      new CryptoPP::HashFilter(cmac, new CryptoPP::StringSink(mac)));
+  return mac;
+}
+
+}  // namespace
+
+SignatureVerifier::SignatureVerifier(const KeyInfo& private_key,
+                                     const CertificateInfo& certificate_info) {
+  private_key_ = private_key;
+  if (private_key_.key().empty()) {
+    LOG(ERROR) << "private invalid";
+  }
+
+  node_id_ = certificate_info.node_id();
+  admin_public_key_ = certificate_info.admin_public_key();
+  AddPublicKey(certificate_info.public_key(), false);
+  if (private_key_.hash_type() == SignatureInfo::ED25519) {
+    CryptoPP::byte byteKey[CryptoPP::ed25519PrivateKey::SECRET_KEYLENGTH];
+    if (private_key_.key().size() !=
+        CryptoPP::ed25519PrivateKey::SECRET_KEYLENGTH) {
+      return;
+    }
+    memcpy(byteKey, private_key_.key().c_str(), private_key_.key().size());
+    signer_ = std::make_unique<CryptoPP::ed25519::Signer>(byteKey);
+  }
+}
+
+bool SignatureVerifier::AddPublicKey(const CertificateKey& public_key,
+                                     bool need_verify) {
+  std::unique_lock<std::shared_mutex> lk(mutex_);
+  if (need_verify &&
+      !VerifyKey(public_key.public_key_info(), public_key.certificate())) {
+    return false;
+  }
+  // LOG(ERROR) << "add public key from:"
+  //           << public_key.public_key_info().node_id();
+  keys_[public_key.public_key_info().node_id()] = public_key;
+  return true;
+}
+
+absl::StatusOr<KeyInfo> SignatureVerifier::GetPublicKey(int64_t node_id) const {
+  std::shared_lock<std::shared_mutex> lk(mutex_);
+  auto it = keys_.find(node_id);
+  if (it == keys_.end()) {
+    return absl::InvalidArgumentError("Public key not exist.");
+  }
+  return it->second.public_key_info().key();
+}
+
+std::vector<CertificateKey> SignatureVerifier::GetAllPublicKeys() const {
+  std::shared_lock<std::shared_mutex> lk(mutex_);
+  std::vector<CertificateKey> keys;
+  for (auto key : keys_) {
+    keys.push_back(key.second);
+  }
+  return keys;
+}
+
+size_t SignatureVerifier::GetPublicKeysSize() const {
+  std::shared_lock<std::shared_mutex> lk(mutex_);
+  return keys_.size();
+}
+
+// Funtion to calculate hash of a string.
+std::string SignatureVerifier::CalculateHash(const std::string& str) {
+  CryptoPP::byte const* pData = (CryptoPP::byte*)str.data();
+  unsigned int nDataLen = str.size();
+  CryptoPP::byte aDigest[CryptoPP::SHA256::DIGESTSIZE];
+
+  CryptoPP::SHA256().CalculateDigest(aDigest, pData, nDataLen);
+  return std::string((char*)aDigest, CryptoPP::SHA256::DIGESTSIZE);
+}
+
+absl::StatusOr<SignatureInfo> SignatureVerifier::SignMessage(
+    const std::string& message) {
+  SignatureInfo info;
+  info.set_node_id(node_id_);
+  switch (private_key_.hash_type()) {
+    case SignatureInfo::RSA:
+      info.set_signature(utils::RsaSignString(private_key_.key(), message));
+      break;
+    case SignatureInfo::ED25519:
+      info.set_signature(ED25519signString(message, signer_.get()));
+      break;
+    case SignatureInfo::CMAC_AES:
+      info.set_signature(CmacSignString(private_key_.key(), message));
+      break;
+    case SignatureInfo::ECDSA:
+      info.set_signature(utils::ECDSASignString(private_key_.key(), message));
+      break;
+    default:
+      break;
+  }
+  return info;
+}
+
+bool SignatureVerifier::VerifyMessage(const google::protobuf::Message& message,
+                                      const SignatureInfo& sign) {
+  std::string str;
+  if (!message.SerializeToString(&str)) {
+    return false;
+  }
+  return VerifyMessage(str, sign);
+}
+
+bool SignatureVerifier::VerifyMessage(const std::string& message,
+                                      const SignatureInfo& info) {
+  if (info.signature().empty()) {
+    LOG(ERROR) << " signature is empty";
+    return false;
+  }
+  auto public_key = GetPublicKey(info.node_id());
+  if (!public_key.ok()) {
+    LOG(ERROR) << "key not found:" << info.node_id();
+    return false;
+  }
+  return VerifyMessage(message, *public_key, info.signature());
+}
+
+absl::StatusOr<SignatureInfo> SignatureVerifier::SignCertificateKeyInfo(
+    const CertificateKeyInfo& info) {
+  std::string str;
+  if (!info.SerializeToString(&str)) {
+    return absl::InvalidArgumentError("Serialize fail");
+  }
+  return SignatureVerifier::SignMessage(str);
+}
+
+bool SignatureVerifier::VerifyKey(const CertificateKeyInfo& info,
+                                  const SignatureInfo& sign) {
+  std::string str;
+  if (!info.SerializeToString(&str)) {
+    return false;
+  }
+  return VerifyMessage(str, admin_public_key_, sign.signature());
+}
+
+bool SignatureVerifier::VerifyMessage(const std::string& message,
+                                      const KeyInfo& public_key,
+                                      const std::string& signature) {
+  if (public_key.key().empty() || signature.empty()) {
+    LOG(ERROR) << "public is empty, size(" << public_key.key().size()
+               << ") or signature is empty, size(" << signature.size() << ")";
+    return false;
+  }
+  // LOG(ERROR) << "public key hash type:" << public_key.hash_type()
+  //          << " key size:" << public_key.key().size()
+  //         << " sig size:" << signature.size()
+  //        << " msg size:" << message.size();
+  switch (public_key.hash_type()) {
+    case SignatureInfo::RSA:
+      return utils::RsaVerifyString(message, public_key.key(), signature);
+    case SignatureInfo::ED25519:
+      return ED25519verifyString(message, public_key.key(), signature);
+    case SignatureInfo::CMAC_AES:
+      return CmacVerifyString(message, public_key.key(), signature);
+    case SignatureInfo::ECDSA:
+      return utils::ECDSAVerifyString(message, public_key.key(), signature);
+    default:
+      return true;
+  }
+}
+
+}  // namespace resdb
diff --git a/common/crypto/signature_verifier.h b/common/crypto/signature_verifier.h
new file mode 100644
index 00000000..619908ea
--- /dev/null
+++ b/common/crypto/signature_verifier.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include <cryptopp/filters.h>
+#include <cryptopp/xed25519.h>
+
+#include <shared_mutex>
+#include <string>
+
+#include "absl/status/statusor.h"
+#include "common/crypto/signature_verifier_interface.h"
+#include "common/proto/signature_info.pb.h"
+
+namespace resdb {
+
+// SignatureVerifier used to sign signatures using private_key,
+// and verify signatures using the public keys of the senders identified
+// by their node_id.
+class SignatureVerifier : public SignatureVerifierInterface {
+ public:
+  SignatureVerifier(const KeyInfo& private_key,
+                    const CertificateInfo& certificate_info);
+  virtual ~SignatureVerifier() = default;
+
+  // Set the public key that contains the public key, node id,
+  // and its certificate.
+  bool AddPublicKey(const CertificateKey& pub_key, bool need_verify = true);
+
+  // Get the public key of node id. KeyInfo contains the key and its hash type.
+  absl::StatusOr<KeyInfo> GetPublicKey(int64_t node_id) const;
+  // Get all the public keys.
+  std::vector<CertificateKey> GetAllPublicKeys() const;
+  // Get the number of public keys it contains.
+  size_t GetPublicKeysSize() const;
+
+  // Sign messages using the private key.
+  virtual absl::StatusOr<SignatureInfo> SignMessage(const std::string& message);
+  absl::StatusOr<SignatureInfo> SignCertificateKeyInfo(
+      const CertificateKeyInfo& info);
+
+  // Verify messages using the public key from the sender.
+  virtual bool VerifyMessage(const std::string& message,
+                             const SignatureInfo& sign);
+  bool VerifyMessage(const google::protobuf::Message& message,
+                     const SignatureInfo& sign);
+  bool VerifyKey(const CertificateKeyInfo& info, const SignatureInfo& sign);
+
+  static std::string CalculateHash(const std::string& str);
+
+  static bool VerifyMessage(const std::string& message,
+                            const KeyInfo& public_key,
+                            const std::string& signature);
+
+ private:
+  std::map<int64_t, CertificateKey> keys_;
+  // GUARDED_BY(mutex_);  // public keys of nodes, including the public key and
+  // its encrpt type.
+  KeyInfo private_key_;       // public-private keys of self.
+  KeyInfo admin_public_key_;  // public key of admin.
+  int64_t node_id_;           // id of current node.
+  std::unique_ptr<CryptoPP::ed25519::Signer> signer_;
+  mutable std::shared_mutex mutex_;
+};
+
+}  // namespace resdb
diff --git a/common/crypto/signature_verifier_interface.cpp b/common/crypto/signature_verifier_interface.cpp
new file mode 100644
index 00000000..07bed5cc
--- /dev/null
+++ b/common/crypto/signature_verifier_interface.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/signature_verifier_interface.h"
+
+namespace resdb {
+
+absl::StatusOr<SignatureInfo> SignatureVerifierInterface::SignMessage(
+    const std::string& message) {
+  return SignatureInfo();
+}
+
+}  // namespace resdb
diff --git a/common/crypto/signature_verifier_interface.h b/common/crypto/signature_verifier_interface.h
new file mode 100644
index 00000000..eea1b410
--- /dev/null
+++ b/common/crypto/signature_verifier_interface.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include "absl/status/statusor.h"
+#include "common/proto/signature_info.pb.h"
+
+namespace resdb {
+
+// SignatureVerifier base class, provide an interface for communication.
+class SignatureVerifierInterface {
+ public:
+  SignatureVerifierInterface() = default;
+  virtual ~SignatureVerifierInterface() = default;
+
+  // Sign messages using the private key.
+  virtual absl::StatusOr<SignatureInfo> SignMessage(const std::string& message);
+};
+
+}  // namespace resdb
diff --git a/common/crypto/signature_verifier_test.cpp b/common/crypto/signature_verifier_test.cpp
new file mode 100644
index 00000000..b7453bb9
--- /dev/null
+++ b/common/crypto/signature_verifier_test.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/crypto/signature_verifier.h"
+
+#include <glog/logging.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "common/crypto/key_generator.h"
+#include "common/test/test_macros.h"
+
+namespace resdb {
+namespace {
+
+using ::resdb::testing::EqualsProto;
+
+TEST(SignatureVerifyTest, CalculateHash) {
+  std::string expected_str =
+      "\x9F\x86\xD0\x81\x88L}e\x9A/"
+      "\xEA\xA0\xC5Z\xD0\x15\xA3\xBFO\x1B+\v\x82,\xD1]l\x15\xB0\xF0\n\b";
+  EXPECT_EQ(SignatureVerifier::CalculateHash("test"), expected_str);
+}
+
+KeyInfo GetKeyInfo(SecretKey key) {
+  KeyInfo info;
+  info.set_key(key.private_key());
+  info.set_hash_type(key.hash_type());
+  return info;
+}
+
+class SignatureVerifyPTest
+    : public ::testing::TestWithParam<SignatureInfo::HashType> {
+ public:
+  SignatureVerifyPTest() {
+    admin_key_ = KeyGenerator ::GeneratorKeys(SignatureInfo::RSA);
+    admin_verifier_ = std::make_unique<SignatureVerifier>(
+        GetKeyInfo(admin_key_), GetCertInfo(0));
+  }
+
+  CertificateInfo GetCertInfo(int64_t node_id) {
+    CertificateInfo cert_info;
+    cert_info.set_node_id(node_id);
+
+    cert_info.mutable_admin_public_key()->set_key(admin_key_.public_key());
+    cert_info.mutable_admin_public_key()->set_hash_type(admin_key_.hash_type());
+
+    return cert_info;
+  }
+
+  CertificateKey GetPublicKeyInfo(SecretKey key, int64_t node_id) {
+    CertificateKey cert_key;
+    cert_key.mutable_public_key_info()->mutable_key()->set_key(
+        key.public_key());
+    cert_key.mutable_public_key_info()->mutable_key()->set_hash_type(
+        key.hash_type());
+    cert_key.mutable_public_key_info()->set_node_id(node_id);
+
+    auto resp_info =
+        admin_verifier_->SignCertificateKeyInfo(cert_key.public_key_info());
+    assert(resp_info.ok());
+    *cert_key.mutable_certificate() = *resp_info;
+    return cert_key;
+  }
+
+ private:
+  SecretKey admin_key_;
+  std::unique_ptr<SignatureVerifier> admin_verifier_;
+};
+
+TEST_P(SignatureVerifyPTest, SignAndVerify) {
+  SignatureInfo::HashType type = GetParam();
+  absl::StatusOr<SignatureInfo> s_info;
+  std::string message = "test_message";
+  SecretKey my_key = KeyGenerator ::GeneratorKeys(type);
+  int64_t my_node_id = 1, your_node_id = 2;
+  {
+    SignatureVerifier verifier(GetKeyInfo(my_key), GetCertInfo(my_node_id));
+    s_info = verifier.SignMessage(message);
+    EXPECT_TRUE(s_info.ok());
+    EXPECT_EQ(s_info->node_id(), my_node_id);
+  }
+  {
+    SecretKey your_key = KeyGenerator ::GeneratorKeys(type);
+    SignatureVerifier verifier(GetKeyInfo(your_key), GetCertInfo(your_node_id));
+    verifier.AddPublicKey(GetPublicKeyInfo(my_key, my_node_id));
+    EXPECT_TRUE(verifier.VerifyMessage(message, *s_info));
+  }
+}
+
+TEST_P(SignatureVerifyPTest, KeyNotFound) {
+  SignatureInfo::HashType type = GetParam();
+
+  absl::StatusOr<SignatureInfo> s_info;
+  std::string message = "test_message";
+  SecretKey my_key = KeyGenerator ::GeneratorKeys(type);
+  int64_t my_node_id = 1, your_node_id = 2;
+
+  {
+    SignatureVerifier verifier(GetKeyInfo(my_key), GetCertInfo(my_node_id));
+    s_info = verifier.SignMessage(message);
+    EXPECT_TRUE(s_info.ok());
+    EXPECT_EQ(s_info->node_id(), my_node_id);
+  }
+
+  {
+    SecretKey your_key = KeyGenerator ::GeneratorKeys(type);
+    SignatureVerifier verifier(GetKeyInfo(your_key), GetCertInfo(your_node_id));
+    EXPECT_FALSE(verifier.VerifyMessage(message, *s_info));
+  }
+}
+
+TEST_P(SignatureVerifyPTest, KeyNotMatch) {
+  SignatureInfo::HashType type = GetParam();
+
+  absl::StatusOr<SignatureInfo> s_info;
+  std::string message = "test_message";
+  SecretKey my_key = KeyGenerator ::GeneratorKeys(type);
+  SecretKey your_key = KeyGenerator ::GeneratorKeys(type);
+  int64_t my_node_id = 1, your_node_id = 2;
+
+  {
+    SignatureVerifier verifier(GetKeyInfo(my_key), GetCertInfo(my_node_id));
+    s_info = verifier.SignMessage(message);
+    EXPECT_TRUE(s_info.ok());
+    EXPECT_EQ(s_info->node_id(), my_node_id);
+  }
+
+  {
+    SignatureVerifier verifier(GetKeyInfo(your_key), GetCertInfo(your_node_id));
+    verifier.AddPublicKey(GetPublicKeyInfo(your_key, my_node_id));
+    EXPECT_FALSE(verifier.VerifyMessage(message, *s_info));
+  }
+}
+
+INSTANTIATE_TEST_SUITE_P(SignatureVerifyPTest, SignatureVerifyPTest,
+                         ::testing::Values(SignatureInfo::RSA,
+                                           SignatureInfo::ED25519,
+                                           SignatureInfo::CMAC_AES,
+                                           SignatureInfo::ECDSA));
+
+}  // namespace
+
+}  // namespace resdb
diff --git a/common/proto/BUILD b/common/proto/BUILD
new file mode 100644
index 00000000..d6647a53
--- /dev/null
+++ b/common/proto/BUILD
@@ -0,0 +1,20 @@
+package(default_visibility = ["//visibility:public"])
+
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("@rules_proto_grpc//python:defs.bzl", "python_proto_library")
+
+proto_library(
+    name = "signature_info_proto",
+    srcs = ["signature_info.proto"],
+)
+
+cc_proto_library(
+    name = "signature_info_cc_proto",
+    deps = [":signature_info_proto"],
+)
+
+python_proto_library(
+    name = "signature_info_py_proto",
+    protos = [":signature_info_proto"],
+)
diff --git a/common/proto/signature_info.proto b/common/proto/signature_info.proto
new file mode 100644
index 00000000..607fe4ac
--- /dev/null
+++ b/common/proto/signature_info.proto
@@ -0,0 +1,61 @@
+syntax = "proto3";
+
+package resdb;
+
+message SignatureInfo {
+    enum HashType{
+        NONE = 0;
+        RSA = 1;
+        ED25519 = 2;
+        CMAC_AES = 3;
+        ECDSA = 4;
+    };
+
+    HashType hash_type = 1;
+    int64 node_id = 2;
+    bytes signature = 3;
+};
+
+message SecretKey {
+    bytes public_key = 1;
+    bytes private_key = 2;
+    SignatureInfo.HashType hash_type = 3;
+};
+
+message KeyInfo {
+    bytes key = 1;
+    SignatureInfo.HashType hash_type = 2;
+}
+
+message CertificateKeyInfo {
+    enum Type {
+        REPLICA = 0;
+        CLIENT  = 1;
+    }
+    KeyInfo key = 1;
+    int64 node_id = 2;
+    Type type = 3;
+    string ip = 4;
+    int32 port = 5;
+    // the ip:port the replica uses, if it is a client node, can be ignored.
+}
+
+message CertificateKey {
+   CertificateKeyInfo public_key_info = 1; // the public key of current node.
+   SignatureInfo certificate = 2; // the certificate of `public_key_info`.
+}
+
+// CertificateInfo is published from the adminisotr and will be written to a cert file.
+message CertificateInfo {
+   KeyInfo admin_public_key = 1; // the public key owned by the administor.
+   CertificateKey public_key = 3; // public key info with certificate.
+   int64 node_id = 4;
+};
+  
+// Used to construct SignatureVerifier.
+message SignatureKeyInfo {
+    KeyInfo admin_public_key = 1; // the public key owned by the administor.
+    KeyInfo private_key = 2; // the private key from the user, used to sign messages.
+    int64 node_id = 3;  // the unique id of the replica or client.
+}
+
diff --git a/common/test/BUILD b/common/test/BUILD
new file mode 100644
index 00000000..df156e5c
--- /dev/null
+++ b/common/test/BUILD
@@ -0,0 +1,43 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "test",
+    hdrs = [
+        "test_macros.h",
+    ],
+    deps = [
+        "//common:comm",
+        "@com_google_googletest//:gtest",
+        "@com_google_protobuf//:protobuf",
+    ],
+)
+
+cc_library(
+    name = "test_main",
+    defines = ["TEST_MODE"],
+    deps = [
+        ":test",
+        "@com_google_googletest//:gtest_main",
+    ],
+)
+
+proto_library(
+    name = "test_proto",
+    srcs = ["test.proto"],
+    visibility = ["//visibility:private"],
+)
+
+cc_proto_library(
+    name = "test_cc_proto",
+    visibility = ["//visibility:private"],
+    deps = [":test_proto"],
+)
+
+cc_test(
+    name = "json_test",
+    srcs = ["json_test.cpp"],
+    deps = [
+        ":test_cc_proto",
+        ":test_main",
+    ],
+)
diff --git a/common/test/json_test.cpp b/common/test/json_test.cpp
new file mode 100644
index 00000000..ccc28680
--- /dev/null
+++ b/common/test/json_test.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <gtest/gtest.h>
+
+#include "common/test/test.pb.h"
+#include "common/test/test_macros.h"
+
+namespace resdb {
+namespace testing {
+namespace {
+
+using ::resdb::testing::EqualsProto;
+
+TEST(SignatureVerifyTest, ParseFromJson) {
+  resdb::test::JsonMessage json_msg;
+
+  json_msg.set_id(1);
+  json_msg.set_data("data");
+  json_msg.mutable_sub_msg()->set_id(2);
+  json_msg.mutable_sub_msg()->set_data("sub_data");
+
+  std::string json =
+      "{ \
+			    \"id\": 1, \
+			    \"data\": \"data\", \
+			    \"sub_msg\":{ \
+				\"id\": 2, \
+			        \"data\":\"sub_data\" \
+			    } \
+	}";
+
+  EXPECT_THAT(ParseFromText<resdb::test::JsonMessage>(json),
+              EqualsProto(json_msg));
+}
+
+}  // namespace
+}  // namespace testing
+}  // namespace resdb
diff --git a/common/test/test.proto b/common/test/test.proto
new file mode 100644
index 00000000..c8a075d1
--- /dev/null
+++ b/common/test/test.proto
@@ -0,0 +1,15 @@
+syntax = "proto3";
+
+package resdb.test;
+
+message JsonSubMessage {
+    int64 id = 1;
+    string  data = 2;
+};
+
+message JsonMessage {
+    int64 id = 1;
+    string data = 2;
+    JsonMessage sub_msg = 3;
+};
+
diff --git a/common/test/test_macros.h b/common/test/test_macros.h
new file mode 100644
index 00000000..6a991ed4
--- /dev/null
+++ b/common/test/test_macros.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+#include <glog/logging.h>
+#include <google/protobuf/util/json_util.h>
+#include <google/protobuf/util/message_differencer.h>
+
+#include "gmock/gmock.h"
+
+namespace resdb {
+namespace testing {
+
+MATCHER_P(EqualsProto, replica, "") {
+  return ::google::protobuf::util::MessageDifferencer::Equals(arg, replica);
+}
+
+template <typename T>
+T ParseFromText(const std::string& json_str) {
+  T message;
+  google::protobuf::util::JsonParseOptions options;
+  auto st =
+      google::protobuf::util::JsonStringToMessage(json_str, &message, options);
+  if (!st.ok()) {
+    LOG(ERROR) << st.message();
+  }
+  return message;
+}
+
+}  // namespace testing
+}  // namespace resdb
diff --git a/common/utils/BUILD b/common/utils/BUILD
new file mode 100644
index 00000000..3f6d1d06
--- /dev/null
+++ b/common/utils/BUILD
@@ -0,0 +1,7 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "utils",
+    srcs = ["utils.cpp"],
+    hdrs = ["utils.h"],
+)
diff --git a/common/utils/utils.cpp b/common/utils/utils.cpp
new file mode 100644
index 00000000..d4707fc5
--- /dev/null
+++ b/common/utils/utils.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "common/utils/utils.h"
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+namespace resdb {
+
+#define CPU_FREQ 2.2
+#define TIME_ENABLE true
+
+uint64_t GetCurrentTime() {
+  struct timeval tv;
+  gettimeofday(&tv, nullptr);
+  return (uint64_t)(tv.tv_sec) * 1000000 + tv.tv_usec;
+}
+
+}  // namespace resdb
diff --git a/common/utils/utils.h b/common/utils/utils.h
new file mode 100644
index 00000000..bc57af07
--- /dev/null
+++ b/common/utils/utils.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+namespace resdb {
+
+uint64_t GetCurrentTime();
+
+}  // namespace resdb
diff --git a/documents/doxygen/.gitignore b/documents/doxygen/.gitignore
new file mode 100644
index 00000000..67897178
--- /dev/null
+++ b/documents/doxygen/.gitignore
@@ -0,0 +1,2 @@
+html/
+latex/
diff --git a/documents/doxygen/Doxyfile b/documents/doxygen/Doxyfile
new file mode 100644
index 00000000..13911062
--- /dev/null
+++ b/documents/doxygen/Doxyfile
@@ -0,0 +1,2780 @@
+# Doxyfile 1.9.6
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+#
+# Note:
+#
+# Use doxygen to compare the used configuration file with the template
+# configuration file:
+# doxygen -x [configFile]
+# Use doxygen to compare the used configuration file with the template
+# configuration file without replacing the environment variables or CMake type
+# replacement variables:
+# doxygen -x_noenv [configFile]
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = ResilientDB 
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER         = v1.3.1
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = ResilientDB 
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO           = logo.png
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
+# sub-directories (in 2 levels) under the output directory of each output format
+# and will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to
+# control the number of sub-directories.
+# The default value is: NO.
+
+CREATE_SUBDIRS         = YES
+
+# Controls the number of sub-directories that will be created when
+# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every
+# level increment doubles the number of directories, resulting in 4096
+# directories at level 8 which is the default and also the maximum value. The
+# sub-directories are organized in 2 levels, the first level always has a fixed
+# number of 16 directories.
+# Minimum value: 0, maximum value: 8, default value: 8.
+# This tag requires that the tag CREATE_SUBDIRS is set to YES.
+
+CREATE_SUBDIRS_LEVEL   = 8
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES    = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,
+# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English
+# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,
+# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with
+# English messages), Korean, Korean-en (Korean with English messages), Latvian,
+# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,
+# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,
+# Swedish, Turkish, Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES        = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
+
+JAVADOC_BANNER         = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
+
+PYTHON_DOCSTRING       = YES
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:^^"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
+# to insert newlines (in the resulting output). You can put ^^ in the value part
+# of an alias to insert a newline as if a physical newline was in the original
+# file. When you need a literal { or } or , in the value part of an alias you
+# have to escape them by means of a backslash (\), this can lead to conflicts
+# with the commands \{ and \} for these it is advised to use the version @{ and
+# @} or use a double escape (\\{ and \\})
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE  = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
+
+EXTENSION_MAPPING      =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS   = 5
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 0
+
+# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which effectively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS       = 1
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIV_VIRTUAL   = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
+
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# will also hide undocumented C++ concepts if enabled. This option has no effect
+# if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
+# documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS          = NO
+
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# Possible values are: SYSTEM, NO and YES.
+# The default value is: SYSTEM.
+
+CASE_SENSE_NAMES       = SYSTEM
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
+# will show which file needs to be included to use the class.
+# The default value is: YES.
+
+SHOW_HEADERFILE        = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC  = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
... 58945 lines suppressed ...