1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

New liteserver config format

* Specify shards and seqno/utime/lt limits for liteservers in global config
* Support in lite-client, tonlib, blockchain-explorer
* Rework proxy-liteserver
This commit is contained in:
SpyCheese 2024-06-12 18:12:45 +03:00
parent 38ab70c037
commit 007f1fb1d7
26 changed files with 1187 additions and 1130 deletions

View file

@ -18,29 +18,24 @@
#include "td/actor/actor.h"
#include "ton/ton-types.h"
#include "adnl/adnl-ext-client.h"
#include "query-utils.hpp"
namespace liteclient {
class ExtClient : public td::actor::Actor {
public:
struct LiteServer {
ton::adnl::AdnlNodeIdFull adnl_id;
td::IPAddress address;
bool is_full = true;
std::vector<ton::ShardIdFull> shards;
};
class Callback {
public:
virtual ~Callback() {
}
virtual ~Callback() = default;
};
virtual void send_query(std::string name, td::BufferSlice data, ton::ShardIdFull shard, td::Timestamp timeout,
virtual void send_query(std::string name, td::BufferSlice data, td::Timestamp timeout,
td::Promise<td::BufferSlice> promise) = 0;
virtual void force_change_liteserver() = 0;
virtual void reset_servers() {
}
static td::actor::ActorOwn<ExtClient> create(ton::adnl::AdnlNodeIdFull dst, td::IPAddress dst_addr,
td::unique_ptr<Callback> callback);
static td::actor::ActorOwn<ExtClient> create(std::vector<LiteServer> servers, td::unique_ptr<Callback> callback);
static td::actor::ActorOwn<ExtClient> create(std::vector<LiteServerConfig> liteservers,
td::unique_ptr<Callback> callback);
};
} // namespace liteclient