mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
initial commit
This commit is contained in:
commit
c2da007f40
1610 changed files with 398047 additions and 0 deletions
65
validator/db/statedb.hpp
Normal file
65
validator/db/statedb.hpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
This file is part of TON Blockchain Library.
|
||||
|
||||
TON Blockchain Library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
TON Blockchain Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2017-2019 Telegram Systems LLP
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
#include "td/db/KeyValueAsync.h"
|
||||
#include "ton/ton-types.h"
|
||||
|
||||
#include "validator/interfaces/db.h"
|
||||
|
||||
namespace ton {
|
||||
|
||||
namespace validator {
|
||||
|
||||
class RootDb;
|
||||
|
||||
class StateDb : public td::actor::Actor {
|
||||
public:
|
||||
void update_init_masterchain_block(BlockIdExt block, td::Promise<td::Unit> promise);
|
||||
void get_init_masterchain_block(td::Promise<BlockIdExt> promise);
|
||||
|
||||
void update_gc_masterchain_block(BlockIdExt block, td::Promise<td::Unit> promise);
|
||||
void get_gc_masterchain_block(td::Promise<BlockIdExt> promise);
|
||||
|
||||
void update_shard_client_state(BlockIdExt masterchain_block_id, td::Promise<td::Unit> promise);
|
||||
void get_shard_client_state(td::Promise<BlockIdExt> promise);
|
||||
|
||||
void update_destroyed_validator_sessions(std::vector<ValidatorSessionId> sessions, td::Promise<td::Unit> promise);
|
||||
void get_destroyed_validator_sessions(td::Promise<std::vector<ValidatorSessionId>> promise);
|
||||
|
||||
void update_async_serializer_state(AsyncSerializerState state, td::Promise<td::Unit> promise);
|
||||
void get_async_serializer_state(td::Promise<AsyncSerializerState> promise);
|
||||
|
||||
StateDb(td::actor::ActorId<RootDb> root_db, std::string path);
|
||||
|
||||
void start_up() override;
|
||||
|
||||
private:
|
||||
using KeyType = td::Bits256;
|
||||
|
||||
std::shared_ptr<td::KeyValue> kv_;
|
||||
|
||||
td::actor::ActorId<RootDb> root_db_;
|
||||
std::string db_path_;
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
||||
} // namespace ton
|
Loading…
Add table
Add a link
Reference in a new issue