mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add TON Storage to Proxy via storage gateway (#577)
* Access ton storage from proxy, resolve "dns_storage_address" in tonlib * Set storage gateway address in proxy args Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
ad736c6bc3
commit
7347ec0b3b
11 changed files with 171 additions and 73 deletions
|
@ -34,16 +34,16 @@ class DNSResolver : public td::actor::Actor {
|
|||
explicit DNSResolver(td::actor::ActorId<tonlib::TonlibClientWrapper> tonlib_client);
|
||||
|
||||
void start_up() override;
|
||||
void resolve(std::string host, td::Promise<ton::adnl::AdnlNodeIdShort> promise);
|
||||
void resolve(std::string host, td::Promise<std::string> promise);
|
||||
|
||||
private:
|
||||
void sync();
|
||||
void save_to_cache(std::string host, ton::adnl::AdnlNodeIdShort id);
|
||||
void save_to_cache(std::string host, std::string address);
|
||||
|
||||
td::actor::ActorId<tonlib::TonlibClientWrapper> tonlib_client_;
|
||||
|
||||
struct CacheEntry {
|
||||
ton::adnl::AdnlNodeIdShort id_;
|
||||
std::string address_;
|
||||
double created_at_;
|
||||
};
|
||||
std::map<std::string, CacheEntry> cache_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue