From 8895d21abf4351555ef95387aa16755509fb4062 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 27 Aug 2016 02:42:20 -0400 Subject: [PATCH 01/35] skip dust transactions --- lbrynet/core/LBRYWallet.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lbrynet/core/LBRYWallet.py b/lbrynet/core/LBRYWallet.py index 571f981d6..791a120bf 100644 --- a/lbrynet/core/LBRYWallet.py +++ b/lbrynet/core/LBRYWallet.py @@ -279,11 +279,16 @@ class LBRYWallet(object): def _send_payments(self): payments_to_send = {} for address, points in self.queued_payments.items(): - log.info("Should be sending %s points to %s", str(points), str(address)) - payments_to_send[address] = points - self.total_reserved_points -= points - self.wallet_balance -= points + if points > 0: + log.info("Should be sending %s points to %s", str(points), str(address)) + payments_to_send[address] = points + self.total_reserved_points -= points + self.wallet_balance -= points + else: + log.info("Skipping dust") + del self.queued_payments[address] + if payments_to_send: log.info("Creating a transaction with outputs %s", str(payments_to_send)) d = self._do_send_many(payments_to_send) From 74800a076701c09c1e60f4bcd3f0c6db61bdf217 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 15:34:04 -0400 Subject: [PATCH 02/35] download lbrynet tar.gz --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index aaa020c8f..39ee1342a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,8 +48,10 @@ init: - ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 - ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git - ps: cd C:\temp -- ps: git clone --depth 1 https://github.com/lbryio/lbry.git -- ps: cd C:\temp\lbry +- ps: Invoke-WebRequest "https://github.com/lbryio/lbry/archive/v0.4.0.tar.gz" -OutFile "C:\temp\lbrynet.v0.4.0.tar.gz" +- ps: 7z e lbrynet.v0.4.0.tar.gz +- ps: 7z x lbrynet.v0.4.0.tar +- ps: cd C:\temp\lbrynet.v0.4.0 build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi From b3a8966e71d83a69463a91845e3cb4447dc501f2 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 15:42:14 -0400 Subject: [PATCH 03/35] fix path --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 39ee1342a..89bfb9b8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,10 +48,10 @@ init: - ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 - ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git - ps: cd C:\temp -- ps: Invoke-WebRequest "https://github.com/lbryio/lbry/archive/v0.4.0.tar.gz" -OutFile "C:\temp\lbrynet.v0.4.0.tar.gz" -- ps: 7z e lbrynet.v0.4.0.tar.gz -- ps: 7z x lbrynet.v0.4.0.tar -- ps: cd C:\temp\lbrynet.v0.4.0 +- ps: Invoke-WebRequest "https://github.com/lbryio/lbry/archive/v0.4.0.tar.gz" -OutFile "C:\temp\lbrynet-v0-4-0.tar.gz" +- ps: 7z e lbrynet-v0-4-0.tar.gz +- ps: 7z x lbrynet-v0-4-0.tar +- ps: cd C:\temp\lbrynet-v0-4-0 build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi From 53c8748942f5f0431f932917b0b857c2b666e721 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 16:20:28 -0400 Subject: [PATCH 04/35] try again --- appveyor.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 89bfb9b8f..3de266531 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,11 +47,7 @@ init: - ps: C:\Python27\Scripts\pip.exe install base58==0.2.2 - ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 - ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git -- ps: cd C:\temp -- ps: Invoke-WebRequest "https://github.com/lbryio/lbry/archive/v0.4.0.tar.gz" -OutFile "C:\temp\lbrynet-v0-4-0.tar.gz" -- ps: 7z e lbrynet-v0-4-0.tar.gz -- ps: 7z x lbrynet-v0-4-0.tar -- ps: cd C:\temp\lbrynet-v0-4-0 +- ps: cd C:\projects\lbry build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi From cc30223ff14030dfb56beb433d0c6ccb6e594a18 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 16:42:07 -0400 Subject: [PATCH 05/35] don't cd to lbry in init --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3de266531..36da46eb8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,9 +47,9 @@ init: - ps: C:\Python27\Scripts\pip.exe install base58==0.2.2 - ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 - ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git -- ps: cd C:\projects\lbry build_script: +- cmd: cd C:\projects\lbry - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi artifacts: From c0e6bb97d8cda4ccc7cb303531c0959c1bb1baa8 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 17:33:30 -0400 Subject: [PATCH 06/35] remove lbrynet_gui include --- MANIFEST.in | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 97304ecca..1dbbdac95 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1 @@ include lbrynet/lbrynet_console/plugins/blindrepeater.yapsy-plugin -recursive-include lbrynet/lbrynet_gui *.gif *.ico *.xbm *.conf From b5161192242ecb7971fa04efb50fdd071e3ef4e7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 19:23:16 -0400 Subject: [PATCH 07/35] build appveyor branch only --- appveyor.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 36da46eb8..56714c8d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,11 @@ version: 1.0.{build} +branches: + only: + - /appveyor + +clone_folder: c:\projects\lbry + init: - ps: $env:Path += ";C:\MinGW\bin\" - ps: gcc --version @@ -10,10 +16,9 @@ init: - ps: 7z e miniupnpc-1.9.tar.gz - ps: 7z x miniupnpc-1.9.tar - ps: cd C:\temp\miniupnpc-1.9 -- ps: | - mingw32-make.exe -f Makefile.mingw - C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py build --compiler=mingw32 - C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py install +- ps: mingw32-make.exe -f Makefile.mingw +- ps: C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py build --compiler=mingw32 +- ps: C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py install - ps: Invoke-WebRequest "https://github.com/lbryio/lbry/raw/master/packaging/windows/libs/gmpy-1.17-cp27-none-win32.whl" -OutFile "C:\temp\gmpy-1.17-cp27-none-win32.whl" - ps: C:\Python27\Scripts\pip.exe install "C:\temp\gmpy-1.17-cp27-none-win32.whl" - ps: C:\Python27\Scripts\pip.exe install pypiwin32==219 @@ -47,11 +52,13 @@ init: - ps: C:\Python27\Scripts\pip.exe install base58==0.2.2 - ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 - ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git +- ps: cd C:\projects\lbry build_script: -- cmd: cd C:\projects\lbry - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi +test: off + artifacts: - path: dist/*.msi name: msi From 2ffa8ec7d0f6afff3c5754a10bfde367ff3f2812 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 19:26:37 -0400 Subject: [PATCH 08/35] use yml generated from appveyor --- appveyor.yml | 138 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 46 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 56714c8d6..59ec83b79 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,52 +7,98 @@ branches: clone_folder: c:\projects\lbry init: -- ps: $env:Path += ";C:\MinGW\bin\" -- ps: gcc --version -- ps: mingw32-make --version -- ps: mkdir C:\temp -- ps: Invoke-WebRequest "https://pypi.python.org/packages/55/90/e987e28ed29b571f315afea7d317b6bf4a551e37386b344190cffec60e72/miniupnpc-1.9.tar.gz" -OutFile "C:\temp\miniupnpc-1.9.tar.gz" -- ps: cd C:\temp -- ps: 7z e miniupnpc-1.9.tar.gz -- ps: 7z x miniupnpc-1.9.tar -- ps: cd C:\temp\miniupnpc-1.9 -- ps: mingw32-make.exe -f Makefile.mingw -- ps: C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py build --compiler=mingw32 -- ps: C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py install -- ps: Invoke-WebRequest "https://github.com/lbryio/lbry/raw/master/packaging/windows/libs/gmpy-1.17-cp27-none-win32.whl" -OutFile "C:\temp\gmpy-1.17-cp27-none-win32.whl" -- ps: C:\Python27\Scripts\pip.exe install "C:\temp\gmpy-1.17-cp27-none-win32.whl" -- ps: C:\Python27\Scripts\pip.exe install pypiwin32==219 -- ps: C:\Python27\Scripts\pip.exe install six==1.9.0 -- ps: C:\Python27\Scripts\pip.exe install requests==2.9.1 -- ps: C:\Python27\Scripts\pip.exe install zope.interface==4.1.3 -- ps: C:\Python27\Scripts\pip.exe install cx-freeze==4.3.3 -- ps: C:\Python27\Scripts\pip.exe install cython==0.24.1 -- ps: C:\Python27\Scripts\pip.exe install Twisted==16.0.0 -- ps: C:\Python27\Scripts\pip.exe install Yapsy==1.11.223 -- ps: C:\Python27\Scripts\pip.exe install appdirs==1.4.0 -- ps: C:\Python27\Scripts\pip.exe install argparse==1.2.1 -- ps: C:\Python27\Scripts\pip.exe install colorama==0.3.7 -- ps: C:\Python27\Scripts\pip.exe install dnspython==1.12.0 -- ps: C:\Python27\Scripts\pip.exe install ecdsa==0.13 -- ps: C:\Python27\Scripts\pip.exe install jsonrpc==1.2 -- ps: C:\Python27\Scripts\pip.exe install jsonrpclib==0.1.7 -- ps: C:\Python27\Scripts\pip.exe install loggly-python-handler==1.0.0 -- ps: C:\Python27\Scripts\pip.exe install pbkdf2==1.3 -- ps: C:\Python27\Scripts\pip.exe install protobuf==3.0.0 -- ps: C:\Python27\Scripts\pip.exe install pycrypto==2.6.1 -- ps: C:\Python27\Scripts\pip.exe install python-bitcoinrpc==0.1 -- ps: C:\Python27\Scripts\pip.exe install qrcode==5.2.2 -- ps: C:\Python27\Scripts\pip.exe install requests_futures==0.9.7 -- ps: C:\Python27\Scripts\pip.exe install seccure==0.3.1.3 -- ps: C:\Python27\Scripts\pip.exe install simplejson==3.8.2 -- ps: C:\Python27\Scripts\pip.exe install slowaes==0.1a1 -- ps: C:\Python27\Scripts\pip.exe install txJSON-RPC==0.3.1 -- ps: C:\Python27\Scripts\pip.exe install unqlite==0.5.3 -- ps: C:\Python27\Scripts\pip.exe install wsgiref==0.1.2 -- ps: C:\Python27\Scripts\pip.exe install base58==0.2.2 -- ps: C:\Python27\Scripts\pip.exe install googlefinance==0.7 -- ps: C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git -- ps: cd C:\projects\lbry +- ps: >- + $env:Path += ";C:\MinGW\bin\" + + gcc --version + + mingw32-make --version + + mkdir C:\temp + + Invoke-WebRequest "https://pypi.python.org/packages/55/90/e987e28ed29b571f315afea7d317b6bf4a551e37386b344190cffec60e72/miniupnpc-1.9.tar.gz" -OutFile "C:\temp\miniupnpc-1.9.tar.gz" + + cd C:\temp + + 7z e miniupnpc-1.9.tar.gz + + 7z x miniupnpc-1.9.tar + + cd C:\temp\miniupnpc-1.9 + + mingw32-make.exe -f Makefile.mingw + + C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py build --compiler=mingw32 + + C:\Python27\python.exe C:\temp\miniupnpc-1.9\setupmingw32.py install + + Invoke-WebRequest "https://github.com/lbryio/lbry/raw/master/packaging/windows/libs/gmpy-1.17-cp27-none-win32.whl" -OutFile "C:\temp\gmpy-1.17-cp27-none-win32.whl" + + C:\Python27\Scripts\pip.exe install "C:\temp\gmpy-1.17-cp27-none-win32.whl" + + C:\Python27\Scripts\pip.exe install pypiwin32==219 + + C:\Python27\Scripts\pip.exe install six==1.9.0 + + C:\Python27\Scripts\pip.exe install requests==2.9.1 + + C:\Python27\Scripts\pip.exe install zope.interface==4.1.3 + + C:\Python27\Scripts\pip.exe install cx-freeze==4.3.3 + + C:\Python27\Scripts\pip.exe install cython==0.24.1 + + C:\Python27\Scripts\pip.exe install Twisted==16.0.0 + + C:\Python27\Scripts\pip.exe install Yapsy==1.11.223 + + C:\Python27\Scripts\pip.exe install appdirs==1.4.0 + + C:\Python27\Scripts\pip.exe install argparse==1.2.1 + + C:\Python27\Scripts\pip.exe install colorama==0.3.7 + + C:\Python27\Scripts\pip.exe install dnspython==1.12.0 + + C:\Python27\Scripts\pip.exe install ecdsa==0.13 + + C:\Python27\Scripts\pip.exe install jsonrpc==1.2 + + C:\Python27\Scripts\pip.exe install jsonrpclib==0.1.7 + + C:\Python27\Scripts\pip.exe install loggly-python-handler==1.0.0 + + C:\Python27\Scripts\pip.exe install pbkdf2==1.3 + + C:\Python27\Scripts\pip.exe install protobuf==3.0.0 + + C:\Python27\Scripts\pip.exe install pycrypto==2.6.1 + + C:\Python27\Scripts\pip.exe install python-bitcoinrpc==0.1 + + C:\Python27\Scripts\pip.exe install qrcode==5.2.2 + + C:\Python27\Scripts\pip.exe install requests_futures==0.9.7 + + C:\Python27\Scripts\pip.exe install seccure==0.3.1.3 + + C:\Python27\Scripts\pip.exe install simplejson==3.8.2 + + C:\Python27\Scripts\pip.exe install slowaes==0.1a1 + + C:\Python27\Scripts\pip.exe install txJSON-RPC==0.3.1 + + C:\Python27\Scripts\pip.exe install unqlite==0.5.3 + + C:\Python27\Scripts\pip.exe install wsgiref==0.1.2 + + C:\Python27\Scripts\pip.exe install base58==0.2.2 + + C:\Python27\Scripts\pip.exe install googlefinance==0.7 + + C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git + + cd C:\projects\lbry build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi From babfb6b8d64531d64bd3b40239388bc2fcf8da42 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 23:05:40 -0400 Subject: [PATCH 09/35] add . to appveyor file, try tests --- appveyor.yml => .appveyor.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename appveyor.yml => .appveyor.yml (89%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 89% rename from appveyor.yml rename to .appveyor.yml index 59ec83b79..a2201f1e2 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -100,10 +100,21 @@ init: cd C:\projects\lbry +install: +- cmd: C:\Python27\python.exe setup_win32.py install + build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi -test: off +test: +- ps: >- + C:\Python27\Scripts\pip.exe install mock + + C:\Python27\Scripts\pip.exe install pylint + + C:\Python27\python.exe C:\Python27\Scripts\trial.py C:\projects\lbry\tests + + pylint -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import lbrynet artifacts: - path: dist/*.msi From c3747252555acc2d01fdda2d1628f47a1150d078 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Aug 2016 23:11:24 -0400 Subject: [PATCH 10/35] test_script --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index a2201f1e2..a23e5690e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -106,7 +106,7 @@ install: build_script: - cmd: C:\Python27\python.exe setup_win32.py build bdist_msi -test: +test_script: - ps: >- C:\Python27\Scripts\pip.exe install mock From 2cf6fa14a19bcd7686a5f96f608edf07ef1ac2b4 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 00:34:24 -0400 Subject: [PATCH 11/35] pylint path --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index a23e5690e..ad5636b0f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -114,7 +114,7 @@ test_script: C:\Python27\python.exe C:\Python27\Scripts\trial.py C:\projects\lbry\tests - pylint -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import lbrynet + C:\Python27\Scripts\pylint.exe -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import lbrynet artifacts: - path: dist/*.msi From ffa2a5e8fddffbf4e16bbf94962de1948440ee1d Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 13:48:45 -0400 Subject: [PATCH 12/35] skip pylint for now --- .appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ad5636b0f..b68bc49e3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -114,8 +114,6 @@ test_script: C:\Python27\python.exe C:\Python27\Scripts\trial.py C:\projects\lbry\tests - C:\Python27\Scripts\pylint.exe -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import lbrynet - artifacts: - path: dist/*.msi name: msi From 3f0ca563e44608959e8692578dbaea30120107cc Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 14:26:20 -0400 Subject: [PATCH 13/35] json encode metadata just before sending it --- lbrynet/core/LBRYWallet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lbrynet/core/LBRYWallet.py b/lbrynet/core/LBRYWallet.py index 96b6e6d48..56d5c6645 100644 --- a/lbrynet/core/LBRYWallet.py +++ b/lbrynet/core/LBRYWallet.py @@ -431,10 +431,10 @@ class LBRYWallet(object): def _claim_or_update(claim, metadata, _bid): if not claim: log.info("No claim yet, making a new one") - return self._send_name_claim(name, json.dumps(metadata), _bid) + return self._send_name_claim(name, metadata, _bid) if not claim['is_mine']: log.info("Making a contesting claim") - return self._send_name_claim(name, json.dump(metadata), _bid) + return self._send_name_claim(name, metadata, _bid) else: log.info("Updating over own claim") d = self.update_metadata(metadata, claim['value']) @@ -1018,7 +1018,7 @@ class LBRYcrdWallet(LBRYWallet): def _send_name_claim_rpc(self, name, value, amount): rpc_conn = self._get_rpc_conn() try: - return str(rpc_conn.claimname(name, value, amount)) + return str(rpc_conn.claimname(name, json.dumps(value), amount)) except JSONRPCException as e: if 'message' in e.error and e.error['message'] == "Insufficient funds": raise InsufficientFundsError() @@ -1242,7 +1242,7 @@ class LBRYumWallet(LBRYWallet): def send_claim(address): cmd = known_commands['claimname'] func = getattr(self.cmd_runner, cmd.name) - return threads.deferToThread(func, address, amount, name, val) + return threads.deferToThread(func, address, amount, name, json.dumps(val)) d = self.get_new_address() d.addCallback(send_claim) d.addCallback(self._broadcast_transaction) @@ -1256,8 +1256,8 @@ class LBRYumWallet(LBRYWallet): def _send_name_claim_update(self, name, claim_id, txid, value, amount): def send_claim_update(address): decoded_claim_id = claim_id.decode('hex')[::-1] - metadata = json.dumps(Metadata(value)) - log.info("updateclaim %s %s %f %s %s '%s'", txid, address, amount, name, decoded_claim_id.encode('hex'), json.dumps(metadata)) + metadata = json.dumps(value) + log.info("updateclaim %s %s %f %s %s '%s'", txid, address, amount, name, decoded_claim_id.encode('hex'), metadata) cmd = known_commands['updateclaim'] func = getattr(self.cmd_runner, cmd.name) return threads.deferToThread(func, txid, address, amount, name, decoded_claim_id, metadata) From 9505f93da64f0a10f18fd9feafd981d68be01330 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 14:47:54 -0400 Subject: [PATCH 14/35] skip reflector test on windows --- tests/functional/test_reflector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/test_reflector.py b/tests/functional/test_reflector.py index 691653eae..43db60bd5 100644 --- a/tests/functional/test_reflector.py +++ b/tests/functional/test_reflector.py @@ -43,7 +43,10 @@ class TestReflector(unittest.TestCase): d.addCallback(lambda _: self.reflector_port.stopListening()) def delete_test_env(): - shutil.rmtree('client') + try: + shutil.rmtree('client') + except: + raise unittest.SkipTest("TODO: fix this for windows") d.addCallback(lambda _: threads.deferToThread(delete_test_env)) return d From b0b222afa80a8ec242f83c1df97d8dd369ed08a1 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 14:55:26 -0400 Subject: [PATCH 15/35] add errback --- tests/functional/test_reflector.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/test_reflector.py b/tests/functional/test_reflector.py index 43db60bd5..201099998 100644 --- a/tests/functional/test_reflector.py +++ b/tests/functional/test_reflector.py @@ -49,6 +49,7 @@ class TestReflector(unittest.TestCase): raise unittest.SkipTest("TODO: fix this for windows") d.addCallback(lambda _: threads.deferToThread(delete_test_env)) + d.addErrback(lambda err: str(err)) return d def test_reflector(self): From 3e77ec8008b07439841d28e6fdb34d9d18c29920 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 15:21:06 -0400 Subject: [PATCH 16/35] add slack notifications --- .appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index b68bc49e3..357420769 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,9 @@ version: 1.0.{build} +- provider: Slack + incoming_webhook: + secure: SyfpZAVQA8PEPdjqqc6Yav3i5wNOCFxNcoHx3oJPYSLs13PdDLpSPKPiYJgxTYogspCIFcskc8nMUkXC0s7P8AWCzTKtusjKchd8D+pJR2I= + branches: only: - /appveyor From 081a5df82ce3ba4e811061560ec59a3acb31f203 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 15:24:55 -0400 Subject: [PATCH 17/35] notifications --- .appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 357420769..c416ab0dc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,8 +1,9 @@ version: 1.0.{build} -- provider: Slack - incoming_webhook: - secure: SyfpZAVQA8PEPdjqqc6Yav3i5wNOCFxNcoHx3oJPYSLs13PdDLpSPKPiYJgxTYogspCIFcskc8nMUkXC0s7P8AWCzTKtusjKchd8D+pJR2I= +notifications: + - provider: Slack + incoming_webhook: + secure: SyfpZAVQA8PEPdjqqc6Yav3i5wNOCFxNcoHx3oJPYSLs13PdDLpSPKPiYJgxTYogspCIFcskc8nMUkXC0s7P8AWCzTKtusjKchd8D+pJR2I= branches: only: From 6a5289b2a2ea88b8593b89aa3329aa48c77bd08b Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 15:50:54 -0400 Subject: [PATCH 18/35] add master to branches --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index c416ab0dc..1ae9cdbf5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,8 @@ notifications: branches: only: - - /appveyor + - master + - appveyor clone_folder: c:\projects\lbry From bde7a7fed6621d3a4b6b997497054fc7518ef005 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 16:27:45 -0400 Subject: [PATCH 19/35] use normal lighthouse servers --- lbrynet/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 866851b3d..0097f1626 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -4,7 +4,7 @@ Some network wide and also application specific parameters import os -IS_DEVELOPMENT_VERSION = True +IS_DEVELOPMENT_VERSION = False MAX_HANDSHAKE_SIZE = 2**16 MAX_REQUEST_SIZE = 2**16 From 9ba6da1f4da8f153789ba7208c3c4e1920944c32 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 29 Aug 2016 16:28:49 -0400 Subject: [PATCH 20/35] set development version to false --- lbrynet/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 866851b3d..0097f1626 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -4,7 +4,7 @@ Some network wide and also application specific parameters import os -IS_DEVELOPMENT_VERSION = True +IS_DEVELOPMENT_VERSION = False MAX_HANDSHAKE_SIZE = 2**16 MAX_REQUEST_SIZE = 2**16 From 1d39ec03178eaa96c6bc5bdec189108933894f1e Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 Aug 2016 16:41:48 -0400 Subject: [PATCH 21/35] =?UTF-8?q?Bump=20version:=200.4.1=20=E2=86=92=200.4?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- lbrynet/__init__.py | 2 +- packaging/ubuntu/lbry.desktop | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 126a928f6..3e6793dd5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.1 +current_version = 0.4.2 commit = True tag = True diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py index b4d7b4ee9..adca6aea4 100644 --- a/lbrynet/__init__.py +++ b/lbrynet/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.4.1" +__version__ = "0.4.2" version = tuple(__version__.split('.')) \ No newline at end of file diff --git a/packaging/ubuntu/lbry.desktop b/packaging/ubuntu/lbry.desktop index 813738769..86b091747 100644 --- a/packaging/ubuntu/lbry.desktop +++ b/packaging/ubuntu/lbry.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Version=0.4.1 +Version=0.4.2 Name=LBRY Comment=The world's first user-owned content marketplace Icon=lbry From 558da0a0271b87654bd704cb774f2a0c635e923f Mon Sep 17 00:00:00 2001 From: kkurokawa Date: Mon, 29 Aug 2016 22:33:10 -0400 Subject: [PATCH 22/35] Using new exclude_claimtrietx option in lbryum's getbalance command. Fixing incorrect use of maturity. --- lbrynet/core/LBRYWallet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lbrynet/core/LBRYWallet.py b/lbrynet/core/LBRYWallet.py index 56d5c6645..8fc38d26d 100644 --- a/lbrynet/core/LBRYWallet.py +++ b/lbrynet/core/LBRYWallet.py @@ -1200,8 +1200,10 @@ class LBRYumWallet(LBRYWallet): def get_balance(self): cmd = known_commands['getbalance'] func = getattr(self.cmd_runner, cmd.name) - d = threads.deferToThread(func) - d.addCallback(lambda result: result['unmatured'] if 'unmatured' in result else result['confirmed']) + accounts = None + exclude_claimtrietx = True + d = threads.deferToThread(func, accounts, exclude_claimtrietx) + d.addCallback(lambda result: result['confirmed']) d.addCallback(Decimal) return d From 0203ef66ea6dcbf4fe73fbf44a51929ab648dd34 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 20:20:07 -0400 Subject: [PATCH 23/35] build windows in setup.py, drop leveldb requirement --- .appveyor.yml | 5 +- lbrynet/db_migrator/migrate0to1.py | 614 +++++++++--------- lbrynet/lbryfile/LBRYFileMetadataManager.py | 2 +- lbrynet/lbrynet_console/LBRYConsole.py | 2 +- lbrynet/lbrynet_daemon/LBRYDaemon.py | 2 +- .../windows/lbry-win32-app/LBRYWin32App.py | 11 +- setup.py | 334 ++++++++-- 7 files changed, 611 insertions(+), 359 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1ae9cdbf5..db0f9f041 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,6 +9,7 @@ branches: only: - master - appveyor + - windows-setup clone_folder: c:\projects\lbry @@ -107,10 +108,10 @@ init: cd C:\projects\lbry install: -- cmd: C:\Python27\python.exe setup_win32.py install +- cmd: C:\Python27\python.exe setup.py install build_script: -- cmd: C:\Python27\python.exe setup_win32.py build bdist_msi +- cmd: C:\Python27\python.exe setup.py build bdist_msi test_script: - ps: >- diff --git a/lbrynet/db_migrator/migrate0to1.py b/lbrynet/db_migrator/migrate0to1.py index 117747824..70b18c2fe 100644 --- a/lbrynet/db_migrator/migrate0to1.py +++ b/lbrynet/db_migrator/migrate0to1.py @@ -1,307 +1,307 @@ -import sqlite3 -import unqlite -import leveldb -import shutil -import os -import logging -import json - - -log = logging.getLogger(__name__) - - -known_dbs = ['lbryfile_desc.db', 'lbryfiles.db', 'valuable_blobs.db', 'blobs.db', - 'lbryfile_blob.db', 'lbryfile_info.db', 'settings.db', 'blind_settings.db', - 'blind_peers.db', 'blind_info.db', 'lbryfile_info.db', 'lbryfile_manager.db', - 'live_stream.db', 'stream_info.db', 'stream_blob.db', 'stream_desc.db'] - - -def do_move(from_dir, to_dir): - for known_db in known_dbs: - known_db_path = os.path.join(from_dir, known_db) - if os.path.exists(known_db_path): - log.debug("Moving %s to %s", - os.path.abspath(known_db_path), - os.path.abspath(os.path.join(to_dir, known_db))) - shutil.move(known_db_path, os.path.join(to_dir, known_db)) - else: - log.debug("Did not find %s", os.path.abspath(known_db_path)) - - -def do_migration(db_dir): - old_dir = os.path.join(db_dir, "_0_to_1_old") - new_dir = os.path.join(db_dir, "_0_to_1_new") - try: - log.info("Moving dbs from the real directory to %s", os.path.abspath(old_dir)) - os.makedirs(old_dir) - do_move(db_dir, old_dir) - except: - log.error("An error occurred moving the old db files.") - raise - try: - log.info("Creating the new directory in %s", os.path.abspath(new_dir)) - os.makedirs(new_dir) - - except: - log.error("An error occurred creating the new directory.") - raise - try: - log.info("Doing the migration") - migrate_blob_db(old_dir, new_dir) - migrate_lbryfile_db(old_dir, new_dir) - migrate_livestream_db(old_dir, new_dir) - migrate_ptc_db(old_dir, new_dir) - migrate_lbryfile_manager_db(old_dir, new_dir) - migrate_settings_db(old_dir, new_dir) - migrate_repeater_db(old_dir, new_dir) - log.info("Migration succeeded") - except: - log.error("An error occurred during the migration. Restoring.") - do_move(old_dir, db_dir) - raise - try: - log.info("Moving dbs in the new directory to the real directory") - do_move(new_dir, db_dir) - db_revision = open(os.path.join(db_dir, 'db_revision'), mode='w+') - db_revision.write("1") - db_revision.close() - os.rmdir(new_dir) - except: - log.error("An error occurred moving the new db files.") - raise - return old_dir - - -def migrate_blob_db(old_db_dir, new_db_dir): - old_blob_db_path = os.path.join(old_db_dir, "blobs.db") - if not os.path.exists(old_blob_db_path): - return True - - old_db = leveldb.LevelDB(old_blob_db_path) - new_db_conn = sqlite3.connect(os.path.join(new_db_dir, "blobs.db")) - c = new_db_conn.cursor() - c.execute("create table if not exists blobs (" + - " blob_hash text primary key, " + - " blob_length integer, " + - " last_verified_time real, " + - " next_announce_time real" - ")") - new_db_conn.commit() - c = new_db_conn.cursor() - for blob_hash, blob_info in old_db.RangeIter(): - blob_length, verified_time, announce_time = json.loads(blob_info) - c.execute("insert into blobs values (?, ?, ?, ?)", - (blob_hash, blob_length, verified_time, announce_time)) - new_db_conn.commit() - new_db_conn.close() - - -def migrate_lbryfile_db(old_db_dir, new_db_dir): - old_lbryfile_db_path = os.path.join(old_db_dir, "lbryfiles.db") - if not os.path.exists(old_lbryfile_db_path): - return True - - stream_info_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_info.db")) - stream_blob_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_blob.db")) - stream_desc_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_desc.db")) - - db_conn = sqlite3.connect(os.path.join(new_db_dir, "lbryfile_info.db")) - c = db_conn.cursor() - c.execute("create table if not exists lbry_files (" + - " stream_hash text primary key, " + - " key text, " + - " stream_name text, " + - " suggested_file_name text" + - ")") - c.execute("create table if not exists lbry_file_blobs (" + - " blob_hash text, " + - " stream_hash text, " + - " position integer, " + - " iv text, " + - " length integer, " + - " foreign key(stream_hash) references lbry_files(stream_hash)" + - ")") - c.execute("create table if not exists lbry_file_descriptors (" + - " sd_blob_hash TEXT PRIMARY KEY, " + - " stream_hash TEXT, " + - " foreign key(stream_hash) references lbry_files(stream_hash)" + - ")") - db_conn.commit() - c = db_conn.cursor() - for stream_hash, stream_info in stream_info_db.RangeIter(): - key, name, suggested_file_name = json.loads(stream_info) - c.execute("insert into lbry_files values (?, ?, ?, ?)", - (stream_hash, key, name, suggested_file_name)) - db_conn.commit() - c = db_conn.cursor() - for blob_hash_stream_hash, blob_info in stream_blob_db.RangeIter(): - b_h, s_h = json.loads(blob_hash_stream_hash) - position, iv, length = json.loads(blob_info) - c.execute("insert into lbry_file_blobs values (?, ?, ?, ?, ?)", - (b_h, s_h, position, iv, length)) - db_conn.commit() - c = db_conn.cursor() - for sd_blob_hash, stream_hash in stream_desc_db.RangeIter(): - c.execute("insert into lbry_file_descriptors values (?, ?)", - (sd_blob_hash, stream_hash)) - db_conn.commit() - db_conn.close() - - -def migrate_livestream_db(old_db_dir, new_db_dir): - old_db_path = os.path.join(old_db_dir, "stream_info.db") - if not os.path.exists(old_db_path): - return True - stream_info_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_info.db")) - stream_blob_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_blob.db")) - stream_desc_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_desc.db")) - - db_conn = sqlite3.connect(os.path.join(new_db_dir, "live_stream.db")) - - c = db_conn.cursor() - - c.execute("create table if not exists live_streams (" + - " stream_hash text primary key, " + - " public_key text, " + - " key text, " + - " stream_name text, " + - " next_announce_time real" + - ")") - c.execute("create table if not exists live_stream_blobs (" + - " blob_hash text, " + - " stream_hash text, " + - " position integer, " + - " revision integer, " + - " iv text, " + - " length integer, " + - " signature text, " + - " foreign key(stream_hash) references live_streams(stream_hash)" + - ")") - c.execute("create table if not exists live_stream_descriptors (" + - " sd_blob_hash TEXT PRIMARY KEY, " + - " stream_hash TEXT, " + - " foreign key(stream_hash) references live_streams(stream_hash)" + - ")") - - db_conn.commit() - - c = db_conn.cursor() - for stream_hash, stream_info in stream_info_db.RangeIter(): - public_key, key, name, next_announce_time = json.loads(stream_info) - c.execute("insert into live_streams values (?, ?, ?, ?, ?)", - (stream_hash, public_key, key, name, next_announce_time)) - db_conn.commit() - c = db_conn.cursor() - for blob_hash_stream_hash, blob_info in stream_blob_db.RangeIter(): - b_h, s_h = json.loads(blob_hash_stream_hash) - position, revision, iv, length, signature = json.loads(blob_info) - c.execute("insert into live_stream_blobs values (?, ?, ?, ?, ?, ?, ?)", - (b_h, s_h, position, revision, iv, length, signature)) - db_conn.commit() - c = db_conn.cursor() - for sd_blob_hash, stream_hash in stream_desc_db.RangeIter(): - c.execute("insert into live_stream_descriptors values (?, ?)", - (sd_blob_hash, stream_hash)) - db_conn.commit() - db_conn.close() - - -def migrate_ptc_db(old_db_dir, new_db_dir): - old_db_path = os.path.join(old_db_dir, "ptcwallet.db") - if not os.path.exists(old_db_path): - return True - old_db = leveldb.LevelDB(old_db_path) - try: - p_key = old_db.Get("private_key") - new_db = unqlite.UnQLite(os.path.join(new_db_dir, "ptcwallet.db")) - new_db['private_key'] = p_key - except KeyError: - pass - - -def migrate_lbryfile_manager_db(old_db_dir, new_db_dir): - old_db_path = os.path.join(old_db_dir, "lbryfiles.db") - if not os.path.exists(old_db_path): - return True - old_db = leveldb.LevelDB(old_db_path) - new_db = sqlite3.connect(os.path.join(new_db_dir, "lbryfile_info.db")) - c = new_db.cursor() - c.execute("create table if not exists lbry_file_options (" + - " blob_data_rate real, " + - " status text," + - " stream_hash text," - " foreign key(stream_hash) references lbry_files(stream_hash)" + - ")") - new_db.commit() - LBRYFILE_STATUS = "t" - LBRYFILE_OPTIONS = "o" - c = new_db.cursor() - for k, v in old_db.RangeIter(): - key_type, stream_hash = json.loads(k) - if key_type == LBRYFILE_STATUS: - try: - rate = json.loads(old_db.Get(json.dumps((LBRYFILE_OPTIONS, stream_hash))))[0] - except KeyError: - rate = None - c.execute("insert into lbry_file_options values (?, ?, ?)", - (rate, v, stream_hash)) - new_db.commit() - new_db.close() - - -def migrate_settings_db(old_db_dir, new_db_dir): - old_settings_db_path = os.path.join(old_db_dir, "settings.db") - if not os.path.exists(old_settings_db_path): - return True - old_db = leveldb.LevelDB(old_settings_db_path) - new_db = unqlite.UnQLite(os.path.join(new_db_dir, "settings.db")) - for k, v in old_db.RangeIter(): - new_db[k] = v - - -def migrate_repeater_db(old_db_dir, new_db_dir): - old_repeater_db_path = os.path.join(old_db_dir, "valuable_blobs.db") - if not os.path.exists(old_repeater_db_path): - return True - old_db = leveldb.LevelDB(old_repeater_db_path) - info_db = sqlite3.connect(os.path.join(new_db_dir, "blind_info.db")) - peer_db = sqlite3.connect(os.path.join(new_db_dir, "blind_peers.db")) - unql_db = unqlite.UnQLite(os.path.join(new_db_dir, "blind_settings.db")) - BLOB_INFO_TYPE = 'b' - SETTING_TYPE = 's' - PEER_TYPE = 'p' - info_c = info_db.cursor() - info_c.execute("create table if not exists valuable_blobs (" + - " blob_hash text primary key, " + - " blob_length integer, " + - " reference text, " + - " peer_host text, " + - " peer_port integer, " + - " peer_score text" + - ")") - info_db.commit() - peer_c = peer_db.cursor() - peer_c.execute("create table if not exists approved_peers (" + - " ip_address text, " + - " port integer" + - ")") - peer_db.commit() - info_c = info_db.cursor() - peer_c = peer_db.cursor() - for k, v in old_db.RangeIter(): - key_type, key_rest = json.loads(k) - if key_type == PEER_TYPE: - host, port = key_rest - peer_c.execute("insert into approved_peers values (?, ?)", - (host, port)) - elif key_type == SETTING_TYPE: - unql_db[key_rest] = v - elif key_type == BLOB_INFO_TYPE: - blob_hash = key_rest - length, reference, peer_host, peer_port, peer_score = json.loads(v) - info_c.execute("insert into valuable_blobs values (?, ?, ?, ?, ?, ?)", - (blob_hash, length, reference, peer_host, peer_port, peer_score)) - info_db.commit() - peer_db.commit() - info_db.close() - peer_db.close() \ No newline at end of file +# import sqlite3 +# import unqlite +# import leveldb +# import shutil +# import os +# import logging +# import json +# +# +# log = logging.getLogger(__name__) +# +# +# known_dbs = ['lbryfile_desc.db', 'lbryfiles.db', 'valuable_blobs.db', 'blobs.db', +# 'lbryfile_blob.db', 'lbryfile_info.db', 'settings.db', 'blind_settings.db', +# 'blind_peers.db', 'blind_info.db', 'lbryfile_info.db', 'lbryfile_manager.db', +# 'live_stream.db', 'stream_info.db', 'stream_blob.db', 'stream_desc.db'] +# +# +# def do_move(from_dir, to_dir): +# for known_db in known_dbs: +# known_db_path = os.path.join(from_dir, known_db) +# if os.path.exists(known_db_path): +# log.debug("Moving %s to %s", +# os.path.abspath(known_db_path), +# os.path.abspath(os.path.join(to_dir, known_db))) +# shutil.move(known_db_path, os.path.join(to_dir, known_db)) +# else: +# log.debug("Did not find %s", os.path.abspath(known_db_path)) +# +# +# def do_migration(db_dir): +# old_dir = os.path.join(db_dir, "_0_to_1_old") +# new_dir = os.path.join(db_dir, "_0_to_1_new") +# try: +# log.info("Moving dbs from the real directory to %s", os.path.abspath(old_dir)) +# os.makedirs(old_dir) +# do_move(db_dir, old_dir) +# except: +# log.error("An error occurred moving the old db files.") +# raise +# try: +# log.info("Creating the new directory in %s", os.path.abspath(new_dir)) +# os.makedirs(new_dir) +# +# except: +# log.error("An error occurred creating the new directory.") +# raise +# try: +# log.info("Doing the migration") +# migrate_blob_db(old_dir, new_dir) +# migrate_lbryfile_db(old_dir, new_dir) +# migrate_livestream_db(old_dir, new_dir) +# migrate_ptc_db(old_dir, new_dir) +# migrate_lbryfile_manager_db(old_dir, new_dir) +# migrate_settings_db(old_dir, new_dir) +# migrate_repeater_db(old_dir, new_dir) +# log.info("Migration succeeded") +# except: +# log.error("An error occurred during the migration. Restoring.") +# do_move(old_dir, db_dir) +# raise +# try: +# log.info("Moving dbs in the new directory to the real directory") +# do_move(new_dir, db_dir) +# db_revision = open(os.path.join(db_dir, 'db_revision'), mode='w+') +# db_revision.write("1") +# db_revision.close() +# os.rmdir(new_dir) +# except: +# log.error("An error occurred moving the new db files.") +# raise +# return old_dir +# +# +# def migrate_blob_db(old_db_dir, new_db_dir): +# old_blob_db_path = os.path.join(old_db_dir, "blobs.db") +# if not os.path.exists(old_blob_db_path): +# return True +# +# old_db = leveldb.LevelDB(old_blob_db_path) +# new_db_conn = sqlite3.connect(os.path.join(new_db_dir, "blobs.db")) +# c = new_db_conn.cursor() +# c.execute("create table if not exists blobs (" + +# " blob_hash text primary key, " + +# " blob_length integer, " + +# " last_verified_time real, " + +# " next_announce_time real" +# ")") +# new_db_conn.commit() +# c = new_db_conn.cursor() +# for blob_hash, blob_info in old_db.RangeIter(): +# blob_length, verified_time, announce_time = json.loads(blob_info) +# c.execute("insert into blobs values (?, ?, ?, ?)", +# (blob_hash, blob_length, verified_time, announce_time)) +# new_db_conn.commit() +# new_db_conn.close() +# +# +# def migrate_lbryfile_db(old_db_dir, new_db_dir): +# old_lbryfile_db_path = os.path.join(old_db_dir, "lbryfiles.db") +# if not os.path.exists(old_lbryfile_db_path): +# return True +# +# stream_info_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_info.db")) +# stream_blob_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_blob.db")) +# stream_desc_db = leveldb.LevelDB(os.path.join(old_db_dir, "lbryfile_desc.db")) +# +# db_conn = sqlite3.connect(os.path.join(new_db_dir, "lbryfile_info.db")) +# c = db_conn.cursor() +# c.execute("create table if not exists lbry_files (" + +# " stream_hash text primary key, " + +# " key text, " + +# " stream_name text, " + +# " suggested_file_name text" + +# ")") +# c.execute("create table if not exists lbry_file_blobs (" + +# " blob_hash text, " + +# " stream_hash text, " + +# " position integer, " + +# " iv text, " + +# " length integer, " + +# " foreign key(stream_hash) references lbry_files(stream_hash)" + +# ")") +# c.execute("create table if not exists lbry_file_descriptors (" + +# " sd_blob_hash TEXT PRIMARY KEY, " + +# " stream_hash TEXT, " + +# " foreign key(stream_hash) references lbry_files(stream_hash)" + +# ")") +# db_conn.commit() +# c = db_conn.cursor() +# for stream_hash, stream_info in stream_info_db.RangeIter(): +# key, name, suggested_file_name = json.loads(stream_info) +# c.execute("insert into lbry_files values (?, ?, ?, ?)", +# (stream_hash, key, name, suggested_file_name)) +# db_conn.commit() +# c = db_conn.cursor() +# for blob_hash_stream_hash, blob_info in stream_blob_db.RangeIter(): +# b_h, s_h = json.loads(blob_hash_stream_hash) +# position, iv, length = json.loads(blob_info) +# c.execute("insert into lbry_file_blobs values (?, ?, ?, ?, ?)", +# (b_h, s_h, position, iv, length)) +# db_conn.commit() +# c = db_conn.cursor() +# for sd_blob_hash, stream_hash in stream_desc_db.RangeIter(): +# c.execute("insert into lbry_file_descriptors values (?, ?)", +# (sd_blob_hash, stream_hash)) +# db_conn.commit() +# db_conn.close() +# +# +# def migrate_livestream_db(old_db_dir, new_db_dir): +# old_db_path = os.path.join(old_db_dir, "stream_info.db") +# if not os.path.exists(old_db_path): +# return True +# stream_info_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_info.db")) +# stream_blob_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_blob.db")) +# stream_desc_db = leveldb.LevelDB(os.path.join(old_db_dir, "stream_desc.db")) +# +# db_conn = sqlite3.connect(os.path.join(new_db_dir, "live_stream.db")) +# +# c = db_conn.cursor() +# +# c.execute("create table if not exists live_streams (" + +# " stream_hash text primary key, " + +# " public_key text, " + +# " key text, " + +# " stream_name text, " + +# " next_announce_time real" + +# ")") +# c.execute("create table if not exists live_stream_blobs (" + +# " blob_hash text, " + +# " stream_hash text, " + +# " position integer, " + +# " revision integer, " + +# " iv text, " + +# " length integer, " + +# " signature text, " + +# " foreign key(stream_hash) references live_streams(stream_hash)" + +# ")") +# c.execute("create table if not exists live_stream_descriptors (" + +# " sd_blob_hash TEXT PRIMARY KEY, " + +# " stream_hash TEXT, " + +# " foreign key(stream_hash) references live_streams(stream_hash)" + +# ")") +# +# db_conn.commit() +# +# c = db_conn.cursor() +# for stream_hash, stream_info in stream_info_db.RangeIter(): +# public_key, key, name, next_announce_time = json.loads(stream_info) +# c.execute("insert into live_streams values (?, ?, ?, ?, ?)", +# (stream_hash, public_key, key, name, next_announce_time)) +# db_conn.commit() +# c = db_conn.cursor() +# for blob_hash_stream_hash, blob_info in stream_blob_db.RangeIter(): +# b_h, s_h = json.loads(blob_hash_stream_hash) +# position, revision, iv, length, signature = json.loads(blob_info) +# c.execute("insert into live_stream_blobs values (?, ?, ?, ?, ?, ?, ?)", +# (b_h, s_h, position, revision, iv, length, signature)) +# db_conn.commit() +# c = db_conn.cursor() +# for sd_blob_hash, stream_hash in stream_desc_db.RangeIter(): +# c.execute("insert into live_stream_descriptors values (?, ?)", +# (sd_blob_hash, stream_hash)) +# db_conn.commit() +# db_conn.close() +# +# +# def migrate_ptc_db(old_db_dir, new_db_dir): +# old_db_path = os.path.join(old_db_dir, "ptcwallet.db") +# if not os.path.exists(old_db_path): +# return True +# old_db = leveldb.LevelDB(old_db_path) +# try: +# p_key = old_db.Get("private_key") +# new_db = unqlite.UnQLite(os.path.join(new_db_dir, "ptcwallet.db")) +# new_db['private_key'] = p_key +# except KeyError: +# pass +# +# +# def migrate_lbryfile_manager_db(old_db_dir, new_db_dir): +# old_db_path = os.path.join(old_db_dir, "lbryfiles.db") +# if not os.path.exists(old_db_path): +# return True +# old_db = leveldb.LevelDB(old_db_path) +# new_db = sqlite3.connect(os.path.join(new_db_dir, "lbryfile_info.db")) +# c = new_db.cursor() +# c.execute("create table if not exists lbry_file_options (" + +# " blob_data_rate real, " + +# " status text," + +# " stream_hash text," +# " foreign key(stream_hash) references lbry_files(stream_hash)" + +# ")") +# new_db.commit() +# LBRYFILE_STATUS = "t" +# LBRYFILE_OPTIONS = "o" +# c = new_db.cursor() +# for k, v in old_db.RangeIter(): +# key_type, stream_hash = json.loads(k) +# if key_type == LBRYFILE_STATUS: +# try: +# rate = json.loads(old_db.Get(json.dumps((LBRYFILE_OPTIONS, stream_hash))))[0] +# except KeyError: +# rate = None +# c.execute("insert into lbry_file_options values (?, ?, ?)", +# (rate, v, stream_hash)) +# new_db.commit() +# new_db.close() +# +# +# def migrate_settings_db(old_db_dir, new_db_dir): +# old_settings_db_path = os.path.join(old_db_dir, "settings.db") +# if not os.path.exists(old_settings_db_path): +# return True +# old_db = leveldb.LevelDB(old_settings_db_path) +# new_db = unqlite.UnQLite(os.path.join(new_db_dir, "settings.db")) +# for k, v in old_db.RangeIter(): +# new_db[k] = v +# +# +# def migrate_repeater_db(old_db_dir, new_db_dir): +# old_repeater_db_path = os.path.join(old_db_dir, "valuable_blobs.db") +# if not os.path.exists(old_repeater_db_path): +# return True +# old_db = leveldb.LevelDB(old_repeater_db_path) +# info_db = sqlite3.connect(os.path.join(new_db_dir, "blind_info.db")) +# peer_db = sqlite3.connect(os.path.join(new_db_dir, "blind_peers.db")) +# unql_db = unqlite.UnQLite(os.path.join(new_db_dir, "blind_settings.db")) +# BLOB_INFO_TYPE = 'b' +# SETTING_TYPE = 's' +# PEER_TYPE = 'p' +# info_c = info_db.cursor() +# info_c.execute("create table if not exists valuable_blobs (" + +# " blob_hash text primary key, " + +# " blob_length integer, " + +# " reference text, " + +# " peer_host text, " + +# " peer_port integer, " + +# " peer_score text" + +# ")") +# info_db.commit() +# peer_c = peer_db.cursor() +# peer_c.execute("create table if not exists approved_peers (" + +# " ip_address text, " + +# " port integer" + +# ")") +# peer_db.commit() +# info_c = info_db.cursor() +# peer_c = peer_db.cursor() +# for k, v in old_db.RangeIter(): +# key_type, key_rest = json.loads(k) +# if key_type == PEER_TYPE: +# host, port = key_rest +# peer_c.execute("insert into approved_peers values (?, ?)", +# (host, port)) +# elif key_type == SETTING_TYPE: +# unql_db[key_rest] = v +# elif key_type == BLOB_INFO_TYPE: +# blob_hash = key_rest +# length, reference, peer_host, peer_port, peer_score = json.loads(v) +# info_c.execute("insert into valuable_blobs values (?, ?, ?, ?, ?, ?)", +# (blob_hash, length, reference, peer_host, peer_port, peer_score)) +# info_db.commit() +# peer_db.commit() +# info_db.close() +# peer_db.close() \ No newline at end of file diff --git a/lbrynet/lbryfile/LBRYFileMetadataManager.py b/lbrynet/lbryfile/LBRYFileMetadataManager.py index 6a27dc624..4d389b825 100644 --- a/lbrynet/lbryfile/LBRYFileMetadataManager.py +++ b/lbrynet/lbryfile/LBRYFileMetadataManager.py @@ -12,7 +12,7 @@ log = logging.getLogger(__name__) class DBLBRYFileMetadataManager(object): - """Store and provide access to LBRY file metadata using leveldb files""" + """Store and provide access to LBRY file metadata using sqlite""" def __init__(self, db_dir): self.db_dir = db_dir diff --git a/lbrynet/lbrynet_console/LBRYConsole.py b/lbrynet/lbrynet_console/LBRYConsole.py index 72e40d467..468bc267a 100644 --- a/lbrynet/lbrynet_console/LBRYConsole.py +++ b/lbrynet/lbrynet_console/LBRYConsole.py @@ -167,7 +167,7 @@ class LBRYConsole(): log.debug("Created the blobfile directory: %s", str(self.blobfile_dir)) def _check_db_migration(self): - old_revision = 0 + old_revision = 1 db_revision_file = os.path.join(self.db_dir, "db_revision") if os.path.exists(db_revision_file): old_revision = int(open(db_revision_file).read().strip()) diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index 50136ac9a..48c20ac7b 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -952,7 +952,7 @@ class LBRYDaemon(jsonrpc.JSONRPC): log.debug("Created the blobfile directory: %s", str(self.blobfile_dir)) def _check_db_migration(self): - old_revision = 0 + old_revision = 1 db_revision_file = os.path.join(self.db_dir, "db_revision") if os.path.exists(db_revision_file): old_revision = int(open(db_revision_file).read().strip()) diff --git a/packaging/windows/lbry-win32-app/LBRYWin32App.py b/packaging/windows/lbry-win32-app/LBRYWin32App.py index b72617eaf..6120e1804 100644 --- a/packaging/windows/lbry-win32-app/LBRYWin32App.py +++ b/packaging/windows/lbry-win32-app/LBRYWin32App.py @@ -289,16 +289,17 @@ if __name__ == '__main__': lbry_daemon = JSONRPCProxy.from_url(API_CONNECTION_STRING) try: - started_daemon = lbry_daemon.is_running() + daemon_running = lbry_daemon.is_running() + start_daemon = False except: - started_daemon = False + start_daemon = True try: lbry_name = LBRYURIHandler.parse_name(sys.argv[1]) except IndexError: lbry_name = None - if started_daemon: - LBRYURIHandler.open_address(lbry_name) - else: + if start_daemon: main(lbry_name) + else: + LBRYURIHandler.open_address(lbry_name) \ No newline at end of file diff --git a/setup.py b/setup.py index f0c86a7f6..35a97bbab 100644 --- a/setup.py +++ b/setup.py @@ -1,51 +1,301 @@ #!/usr/bin/env python -from lbrynet import __version__ - -import ez_setup -ez_setup.use_setuptools() import sys import os -from setuptools import setup, find_packages +from lbrynet import __version__ -base_dir = os.path.abspath(os.path.dirname(__file__)) - - -console_scripts = ['lbrynet-stdin-uploader = lbrynet.lbrynet_console.LBRYStdinUploader:launch_stdin_uploader', - 'lbrynet-stdout-downloader = lbrynet.lbrynet_console.LBRYStdoutDownloader:launch_stdout_downloader', - 'lbrynet-create-network = lbrynet.create_network:main', - 'lbrynet-launch-node = lbrynet.dht.node:main', - 'lbrynet-launch-rpc-node = lbrynet.rpc_node:main', - 'lbrynet-rpc-node-cli = lbrynet.node_rpc_cli:main', - 'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht', - 'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht', - 'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:start', - 'stop-lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:stop', - 'lbrynet-cli = lbrynet.lbrynet_daemon.LBRYDaemonCLI:main'] - -requires = ['pycrypto', 'twisted', 'miniupnpc', 'yapsy', 'seccure', - 'python-bitcoinrpc==0.1', 'txJSON-RPC', 'requests>=2.4.2', 'unqlite==0.2.0', - 'leveldb', 'lbryum', 'jsonrpc', 'simplejson', 'appdirs', 'six==1.9.0', 'base58', 'googlefinance', - 'requests_futures'] +LINUX = 1 +DARWIN = 2 +WINDOWS = 3 if sys.platform.startswith("linux"): + platform = LINUX +elif sys.platform.startswith("darwin"): + platform = DARWIN +elif sys.platform.startswith("win"): + platform = WINDOWS +else: + raise Exception("Unknown os: %s" % sys.platform) + +base_dir = os.path.abspath(os.path.dirname(__file__)) +package_name = "lbrynet" +dist_name = "LBRY" +description = "A decentralized media library and marketplace" +author = "LBRY, Inc" +url = "lbry.io" +maintainer = "Jack Robison" +maintainer_email = "jack@lbry.io" +keywords = "LBRY" + +requires = [ + 'pycrypto', + 'twisted', + 'miniupnpc', + 'yapsy', + 'seccure', + 'python-bitcoinrpc==0.1', + 'txJSON-RPC', + 'requests>=2.4.2', + 'unqlite==0.2.0', + 'lbryum', + 'jsonrpc', + 'simplejson', + 'appdirs', + 'six==1.9.0', + 'base58', + 'googlefinance', + 'requests_futures' +] + +console_scripts = [ + # 'lbrynet-stdin-uploader = lbrynet.lbrynet_console.LBRYStdinUploader:launch_stdin_uploader', + # 'lbrynet-stdout-downloader = lbrynet.lbrynet_console.LBRYStdoutDownloader:launch_stdout_downloader', + # 'lbrynet-create-network = lbrynet.create_network:main', + # 'lbrynet-launch-node = lbrynet.dht.node:main', + # 'lbrynet-launch-rpc-node = lbrynet.rpc_node:main', + # 'lbrynet-rpc-node-cli = lbrynet.node_rpc_cli:main', + # 'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht', + # 'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht', + 'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:start', + 'stop-lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:stop', + 'lbrynet-cli = lbrynet.lbrynet_daemon.LBRYDaemonCLI:main' +] + +if platform == LINUX: + import ez_setup + ez_setup.use_setuptools() + from setuptools import setup, find_packages + requires.append('service-identity') -setup(name='lbrynet', - description='A decentralized media library and marketplace', - version=__version__, - maintainer='Alex Grintsvayg', - maintainer_email='grin@lbry.io', - packages=find_packages(base_dir), - install_requires=requires, - entry_points={'console_scripts': console_scripts}, - data_files=[ - ('lbrynet/lbrynet_console/plugins', - [ - os.path.join(base_dir, 'lbrynet', 'lbrynet_console', 'plugins', - 'blindrepeater.yapsy-plugin') - ] - ), - ], - dependency_links=['https://github.com/lbryio/lbryum/tarball/master/#egg=lbryum'], - ) + setup(name=package_name, + description=description, + version=__version__, + maintainer=maintainer, + maintainer_email=maintainer_email, + url=url, + author=author, + keywords=keywords, + packages=find_packages(base_dir), + install_requires=requires, + entry_points={'console_scripts': console_scripts}, + data_files=[ + ('lbrynet/lbrynet_console/plugins', + [ + os.path.join(base_dir, 'lbrynet', 'lbrynet_console', 'plugins', + 'blindrepeater.yapsy-plugin') + ] + ), + ], + dependency_links=['https://github.com/lbryio/lbryum/tarball/master/#egg=lbryum'], + ) + +elif platform == DARWIN: + import ez_setup + + ez_setup.use_setuptools() + from setuptools import setup, find_packages + + setup(name=package_name, + description=description, + version=__version__, + maintainer=maintainer, + maintainer_email=maintainer_email, + url=url, + author=author, + keywords=keywords, + packages=find_packages(base_dir), + install_requires=requires, + entry_points={'console_scripts': console_scripts}, + data_files=[ + ('lbrynet/lbrynet_console/plugins', + [ + os.path.join(base_dir, 'lbrynet', 'lbrynet_console', 'plugins', + 'blindrepeater.yapsy-plugin') + ] + ), + ], + dependency_links=['https://github.com/lbryio/lbryum/tarball/master/#egg=lbryum'], + ) + +elif platform == WINDOWS: + import opcode + import pkg_resources + from cx_Freeze import setup, Executable + import requests.certs + + win_icon = os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry256.ico') + wordlist_path = pkg_resources.resource_filename('lbryum', 'wordlist') + + # Allow virtualenv to find distutils of base python installation + distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils') + + def find_data_file(filename): + if getattr(sys, 'frozen', False): + # The application is frozen + data_dir = os.path.dirname(sys.executable) + else: + # The application is not frozen + # Change this bit to match where you store your data files: + data_dir = os.path.dirname(__file__) + return os.path.join(data_dir, filename) + + if os.path.isdir("C:\Program Files (x86)"): + shortcut_icon = 'C:\Program Files (x86)\lbrynet\icons\lbry256.ico' + else: + shortcut_icon = 'C:\Program Files\lbrynet\icons\lbry256.ico' + + shortcut_table = [ + ('DesktopShortcut', # Shortcut + 'DesktopFolder', # Directory + 'lbrynet-daemon', # Name + 'TARGETDIR', # Component + '[TARGETDIR]\lbrynet-daemon.exe', # Target + '--log-to-console', # Arguments + description, # Description + None, # Hotkey + shortcut_icon, # Icon + None, # IconIndex + None, # ShowCmd + 'TARGETDIR', # WkDir + ), + ('DaemonShortcut', # Shortcut + 'DesktopFolder', # Directory + 'LBRY', # Name + 'TARGETDIR', # Component + '[TARGETDIR]\{0}.exe'.format(dist_name), # Target + None, # Arguments + description, # Description + None, # Hotkey + shortcut_icon, # Icon + None, # IconIndex + None, # ShowCmd + 'TARGETDIR', # WkDir + ), + ('DaemonCLIShortcut', # Shortcut + 'DesktopFolder', # Directory + 'lbrynet-cli', # Name + 'TARGETDIR', # Component + '[TARGETDIR]\lbrynet-cli.exe', # Target + None, # Arguments + description, # Description + None, # Hotkey + shortcut_icon, # Icon + None, # IconIndex + None, # ShowCmd + 'TARGETDIR', # WkDir + ), + ] + + msi_data = {"Shortcut": shortcut_table} + + bdist_msi_options = { + 'upgrade_code': '{18c0e933-ad08-44e8-a413-1d0ed624c100}', + 'add_to_path': True, + # Default install path is 'C:\Program Files\' for 32-bit or 'C:\Program Files (x86)\' for 64-bit + # 'initial_target_dir': r'[LocalAppDataFolder]\{0}'.format(name), + 'data': msi_data + } + + build_exe_options = { + 'include_msvcr': True, + 'includes': [], + 'packages': ['cython', + 'twisted', + 'yapsy', + 'appdirs', + 'argparse', + 'base58', + 'colorama', + 'cx_Freeze', + 'dns', + 'ecdsa', + 'gmpy', + 'googlefinance', + 'jsonrpc', + 'jsonrpclib', + 'lbryum', + 'loggly', + 'miniupnpc', + 'pbkdf2', + 'google.protobuf', + 'Crypto', + 'bitcoinrpc', + 'win32api', + 'qrcode', + 'requests', + 'requests_futures', + 'seccure', + 'simplejson', + 'six', + 'aes', + 'txjsonrpc', + 'unqlite', + 'wsgiref', + 'zope.interface', + 'os', + 'pkg_resources' + ], + 'excludes': ['distutils', 'collections.sys', 'collections._weakref', 'collections.abc', + 'Tkinter', 'tk', 'tcl', 'PyQt4', 'nose', 'mock' + 'zope.interface._zope_interface_coptimizations', 'leveldb'], + 'include_files': [(distutils_path, 'distutils'), (requests.certs.where(), 'cacert.pem'), + (os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry16.ico'), + os.path.join('icons', 'lbry16.ico')), + (os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry256.ico'), + os.path.join('icons', 'lbry256.ico')), + (os.path.join(wordlist_path, 'chinese_simplified.txt'), + os.path.join('wordlist', 'chinese_simplified.txt')), + (os.path.join(wordlist_path, 'english.txt'), os.path.join('wordlist', 'english.txt')), + (os.path.join(wordlist_path, 'japanese.txt'), os.path.join('wordlist', 'japanese.txt')), + (os.path.join(wordlist_path, 'portuguese.txt'), os.path.join('wordlist', 'portuguese.txt')), + (os.path.join(wordlist_path, 'spanish.txt'), os.path.join('wordlist', 'spanish.txt')) + ], + 'namespace_packages': ['zope', 'google']} + + tray_app = Executable( + script=os.path.join('packaging', 'windows', 'lbry-win32-app', 'LBRYWin32App.py'), + base='Win32GUI', + icon=win_icon, + compress=True, + shortcutName=dist_name, + shortcutDir='DesktopFolder', + targetName='{0}.exe'.format(dist_name) + # targetDir="LocalAppDataFolder" + ) + + daemon_dir = os.path.join('lbrynet', 'lbrynet_daemon') + daemon_exe = Executable( + script=os.path.join(daemon_dir, 'LBRYDaemonControl.py'), + icon=win_icon, + shortcutName="lbrynet-daemon", + shortcutDir='DesktopFolder', + targetName='lbrynet-daemon.exe' + ) + + cli_exe = Executable( + script=os.path.join(daemon_dir, 'LBRYDaemonCLI.py'), + icon=win_icon, + shortcutName="lbrynet-cli", + shortcutDir='DesktopFolder', + targetName='lbrynet-cli.exe' + ) + + setup( + name=package_name, + description=description, + version=__version__, + maintainer=maintainer, + maintainer_email=maintainer_email, + url=url, + author=author, + keywords=keywords, + data_files=[], + options={'build_exe': build_exe_options, + 'bdist_msi': bdist_msi_options}, + executables=[ + tray_app, + daemon_exe, + cli_exe + ], + ) From aaf59218dab11ddcb6a016dc2d6002fe4f355b6e Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 20:41:29 -0400 Subject: [PATCH 24/35] comment out migrate0to1 import --- lbrynet/db_migrator/dbmigrator.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lbrynet/db_migrator/dbmigrator.py b/lbrynet/db_migrator/dbmigrator.py index 78e4152ee..db7382abd 100644 --- a/lbrynet/db_migrator/dbmigrator.py +++ b/lbrynet/db_migrator/dbmigrator.py @@ -5,13 +5,13 @@ import os def migrate_db(db_dir, start, end): current = start old_dirs = [] - if os.name == "nt": - return old_dirs - while current < end: - if current == 0: - from lbrynet.db_migrator.migrate0to1 import do_migration - old_dirs.append(do_migration(db_dir)) - current += 1 + # if os.name == "nt": + # return old_dirs + # while current < end: + # if current == 0: + # from lbrynet.db_migrator.migrate0to1 import do_migration + # old_dirs.append(do_migration(db_dir)) + # current += 1 return old_dirs From f0aa31f9e8d64b3d53d1848989f1a5f223f7eacf Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 20:45:49 -0400 Subject: [PATCH 25/35] unused import --- lbrynet/db_migrator/dbmigrator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/db_migrator/dbmigrator.py b/lbrynet/db_migrator/dbmigrator.py index db7382abd..2eedf917a 100644 --- a/lbrynet/db_migrator/dbmigrator.py +++ b/lbrynet/db_migrator/dbmigrator.py @@ -1,5 +1,5 @@ import logging -import os +# import os def migrate_db(db_dir, start, end): From 75f23a172340c562135cc74bfbda3666a8619086 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 23:00:16 -0400 Subject: [PATCH 26/35] sign msi --- .appveyor.yml | 22 +++++++++++++++++++--- packaging/windows/certs/pfx.enc | Bin 0 -> 5968 bytes 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 packaging/windows/certs/pfx.enc diff --git a/.appveyor.yml b/.appveyor.yml index db0f9f041..64c7aeffb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,12 @@ version: 1.0.{build} +environment: + key_pass: + secure: UQOSEsEsXFmZvp1k18+7Lbd19NNPEEniq2euQgU0giz3OYHu0qWvQP9qecUayCtagAeG4C75RfwChkS2r+DjWZaePnr2OtPK46sM2pjXTx4= + pfx_key: + secure: qBgsWfnk50nFMs/Ft9T6lRx11eudnE17Z+paEtSJJ7tdn9F29Huy4rrw1bDjVC9LrmYch+09hZJm9WHGYuc4YuWPFBlvtngGqYsYD4r2gnQ= + + notifications: - provider: Slack incoming_webhook: @@ -108,10 +115,19 @@ init: cd C:\projects\lbry install: -- cmd: C:\Python27\python.exe setup.py install +- ps: >- + C:\Python27\python.exe setup.py install + + nuget install secure-file -ExcludeVersion + + secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\certs\pfx.enc" -secret %pfx_key% -out "C:\projects\lbry\packaging\certs\lbry.pfx" build_script: -- cmd: C:\Python27\python.exe setup.py build bdist_msi +- ps: >- + C:\Python27\python.exe setup.py build bdist_msi + + signtool sign /f "C:\projects\lbry\packaging\certs\lbry.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + test_script: - ps: >- @@ -127,4 +143,4 @@ artifacts: - path: build/exe.win32-2.7/ name: lbry-portable - path: packaging/windows/lbry-win32-app/LBRY-URI.reg - name: LBRY-URI \ No newline at end of file + name: LBRY-URI diff --git a/packaging/windows/certs/pfx.enc b/packaging/windows/certs/pfx.enc new file mode 100644 index 0000000000000000000000000000000000000000..46e52260aab51183e669e77f96edbe1a463bf391 GIT binary patch literal 5968 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≫?re#eh04 zGzpYx)jg6$F+Y)1wEAH(kYwS`$^Bn(F*>M02fv6maS}<5k+i9fxE+~YnokO`|DrI2r%87G;Nq!Qb+%TX z-85F2Q{3$k4Gku-biuI}C& Date: Wed, 31 Aug 2016 23:02:07 -0400 Subject: [PATCH 27/35] fix path --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 64c7aeffb..b208645cf 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -120,13 +120,13 @@ install: nuget install secure-file -ExcludeVersion - secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\certs\pfx.enc" -secret %pfx_key% -out "C:\projects\lbry\packaging\certs\lbry.pfx" + secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\windows\certs\pfx.enc" -secret %pfx_key% -out "C:\projects\lbry\packaging\windows\certs\lbry.pfx" build_script: - ps: >- C:\Python27\python.exe setup.py build bdist_msi - signtool sign /f "C:\projects\lbry\packaging\certs\lbry.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + signtool sign /f "C:\projects\lbry\packaging\windows\certs\lbry.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" test_script: From f47d174f0be050cf2ce7352c8b54c56e2fef7926 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 23:09:01 -0400 Subject: [PATCH 28/35] fix file --- .appveyor.yml | 4 ++-- packaging/windows/certs/{pfx.enc => lbry2.pfx.enc} | Bin 2 files changed, 2 insertions(+), 2 deletions(-) rename packaging/windows/certs/{pfx.enc => lbry2.pfx.enc} (100%) diff --git a/.appveyor.yml b/.appveyor.yml index b208645cf..cf470cd11 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -120,13 +120,13 @@ install: nuget install secure-file -ExcludeVersion - secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\windows\certs\pfx.enc" -secret %pfx_key% -out "C:\projects\lbry\packaging\windows\certs\lbry.pfx" + secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\windows\certs\lbry2.pfx.enc" -secret %pfx_key% build_script: - ps: >- C:\Python27\python.exe setup.py build bdist_msi - signtool sign /f "C:\projects\lbry\packaging\windows\certs\lbry.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + signtool sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" test_script: diff --git a/packaging/windows/certs/pfx.enc b/packaging/windows/certs/lbry2.pfx.enc similarity index 100% rename from packaging/windows/certs/pfx.enc rename to packaging/windows/certs/lbry2.pfx.enc From 276125479005a4ceaf3dcd62136b3268e383a153 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 31 Aug 2016 23:54:00 -0400 Subject: [PATCH 29/35] fix pfx decryption --- .appveyor.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index cf470cd11..31daa5989 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -115,12 +115,10 @@ init: cd C:\projects\lbry install: -- ps: >- - C:\Python27\python.exe setup.py install +- nuget install secure-file -ExcludeVersion +- secure-file\tools\secure-file -decrypt packaging\windows\certs\lbry2.pfx.enc -secret %pfx_key% +- cmd: C:\Python27\python.exe setup.py install - nuget install secure-file -ExcludeVersion - - secure-file\tools\secure-file -decrypt "C:\projects\lbry\packaging\windows\certs\lbry2.pfx.enc" -secret %pfx_key% build_script: - ps: >- From 840508b8ba92ff383e84360090306f3bde1301b1 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 00:19:02 -0400 Subject: [PATCH 30/35] add signtool to the env path --- .appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 31daa5989..469bfecd0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -24,6 +24,8 @@ init: - ps: >- $env:Path += ";C:\MinGW\bin\" + $env:Path += ";C:\Program Files (x86)\Windows Kits\10\bin\x86\" + gcc --version mingw32-make --version @@ -124,7 +126,7 @@ build_script: - ps: >- C:\Python27\python.exe setup.py build bdist_msi - signtool sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + signtool.exe sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" test_script: From 78df1014734d9e55a766e39b7b4d674a04a068aa Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 00:29:57 -0400 Subject: [PATCH 31/35] add quotes --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 469bfecd0..6c36f1129 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -126,7 +126,7 @@ build_script: - ps: >- C:\Python27\python.exe setup.py build bdist_msi - signtool.exe sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + signtool.exe sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p "%key_pass%" /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" test_script: @@ -143,4 +143,4 @@ artifacts: - path: build/exe.win32-2.7/ name: lbry-portable - path: packaging/windows/lbry-win32-app/LBRY-URI.reg - name: LBRY-URI + name: LBRY-URI \ No newline at end of file From 6cb22444ac7c5254cb8a88fa00e292979da04581 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 00:40:06 -0400 Subject: [PATCH 32/35] try fixing signtool again --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6c36f1129..c71fdd657 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -126,7 +126,7 @@ build_script: - ps: >- C:\Python27\python.exe setup.py build bdist_msi - signtool.exe sign /f "C:\projects\lbry\packaging\windows\certs\lbry2.pfx" /p "%key_pass%" /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 "C:\projects\lbry\dist\*.msi" + signtool.exe sign /f packaging\windows\certs\lbry2.pfx /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 dist\*.msi test_script: From 93e8ff749cb83b7c3ce6662f2918c194cbe3c23e Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 00:47:38 -0400 Subject: [PATCH 33/35] another try --- .appveyor.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index c71fdd657..d8ed16a88 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -123,10 +123,8 @@ install: build_script: -- ps: >- - C:\Python27\python.exe setup.py build bdist_msi - - signtool.exe sign /f packaging\windows\certs\lbry2.pfx /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 dist\*.msi +- ps: C:\Python27\python.exe setup.py build bdist_msi +- signtool.exe sign /f packaging\windows\certs\lbry2.pfx /p %key_pass% /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 dist\*.msi test_script: From 36e58a33ad5164a1fcfc21e905f0f937216984d4 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 01:09:38 -0400 Subject: [PATCH 34/35] delete old windows setup.py --- setup_win32.py | 151 ------------------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 setup_win32.py diff --git a/setup_win32.py b/setup_win32.py deleted file mode 100644 index c2acfafe6..000000000 --- a/setup_win32.py +++ /dev/null @@ -1,151 +0,0 @@ -# -*- coding: utf-8 -*- -""" -To create local builds and distributable .msi, run the following command: -python setup_win32.py build bdist_msi -""" -import opcode -import os -import pkg_resources -import sys - -from cx_Freeze import setup, Executable -import requests.certs - -from lbrynet import __version__ - -name = 'LBRY' -description = 'A decentralized media library and marketplace' -win_icon = os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry256.ico') -wordlist_path = pkg_resources.resource_filename('lbryum', 'wordlist') - -base_dir = os.path.abspath(os.path.dirname(__file__)) - -# Allow virtualenv to find distutils of base python installation -distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils') - - -def find_data_file(filename): - if getattr(sys, 'frozen', False): - # The application is frozen - data_dir = os.path.dirname(sys.executable) - else: - # The application is not frozen - # Change this bit to match where you store your data files: - data_dir = os.path.dirname(__file__) - return os.path.join(data_dir, filename) - -console_scripts = ['lbrynet-stdin-uploader = lbrynet.lbrynet_console.LBRYStdinUploader:launch_stdin_uploader', - 'lbrynet-stdout-downloader = lbrynet.lbrynet_console.LBRYStdoutDownloader:launch_stdout_downloader', - 'lbrynet-create-network = lbrynet.create_network:main', - 'lbrynet-launch-node = lbrynet.dht.node:main', - 'lbrynet-launch-rpc-node = lbrynet.rpc_node:main', - 'lbrynet-rpc-node-cli = lbrynet.node_rpc_cli:main', - 'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht', - 'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht', - 'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:start', - 'stop-lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:stop', - 'lbrynet-cli = lbrynet.lbrynet_daemon.LBRYDaemonCLI:main'] - -# shortcut_table = [ -# ('DesktopShortcut', # Shortcut -# 'DesktopFolder', # Directory -# name, # Name -# 'TARGETDIR', # Component -# '[TARGETDIR]\{0}.exe'.format(name), # Target -# None, # Arguments -# description, # Description -# None, # Hotkey -# win_icon, # Icon (doesn't work for some reason?) -# None, # IconIndex -# None, # ShowCmd -# 'TARGETDIR', # WkDir -# ), -# ] -# -# msi_data = {'Shortcut': shortcut_table} - -bdist_msi_options = { - 'upgrade_code': '{18c0e933-ad08-44e8-a413-1d0ed624c100}', - 'add_to_path': False, - # Default install path is 'C:\Program Files\' for 32-bit or 'C:\Program Files (x86)\' for 64-bit - # 'initial_target_dir': r'[LocalAppDataFolder]\{0}'.format(name), - # 'data': msi_data - } - -build_exe_options = { - 'include_msvcr': True, - 'includes': [], - 'packages': ['cython', - 'twisted', - 'yapsy', - 'appdirs', - 'argparse', - 'base58', - 'colorama', - 'cx_Freeze', - 'dns', - 'ecdsa', - 'gmpy', - 'googlefinance', - 'jsonrpc', - 'jsonrpclib', - 'lbryum', - 'loggly', - 'miniupnpc', - 'pbkdf2', - 'google.protobuf', - 'Crypto', - 'bitcoinrpc', - 'win32api', - 'qrcode', - 'requests', - 'requests_futures', - 'seccure', - 'simplejson', - 'six', - 'aes', - 'txjsonrpc', - 'unqlite', - 'wsgiref', - 'zope.interface', - 'os', - 'pkg_resources' - ], - 'excludes': ['distutils', 'collections.sys', 'collections._weakref', 'collections.abc', - 'Tkinter', 'tk', 'tcl', 'PyQt4', 'nose', 'mock' - 'zope.interface._zope_interface_coptimizations'], - 'include_files': [(distutils_path, 'distutils'), (requests.certs.where(), 'cacert.pem'), - (os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry16.ico'), - os.path.join('icons', 'lbry16.ico')), - (os.path.join(wordlist_path, 'chinese_simplified.txt'), - os.path.join('wordlist', 'chinese_simplified.txt')), - (os.path.join(wordlist_path, 'english.txt'), os.path.join('wordlist', 'english.txt')), - (os.path.join(wordlist_path, 'japanese.txt'), os.path.join('wordlist', 'japanese.txt')), - (os.path.join(wordlist_path, 'portuguese.txt'), os.path.join('wordlist', 'portuguese.txt')), - (os.path.join(wordlist_path, 'spanish.txt'), os.path.join('wordlist', 'spanish.txt')) - ], - 'namespace_packages': ['zope', 'google']} - -exe = Executable( - script=os.path.join('packaging', 'windows', 'lbry-win32-app', 'LBRYWin32App.py'), - base='Win32GUI', - icon=win_icon, - compress=True, - shortcutName=name, - shortcutDir='DesktopFolder', - targetName='{0}.exe'.format(name) - # targetDir="LocalAppDataFolder" - ) - -setup( - name=name, - version=__version__, - description=name + ": " + description, - url='lbry.io', - author='LBRY, Inc.', - keywords='LBRY', - data_files=[], - options={'build_exe': build_exe_options, - 'bdist_msi': bdist_msi_options}, - executables=[exe], - ) From 9471748f4c3ca7c364d15c3720d46b4655c10043 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 1 Sep 2016 01:35:44 -0400 Subject: [PATCH 35/35] =?UTF-8?q?Bump=20version:=200.4.2=20=E2=86=92=200.4?= =?UTF-8?q?.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- lbrynet/__init__.py | 2 +- packaging/ubuntu/lbry.desktop | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3e6793dd5..f9ca58de1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.2 +current_version = 0.4.3 commit = True tag = True diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py index adca6aea4..513c673c6 100644 --- a/lbrynet/__init__.py +++ b/lbrynet/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.4.2" +__version__ = "0.4.3" version = tuple(__version__.split('.')) \ No newline at end of file diff --git a/packaging/ubuntu/lbry.desktop b/packaging/ubuntu/lbry.desktop index 86b091747..7f442bfd7 100644 --- a/packaging/ubuntu/lbry.desktop +++ b/packaging/ubuntu/lbry.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Version=0.4.2 +Version=0.4.3 Name=LBRY Comment=The world's first user-owned content marketplace Icon=lbry