Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
507 changes: 507 additions & 0 deletions cpp/core/MsgsGen.cpp

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions cpp/core/MsgsGen.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions cpp/core/Protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ constexpr uint32_t LOG_REQ_PROTOCOL_VERSION = 0x474f4c;
// '1474f4c'
constexpr uint32_t LOG_RESP_PROTOCOL_VERSION = 0x1474f4c;

// >>> format(struct.unpack('<I', b'SYN\0')[0], 'x')
// '4e5953'
constexpr uint32_t SYNC_REQ_PROTOCOL_VERSION = 0x4e5953;

// >>> format(struct.unpack('<I', b'SYN\1')[0], 'x')
// '14e5953'
constexpr uint32_t SYNC_RESP_PROTOCOL_VERSION = 0x14e5953;

struct ShardCheckPointedResp {
public:
static constexpr size_t STATIC_SIZE = LogIdx::STATIC_SIZE + ShardRespContainer::STATIC_SIZE;
Expand Down Expand Up @@ -103,3 +111,5 @@ using LogReqMsg = SignedProtocolMessage<LOG_REQ_PROTOCOL_VERSION, LogReqContaine
using LogRespMsg = SignedProtocolMessage<LOG_RESP_PROTOCOL_VERSION, LogRespContainer>;
using ProxyShardReqMsg = SignedProtocolMessage<PROXY_SHARD_REQ_PROTOCOL_VERSION, ShardReqContainer>;
using ProxyShardRespMsg = SignedProtocolMessage<PROXY_SHARD_RESP_PROTOCOL_VERSION, ShardCheckPointedResp>;
using SyncReqMsg = ProtocolMessage<SYNC_REQ_PROTOCOL_VERSION, SyncReqContainer>;
using SyncRespMsg = ProtocolMessage<SYNC_RESP_PROTOCOL_VERSION, SyncRespContainer>;
2 changes: 1 addition & 1 deletion cpp/shard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

include_directories(${ternfs_SOURCE_DIR}/core ${ternfs_SOURCE_DIR}/crc32c)

add_library(shard Shard.cpp Shard.hpp ShardDB.cpp ShardDB.hpp ShardDBData.cpp ShardDBData.hpp BlockServicesCacheDB.hpp BlockServicesCacheDB.cpp)
add_library(shard Shard.cpp Shard.hpp ShardDB.cpp ShardDB.hpp ShardDBData.cpp ShardDBData.hpp BlockServicesCacheDB.hpp BlockServicesCacheDB.cpp ShardSyncServer.cpp ShardSyncServer.hpp)
target_link_libraries(shard PRIVATE core)

add_executable(ternshard ternshard.cpp)
Expand Down
Loading