Skip to content

Commit 360ef54

Browse files
EmelyanenkoKSpyCheese
andauthoredDec 22, 2022
TON Storage utilities (ton-blockchain#564)
* Rename chunk to piece in MerkleTree for consistency * Refactor PeerManager * Make PeerState thread-safe * Download torrent by hash * First version of storage daemon * Download torrents partially * Improve storing and loading torrent state in DB * Rewrite MerkleTree * "Remove torrent" in storage daemon * Process errors, fix bugs in storage * Move TonlibClientWrapper from rldp-http-proxy to tonlib * Initial version of storage provider * Move interaction with contracts to smc-util * Improve TonlibClientWrapper interface * Various improvements in storage provider * Fix TorrentCreator.cpp * Improve interface for partial download * Client mode in storage-daemon * Improve interface of storage-daemon-cli * Fix calculating speed, show peers in storage-daemon * Use permanent adnl id in storage daemon * Fix sending large "storage.addUpdate" messages * Improve printing torrents in cli * Update tlo * Fix RldpSender::on_ack * Update storage provider * Add "address" parameter to get-provider-params * Allow client to close storage contract * Limit torrent description * Add more logs to storage provider * smc.forget tonlib method * Use smc.forget in storage daemon * Optimize sending messages in smc-util.cpp * Fix verbosity, remove excessive logs * Json output in storage-daemon-cli * Update storage provider contracts * Fix rldp2 acks * Change verbosity of logs in rldp2 * Update help and output of commands and in storage-daemon-cli Co-authored-by: SpyCheese <[email protected]>
1 parent 434dc48 commit 360ef54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8857
-1133
lines changed
 

‎overlay/overlay-manager.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,20 @@ void OverlayManager::delete_overlay(adnl::AdnlNodeIdShort local_id, OverlayIdSho
9090
}
9191

9292
void OverlayManager::create_public_overlay(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,
93-
std::unique_ptr<Callback> callback, OverlayPrivacyRules rules, td::string scope) {
93+
std::unique_ptr<Callback> callback, OverlayPrivacyRules rules,
94+
td::string scope) {
95+
create_public_overlay_ex(local_id, std::move(overlay_id), std::move(callback), std::move(rules), std::move(scope),
96+
true);
97+
}
98+
99+
void OverlayManager::create_public_overlay_ex(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,
100+
std::unique_ptr<Callback> callback, OverlayPrivacyRules rules,
101+
td::string scope, bool announce_self) {
94102
CHECK(!dht_node_.empty());
95103
auto id = overlay_id.compute_short_id();
96104
register_overlay(local_id, id,
97105
Overlay::create(keyring_, adnl_, actor_id(this), dht_node_, local_id, std::move(overlay_id),
98-
std::move(callback), std::move(rules), scope));
106+
std::move(callback), std::move(rules), scope, announce_self));
99107
}
100108

101109
void OverlayManager::create_private_overlay(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,

‎overlay/overlay-manager.h

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class OverlayManager : public Overlays {
5252

5353
void create_public_overlay(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,
5454
std::unique_ptr<Callback> callback, OverlayPrivacyRules rules, td::string scope) override;
55+
void create_public_overlay_ex(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,
56+
std::unique_ptr<Callback> callback, OverlayPrivacyRules rules, td::string scope,
57+
bool announce_self) override;
5558
void create_private_overlay(adnl::AdnlNodeIdShort local_id, OverlayIdFull overlay_id,
5659
std::vector<adnl::AdnlNodeIdShort> nodes, std::unique_ptr<Callback> callback,
5760
OverlayPrivacyRules rules) override;

0 commit comments

Comments
 (0)