Commit graph

502 commits

Author SHA1 Message Date
Kay Kurokawa 34f5bc93ae adding immediate announce option to hash announce 2017-02-13 17:27:10 -05:00
Kay Kurokawa 8e0f71ac74 Make hash reannounce time adjusted based on the queue of hashes yet to be announced, add test for DHTHashAnnouncer 2017-02-13 17:27:10 -05:00
Jack Robison 8859c1b0c1 fix claim_abandon 2017-02-13 15:14:54 -05:00
Jack Robison 5a1bab2eaa refactor Publisher and jsonrpc_publish
-add get_read_handle to file_utils

-don’t leave read handle hanging after creating lbry file

-get rid of threaded weirdness

-remove reflector functionality from Publisher

-fix updating with an existing stream

-reflect new stream in thread after broadcasting name claim
2017-02-13 13:07:27 -05:00
Kay Kurokawa 4f87e87d3e Adding connection manager tests, and modifying connection manager to be testeable, fix bug where failed connection was not marked as down 2017-02-13 12:17:27 -05:00
Jack Robison 630d0bf5be convert Wallet.claim_name to use inlineCallbacks 2017-02-09 10:13:41 -05:00
Jack Robison 19fe101d73 fix claim update
dict.update does not return the dict, so this can’t be lambda’d
2017-02-09 10:11:46 -05:00
jobevers 4bb3e2a154 remove is_lagging wallet attribute 2017-02-01 12:13:43 -08:00
jobevers ed227a239e Fixes #449
What was happening was the wallet claimed to be caught up before it
actually was and so the wallet’s local_height was still the value from
when lbry was last run, frequently more than 20 or 50 blocks
behind. _get_value_for_name uses the block at local_height as the
basis for the proof.  If _get_value_for_name is called during that
time between when the wallet claims to be caught up and it actually
is, the “Block too deep error” happens.  And since the discover page
of the UI does name resolution right away, the error basically happens
anytime somebody starts the app after not using it for a few hours.

This changes the startup behaviour of the wallet to
- use the `update` callback provided by lbryum
- check that local_height and network_height match before declaring
  that the wallet has caught up

For reference, the error is raised here:
1b896ae75b/src/rpc/claimtrie.cpp (L688)
2017-01-30 09:32:04 -08:00
jobevers 7360015fa4 small refactor 2017-01-30 09:32:04 -08:00
jobevers 04ee2f786d remove backslash line continuation 2017-01-30 09:32:04 -08:00
jobevers 43451c485f change alerts to logs 2017-01-30 09:32:04 -08:00
Umpei Kay Kurokawa 893fe8823e Merge pull request #409 from lbryio/fix_wallet_race_condition
Fix wallet balance interfaces
2017-01-26 15:12:54 -05:00
Kay Kurokawa 90438ddf9f removing str() from logging functions 2017-01-26 12:14:33 -05:00
Kay Kurokawa 08e336e476 adding better debug logs for ConnectionManager and ClientProtocol 2017-01-26 12:09:55 -05:00
Kay Kurokawa 0e864f5df1 Update interface for wallet balance 2017-01-26 11:41:27 -05:00
Alex Grintsvayg c88631d910 fix long lines 2017-01-25 17:00:21 -05:00
Alex Grintsvayg 897fba35df fix formatting, reenable pylint 2017-01-25 15:33:46 -05:00
Jack Robison 3b65f5962c disable verbose twisted logs 2017-01-25 13:04:02 -05:00
Job Evers‐Meltzer ec873129d5 Merge pull request #434 from lbryio/ensure-tmp-blobs-deleted
Bug fix: delete empty blobs
2017-01-24 11:55:13 -05:00
Job Evers‐Meltzer a90f413f94 Merge pull request #438 from lbryio/warn_large_wallet
Add warning for large wallet sizes
2017-01-24 11:54:53 -05:00
Kay Kurokawa ee84253b90 add warning for large wallet sizes 2017-01-23 18:55:20 -05:00
Job Evers‐Meltzer 06e45ee32a Merge pull request #410 from lbryio/reveal-open-refactor
Add open() API method and refactor/update reveal() API method (WIP)
2017-01-23 16:44:31 -05:00
Job Evers-Meltzer 7696f30009 add debug log to hash announcing 2017-01-21 22:48:16 -06:00
Job Evers-Meltzer c211d87164 Bug fix: delete empty blobs
When creating a CryptStream, the last blob is always empty. Previously, this
blob wouldn't be deleted and would instead just stick around in the blobfiles
directory.
2017-01-21 17:27:19 -06:00
Alex Liebowitz d3a63c38fc Fix pylint errors 2017-01-20 22:36:31 -05:00
Alex Liebowitz 8b68a752ed Add file_utils module 2017-01-20 22:29:27 -05:00
Job Evers-Meltzer 2c9c0da501 get_blob bug fix 2017-01-20 17:41:08 -06:00
Umpei Kay Kurokawa 60195ed6d4 Merge pull request #427 from lbryio/fix_new_address
Prevent excessive generation of new addresses
2017-01-20 17:14:21 -05:00
Job Evers-Meltzer 3e774fc158 missed another verified time check 2017-01-20 18:47:53 +00:00
Job Evers‐Meltzer 6c571b5227 Blob verification fixes (#428)
* Move the blob verification to the actual Blob object
 * remove the check on verification time
 * remove get_blob_length from BlobManager

Removed because I'm not sure what checking verification time against ctime gets us, except some protection against an accidental modification of the blob.
2017-01-20 10:54:36 -06:00
Kay Kurokawa 8628b127f7 do not create new addresses in lbryum, get unused ones 2017-01-18 20:48:23 -05:00
Job Evers-Meltzer 1a850b0256 log exception on callback failure 2017-01-17 20:01:04 -06:00
Alex Grin 17d9c0ab97 Merge pull request #417 from lbryio/refactor_settings
refactor conf.settings
2017-01-17 14:53:01 -05:00
Alex Grintsvayg 267c6cbaca refactor conf.settings 2017-01-16 22:32:54 -05:00
Kay Kurokawa 03b214a9d2 convert claim_out['fee'] to float 2017-01-16 15:36:37 -05:00
Job Evers‐Meltzer 2b2fa29db5 Merge pull request #395 from lbryio/fix_publish_output
Fix Daemon RPC command publish output
2017-01-13 14:02:23 -06:00
Job Evers‐Meltzer ddcfa7f97c Merge pull request #383 from lbryio/logging-improvements
Logging Improvements
2017-01-13 13:42:35 -06:00
Alex Grintsvayg 8277df1034 minor nits 2017-01-13 12:26:37 -05:00
Job Evers-Meltzer cb2bb6ee6b bug fix: properly stop ConnectionManager
It is possible (likely) that a manage call is in progress when
`stop` is called. When that happens, _manage will continue to
run, and schedule another call - and the manager won't actually stop,
and will likely cause an error as other components have been torn down.

This fix adds a deferred that gets created when a manage call starts
and is fired when its done.  At this points its safe to start the
stopping process.  Also add a check to not schedule another manage
call if we're stopped

This fixes https://app.asana.com/0/142330900434470/239832897034382
2017-01-13 08:24:06 -06:00
Job Evers-Meltzer 0bb62515a8 reorder functions to match call order 2017-01-13 08:24:06 -06:00
Job Evers-Meltzer f535d96929 switch stop to inlineCallback 2017-01-13 08:24:06 -06:00
Job Evers-Meltzer 15c5075d38 refactor closing peers 2017-01-13 08:24:06 -06:00
Job Evers-Meltzer 2449604844 fixup: bug fix for stopping downloads 2017-01-13 08:24:06 -06:00
Job Evers-Meltzer 6035a84675 bug fix for stopping downloads
deferredlist returns a tuple of (success, result) and the previous
code was looking at the entire tuple not the success values.
2017-01-13 08:24:05 -06:00
Job Evers-Meltzer 1b2c46e224 make _download_manager private 2017-01-13 08:19:23 -06:00
Job Evers‐Meltzer 61702ba1e4 Merge pull request #301 from lbryio/query-available-blobs
Query available blobs and Upload to Lighthouse Scripts
2017-01-12 08:42:08 -06:00
Alex Grintsvayg 5c429e15bd remove authjsonrpc subhandlers. we dont use them 2017-01-11 15:39:28 -05:00
Alex Grintsvayg 628defa891 remove extraneous ellipses in messages 2017-01-11 15:39:28 -05:00
Alex Grintsvayg 962edb8e4c rename api endpoints 2017-01-11 15:39:28 -05:00
Job Evers-Meltzer 5dbf9034ec Add scripts related to querying / downloading sd blobs 2017-01-11 12:05:34 -06:00
Job Evers‐Meltzer c393bd97e8 Merge pull request #388 from lbryio/hash-announce
ensure hash_announcer exists before announcing
2017-01-09 15:23:53 -06:00
Kay Kurokawa 9e7b69f4a0 fix publish output 2017-01-09 14:35:29 -05:00
Job Evers-Meltzer 68887d145f cleanup whitespace for increased readability 2017-01-06 08:04:18 -06:00
Job Evers-Meltzer f37808859f ensure hash_announcer exists before announcing 2017-01-06 08:00:22 -06:00
Job Evers abc122f77b Don't send log messages to loggly in dev mode 2017-01-03 22:17:44 -06:00
Job Evers 0ababb7f3b Route twisted logging messages to the python stdlib logger 2017-01-03 22:16:57 -06:00
Jack c2c7d2b327 send bug reports to slack 2017-01-02 14:52:24 -05:00
Job Evers-Meltzer a5c25ff887 Stop eating wallet connection error 2016-12-30 22:34:08 -06:00
Job Evers‐Meltzer 6936dbd588 Merge pull request #369 from lbryio/track-errors
track errors in analytics
2016-12-30 15:39:41 -06:00
Job Evers-Meltzer 123fda1844 track errors in analytics 2016-12-30 15:09:34 -06:00
Job Evers-Meltzer 669a567545 add id to link download events 2016-12-30 13:35:16 -06:00
Job Evers-Meltzer 0b53fde352 refactor connectionmanager to use inlineCallbacks 2016-12-30 13:28:34 -06:00
Job Evers-Meltzer 4eb10b56c1 small changes 2016-12-30 13:27:17 -06:00
Job Evers-Meltzer 1256beea96 remove blob_requester from DownloadManager 2016-12-30 13:27:16 -06:00
Job Evers-Meltzer 689ac431d3 bug fix in log.fail()
The value of the callback needs to be returned.  In particular,
this allows the error to be passed along.
2016-12-30 13:22:06 -06:00
Job Evers-Meltzer 39b2e44492 Replace settings with conf.settings
In the next commit I change conf.settings to be initialized
at runtime instead of load time and so any import of
`from lbrynet.conf import settings` will be and stay None if
it happens before the initialization.
2016-12-30 13:05:18 -06:00
Job Evers‐Meltzer 47f71fd363 Merge pull request #360 from lbryio/store-offer
Only store the offer explicitly when its sent
2016-12-30 12:15:06 -06:00
Job Evers‐Meltzer 4574e3317c Merge pull request #363 from lbryio/wallet-storage
Wallet storage
2016-12-30 11:41:38 -06:00
Kay Kurokawa 7d5dd1ff51 fix bug in ServerProtocol 2016-12-28 14:34:38 -05:00
Job Evers-Meltzer fc24d9b5aa pull out metadata storage from the wallet 2016-12-28 11:18:55 -06:00
Kay Kurokawa da366495b0 fixing get_value_for_name bug 2016-12-28 10:37:53 -05:00
Job Evers-Meltzer f7864e8cb7 Only store the offer explicitly when its sent
Ran into a situation where I was recieving an offer response without
something in protocol_offers. I think this was because
get_and_set_rate doesn't always populate that dictionary.

Worried that there still might be issues if the connection is
unreliable: if a response comes in twice it will error or
if a second offer is made without a response to the first
there will be an error.
2016-12-20 10:37:42 -08:00
Kay Kurokawa 1690e71ad1 setup Commands class on run, instead of on initialization 2016-12-19 19:15:59 -05:00
Kay Kurokawa 7d02e7d370 changing wallet initialization order 2016-12-19 19:15:50 -05:00
Jack 0044d6cf75 BlobAvailabilityTracker.sample bug, remove whitespace 2016-12-17 20:05:27 -05:00
Jack 5a76a03cb6 remove unqlite requirement
-conditionally import PTCWallet (needed for testing, requires unqlite)

-install unqlite on travis and appveyor
2016-12-17 20:03:35 -05:00
Job Evers‐Meltzer 3dde7af576 Merge pull request #339 from lbryio/all-prs
All The PRs
2016-12-15 19:42:35 -06:00
Job Evers-Meltzer 7af6e9e0dd Improve BlobAvailabilityTracker performance
For daemons with a lot of blobs, getting mean availabity
will be slow. Samples the blobs in an attempt at getting
better performance.
2016-12-15 19:03:37 -06:00
Job Evers-Meltzer 56d394fb5f Add timing to hash announcements
This could potentially be a performance issue
on reflector or any daemon with a large number of blobs.
2016-12-15 18:58:16 -06:00
Job Evers-Meltzer 3585d861ff Add TRACE level logging 2016-12-15 18:58:16 -06:00
Job Evers-Meltzer f181af8547 Cleanup code in BlobManager 2016-12-15 18:58:16 -06:00
Job Evers-Meltzer 781b915717 remove unused check_consistency function 2016-12-15 18:58:16 -06:00
Job Evers-Meltzer fec917b9c1 rename platform to system_info 2016-12-15 18:58:16 -06:00
Job Evers-Meltzer 4ca33505b5 logging: add kwargs to fail() call 2016-12-15 18:58:15 -06:00
Job Evers-Meltzer 20b6b22334 Add callback functionality to log.fail
This enables the common pattern of being able to log a failure and
then do something.
2016-12-15 18:58:15 -06:00
Job Evers-Meltzer b8c91c61bb Make a new logger with a fail method that is useful for errbacks.
Extracting useful tracebacks and line numbers from failures
withing twisted's deferred can be a pain. Hopefully this is a step
in the right direction.
2016-12-15 18:58:15 -06:00
Job Evers-Meltzer c30ea04959 Remove commented code
This is the result of running eradicate (https://github.com/myint/eradicate)
on the code and double-checking the changes.
2016-12-15 18:58:06 -06:00
Kay Kurokawa 23bf43f40c fixing bug where broadcast_transaction function would not return a deferred 2016-12-15 10:28:49 -05:00
Kay Kurokawa 6f60b8b827 work on resolving threading issues with lbryum in Wallet.py 2016-12-15 10:28:49 -05:00
Kay Kurokawa 965f8f1238 removing unused get_transaction function from daemon and wallet 2016-12-15 10:28:49 -05:00
Job Evers-Meltzer 7bce37a720 pylint: add check for missing-final-newline 2016-12-14 19:21:59 -06:00
Job Evers-Meltzer 14ac2bac39 pylint: fix trailing-whitespace 2016-12-14 19:21:59 -06:00
Job Evers-Meltzer f796f701f2 Immediately announce completed blobs
It doesn't seem necessary to wait up to 60 seconds for a new blob to
be announced to the dht. Immediately announce it and schedule the next
announce time as usual.
2016-12-14 19:05:24 -06:00
Kay Kurokawa bce41ddab4 Do not return 'success' and 'reason' as outputs in claim commands
We throw an Exception instead
2016-12-14 19:05:05 -06:00
Job Evers-Meltzer b64fa51567 fixup long lines 2016-12-07 09:38:34 -05:00
Jack Robison 9ad55e93b9 Merge pull request #315 from kaykurokawa/fix_claim_bug
Fix bug to exclude support in get_my_claim
2016-12-07 09:25:44 -05:00
Jack 8cb0f99e30 fix pylint errors 2016-12-06 12:22:43 -05:00
Umpei Kay Kurokawa 6076861cd0 Merge pull request #304 from kaykurokawa/remove_lbrycrd
Remove lbrycrdd
2016-12-06 12:06:09 -05:00
Kay Kurokawa 9c50cfdcdb fix bug in get_my_claim 2016-12-05 17:17:17 -05:00
Jack Robison 13d74d1f76 Merge pull request #297 from lbryio/better-name-error
Provide better feedback on why a name is invalid
2016-12-02 12:08:58 -05:00
Kay Kurokawa 200a22c93b Remove support for lbrycrdd wallet and related code 2016-12-01 16:45:48 -05:00
Job Evers-Meltzer f39a21cf7b Provide better feedback on why a name is invalid 2016-12-01 11:02:37 -06:00
Umpei Kay Kurokawa 67b169c5a1 Merge pull request #300 from kaykurokawa/fix_claim_defer
Missing the return of a defer.fail when claim fails, changing to raise Exception
2016-11-30 23:08:48 -05:00
Kay Kurokawa ff10546152 Missing the return of a defer.fail when claim fails, changing to raise Exception 2016-11-30 22:57:23 -05:00
Kay Kurokawa 360f4e50a0 converting some log.info to log.debug in Wallet 2016-11-30 16:37:28 -05:00
Job Evers‐Meltzer f11f486f5a Merge pull request #292 from lbryio/allow-rc
allow for rc in version values
2016-11-30 14:16:17 -06:00
Job Evers-Meltzer 6f2e2e727e fix pylint errors 2016-11-28 13:33:34 -06:00
Jack bfcd84a568 use nOut in addition with txid to identify claims 2016-11-25 16:59:23 -05:00
Job Evers-Meltzer 3d7dee1208 allow for rc in version values 2016-11-19 16:58:40 -06:00
Alex Grintsvayg 7ecc8103d8 improve error analytics
- move analytics creation earlier in the startup process
- add several events to track startup, startup failure, other errors
- abstract platform detection into separate file
- add "build" type to platform so we can differentiate devs vs live users
2016-11-15 10:31:35 -05:00
Job Evers‐Meltzer 5b7f80487f Merge pull request #271 from lbryio/log-lbryum-on-verbose
enable lbryum info logging when verbose
2016-11-15 08:47:51 -06:00
Job Evers-Meltzer 9940327b9a enable lbryum info logging when verbose 2016-11-14 20:34:56 -06:00
Job Evers-Meltzer 85dee27c92 whitespace 2016-11-14 19:33:36 -06:00
Jack e1cdbdc91d fix coveralls error 2016-11-14 14:02:19 -05:00
Jack Robison 763fefb33f Merge pull request #256 from kaykurokawa/fix_get_my_claim
Update right after making claim will fail due to get_my_claim()
2016-11-14 13:37:54 -05:00
Job Evers-Meltzer 3b34bddf0a more logging on startup 2016-11-11 10:14:41 -06:00
Kay Kurokawa 11b36ff4c8 fixing to remove supports from get_my_claim 2016-11-10 12:52:35 -05:00
Kay Kurokawa 1f06339d5a fix get_my_claim command 2016-11-09 15:19:58 -05:00
Umpei Kay Kurokawa 28bf5215e4 Merge pull request #251 from kaykurokawa/fix_unknonwname_exc
fixing UnknownNameError exception initialization
2016-11-09 12:37:03 -05:00
Job Evers-Meltzer 61a354fa60 add bad-whitespace check to pylint 2016-11-09 11:27:07 -06:00
Job Evers‐Meltzer 66745b0820 Merge pull request #242 from lbryio/shutdown-issues
Shutdown issues
2016-11-09 08:17:13 -06:00
Kay Kurokawa 4ad6405f35 fixing UnknownNameError exception initialization 2016-11-08 14:28:17 -05:00
Job Evers-Meltzer 43b2cd1433 cleanup whitespace and long-lines 2016-11-04 11:44:50 -05:00
Job Evers-Meltzer 59c4593bf4 whitespace 2016-11-03 14:42:57 -05:00
Job Evers-Meltzer 5bccfdb244 add logging to shutdown process 2016-11-03 14:42:45 -05:00
Job Evers-Meltzer 10cb20d08f fix whitespace and long-lines 2016-11-03 14:22:16 -05:00
Job Evers‐Meltzer 269dc47b69 Merge pull request #230 from kaykurokawa/better_stream_info_error
Better error detection in Wallet for invalid streams
2016-11-02 07:13:48 -05:00
kkurokawa 7dd5e7ceeb spacing after comma fix, use Exception init in InvalidStreamInfoError 2016-11-01 16:35:44 -04:00
Job Evers‐Meltzer c88e4aecf5 Merge pull request #232 from lbryio/read-config
Read config
2016-11-01 11:33:17 -05:00
Job Evers-Meltzer 30533a7986 Read config file in windows and osx
Also moves the config loading to BEFORE the log configuration
2016-11-01 11:14:04 -05:00
kkurokawa 39b47bc569 better error detection in _get_stream_info_from_value 2016-11-01 10:34:08 -04:00
kkurokawa e9bab33e2a fixing claim updates 2016-10-31 19:17:37 -04:00
Job Evers-Meltzer 9ca80a7cf7 set lbryum to log at warning level
lbryum is very chatty at the info level. As a rough estimate a bit
over half of our logs in loggly are a result of lbrum.

The better, long-term, solution would be to modify lbryum to move more
logs to the debug level.
2016-10-30 16:47:37 -05:00
Job Evers-Meltzer 353ede26b8 Log error when resolve name fails 2016-10-28 16:03:58 -05:00
Job Evers-Meltzer 6fa624ec8a switch LogUploader to use an already encoded lbryid 2016-10-28 15:44:24 -05:00
Job Evers-Meltzer 6f9ec2fa66 remove repeated log code 2016-10-28 15:43:04 -05:00
Job Evers-Meltzer 40437e4a82 log cleanup 2016-10-28 15:43:04 -05:00
Job Evers-Meltzer 2ee6fac014 redo logging configuration for lbrynet-daemon script 2016-10-28 15:43:04 -05:00
Job Evers-Meltzer 862055a6de move settings into conf file 2016-10-27 14:31:27 -05:00
Job Evers-Meltzer 2cd6c644a0 Merge remote-tracking branch 'origin/master' into refactor-settings
Conflicts:
	lbrynet/lbrynet_daemon/Daemon.py
	lbrynet/lbrynet_daemon/DaemonControl.py
	lbrynet/lbrynet_daemon/DaemonServer.py
2016-10-27 10:34:48 -05:00
Job Evers-Meltzer 0edacbe4c8 Merge remote-tracking branch 'origin/master' into refactor-settings
Conflicts:
	lbrynet/conf.py
	lbrynet/lbrynet_daemon/Daemon.py
	lbrynet/lbrynet_daemon/DaemonCLI.py
	lbrynet/lbrynet_daemon/UIManager.py
	tests/functional/test_misc.py
2016-10-27 10:18:56 -05:00
Job Evers-Meltzer 5d45345398 shutdown if there are errors during setup 2016-10-26 17:39:43 -05:00
Jack 1951ea09cd updates from master, more refactoring
-lbrynet.lbrynet_daemon.auth.client.LBRYAPIClient.config will detect if
it needs to return the auth/non-auth version
2016-10-26 03:16:33 -04:00
Job Evers-Meltzer 4d391e7429 Use better json formatting
Apply json.dumps at the end of the formatting process instead of the
middle.  This allows for proper escaping of quotes and allows for
actual json to be emitted.
2016-10-25 17:49:35 -05:00
Job Evers-Meltzer 0c2265a8da replace some strings 2016-10-20 11:30:38 -07:00
Job Evers-Meltzer 01811621a6 shorten is_valid_blobhash logic 2016-10-20 11:29:58 -07:00
Job Evers-Meltzer ddb88eb1c9 move LoopingCallManager to own module 2016-10-20 11:29:58 -07:00
Job Evers-Meltzer d5f0001950 small cleanups 2016-10-20 11:29:15 -07:00
Job Evers-Meltzer 3a91896d8a track the amount of data uploaded 2016-10-20 11:28:05 -07:00