From cb069ca002d0ac687aa3b9abdecb7400f77bb643 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 22 Mar 2018 16:54:29 -0400 Subject: [PATCH] add blob_reflect --- CHANGELOG.md | 2 +- lbrynet/daemon/Daemon.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72dd4428c..80d5675dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ at anytime. * ### Added - * + * `blob_reflect` command to send specific blobs to a reflector server * ### Removed diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index c5e7d0e22..d83f0a118 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -3074,6 +3074,24 @@ class Daemon(AuthJSONRPCServer): response = yield self._render_response(blob_hashes_for_return) defer.returnValue(response) + def jsonrpc_blob_reflect(self, blob_hashes, reflector_server=None): + """ + Reflects specified blobs + + Usage: + blob_reflect (...) [--reflector_server=] + + Options: + --reflector_server= (str) : reflector address + + Returns: + (list) reflected blob hashes + """ + + d = reupload.reflect_blob_hashes(blob_hashes, self.session.blob_manager, reflector_server) + d.addCallback(lambda r: self._render_response(r)) + return d + def jsonrpc_blob_reflect_all(self): """ Reflects all saved blobs