Skip to content

Commit

Permalink
snapshot support state and block seperate
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust committed Jul 26, 2024
1 parent 59199c8 commit b107604
Show file tree
Hide file tree
Showing 10 changed files with 419 additions and 150 deletions.
1 change: 0 additions & 1 deletion .github/workflows/workflow-self-hosted-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: update vcpkg
run: |
cd vcpkg && git fetch origin master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:

- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: update vcpkg
run: |
cd ${{ env.VCPKG_ROOT }} && git fetch --all && git checkout master && git pull
Expand Down
5 changes: 5 additions & 0 deletions bcos-framework/bcos-framework/storage/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#define STORAGE_LOG(LEVEL) BCOS_LOG(LEVEL) << "[STORAGE]"

namespace bcos::storage
{

const std::string ROCKSDB = "rocksDB";
const std::string TiKV = "TiKV";

enum StorageError
{
UnknownError = -60000,
Expand Down
1 change: 0 additions & 1 deletion bcos-ledger/src/libledger/Ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,6 @@ void Ledger::asyncGetBlockTransactionHashes(bcos::protocol::BlockNumber blockNum
void Ledger::asyncBatchGetTransactions(std::shared_ptr<std::vector<std::string>> hashes,
std::function<void(Error::Ptr&&, std::vector<protocol::Transaction::Ptr>&&)> callback)
{
// FIXME: adapt the getBlockStorage()
std::vector<std::string_view> hashesView;
hashesView.reserve(hashes->size());
for (auto& hash : *hashes)
Expand Down
7 changes: 7 additions & 0 deletions bcos-tool/bcos-tool/NodeConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,13 @@ void NodeConfig::loadStorageConfig(boost::property_tree::ptree const& _pt)
m_pdKeyPath = _pt.get<std::string>("storage.pd_ssl_key_path", "");
m_enableArchive = _pt.get<bool>("storage.enable_archive", false);
m_enableSeparateBlockAndState = _pt.get<bool>("storage.enable_separate_block_state", false);
if (boost::iequals(m_storageType, bcos::storage::TiKV))
{
m_enableSeparateBlockAndState = false;
NodeConfig_LOG(INFO) << LOG_DESC("Only rocksDB support separate block and state")
<< LOG_KV("separateBlockAndState", m_enableSeparateBlockAndState)
<< LOG_KV("storageType", m_storageType);
}
m_stateDBPath = m_storagePath;
m_stateDBPath = m_storagePath + "/state";
m_blockDBPath = m_storagePath + "/block";
Expand Down
9 changes: 8 additions & 1 deletion libinitializer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ endif()

add_library(${TXPOOL_INIT_LIB} TxPoolInitializer.cpp)
target_link_libraries(${TXPOOL_INIT_LIB} PUBLIC ${PROTOCOL_INIT_LIB} ${TOOL_TARGET} ${TXPOOL_TARGET})
include(FetchContent)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0
)
FetchContent_MakeAvailable(tomlplusplus)

add_library(${INIT_LIB} Initializer.cpp LightNodeInitializer.h BaselineSchedulerInitializer.cpp)
list(APPEND INIT_LIB_DEPENDS ${PROTOCOL_INIT_LIB} ${FRONTSERVICE_INIT_LIB} ${TXPOOL_INIT_LIB} ${SCHEDULER_TARGET} ${STORAGE_TARGET} ${EXECUTOR_TARGET} ${RPC_TARGET} transaction-scheduler transaction-executor bcos-boostssl)
list(APPEND INIT_LIB_DEPENDS ${PROTOCOL_INIT_LIB} ${FRONTSERVICE_INIT_LIB} ${TXPOOL_INIT_LIB} ${SCHEDULER_TARGET} ${STORAGE_TARGET} ${EXECUTOR_TARGET} ${RPC_TARGET} transaction-scheduler transaction-executor bcos-boostssl tomlplusplus::tomlplusplus)
if(WITH_TIKV)
list(APPEND INIT_LIB_DEPENDS ${LEADER_ELECTION_TARGET})
endif()
Expand Down
Loading

0 comments on commit b107604

Please sign in to comment.