Compare commits

...
Author SHA1 Message Date
Victor Shyba abfe0be81e do a reatriable call so the service doesnt die 2020-02-21 17:26:31 -03:00
Victor Shyba 820b7a6753 check its broadcasted 2020-02-21 17:26:04 -03:00
Victor Shyba 8bb6f328dc use the stream controller tx instead of local history 2020-02-21 16:41:23 -03:00
Jack Robison 7f03b13579 v0.60.1 2020-02-21 14:14:15 -05:00
Jack Robison 09008ea991 Merge pull request #2824 from lbryio/skip_wallet_server_payment
max wallet server payment fee defaults to 0 and component doesnt start when its not a positive value
2020-02-21 13:27:58 -05:00
Jack Robison ee234212e6 Merge branch 'master' into skip_wallet_server_payment 2020-02-21 13:26:38 -05:00
Jack Robison 277b243f52 Merge pull request #2772 from lbryio/reflector-status
Add `is_fully_reflected` to `file_list` response
2020-02-21 13:21:36 -05:00
Jack Robison 0973ac753f add is_fully_reflected to file_list response 2020-02-21 12:49:19 -05:00
Victor Shyba f41cfbfb97 max wallet server payment fee defaults to 0 and component doesnt start in that case 2020-02-21 14:47:09 -03:00
Lex Berezhny a70980c81a reverting v0.60.1 release 2020-02-21 12:43:43 -05:00
Lex Berezhny 12a962f656 Merge pull request #2822 from lbryio/stream_controller_payment
use stream controller and documented errors for wallet server payments
2020-02-21 12:34:07 -05:00
Lex Berezhny 5936444f3e more reliable wait for wallet server payment test 2020-02-21 12:18:44 -05:00
Lex Berezhny c7d42f00c6 shorten error message for ServerPaymentFeeAboveMaxAllowed 2020-02-21 10:16:56 -05:00
Lex Berezhny b1318a9958 minor cleanup 2020-02-21 10:05:46 -05:00
Victor Shyba d2560d260c use stream controller and documented errors 2020-02-21 00:04:37 -03:00
Jack Robison f40a61cf9a v0.60.1 2020-02-20 17:56:54 -05:00
Jack Robison e0623578bf Merge pull request #2821 from lbryio/ffmpeg-find
add `ffmpeg_find` api to check ffmpeg installation status, don't recheck for ffmpeg in `status`
2020-02-20 17:48:36 -05:00
Jack Robison ead8daaa14 doc 2020-02-20 17:27:18 -05:00
Jack Robison 23b4b9e230 add ffmpeg_find api, don't recheck for it in status 2020-02-20 16:43:41 -05:00
Jack Robison 947017e334 Merge pull request #2820 from lbryio/disconnect-on-oversized
disconnect from client sending message larger than MAX_RECEIVE
2020-02-20 16:24:26 -05:00
Jack Robison 7fd0d6507f disconnect from client sending message larger than MAX_RECEIVE 2020-02-20 16:08:21 -05:00
Jack Robison ad1e9ef086 Merge pull request #2819 from lbryio/max-receive
add MAX_RECEIVE setting to wallet server
2020-02-20 14:38:11 -05:00
Jack Robison 2f1d08e417 add MAX_RECEIVE wallet server setting 2020-02-20 14:11:16 -05:00
Lex Berezhny 55f4eb80ba Merge pull request #2815 from lbryio/apply_share_usage_data_live
apply share_usage_data as its set, without restarting
2020-02-20 13:35:47 -05:00
Victor Shyba 7c160ff65e remove unused parameters 2020-02-20 14:38:13 -03:00
Victor Shyba fc5d5faaed use conf directly isntead of lambda 2020-02-20 14:27:39 -03:00
Victor Shyba 5394f1763c simplify external ip logic 2020-02-20 12:12:40 -03:00
Victor Shyba 050b67c9d6 apply share_usage_data as its set 2020-02-20 12:12:40 -03:00
Lex Berezhny 4b87cb45ee Merge pull request #2707 from lbryio/pay_wallet_servers
wallet servers requiring a daily fee will automatically get paid by client
2020-02-18 17:40:23 -05:00
Victor Shyba f0e1db319c make wallet server payments a component 2020-02-18 19:18:30 -03:00
Victor Shyba 3950715237 add max_wallet_server_fee conf to limit daily wallet server payments 2020-02-18 18:10:58 -03:00
Victor Shyba ae9ba14b59 use both donation and payment addresses separately 2020-02-18 18:10:58 -03:00
Victor Shyba ad6c6fbe35 fixes from review and add analytics 2020-02-18 18:10:58 -03:00
Victor Shyba ffa5c20c88 fix hanging test 2020-02-18 18:10:58 -03:00
Victor Shyba 5a6218eeca improve tests, fix types 2020-02-18 18:10:58 -03:00
Victor Shyba 200531dd96 wait for tx instead 2020-02-18 18:10:58 -03:00
Victor Shyba 15a2f048ac pay wallet server test and initial prototype 2020-02-18 18:10:58 -03:00
Victor Shyba d317a4042c change daily_fee to be lbc instead of dewies 2020-02-18 18:10:58 -03:00
Victor Shyba c2d717aba5 old code from #2683 2020-02-18 18:10:58 -03:00
Lex Berezhny ef74777df1 v0.60.0 2020-02-17 17:52:11 -05:00
Lex Berezhny f6dbf99fb5 Merge pull request #2811 from lbryio/index_fixes
wallet server indexes
2020-02-17 17:43:55 -05:00
Lex Berezhny 0b2d9e15b4 added order bys for fee_amount 2020-02-17 17:24:48 -05:00
Lex Berezhny d14e5e75e8 all three order bys for duration filter 2020-02-17 17:24:48 -05:00
Lex Berezhny df11ef34d2 index cleanup 2020-02-17 17:24:48 -05:00
Lex Berezhny 4fc619262c replacing indexes on trending_global, trending_mixed to be trending_group, trending_mixed 2020-02-17 17:24:48 -05:00
Lex Berezhny 2750eee86d Merge pull request #2810 from lbryio/no_default_order_by
removed default `order_by` for `claim_search`
2020-02-17 17:04:41 -05:00
Lex Berezhny 71cb03345b removed default order_by for claim_search 2020-02-17 16:26:29 -05:00
Lex Berezhny 22c8ca6c40 Merge pull request #2806 from lbryio/privacyDefault
change default privacy setting
2020-02-17 16:21:34 -05:00
Victor Shyba 237a8965eb fix tests 2020-02-17 18:00:23 -03:00
jessop 7d872c7863 change default privacy setting 2020-02-13 18:56:11 -05:00
Jack Robison 0d08858dfb v0.59.2 2020-02-13 17:22:21 -05:00
Jack Robison 5c6d63c93d Merge pull request #2803 from lbryio/fix-2802
fix claim apis failing with --resolve if no claims are present
2020-02-13 15:15:56 -05:00
Jack Robison c8c10d2bb0 fix claim apis failing with --resolve if no claims are present
fixes https://github.com/lbryio/lbry-sdk/issues/2802
2020-02-13 14:58:51 -05:00
Jack Robison f4d3e9ea6a add development wallet server deploy script 2020-02-13 13:54:46 -05:00
Jack Robison 3713d3488d Merge pull request #2800 from lbryio/fix-2746
Fix race condition setting/clearing the claim_search and resolve cache
2020-02-13 11:39:27 -05:00
Jack Robison 9b46d03c91 fix race between setting items in and clearing the resolve/claim_search cache 2020-02-13 11:17:21 -05:00
Jack Robison fe4e738580 Merge pull request #2798 from lbryio/repost-index
Add sqlite index for reposted claims
2020-02-13 10:33:36 -05:00
Jack Robison 205b0c4263 call get_platform only once 2020-02-13 10:04:50 -05:00
Jack Robison 78eef25f1a add reposted_claim_hash index
fixes https://github.com/lbryio/lbry-sdk/issues/2782
2020-02-12 17:39:57 -05:00
Lex Berezhny c9305fd070 Merge pull request #2796 from lbryio/xenial_build
linux build of LBRY SDK for Ubuntu 16.04 Xenial
2020-02-12 14:28:41 -05:00
Lex Berezhny 20774280b9 Merge pull request #2790 from lbryio/sql_in_for_single_value
SQL generation fix to handle IN operation for one value lists
2020-02-12 14:27:36 -05:00
Lex Berezhny 74bd2557af linux build of LBRY SDK for Ubuntu 16.05 Xenial 2020-02-12 14:20:06 -05:00
Lex Berezhny 605fc8ecd8 claim_search by --claim_type=repost support 2020-02-12 11:51:35 -05:00
Lex Berezhny 6b745c53dc make sure SQL IN works with python set 2020-02-12 11:41:32 -05:00
Lex Berezhny 98c60b38fc disable too-many-nested-blocks lint rule 2020-02-12 10:47:40 -05:00
Lex Berezhny be4515ec9a use sets for __in constraint values 2020-02-12 10:39:25 -05:00
Lex Berezhny dcb1b64696 SQL generation fix to handle IN operation for one value lists 2020-02-12 10:31:27 -05:00
Jack Robison 1190a60c7a v0.59.1 2020-02-11 16:56:37 -05:00
Jack Robison 82ecf207c6 Merge pull request #2789 from lbryio/update-default-servers
update default wallet servers
2020-02-11 16:36:31 -05:00
Jack Robison 84c7f1bf58 update test 2020-02-11 16:13:55 -05:00
Jack Robison 5ac453fe07 update default wallet servers 2020-02-11 13:51:15 -05:00
Lex Berezhny c2f39d653d v0.59.0 2020-02-10 12:08:24 -05:00
Lex Berezhny 748178f536 Merge pull request #2780 from lbryio/release_current
manually incremented version and added support to release script to r…
2020-02-09 20:41:00 -05:00
Lex Berezhny ffbef69dc7 manually incremented version and added support to release script to release current version 2020-02-09 20:26:15 -05:00
Lex Berezhny 3757124323 Merge pull request #2771 from lbryio/update_url_regex
update url regex to include missing cases
2020-02-09 18:17:35 -05:00
Victor Shyba e65f214b3c fix test using space in name 2020-02-09 17:55:29 -05:00
Victor Shyba f14004e56b update url regex to cases tom reported 2020-02-09 17:55:29 -05:00
Lex Berezhny dadc004dd6 Merge pull request #2765 from eggplantbren/master
fixed some issues with AR trending
2020-02-09 17:53:27 -05:00
Brendon J. Brewer 3697d9e1f0 Tweaked some parameters, back to 134 2020-02-09 17:38:34 -05:00
Brendon J. Brewer 94524f7330 lint 2020-02-09 17:38:34 -05:00
Brendon J. Brewer 17d8a3e5d6 Use claim_hash not claim_id 2020-02-09 17:38:24 -05:00
Brendon J. Brewer 39996d7612 Only create file during install if logging is turned on 2020-02-09 17:37:55 -05:00
Lex Berezhny 601ee4320f Merge pull request #2768 from mkroman/master
update cffi to v1.13.2
2020-02-09 17:35:06 -05:00
Mikkel Kroman 6e4f6fa92d Update cffi to v1.13.2
This fixes compilation issues for CPython 3.8+
2020-02-09 17:19:53 -05:00
Lex Berezhny b7103c29dd Merge pull request #2773 from lbryio/fix_video_analysis_error
fix video analysis error
2020-02-09 17:19:23 -05:00
Brannon King e53209e5ae handle early lbrycrd exit in tests 2020-02-09 17:02:16 -05:00
Brannon King 501fbd3114 handle strange file metadata 2020-02-09 17:02:16 -05:00
Lex Berezhny 5626f43e2b Merge pull request #2779 from lbryio/github_actions
build community PRs using GitHub Actions
2020-02-09 16:49:40 -05:00
Lex Berezhny 0185cb48fb run lint and tests in parallel 2020-02-09 16:34:04 -05:00
Lex Berezhny 9a49eb06da fix import path in test_transcoding.py 2020-02-09 16:15:20 -05:00
Lex Berezhny 3fbc012231 moved blockchain/test_transcoding.py -> other/test_transcoding.py 2020-02-09 16:15:20 -05:00
Lex Berezhny 3938cf33d8 take github actions for a spin 2020-02-09 16:15:04 -05:00
Lex Berezhny 38b3d0c87c Merge pull request #2777 from lbryio/claim_list_multi_type
`claim_list` argument `--claim_type` can now be repeated to pass a list of claim_types
2020-02-08 23:34:34 -05:00
Lex Berezhny 15a2fa6199 claim_list --claim_type argument can be repeated 2020-02-08 23:34:04 -05:00
Lex Berezhny e834209d40 Merge pull request #2776 from lbryio/resolve_includes_censoring_channels_url
`resolve` results which are censored now include full details of channel which did the censoring
2020-02-08 23:32:44 -05:00
Lex Berezhny 9607d21828 censored searches/resolves include metadata of channel which did the censoring 2020-02-07 18:50:29 -05:00
Lex Berezhny 6fbbf36143 pylint 2020-02-07 18:44:30 -05:00
Lex Berezhny db25f3282e lbry.error: save arguments on self and support for functions around arguments 2020-02-07 18:25:06 -05:00
Jack Robison ceb92838e7 v0.58.2 2020-02-06 11:37:09 -05:00
Jack Robison afb98f2cfc Merge pull request #2770 from lbryio/disable-save-content-claim
Add `save_resolved_claims` config setting for better performance when not using file_x commands
2020-02-06 11:32:49 -05:00
Jack Robison ed785fb087 add save_resolved_claims config setting to disable saving claims upon resolving them 2020-02-06 11:27:26 -05:00
Jack Robison 3921180d77 v0.58.1 2020-02-04 15:12:55 -05:00
Jack Robison ef36e0311e Merge pull request #2764 from lbryio/version-analytics
Add version tracking to prometheus metrics
2020-02-04 12:44:30 -05:00
Jack Robison bf4cbe1204 add version to session count metric 2020-02-04 12:18:32 -05:00
Jack Robison 28eee4da25 add version metrics to prometheus 2020-02-04 10:52:08 -05:00
Jack Robison 933ccf6deb add block updates to prometheus 2020-02-04 10:26:22 -05:00
Jack Robison 9ac41322e5 add cpu count to prometheus 2020-02-04 10:25:40 -05:00
Jack Robison c3233e03ef Merge pull request #2762 from lbryio/fix-2368
cancel reflector uploads upon file delete
2020-02-03 23:51:12 -05:00
Jack Robison 111871bb28 update test 2020-02-03 23:00:45 -05:00
Jack Robison bf5b5f43e3 non blocking analytics 2020-02-03 23:00:45 -05:00
Jack Robison 2ed8ebff09 handle ConnectionError and ValueError in blob sendfile 2020-02-03 23:00:45 -05:00
Jack Robison 34eb856d09 cancel reflector uploads upon file delete
-remove unnecessary db call in stream_update
2020-02-03 23:00:45 -05:00
Lex Berezhny 2d644bdfb0 v0.58.0 2020-02-03 22:33:03 -05:00
Lex Berezhny 741e5cf103 regenerated api docs 2020-02-03 22:30:39 -05:00
Lex Berezhny d745c04fe6 Merge pull request #2726 from lbryio/add_video_transcoding
added video file validation and optimization when publishing streams (using `--validate_file` and `--optimize_file` arguments)
2020-02-03 22:29:15 -05:00
Lex Berezhny 3a3c63956a removed unnecessary try/finally 2020-02-03 22:06:15 -05:00
Lex Berezhny 153bdf576a removed wheel from setup.py 2020-02-03 22:05:47 -05:00
Lex Berezhny 6525ee6510 moved __init__ to top of class 2020-02-03 22:05:23 -05:00
Brannon King 1780ddd329 added ffmpeg status, addressed items from code review
linter
2020-02-03 21:53:42 -05:00
Brannon King 85ad972ca8 return string instead of path object for compatibility with hachoir 2020-02-03 21:53:42 -05:00
Brannon King a90b60799a Fixed check_video.py on Windows
using a cross-platform workaround


fixed proactor use in the SDK


fixed linter
2020-02-03 21:53:42 -05:00
Brannon King 47e8f74da9 changed to list append, relative claim test 2020-02-03 21:53:42 -05:00
Brannon King fac28072ab added unit tests, other minor fixes
added universe


try again


try 4
2020-02-03 21:53:42 -05:00
Brannon King ab77541f36 in progress on video transcoding
works


Fixing lint tests


remove eval
2020-02-03 21:53:42 -05:00
Lex Berezhny 9eb769f340 Merge pull request #2760 from lbryio/channel_hash_wallet_server_idx
added database index for several `channel_hash` based queries
2020-02-03 20:56:48 -05:00
Lex Berezhny 1e81d6f848 added database index for various channel_hash based queries 2020-02-03 20:28:39 -05:00
Jack Robison dc393f4b77 Merge pull request #2761 from lbryio/catch-notification-timeout
catch TimeoutError when attempting to send notifications
2020-02-03 19:03:07 -05:00
Jack Robison dd1de530c3 catch TimeoutError when attempting to send notifications 2020-02-03 18:46:17 -05:00
Lex Berezhny 74cd887249 v0.57.0 2020-02-03 13:41:33 -05:00
Lex Berezhny b40bb35652 change MINIMUM_REQUIRED on client for servers it connects to 2020-02-03 13:41:05 -05:00
Lex Berezhny dfe257af86 Revert "test to make sure next release tests pass"
This reverts commit ebb2a09107.
2020-02-03 13:39:36 -05:00
Lex Berezhny ebb2a09107 test to make sure next release tests pass 2020-02-03 13:22:33 -05:00
Lex Berezhny c157909b4e Merge pull request #2758 from ykris45/patch-6
update copyright year in license
2020-02-02 20:19:33 -05:00
YULIUS KURNIAWAN KRISTIANTO a744239b22 update year 2020-02-03 04:04:51 +07:00
Lex Berezhny 9b4417be87 Merge pull request #2757 from lbryio/resolve_for_local_list
added `--resolve` to local `claim_list`/`stream_list`/`channel_list` commands which returns more metadata for local claims
2020-02-01 18:15:35 -05:00
Lex Berezhny 84f807e278 regenerate docs 2020-02-01 17:59:57 -05:00
Lex Berezhny 448635a945 added --resolve to local *_list commands 2020-02-01 17:59:10 -05:00
Lex Berezhny 638e3e6b3d Merge pull request #2756 from lbryio/blocked_resolve
resolve errors make distinction between truely not found claims and claims which were censored by wallet server
2020-02-01 14:00:37 -05:00
Lex Berezhny bfe711bd42 fixing tests 2020-02-01 13:29:55 -05:00
Lex Berezhny d5eed91e7f fix sql unit tests 2020-02-01 13:03:39 -05:00
Lex Berezhny 15abf49211 censored resolve responses return appropriate error 2020-02-01 12:53:39 -05:00
Lex Berezhny b7eec0586c added ResolveCensoredError 2020-02-01 12:49:01 -05:00
Lex Berezhny e639124a69 Merge pull request #2755 from eggplantbren/master
fixed initialization problem with ar trending algorithm
2020-01-30 13:44:25 -05:00
Brendon J. Brewer 22bca7a16e Length zero could also just mean there aren't any claims 2020-01-31 07:34:43 +13:00
Lex Berezhny 6f66b354e5 Merge pull request #2754 from lbryio/feat-claim_search_duration
add duration to claim search params
2020-01-29 16:43:34 -05:00
jessop f98e3320ae make review changes 2020-01-29 16:25:04 -05:00
jessop 73c958222b add duration to claim search params 2020-01-29 15:46:47 -05:00
Lex Berezhny e43230e46a v0.56.0 2020-01-28 19:58:28 -05:00
Lex Berezhny dd07bc29eb Merge pull request #2747 from eggplantbren/master
new trending algorithm contributed by Brendon Brewer, to enable on wallet server set `TRENDING_ALGORITHMS` environment variable on wallet server to `ar`
2020-01-28 19:36:52 -05:00
Lex Berezhny 790bbfcc99 integrate ar trending algorithm into configurable trending system 2020-01-28 18:11:32 -05:00
Brendon J. Brewer 994e70d43a ar trending algorithm 2020-01-28 18:11:32 -05:00
Jack Robison 7d5e19716a Merge pull request #2749 from lbryio/prometheus-interrupts
add metrics to wallet server prometheus
2020-01-28 16:31:10 -05:00
Jack Robison 11530c675d initialize_request_handlers, remove local rpc handlers 2020-01-28 15:54:22 -05:00
Jack Robison 1c474352fe add wallet server prometheus metrics
-sessions gauge
-requests counter
-response times histogram
-notification counter
-request errors counter
-interrupt counter
-operational error counter
-internal error counter
-reader executor times histogram
-pending queries gauge
-lbrycrd request counter
-client versions counter
2020-01-28 15:54:22 -05:00
Jack Robison 3b2d635390 Revert "Revert "configurable trending algorithms""
This reverts commit 55e08f96a6.
2020-01-28 15:53:57 -05:00
Jack Robison 055c532d31 Merge pull request #2752 from lbryio/revert-2750-configurable_trending
Revert "configurable trending algorithms"
2020-01-28 15:04:29 -05:00
Jack Robison 55e08f96a6 Revert "configurable trending algorithms" 2020-01-28 15:03:09 -05:00
Lex Berezhny 3e0a9180bc Merge pull request #2750 from lbryio/configurable_trending
configurable trending algorithms
2020-01-28 12:30:26 -05:00
Lex Berezhny 01ed71b243 configurable trending 2020-01-28 11:58:27 -05:00
Lex Berezhny 595c058517 moved trending.py to trending/zscore.py 2020-01-28 11:58:27 -05:00
Alex Grintsvayg e04b0a6995 add docker tag to prometheus version info 2020-01-27 14:16:18 -05:00
Jack Robison 8961848ab1 Merge pull request #2748 from lbryio/cached-wallet-id
faster wallet.id attribute, improves speed of selecting wallets during api calls
2020-01-27 13:58:23 -05:00
Jack Robison 6fb1c72b7d cached wallet id 2020-01-27 13:57:21 -05:00
Alex Grintsvayg 400d79d6ab prom port off by default 2020-01-27 13:55:44 -05:00
Lex Berezhny ce6018f387 v0.55.0 2020-01-27 12:20:41 -05:00
Alex Grintsvayg 65d9dca917 Merge branch 'docker'
* docker:
  fix gitlab ci
  add min_version and method name to metrics
  include docker tag in build info
  build_type.py -> build_info.py
  add docker build info to wallet server image
2020-01-23 13:13:33 -05:00
Alex Grintsvayg 2232b08351 fix gitlab ci 2020-01-23 13:13:20 -05:00
Alex Grintsvayg 0732ab6ad5 add min_version and method name to metrics 2020-01-23 13:13:20 -05:00
Alex Grintsvayg fb568768c5 include docker tag in build info 2020-01-23 13:13:19 -05:00
Alex Grintsvayg 7fd56e0add build_type.py -> build_info.py 2020-01-23 13:13:19 -05:00
Alex Grintsvayg 38a3f8cf4c add docker build info to wallet server image 2020-01-23 13:13:19 -05:00
Lex Berezhny 8d8a5b36b6 Merge pull request #2737 from lbryio/fix_repost_resolve_bug
fix bug where repost claims were not being fully resolved
2020-01-22 23:32:55 -05:00
Lex Berezhny a70cc7beb1 fix bug where repost claims were not being fully resolved 2020-01-22 22:59:05 -05:00
Alex Grintsvayg c5421699b1 add prometheus port to docker-compose.yml 2020-01-22 20:08:29 -05:00
Alex Grintsvayg d9f809864f include version and build info in prometheus output 2020-01-22 19:13:58 -05:00
Lex Berezhny bb23f509d7 rename BLOCKING_CHANNELS_IDS/FILTERING_CHANNELS_IDS to remove double S 2020-01-22 11:02:01 -05:00
Alex Grin 254e184677 Merge pull request #2734 from lbryio/prom2
Add prometheus metrics collection to client and server (take two)
2020-01-22 10:28:54 -05:00
Alex Grintsvayg 6c07141abd Add prometheus metrics collection to client and server 2020-01-22 10:28:17 -05:00
Lex Berezhny 5822fc1d5b v0.54.1 2020-01-22 08:40:35 -05:00
Lex Berezhny 2cd7ea257c Added support to differentiate between filtering and blocking for content censoring 2020-01-22 08:39:14 -05:00
Alex Grin 0a21b72f9c v0.54.0 2020-01-21 16:17:12 -05:00
Alex Grintsvayg 80280f6f4a Revert "v0.54.0"
This reverts commit bd3b4906d1.
2020-01-21 15:34:35 -05:00
Alex Grintsvayg 810a8e76d1 Pin pip to 19.3.1 on Windows
pip 20 made the following change:

> Remove interpreter-specific major version tag e.g. cp3-none-any from consideration.
> https://github.com/pypa/pip/pull/7355

The coincurve pip package only has a major version tag for its windows
wheel. pip20 will not allow us to install that wheel, and compiling
coincurve from source causes errors. So we cannot use pip 20 or above
until coincurve fixes its compatibility tags, we can compile coincurve
from source, we stop using coincurve, or we figure out another way to
install it.

Note that on osx and linux, coincurve has the correct tags.
2020-01-21 15:24:29 -05:00
Lex Berezhny bd3b4906d1 v0.54.0 2020-01-21 11:30:14 -05:00
Lex Berezhny d9c740f014 update tests to use 0.54.0 minimum version 2020-01-21 11:28:56 -05:00
Alex Grintsvayg ec63a18960 Revert "v0.54.0"
This reverts commit fab0618b6b.
2020-01-21 11:23:51 -05:00
Alex Grin fab0618b6b v0.54.0 2020-01-21 11:00:38 -05:00
Alex Grintsvayg 13e57e7aa8 Revert "v0.54.0"
This reverts commit 836b66e110.
2020-01-21 10:43:21 -05:00
Alex Grintsvayg 1299c9162c Revert "Add prometheus metrics collection to client and server"
This reverts commit 59a5bacb2e.
2020-01-21 10:30:49 -05:00
Alex Grintsvayg a64f33dbcc ignore coverage files 2020-01-21 10:30:48 -05:00
Alex Grin 836b66e110 v0.54.0 2020-01-20 14:26:36 -05:00
Alex Grintsvayg 802119d789 Revert "v0.54.0"
This reverts commit aec4d1dc60.
2020-01-20 14:24:30 -05:00
Alex Grintsvayg f94135cadd make pycharm happy about long lines 2020-01-20 14:18:00 -05:00
Alex Grintsvayg 474c0f980e skip randomly-failing dht test 2020-01-20 14:16:52 -05:00
Alex Grintsvayg 2cf0f791f2 remove unused import 2020-01-20 13:44:49 -05:00
Alex Grin aec4d1dc60 v0.54.0 2020-01-20 13:13:30 -05:00
Alex Grintsvayg 8d28bb5a66 bump min protocol version 2020-01-20 12:53:10 -05:00
Alex Grintsvayg 1d5e553f9c Merge branch 'blocked_search_metadata'
* blocked_search_metadata:
  add index for claim_type and release_time
  fix test
  fix json api generator
  add pagination for claim_search
  regenerate protobufs
  using multiprocessing.Manager to keep blocked content synced between readers
2020-01-20 12:51:02 -05:00
Lex Berezhny 9d79c52d20 add index for claim_type and release_time 2020-01-20 12:50:20 -05:00
Lex Berezhny 1ac03e2f1d fix test 2020-01-20 12:50:16 -05:00
Lex Berezhny 801f05f45e fix json api generator 2020-01-20 12:50:16 -05:00
Lex Berezhny 345196aa3b add pagination for claim_search 2020-01-20 12:49:42 -05:00
Lex Berezhny a01b52421e regenerate protobufs 2020-01-20 12:49:41 -05:00
Lex Berezhny 86cedfe8b2 using multiprocessing.Manager to keep blocked content synced between readers 2020-01-20 12:49:41 -05:00
Alex Grintsvayg 709128225b Merge branch 'prometheus'
* prometheus:
  Add prometheus metrics collection to client and server
2020-01-20 12:45:11 -05:00
Alex Grintsvayg 59a5bacb2e Add prometheus metrics collection to client and server 2020-01-20 12:43:49 -05:00
Jack Robison 3a21df31ee v0.53.3 2020-01-16 16:43:26 -05:00
Jack Robison 0e3407ec2f Merge pull request #2730 from lbryio/bump-aioupnp2
update aioupnp requirement to 0.0.17
2020-01-16 16:00:42 -05:00
Jack Robison fd6609e961 bump aioupnp requirement to 0.0.17 2020-01-16 15:40:29 -05:00
Jack Robison b0b5e045ff non blocking aioupnp success analytics 2020-01-16 15:40:24 -05:00
Jack Robison f293d7cccc pin windows pyinstaller 2020-01-16 15:02:15 -05:00
Jack Robison 974ed29c36 Merge pull request #2729 from lbryio/fix-headers-subscription-to-old
disconnect from server that returns rpc error for server.version
2020-01-15 17:59:17 -05:00
Jack Robison 53eb033034 disconnect from server that returns rpc error for server.version
-the server returns this error if it thinks we are incompatible with it
2020-01-15 17:06:13 -05:00
Jack Robison f2545b98ab Merge pull request #2728 from lbryio/check-server-version-from-client
check minimum server version from wallet client
2020-01-15 16:53:10 -05:00
Jack Robison 1bf51e855d check minimum server version from wallet client 2020-01-15 15:55:39 -05:00
Jack Robison e4da2a695b v0.53.2 2020-01-14 16:47:56 -05:00
Lex Berezhny 1a905d9a42 make --start-tag work again in release/script.py 2020-01-13 21:40:07 -05:00
Victor Shyba 7d9d0c15d3 fix test_direct_sync flakiness 2020-01-13 21:17:10 -05:00
Victor Shyba d34f5c2712 fix None in history, check records after wait 2020-01-13 21:17:10 -05:00
Victor Shyba a56dd66c98 separate cases and make it deterministic 2020-01-13 21:17:10 -05:00
Victor Shyba 3946bc6662 fix and document new edge case on tests 2020-01-13 21:17:10 -05:00
Victor Shyba 6647dd8f08 fix decrypting invalid bytes with valid padding 2020-01-13 21:17:10 -05:00
Jack Robison 9371122bed Merge pull request #2725 from lbryio/stream-manager-startup
faster stream manager startup
2020-01-13 18:09:49 -05:00
Jack Robison 734cd8ee08 logging 2020-01-13 17:51:05 -05:00
Jack Robison d85d9d05bb fast get_all_lbry_files 2020-01-13 17:51:05 -05:00
Jack Robison 1d7b87b3a9 fix inefficient loop in update_manually_removed_files_since_last_run 2020-01-13 17:51:02 -05:00
Lex Berezhny f0cfde36f2 v0.53.1 2020-01-13 14:12:30 -05:00
Lex Berezhny 7e220d2741 downgrade setuptools 2020-01-13 14:03:45 -05:00
Lex Berezhny c4b1351a43 stop building on travis 2020-01-13 14:03:45 -05:00
Lex Berezhny 90d2597bc3 pin to pyinstaller==3.5 2020-01-13 14:03:45 -05:00
Lex Berezhny c1508c94c2 v0.53.0 2020-01-13 12:23:41 -05:00
Jack Robison 1a0d805bad Merge pull request #2720 from lbryio/loggly-database-error
fix database error caused by logging tracebacks from within the sqlite transaction runner
2020-01-12 16:23:26 -05:00
Jack Robison 1a802469f5 missing fetchall() 2020-01-12 16:16:48 -05:00
Jack Robison 646ae7e2d1 catch RuntimeError in loggly handler to handle cases where there is not an event loop 2020-01-12 16:16:48 -05:00
Jack Robison 563d76ff9f Merge pull request #2719 from lbryio/refactor_header_progress
refactor header progress calculation, making it simpler to understand and not prone to division by zero
2020-01-12 16:16:23 -05:00
Victor Shyba 54d0473e85 refactor header progress 2020-01-12 00:56:43 -03:00
Jack Robison ec8a61c3af Merge pull request #2718 from lbryio/add-connected-to-wallet-status
add `connected` server to wallet status
2020-01-11 01:11:34 -05:00
Jack Robison 0315eaff8a add connected server to wallet status 2020-01-11 00:33:52 -05:00
Jack Robison b34f44c867 logging 2020-01-11 00:17:32 -05:00
Jack Robison ea7056835f Merge pull request #2716 from lbryio/batched-address-subscriptions
speed up wallet sync and startup by batching address history subscriptions
2020-01-10 21:32:12 -05:00
Jack Robison 0bb4cdadd9 use network.subscribe_address 2020-01-10 13:57:52 -05:00
Jack Robison 08f6520557 bare excepts 2020-01-10 12:27:56 -05:00
Jack Robison 38b108752e batched blockchain.address.subscribe 2020-01-09 23:40:04 -05:00
Jack Robison 0ee7870bdf defaultdict 2020-01-09 23:06:29 -05:00
Jack Robison 37d46ecdb2 fix looping over same things in _transaction_io 2020-01-09 23:06:29 -05:00
Oleg Silkin 2a7911c7d6 rename jsonrpc_comment_edit -> jsonrpc_comment_update 2020-01-09 19:28:45 -05:00
Oleg Silkin fc2d9b4fd2 restart travis build 2020-01-09 19:28:45 -05:00
Oleg Silkin 832020fa81 Makes claim_id and parent_id mutually exclusive for comment create 2020-01-09 19:28:45 -05:00
Oleg Silkin 78606ed4b8 Generates docs for comments 2020-01-09 19:28:45 -05:00
Oleg Silkin a04ba606e6 Adds test for comment_edit 2020-01-09 19:28:45 -05:00
Oleg Silkin ebf2e7ee70 Better validation logic; 2020-01-09 19:28:45 -05:00
Oleg Silkin b31881f424 Removes possibility of no channel being passed in & propogates errors 2020-01-09 19:28:45 -05:00
Oleg Silkin c0a6f6fd08 Adds validator methods 2020-01-09 19:28:45 -05:00
Oleg Silkin 7e1b1ca730 Adds comment_edit command 2020-01-09 19:28:45 -05:00
Jack Robison 163d176f0a Merge pull request #2710 from lbryio/fix-version-and-stop
Fix `version` and `stop` rpcs
2020-01-08 17:42:10 -05:00
Jack Robison 0f7eab5100 pylint 2020-01-08 12:44:22 -05:00
Jack Robison cbf78d474a fix version and stop rpcs 2020-01-08 12:44:22 -05:00
Victor Shyba 3615e0de34 cleanup leftover comment from review 2020-01-07 19:57:34 -05:00
Victor Shyba e73c081d36 remove bandwidth_limit env option 2020-01-07 19:57:34 -05:00
Victor Shyba 663bf6e3af remove bandwidth_limit from docker file 2020-01-07 19:57:34 -05:00
Victor Shyba 60194cbafd remove bw_limit on server 2020-01-07 19:57:34 -05:00
Lex Berezhny 7d2eb5faf7 v0.52.0 2020-01-06 12:21:49 -05:00
Lex Berezhny 5969f3d213 revert version 2020-01-06 12:20:05 -05:00
Lex Berezhny 6ddde88389 update release script with new directory structure 2020-01-06 12:18:26 -05:00
Lex Berezhny e9992ed6b4 fix test 2020-01-06 12:17:09 -05:00
Lex Berezhny 4db823a3be set version to 0.52.0 2020-01-06 12:17:09 -05:00
Lex Berezhny 78732513c8 set wallet server min/max 0.52.0-0.99.0 2020-01-06 12:17:09 -05:00
Jack Robison 79557bb878 Merge pull request #2704 from lbryio/disable-cryptonator
disable cryptonator feed
2020-01-03 16:18:05 -05:00
Jack Robison 4094b02ae9 update test 2020-01-03 16:00:00 -05:00
Jack Robison 9cc7c118a8 disable cryptonator feed 2020-01-03 15:28:29 -05:00
Lex Berezhny d3dad51c76 fix import error in cli.py 2020-01-03 03:08:15 -05:00
Lex Berezhny 5bf35de955 fix blockchain integration tests 2020-01-03 03:08:15 -05:00
Lex Berezhny f8928c654b do not reset callable_methods on Daemon class 2020-01-03 03:08:15 -05:00
Lex Berezhny b3903f4ffd fix import in unit test 2020-01-03 03:08:15 -05:00
Lex Berezhny 46c3f76edc run all integration tests on travis until we drop it 2020-01-03 03:08:15 -05:00
Victor Shyba 3488408b7a add jobs=8 back to pylint 2020-01-03 03:08:15 -05:00
Victor Shyba b7b164b84c fix comment alignment 2020-01-03 03:08:15 -05:00
Victor Shyba 7c353b7d76 too many \ 2020-01-03 03:08:15 -05:00
Lex Berezhny 3d9841b61a fix unit wallet tests 2020-01-03 03:08:15 -05:00
Lex Berezhny 87e2d2c7b0 re-enable pylint on CI 2020-01-03 03:08:15 -05:00
Lex Berezhny ff59619af4 more pylint 2020-01-03 03:08:15 -05:00
Lex Berezhny b79f2b86b5 renamed Daemon.py to daemon.py per pylint 2020-01-03 03:08:15 -05:00
Lex Berezhny 386fd7a459 updated imports after renaming component files 2020-01-03 03:08:15 -05:00
Lex Berezhny d4f41901ef lower cased component file names per pylint 2020-01-03 03:08:15 -05:00
Lex Berezhny f170da3e78 pylint fixes in lbry/extras/daemon 2020-01-03 03:08:15 -05:00
Lex Berezhny 5dc15be98a pylint lbry/extras/daemon/exchange_rate_manager.py 2020-01-03 03:08:15 -05:00
Lex Berezhny 88c7cfc745 pylint in progress in lbry/extras/daemon 2020-01-03 03:08:15 -05:00
Victor Shyba 867478697d lint blob/* 2020-01-03 03:08:15 -05:00
Lex Berezhny d27e8cf73a pylint fix in lbry/error/generate.py 2020-01-03 03:08:15 -05:00
Victor Shyba 4490caa4f7 lint storage 2020-01-03 03:08:15 -05:00
Lex Berezhny 1b25f2c531 pylint fix in lbry/utils.py 2020-01-03 03:08:15 -05:00
Lex Berezhny 9d911d1fa0 convince pylint about descriptor return type in lbry/conf.py 2020-01-03 03:08:15 -05:00
Victor Shyba 494feb9f6d lint: lbry/stream/* 2020-01-03 03:08:15 -05:00
Lex Berezhny 2a04943a67 add l variable for lists to allowed good-names in pylint 2020-01-03 03:08:15 -05:00
Lex Berezhny 731b29ce91 progress on pylint in lbry/conf.py 2020-01-03 03:08:15 -05:00
Victor Shyba 28fbb70858 blob_exchange lint 2020-01-03 03:08:15 -05:00
Victor Shyba 44f402c64e delete cryptoutils 2020-01-03 03:08:15 -05:00
Victor Shyba c7f391ca44 lint: finish dht parts 2020-01-03 03:08:15 -05:00
Lex Berezhny 5ed9c5e168 ignore pylint for winpaths.py 2020-01-03 03:08:15 -05:00
Lex Berezhny 51b1a86d19 pylint for lbry/connection_manager.py 2020-01-03 03:08:15 -05:00
Victor Shyba 20c46677d0 lint dht: datastore protocol 2020-01-03 03:08:15 -05:00
Lex Berezhny efb5f232f7 fixed pylint for lbry/utils.py 2020-01-03 03:08:15 -05:00
Lex Berezhny 9edf9561b2 pylint 2020-01-03 03:08:15 -05:00
Lex Berezhny 5d4eb018ee pylint for lbry/testcase.py 2020-01-03 03:08:15 -05:00
Victor Shyba 10fbce056b dht constants -> CONSTANTS (linting) 2020-01-03 03:08:15 -05:00
Lex Berezhny cbc6d6a572 pylint passes for lbry/wallet 2020-01-03 03:08:15 -05:00
Lex Berezhny fb1af9e3d2 update imports and more merging 2020-01-03 03:08:15 -05:00
Lex Berezhny c9e410a6f4 merged torba base classes with lbry sub-classes 2020-01-03 03:08:15 -05:00
Lex Berezhny c8d72b59c0 fix readme urls 2020-01-01 16:02:16 -05:00
Lex Berezhny cd71d4a2f7 remove double install of coverage package 2020-01-01 16:02:11 -05:00
Lex Berezhny ed0cc59e66 fix cyclic import error 2020-01-01 15:57:56 -05:00
Lex Berezhny d4f1b48f52 renamed integration tests to be clearer in gitlab UI 2020-01-01 15:57:56 -05:00
Lex Berezhny 08bec02170 added __init__ 2020-01-01 15:57:56 -05:00
Lex Berezhny c9f27b83e1 split integration tests into three jobs 2020-01-01 15:57:56 -05:00
Lex Berezhny 8327585b3b fix set_build.py and other things 2020-01-01 15:57:56 -05:00
Lex Berezhny 727815d6dd updating scripts after moving lbry up one level 2020-01-01 15:57:56 -05:00
Lex Berezhny 2968f74c6c moved lbry up one level 2020-01-01 15:57:56 -05:00
Lex Berezhny 431499f43f do not install torba 2020-01-01 15:57:56 -05:00
Lex Berezhny d809283d23 fix integrartion test 2020-01-01 15:57:56 -05:00
Lex Berezhny b49275fe6b added support for --no-logging argument to avoid leaking loggers in tests 2020-01-01 15:57:56 -05:00
Lex Berezhny 87c7ce588e disabled cryptonator.com in tests, removed references to torba 2020-01-01 15:57:56 -05:00
Lex Berezhny 26d0a7c742 fix generate_json_api 2020-01-01 15:57:56 -05:00
Lex Berezhny b01887c7ec fix two unit tests 2020-01-01 15:57:56 -05:00
Lex Berezhny 745031c020 orchstr8 works again, for now... 2020-01-01 15:57:56 -05:00
Lex Berezhny 3ccfc09e01 conslidated testcase 2020-01-01 15:57:56 -05:00
Lex Berezhny e8750275c9 skip code quality checks, will fix later 2020-01-01 15:57:56 -05:00
Lex Berezhny f0d7ea4cc6 updated files and scripts post torba merge 2020-01-01 15:57:56 -05:00
Lex Berezhny ea5322af82 removing bitcoin support 2020-01-01 15:57:56 -05:00
Lex Berezhny 0b23f68fb2 merged torba into lbry 2020-01-01 15:57:56 -05:00
Lex Berezhny 1c00129f76 v0.51.2 2019-12-30 16:34:52 -05:00
Lex Berezhny 454700af05 support json in setting_set 2019-12-30 16:31:14 -05:00
Jack Robison d9b482d90a Merge pull request #2699 from lbryio/faster-account-startup
don't log account details on startup if there are more than 10
2019-12-30 16:26:36 -05:00
Jack Robison 09c2c97069 only log account details on startup if there are not very many 2019-12-30 16:22:41 -05:00
Lex Berezhny 88faf0ce78 v0.51.1 2019-12-30 15:11:29 -05:00
Jack Robison aef83eec31 Merge pull request #2695 from lbryio/fix-12-to-13-migrator
Fix 12 to 13 migrator
2019-12-28 15:57:41 -05:00
Jack Robison 5bd222c266 less verbose log 2019-12-28 13:17:19 -05:00
Jack Robison d3e7f789b2 uncaught exception 2019-12-28 13:17:19 -05:00
Jack Robison 87c6e292f1 fix wallet server SessionManager._get_info 2019-12-28 13:17:19 -05:00
Jack Robison b597ad0b3f fix unique constraint failure in migrate12to13 2019-12-28 13:17:19 -05:00
Alex Grintsvayg 40dd99dea3 changelog note 2019-12-28 12:39:46 -05:00
Lex Berezhny 6ea2686219 v0.51.0 2019-12-23 12:39:48 -05:00
Alex Grintsvayg 6bca90c4f7 allow wallet snapshots using different compression algos 2019-12-21 19:18:20 -05:00
Alex Grintsvayg 20fa7bd852 better server range for boris 2019-12-21 13:48:07 -05:00
Alex Grintsvayg 6b80119eff drop travis badge 2019-12-21 13:29:09 -05:00
Alex Grintsvayg 1fc5469eb1 add gitlab badge 2019-12-21 13:26:38 -05:00
Alex Grintsvayg bf2769a0c2 disable travis docker builds. docker builds trigger from docker hub 2019-12-21 13:06:03 -05:00
Victor Shyba 325b601bea enable WAL 2019-12-21 07:49:21 -05:00
Lex Berezhny 126642912e lint 2019-12-20 16:52:56 -05:00
Lex Berezhny 57ee16d565 change returned error data structure to be JSONRPC standard compliant 2019-12-20 16:52:56 -05:00
Alex Grintsvayg 9f0fba063d ensure asset exists before upload 2019-12-20 13:01:51 -05:00
Victor Shyba 757fb51415 make block_expected public 2019-12-20 12:30:16 -05:00
Victor Shyba b1c5655138 __height -> _block_expected 2019-12-20 12:30:16 -05:00
Alex Grintsvayg 4d97dcaa93 remove extraneous apostrophe 2019-12-20 10:26:41 -05:00
Jack Robison 96db1b4685 v0.50.1 2019-12-19 22:09:19 -05:00
Jack Robison 9e21c52d04 Merge pull request #2685 from lbryio/fast_broadcast_notify
Update balance after a broadcast transaction is accepted to mempool without a delay, fix bug in `status` header progress
2019-12-19 22:07:16 -05:00
Victor Shyba 5fa801f9f2 broadcast_or_release uses None as timeout as opposed to tests 2019-12-19 23:42:31 -03:00
Victor Shyba 0301768b79 lint on tests 2019-12-19 22:58:36 -03:00
Victor Shyba 4c6dedfa4f fix last test 2019-12-19 22:34:10 -03:00
Victor Shyba 6652d55455 wip 2019-12-19 21:46:14 -03:00
Victor Shyba 3e03dd3e80 apply timeout and check for expected height on wait 2019-12-19 20:20:42 -03:00
Victor Shyba 84b8a22423 comment the broadcast interruption case 2019-12-19 16:20:12 -03:00
Victor Shyba ada03e12fc proper check for restrictions on gettx 2019-12-19 15:13:13 -03:00
Victor Shyba d66c801350 wake up mempool on broadcast 2019-12-19 15:13:13 -03:00
Victor Shyba 91846939f6 organize logic for when its downloading 2019-12-18 19:09:33 -03:00
Jack Robison c85127d76b fix division by zero error 2019-12-18 10:44:16 -05:00
Lex Berezhny 166bf65e88 torba test_database fix 2019-12-17 23:48:07 -05:00
Lex Berezhny f68bdc406f fix bug when two updates for the same claim happened in the same block 2019-12-17 23:48:07 -05:00
Lex Berezhny 8390482d6c aws does not use memoryview 2019-12-17 23:48:07 -05:00
Alex Grintsvayg 783f454f8e dont include dist dir in windows zip 2019-12-16 20:32:42 -05:00
Alex Grintsvayg 86a67bd245 autopublish release and notify in slack 2019-12-16 16:40:56 -05:00
Alex Grintsvayg 099b0b65c0 run torba unit tests the way lex runs them 2019-12-16 12:59:15 -05:00
386 changed files with 8962 additions and 12127 deletions

No files matched your search

+79
View File
@@ -0,0 +1,79 @@
name: ci
on: pull_request
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- run: make install tools
- run: make lint
tests-unit:
name: "tests / unit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- run: make install tools
- working-directory: lbry
env:
HOME: /tmp
run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
tests-integration:
name: "tests / integration"
runs-on: ubuntu-latest
strategy:
matrix:
test:
- datanetwork
- blockchain
- other
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- if: matrix.test == 'other'
run: sudo apt install -y --no-install-recommends ffmpeg
- run: pip install tox-travis
- run: tox -e ${{ matrix.test }}
build:
needs: ["lint", "tests-unit", "tests-integration"]
name: "build"
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Setup
run: |
pip install pyinstaller
pip install -e .
- if: startsWith(matrix.os, 'windows') == false
name: Build & Run (Unix)
run: |
pyinstaller --onefile --name lbrynet lbry/extras/cli.py
chmod +x dist/lbrynet
dist/lbrynet --version
- if: startsWith(matrix.os, 'windows')
name: Build & Run (Windows)
run: |
pip install pywin32
pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico --onefile --name lbrynet lbry/extras/cli.py
dist/lbrynet.exe --version
+15
View File
@@ -1,2 +1,17 @@
/.idea
/.DS_Store
/build
/dist
/.tox
/.coverage*
/lbry-venv
/venv
lbry.egg-info
__pycache__
_trial_temp/
/tests/integration/blockchain/files
/tests/.coverage.*
/lbry/wallet/bin
+81 -61
View File
@@ -14,50 +14,54 @@ default:
stages:
- test
- build
- assets
- release
.tagged:
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9\.]+$/'
when: on_success
test:lint:
stage: test
script:
- make install tools
- make lint
test:lbry-unit:
test:unit:
stage: test
script:
- make install tools
- cd lbry && HOME=/tmp coverage run -p --source=lbry -m unittest discover -vv tests.unit
- HOME=/tmp coverage run -p --source=lbry -m unittest discover -vv tests.unit
test:lbry-integ:
test:datanetwork-integration:
stage: test
script:
- pip install coverage tox-travis
- cd lbry && tox
- pip install tox-travis
- tox -e datanetwork
.torba-tests: &torba_tests
test:blockchain-integration:
stage: test
script:
- pip install coverage tox-travis
- cd torba && tox
- pip install tox-travis
- tox -e blockchain
test:torba-unit:
before_script:
- export TESTTYPE=unit
<<: *torba_tests
test:torba-integ:
before_script:
- export TESTTYPE=integration
<<: *torba_tests
test:other-integration:
stage: test
script:
- apt-get update
- apt-get install -y --no-install-recommends ffmpeg
- pip install tox-travis
- tox -e other
test:json-api:
stage: test
script:
- make install tools
- cd lbry && HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
- HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
@@ -68,11 +72,11 @@ test:json-api:
paths:
- lbrynet-${OS}.zip
script:
- pip install --upgrade 'setuptools<45.0.0'
- pip install pyinstaller
- pip install -e torba/.
- python3.7 docker/set_build.py
- pip install -e lbry/.
- pyinstaller --onefile --name lbrynet lbry/lbry/extras/cli.py
- pip install -e .
- python3.7 docker/set_build.py # must come after lbry is installed because it imports lbry
- pyinstaller --onefile --name lbrynet lbry/extras/cli.py
- chmod +x dist/lbrynet
- zip --junk-paths ${CI_PROJECT_DIR}/lbrynet-${OS}.zip dist/lbrynet # gitlab expects artifacts to be in $CI_PROJECT_DIR
- openssl dgst -sha256 ${CI_PROJECT_DIR}/lbrynet-${OS}.zip | egrep -o [0-9a-f]+$ # get sha256 of asset. works on mac and ubuntu
@@ -80,14 +84,15 @@ test:json-api:
build:linux:
extends: .build
image: ubuntu:18.04 # cant use python3.7 image - binary won't run on ubuntu
image: ubuntu:16.04
variables:
OS: linux
before_script:
- apt-get update
- apt-get install -y --no-install-recommends software-properties-common zip curl build-essential
- add-apt-repository -y ppa:deadsnakes/ppa
- apt-get install -y --no-install-recommends python3.7-dev python3-setuptools python3-wheel
- apt-get update
- apt-get install -y --no-install-recommends python3.7-dev
- python3.7 <(curl -q https://bootstrap.pypa.io/get-pip.py) # make sure we get pip with python3.7
build:mac:
@@ -116,31 +121,33 @@ build:windows:
before_script:
- ./docker/install_choco.ps1
- choco install -y --x86 python3 7zip checksum
# - python --version | findstr /B "Python 3\.7\." # dont upgrade python on every run. just make sure we're on the right Python
# - pip --version | findstr /E '\(python 3\.7\)'
- python --version # | findstr /B "Python 3\.7\." # dont upgrade python on every run. just make sure we're on the right Python
- pip --version # | findstr /E '\(python 3\.7\)'
- pip install virtualenv pywin32
- virtualenv venv
- venv/Scripts/activate.ps1
- pip install pip==19.3.1; $true # $true ignores errors. need this to get the correct coincurve wheel. see commit notes for details.
after_script:
- rmdir -Recurse venv
script:
- pip install pyinstaller
- pip install -e torba/.
- python docker/set_build.py
- pip install -e lbry/.
- pyinstaller --additional-hooks-dir=lbry/scripts/. --icon=lbry/icons/lbry256.ico -F -n lbrynet lbry/lbry/extras/cli.py
- 7z a -tzip $env:CI_PROJECT_DIR/lbrynet-${OS}.zip dist/lbrynet.exe
- pip install --upgrade 'setuptools<45.0.0'
- pip install pyinstaller==3.5
- pip install -e .
- python docker/set_build.py # must come after lbry is installed because it imports lbry
- pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico -F -n lbrynet lbry/extras/cli.py
- 7z a -tzip $env:CI_PROJECT_DIR/lbrynet-${OS}.zip ./dist/lbrynet.exe
- checksum --type=sha256 --file=$env:CI_PROJECT_DIR/lbrynet-${OS}.zip
- dist/lbrynet.exe --version
# s3 = upload asset to s3 (build.lbry.io)
# could be done by making it a yaml alias and putting it right into the build step. that way if one OS fails, the others still get uploaded
.s3:
stage: release
stage: assets
variables:
GIT_STRATEGY: none
script:
- "[ -f lbrynet-${OS}.zip ]" # check that asset exists before trying to upload
- pip install awscli
- S3_PATH="daemon/gitlab-build-${CI_PIPELINE_ID}_commit-${CI_COMMIT_SHA:0:7}$( if [ ! -z ${CI_COMMIT_TAG} ]; then echo _tag-${CI_COMMIT_TAG}; else echo _branch-${CI_COMMIT_REF_NAME}; fi )"
- AWS_ACCESS_KEY_ID=${ARTIFACTS_KEY} AWS_SECRET_ACCESS_KEY=${ARTIFACTS_SECRET} AWS_REGION=${ARTIFACTS_REGION}
@@ -149,42 +156,55 @@ build:windows:
s3:linux:
extends: .s3
variables: {OS: linux}
dependencies: ["build:linux"]
needs: ["build:linux"]
s3:mac:
extends: .s3
variables: {OS: mac}
dependencies: ["build:mac"]
needs: ["build:mac"]
s3:windows:
extends: .s3
variables: {OS: windows}
dependencies: ["build:windows"]
needs: ["build:windows"]
# release = upload assets to github when there's a tagged release
.release:
# github = upload assets to github when there's a tagged release
.github:
extends: .tagged
stage: assets
variables:
GIT_STRATEGY: none
script:
- "[ -f lbrynet-${OS}.zip ]" # check that asset exists before trying to upload. githubrelease won't error if its missing
- pip install githubrelease
- githubrelease --no-progress --github-token ${GITHUB_CI_USER_ACCESS_TOKEN} asset lbryio/lbry-sdk upload ${CI_COMMIT_TAG} lbrynet-${OS}.zip
github:linux:
extends: .github
variables: {OS: linux}
needs: ["build:linux"]
github:mac:
extends: .github
variables: {OS: mac}
needs: ["build:mac"]
github:windows:
extends: .github
variables: {OS: windows}
needs: ["build:windows"]
publish:
extends: .tagged
stage: release
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9\.]+$/'
when: on_success
variables:
GIT_STRATEGY: none
script:
- pip install githubrelease
- githubrelease --no-progress --github-token ${GITHUB_CI_USER_ACCESS_TOKEN} asset lbryio/lbry-sdk upload ${CI_COMMIT_TAG} lbrynet-${OS}.zip
release:linux:
extends: .release
variables: {OS: linux}
dependencies: ["build:linux"]
release:mac:
extends: .release
variables: {OS: mac}
dependencies: ["build:mac"]
release:windows:
extends: .release
variables: {OS: windows}
dependencies: ["build:windows"]
- githubrelease --no-progress --github-token ${GITHUB_CI_USER_ACCESS_TOKEN} release lbryio/lbry-sdk publish ${CI_COMMIT_TAG}
- >
curl -X POST -H 'Content-type: application/json' --data '{"text":"<!channel> There is a new SDK release: https://github.com/lbryio/lbry-sdk/releases/tag/'"${CI_COMMIT_TAG}"'\n'"$(curl -s "https://api.github.com/repos/lbryio/lbry-sdk/releases/tags/${CI_COMMIT_TAG}" | egrep '\w*\"body\":' | cut -d':' -f 2- | tail -c +3 | head -c -2)"'", "channel":"tech"}' "$(echo ${SLACK_WEBHOOK_URL_BASE64} | base64 -d)"
-142
View File
@@ -1,142 +0,0 @@
dist: xenial
language: python
python: "3.7"
jobs:
include:
- stage: code quality
name: "pylint & mypy"
install:
- make install tools
script: make lint
- stage: test
name: "LBRY Unit Tests"
install:
- make install tools
script:
- cd lbry && HOME=/tmp coverage run -p --source=lbry -m unittest discover -vv tests.unit
after_success:
- coverage combine lbry/
- name: "LBRY Integration Tests"
install:
- pip install coverage tox-travis
- sudo mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
script: cd lbry && tox
after_success:
- coverage combine lbry
- &torba-tests
name: "Torba Unit Tests"
env: TESTTYPE=unit
install:
- pip install coverage tox-travis
script: cd torba && tox
after_success:
- coverage combine torba/tests
- <<: *torba-tests
name: "Torba Integration Tests"
env: TESTTYPE=integration
- name: "Run Examples"
install:
- make install tools
script:
- cd lbry && HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
after_success:
- coverage combine lbry
- &build
stage: build
name: "Linux"
env: OS=linux
install:
- pip install pyinstaller awscli
- python docker/set_build.py
- pip install -e torba/.
- pip install -e lbry/.
script:
- pyinstaller -F -n lbrynet lbry/lbry/extras/cli.py
- chmod +x dist/lbrynet
- zip --junk-paths lbrynet-${OS}.zip dist/lbrynet
- shasum -a 256 -b lbrynet-${OS}.zip
- dist/lbrynet --version
after_success:
- aws configure set aws_access_key_id $ARTIFACTS_KEY
- aws configure set aws_secret_access_key $ARTIFACTS_SECRET
- aws configure set region us-east-1
- export S3_PATH="daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})"
- aws s3 cp lbrynet-${OS}.zip s3://build.lbry.io/${S3_PATH}/lbrynet-${OS}.zip
# deploy:
# provider: releases
# api_key:
# secure: "unnR+aSJ1937Cl1PyBBZzGuZvV5W5TGcXELhXTgyOeeI6FgO/j80qmbNxJDA7qdFH/hvVicQFWoflhZu2dxN5rYP5BQJW3q3XoOLY3XAc1s1vicFkwqn3TIfdFiJTz+/D9eBUBBhHKeYFxm3M+thvklTLgjKl6fflh14NfGuNTevK9yQke8wewW3f9UmFTo1qNOPF1OsTZRbwua6oQYa59P+KukoPt4Dsu1VtILtTkj7hfEsUL79cjotwO3gkhYftxbl/xeDSZWOt+9Nhb8ZKmQG/uDx4JiTMm5lWRk4QB7pUujZ1CftxCYWz/lJx9nuJpdCOgP624tcHymErNlD+vGLwMTNslcXGYkAJH6xvGyxBJ+Obc8vRVnZbRM26BfH34TcPK1ueRxHSrDUbzMIIUsgcoZAxBuim8uDPp+K7bGqiygzSs2vQfr9U5Jhe9/F8sPdtNctfJZEfgmthNTeVFjyNsGIfIt754uGSfACqM7wDLh6fbKx7M+FHlNyOdvYCrbKUOAYXmTikYIpVDvlaaeMO+N+uW8Rhvm1j+JU7CVwhMavLySaPVc6Dt5OxiMMmxw9mVrjW9bBPjS5AkrS5MOA13T5wapoLzH6+gE92U4HzA6ilMcwRaQPSFnK2JU7tzyt2Wy1PH4MjHowXI2WyICG1x510dD3tX1P/1px8ro="
# file: lbrynet-${OS}.zip
# skip_cleanup: true
# overwrite: true
# draft: true
# on:
# tags: true
- <<: *build
name: "Mac"
os: osx
osx_image: xcode8.3
language: shell
env: OS=mac
before_install:
- brew uninstall mercurial
- brew upgrade python || true
- pip3 install --user --upgrade pip virtualenv
- /Users/travis/Library/Python/3.7/bin/virtualenv --clear $HOME/venv
- source $HOME/venv/bin/activate
before_cache:
- brew cleanup
- <<: *build
name: "Windows"
os: windows
language: shell
env:
- OS=windows
- PATH=/c/Python37:/c/Python37/Scripts:/C/Windows/System32/downlevel:$PATH
before_install:
- choco install python --version=3.7.4 --x86
- python -m pip install --upgrade pip
- pip install pywin32
script:
- pyinstaller --additional-hooks-dir=lbry/scripts/. --icon=lbry/icons/lbry256.ico -F -n lbrynet lbry/lbry/extras/cli.py
- cd dist
- 7z a -tzip lbrynet-windows.zip lbrynet.exe
- sha256sum -b lbrynet-windows.zip
- ./lbrynet.exe --version
- if: tag IS present
stage: build
name: "Wallet Server Docker Image - Tagged Release"
script:
- set -e
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- travis_retry docker build -t lbry/wallet-server:$TRAVIS_TAG -t lbry/wallet-server:latest-release -f docker/Dockerfile.wallet_server .
- docker push lbry/wallet-server:$TRAVIS_TAG
- docker push lbry/wallet-server:latest-release
- if: tag IS blank AND branch = master AND NOT type IN (pull_request)
stage: build
name: "Wallet Server Docker Image - Master"
script:
- set -e
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- travis_retry docker build -t lbry/wallet-server:master -f docker/Dockerfile.wallet_server .
- docker push lbry/wallet-server:master
cache:
directories:
- $HOME/venv
- $HOME/.cache/pip
- $HOME/Library/Caches/pip
- $HOME/Library/Caches/Homebrew
- $TRAVIS_BUILD_DIR/.tox
+1 -1018
View File
File diff suppressed because it is too large. Load diff
+1 -4
View File
@@ -88,9 +88,6 @@ To install on Windows:
> lbry-venv\Scripts\activate
Install packages:
> cd torba
> pip install -e .
> cd ../lbry
> pip install -e .
```
@@ -99,7 +96,7 @@ To install on Windows:
To run the unit tests from the repo directory:
```
python -m unittest discover -s lbry tests.unit
python -m unittest discover tests.unit
```
## Usage
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-2019 LBRY Inc
Copyright (c) 2015-2020 LBRY Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
+1 -1
View File
@@ -1,4 +1,4 @@
include README.md
include CHANGELOG.md
include LICENSE
recursive-include torba *.txt *.py
recursive-include lbry *.txt *.py
+5 -8
View File
@@ -5,22 +5,19 @@ install:
--global-option=fetch \
--global-option=--version --global-option=3.30.1 --global-option=--all \
--global-option=build --global-option=--enable --global-option=fts5
cd torba && pip install -e .
cd lbry && pip install -e .
pip install -e .
tools:
pip install mypy==0.701
pip install coverage astroid pylint
lint:
cd lbry && pylint lbry
cd torba && pylint --rcfile=setup.cfg torba
cd torba && mypy --ignore-missing-imports torba
pylint --rcfile=setup.cfg lbry
#mypy --ignore-missing-imports lbry
test:
cd lbry && tox
cd torba && tox
tox
idea:
mkdir -p .idea
cp -r lbry/scripts/idea/* .idea
cp -r scripts/idea/* .idea
+7 -7
View File
@@ -1,15 +1,15 @@
# <img src="https://raw.githubusercontent.com/lbryio/lbry-sdk/master/lbry/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [![Build Status](https://travis-ci.org/lbryio/lbry-sdk.svg?branch=master)](https://travis-ci.org/lbryio/lbry-sdk)
# <img src="https://raw.githubusercontent.com/lbryio/lbry-sdk/master/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [![Gitlab CI Badge](https://ci.lbry.tech/lbry/lbry-sdk/badges/master/pipeline.svg)](https://ci.lbry.tech/lbry/lbry-sdk)
LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the [LBRY blockchain](https://github.com/lbryio/lbrycrd) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers.
LBRY SDK for Python is currently the most fully featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components include:
* Built on Python 3.7+ and `asyncio`.
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/dht)).
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/blob_exchange)).
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/schema)).
* Wallet implementation for the LBRY blockchain ([lbry.wallet](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/wallet)).
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbry.extras.daemon](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/extras/daemon)).
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/dht)).
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/blob_exchange)).
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/schema)).
* Wallet implementation for the LBRY blockchain ([lbry.wallet](https://github.com/lbryio/lbry-sdk/tree/master/lbry/wallet)).
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbry.extras.daemon](https://github.com/lbryio/lbry-sdk/tree/master/lbry/extras/daemon)).
## Installation
@@ -53,4 +53,4 @@ The documentation for the API can be found [here](https://lbry.tech/api/sdk).
Daemon defaults, ports, and other settings are documented [here](https://lbry.tech/resources/daemon-settings).
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry-sdk/blob/master/lbry/example_daemon_settings.yml).
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry-sdk/blob/master/example_daemon_settings.yml).
+6 -1
View File
@@ -4,9 +4,14 @@ ARG user=lbry
ARG db_dir=/database
ARG projects_dir=/home/$user
ARG DOCKER_TAG
ARG DOCKER_COMMIT=docker
ENV DOCKER_TAG=$DOCKER_TAG DOCKER_COMMIT=$DOCKER_COMMIT
RUN apt-get update && \
apt-get -y --no-install-recommends install \
wget \
tar unzip \
build-essential \
python3 \
python3-dev \
@@ -28,6 +33,7 @@ WORKDIR $projects_dir
RUN pip install uvloop
RUN make install
RUN python3 docker/set_build.py
RUN rm ~/.cache -rf
# entry point
@@ -39,7 +45,6 @@ ENV TCP_PORT=$tcp_port
ENV HOST=$host
ENV DAEMON_URL=$daemon_url
ENV DB_DIRECTORY=$db_dir
ENV BANDWIDTH_LIMIT=1000000000000000000000000000000000000000000
ENV MAX_SESSIONS=1000000000
ENV MAX_SEND=1000000000000000000
ENV EVENT_LOOP_POLICY=uvloop
+1
View File
@@ -26,6 +26,7 @@ services:
ports:
- "50001:50001" # rpc port
- "50005:50005" # websocket port
#- "2112:2112" # uncomment to enable prometheus
volumes:
- "wallet_server:/database"
environment:
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR/../.." ## make sure we're in the right place. Docker Hub screws this up sometimes
echo "docker build dir: $(pwd)"
docker build --build-arg DOCKER_TAG=$DOCKER_TAG --build-arg DOCKER_COMMIT=$SOURCE_COMMIT -f $DOCKERFILE_PATH -t $IMAGE_NAME .
+23 -20
View File
@@ -1,38 +1,41 @@
"""Set the build version to be 'qa', 'rc', 'release'"""
import sys
import os
import re
import logging
import lbry.build_info as build_info_mod
log = logging.getLogger()
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
def get_build_type(ci_tag=None):
if not ci_tag:
return "qa"
log.debug("getting build type for tag: \"%s\"", ci_tag)
if re.match(r'v\d+\.\d+\.\d+rc\d+$', ci_tag):
return 'rc'
elif re.match(r'v\d+\.\d+\.\d+$', ci_tag):
return 'release'
return 'qa'
def _check_and_set(d: dict, key: str, value: str):
try:
d[key]
except KeyError:
raise Exception(f"{key} var does not exist in {build_info_mod.__file__}")
d[key] = value
def main():
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
build_type_path = os.path.join(root_dir, 'lbry', 'lbry', 'build_type.py')
log.debug("configuring build type file: %s", build_type_path)
commit_hash = os.getenv('CI_COMMIT_SHA', os.getenv('TRAVIS_COMMIT'))
build_info = {item: build_info_mod.__dict__[item] for item in dir(build_info_mod) if not item.startswith("__")}
commit_hash = os.getenv('DOCKER_COMMIT', os.getenv('CI_COMMIT_SHA', os.getenv('TRAVIS_COMMIT')))
if commit_hash is None:
raise ValueError("Commit hash not found in env vars")
commit_hash = commit_hash[:6]
build_type = get_build_type(os.getenv('CI_COMMIT_TAG', os.getenv('TRAVIS_TAG')))
log.debug("setting build type=%s, build commit=%s", build_type, commit_hash)
with open(build_type_path, 'w') as f:
f.write(f"BUILD = \"{build_type}\"\nBUILD_COMMIT = \"{commit_hash}\"\n")
_check_and_set(build_info, "COMMIT_HASH", commit_hash[:6])
docker_tag = os.getenv('DOCKER_TAG')
if docker_tag:
_check_and_set(build_info, "DOCKER_TAG", docker_tag)
_check_and_set(build_info, "BUILD", "docker")
else:
ci_tag = os.getenv('CI_COMMIT_TAG', os.getenv('TRAVIS_TAG'))
_check_and_set(build_info, "BUILD", "release" if re.match(r'v\d+\.\d+\.\d+$', str(ci_tag)) else "qa")
log.debug("build info: %s", ", ".join([f"{k}={v}" for k, v in build_info.items()]))
with open(build_info_mod.__file__, 'w') as f:
f.write("\n".join([f"{k} = \"{v}\"" for k, v in build_info.items()]) + "\n")
if __name__ == '__main__':
+11 -3
View File
@@ -2,14 +2,22 @@
# entrypoint for wallet server Docker image
set -euo pipefail
SNAPSHOT_URL="${SNAPSHOT_URL:-}" #off by default. latest snapshot at https://lbry.com/snapshot/wallet
if [[ -n "$SNAPSHOT_URL" ]] && [[ ! -f /database/claims.db ]]; then
files="$(ls)"
echo "Downloading wallet snapshot from $SNAPSHOT_URL"
wget --no-verbose -O wallet_snapshot.tar.bz2 "$SNAPSHOT_URL"
wget --no-verbose --trust-server-names --content-disposition "$SNAPSHOT_URL"
echo "Extracting snapshot..."
tar xvjf wallet_snapshot.tar.bz2 --directory /database
rm wallet_snapshot.tar.bz2
filename="$(grep -vf <(echo "$files") <(ls))" # finds the file that was not there before
case "$filename" in
*.tgz|*.tar.gz|*.tar.bz2 ) tar xvf "$filename" --directory /database ;;
*.zip ) unzip "$filename" -d /database ;;
* ) echo "Don't know how to extract ${filename}. SNAPSHOT COULD NOT BE LOADED" && exit 1 ;;
esac
rm "$filename"
fi
/home/lbry/.local/bin/torba-server "$@"
+258 -124
View File
@@ -47,10 +47,10 @@
"examples": [
{
"title": "Get a file",
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#6d779c509a47c97a050540a42863341eed6c47ad\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#6d779c509a47c97a050540a42863341eed6c47ad",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#6d779c509a47c97a050540a42863341eed6c47ad\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1574265331,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpgnoina61\",\n \"download_path\": \"/tmp/tmpgnoina61/tmprsllesnu\",\n \"file_name\": \"tmprsllesnu\",\n \"height\": 214,\n \"key\": \"f67a8b72104b6dba232cfcd28e7a4766\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879\",\n \"stream_name\": \"tmprsllesnu\",\n \"streaming_url\": \"http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"suggested_file_name\": \"tmprsllesnu\",\n \"timestamp\": 1574265353,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#ca642adaf52552f0bfc746c2ebae77724d123aeb",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1580787018,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf0g7xmd6\",\n \"download_path\": \"/tmp/tmpf0g7xmd6/tmp2mvj0998\",\n \"file_name\": \"tmp2mvj0998\",\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -76,6 +76,18 @@
"description": "path to file to be associated with name.",
"is_required": false
},
{
"name": "validate_file",
"type": "bool",
"description": "validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required",
"is_required": false
},
{
"name": "optimize_file",
"type": "bool",
"description": "transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required",
"is_required": false
},
{
"name": "fee_currency",
"type": "string",
@@ -231,10 +243,10 @@
"examples": [
{
"title": "Publish a file",
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpj75adf8c\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpj75adf8c",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpj75adf8c\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000014b4df6fa2d6bb71b8963612d726f784dde2af32bfab13e96b0339f81301b0f48010000006b483045022100aff221a2ddf4253b22658eaeaf7cb16c2d561e3adcf68f7fee8965b3a935de5f0220321668388dc2b49b200d49e890027f500a3eb249645d9f5b6f46a33a9362dbf6012103a6b983e7675a1caab5c6ba805072f0dc58d8c1c968f1d52a4dd3be4f2fa04eb9ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706a37356164663863180b22186170706c69636174696f6e2f6f637465742d73747265616d3230776854e31884a3d321f5cba68a640d5d995830a21e4f7ea985d0441807f27bce45931c596ce0593ad47098dc7e55b6286d7576a9145b6f93dc376438022d0efc6e47fee875712590b488ace0b46217000000001976a9141bfe3963c1ea54a16243934a6c2fb6e2e3bf751788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mpzToGNACEPUN3SP3mavDeXyjZLPBAdKzh\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265353,\n \"txid\": \"480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"morRT4ExEyDWP11jMcr1HgZEq41QcScjzV\",\n \"amount\": \"1.0\",\n \"claim_id\": \"252b24ba95a8ce9219092bc57fae0e79680f0339\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"a-new-stream\",\n \"normalized_name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#252b24ba95a8ce9219092bc57fae0e79680f0339\",\n \"timestamp\": null,\n \"txid\": \"7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpj75adf8c\",\n \"sd_hash\": \"776854e31884a3d321f5cba68a640d5d995830a21e4f7ea985d0441807f27bce45931c596ce0593ad47098dc7e55b628\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mi4y63DYGkcC8Vgc1wLMc1GSB4wJdK9zQL\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a\"\n }\n}"
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsknvxuc2\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpsknvxuc2",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsknvxuc2\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015bc2b04ccba1d35b1c942beeac9e3bbb3113cd36eb9ac1d0a4f84c5a2d057fd2010000006b483045022100cbbfb6085367ee776c193804556a42c1840df308ff0a61281a7b3006a86d09ca022027ddfb85c92502cb6350fc8ee19b64864cd51b83470c4a792c072f712320733f012102be714be5898d0b931ea632d814be706430a0bc970e224d1827308b6cb33944cdffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70736b6e7678756332180b22186170706c69636174696f6e2f6f637465742d73747265616d323092b47fe68f0ef8f5f2f2f2e0621589810457e3ff1bc02fa4b48b7a8ac445b470ec5f8c686d9061f640266169fff8a64b6d7576a914c942e5805b2e2efcc4c48564b95ca922a9df998088ace0b46217000000001976a914fee1c3f1738006ada057ff984ac3fed9dfa34bf088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mxUpKsZ6bvqqn3nhpDuC3hZBgjFXid8dc6\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787039,\n \"txid\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941c5bd3a1cb4cb0c25b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mys8FfKeiRYbY7jDyZ7Ux3xdTAcGcqDoYu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"35946fe623d5aeb34b4399c999067cd20e045368\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"a-new-stream\",\n \"normalized_name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#35946fe623d5aeb34b4399c999067cd20e045368\",\n \"timestamp\": null,\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpsknvxuc2\",\n \"sd_hash\": \"92b47fe68f0ef8f5f2f2f2e0621589810457e3ff1bc02fa4b48b7a8ac445b470ec5f8c686d9061f640266169fff8a64b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n4kePEXwBnUC4eiH65PmEPAJ2bKZw2UiVH\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\"\n }\n}"
}
]
},
@@ -259,10 +271,10 @@
"examples": [
{
"title": "Resolve a claim",
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#6d779c509a47c97a050540a42863341eed6c47ad\"]}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#6d779c509a47c97a050540a42863341eed6c47ad",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#6d779c509a47c97a050540a42863341eed6c47ad\"]}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#6d779c509a47c97a050540a42863341eed6c47ad\": {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#6\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1574265353,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1574265352,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"]}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#ca642adaf52552f0bfc746c2ebae77724d123aeb",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"]}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\": {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
}
]
},
@@ -277,14 +289,14 @@
"name": "status",
"description": "Get daemon status",
"arguments": [],
"returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'database': (bool),\n 'dht': (bool),\n 'exchange_rate_manager': (bool),\n 'hash_announcer': (bool),\n 'peer_protocol_server': (bool),\n 'stream_manager': (bool),\n 'upnp': (bool),\n 'wallet': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n 'connected_servers': (list) [\n {\n 'host': (str) server hostname,\n 'port': (int) server port,\n 'latency': (int) milliseconds\n }\n ],\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n 'connections': {\n 'incoming_bps': {\n <source ip and tcp port>: (int) bytes per second received,\n },\n 'outgoing_bps': {\n <destination ip and tcp port>: (int) bytes per second sent,\n },\n 'total_outgoing_mps': (float) megabytes per second sent,\n 'total_incoming_mps': (float) megabytes per second received,\n 'time': (float) timestamp\n }\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'stream_manager': {\n 'managed_files': (int) count of files in the stream manager,\n },\n 'upnp': {\n 'aioupnp_version': (str),\n 'redirects': {\n <TCP | UDP>: (int) external_port,\n },\n 'gateway': (str) manufacturer and model,\n 'dht_redirect_set': (bool),\n 'peer_redirect_set': (bool),\n 'external_ip': (str) external ip address,\n }\n }",
"returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'database': (bool),\n 'dht': (bool),\n 'exchange_rate_manager': (bool),\n 'hash_announcer': (bool),\n 'peer_protocol_server': (bool),\n 'stream_manager': (bool),\n 'upnp': (bool),\n 'wallet': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'connected': (str) host and port of the connected spv server,\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n 'connected_servers': (list) [\n {\n 'host': (str) server hostname,\n 'port': (int) server port,\n 'latency': (int) milliseconds\n }\n ],\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n 'connections': {\n 'incoming_bps': {\n <source ip and tcp port>: (int) bytes per second received,\n },\n 'outgoing_bps': {\n <destination ip and tcp port>: (int) bytes per second sent,\n },\n 'total_outgoing_mps': (float) megabytes per second sent,\n 'total_incoming_mps': (float) megabytes per second received,\n 'time': (float) timestamp\n }\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'stream_manager': {\n 'managed_files': (int) count of files in the stream manager,\n },\n 'upnp': {\n 'aioupnp_version': (str),\n 'redirects': {\n <TCP | UDP>: (int) external_port,\n },\n 'gateway': (str) manufacturer and model,\n 'dht_redirect_set': (bool),\n 'peer_redirect_set': (bool),\n 'external_ip': (str) external ip address,\n }\n }",
"examples": [
{
"title": "Get status",
"curl": "curl -d'{\"method\": \"status\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet status",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"status\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"installation_id\": \"74U1CVifa5TSrJmrBCWUemuehciruvX7jp93cy3JZ3hPueR58izqFbkVeEkjo8dkcc\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"best_blockhash\": \"ee5cc9630f7869eb12890fb4041401996ea0190974145eeeea71a5155030d888\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected_servers\": [\n {\n \"host\": \"localhost\",\n \"latency\": 0.01,\n \"port\": 50002\n }\n ],\n \"headers_synchronization_progress\": 100\n }\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"installation_id\": \"2jezwuwxQ4YaPeK8NWsvHUG3cqafj355AKRN8FTu2it544VPXfKj3zyiy2Q9vDjTk3\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"53e5208f4f72ba63ec828e4f3cc51d51a1771862545ed88559ab2fdc9b3ad9dd\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"127.0.0.1:50002\",\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.010943017026875168,\n \"port\": 50002\n }\n ]\n }\n }\n}"
}
]
},
@@ -299,14 +311,14 @@
"name": "version",
"description": "Get lbrynet API server version information",
"arguments": [],
"returns": "(dict) Dictionary of lbry version information\n {\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n 'platform': (str) platform string,\n 'os_release': (str) os release string,\n 'os_system': (str) os name,\n 'lbrynet_version': (str) lbrynet version,\n 'torba_version': (str) torba version,\n 'build': (str) \"dev\" | \"qa\" | \"rc\" | \"release\",\n }",
"returns": "(dict) Dictionary of lbry version information\n {\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n 'platform': (str) platform string,\n 'os_release': (str) os release string,\n 'os_system': (str) os name,\n 'version': (str) lbrynet version,\n 'build': (str) \"dev\" | \"qa\" | \"rc\" | \"release\",\n }",
"examples": [
{
"title": "Get version",
"curl": "curl -d'{\"method\": \"version\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet version",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"version\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"GNOME\",\n \"distro\": {\n \"codename\": \"xenial\",\n \"id\": \"ubuntu\",\n \"like\": \"debian\",\n \"version\": \"16.04\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"16\",\n \"minor\": \"04\"\n }\n },\n \"lbrynet_version\": \"0.47.0\",\n \"os_release\": \"4.4.0-116-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.4\",\n \"torba_version\": \"0.5.7\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"GNOME\",\n \"distro\": {\n \"codename\": \"xenial\",\n \"id\": \"ubuntu\",\n \"like\": \"debian\",\n \"version\": \"16.04\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"16\",\n \"minor\": \"04\"\n }\n },\n \"lbrynet_version\": \"0.57.0\",\n \"os_release\": \"4.4.0-116-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.5\",\n \"version\": \"0.57.0\"\n }\n}"
}
]
}
@@ -360,10 +372,10 @@
"examples": [
{
"title": "Add an account from seed",
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\", \"single_key\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1574265320.2105434,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH\",\n \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"ten hope good unable volume uniform soda shell issue blame lemon mean\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\", \"single_key\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.8771687,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
}
]
},
@@ -401,9 +413,9 @@
},
{
"title": "Get balance for specific account by id",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}).json()",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"available\": \"2.0\",\n \"reserved\": \"0.0\",\n \"reserved_subtotals\": {\n \"claims\": \"0.0\",\n \"supports\": \"0.0\",\n \"tips\": \"0.0\"\n },\n \"total\": \"2.0\"\n }\n}"
}
]
@@ -438,7 +450,7 @@
"curl": "curl -d'{\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account create \"generated account\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1574265320.0034864,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH\",\n \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.6951761,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
}
]
},
@@ -493,24 +505,24 @@
"examples": [
{
"title": "Transfer 2 LBC from default account to specific account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001276e9cfba73cb4448a96198655b86391ac3da3a508cc0efbef344f9be34ccf1b010000006b483045022100e0d7d563ba1fef74e214800b5ef2a52b39a1a028f669da9c2e5a929faabb799002200342f38bba0e5f98b2d2257e3614fb8923ea67a74bca5bed2e704ee34025f348012102474c29b50715004a9ebcbd3437d191003a07d070e7d690f308d6617784f6b589ffffffff0200c2eb0b000000001976a91430ef0de4c1658b4786a47735a51889541f4ea0d888ac90d7ae2f000000001976a9140954d00cc8870a6fffe95dd68a4b8c0b43e0eb1488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mii4sVHEHUe2b5ByScY8YRy8uoFHJQQiLL\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265351,\n \"txid\": \"1bcf4ce39b4f34effb0ecc08a5a33dac9163b8558619968a44b43ca7fb9c6e27\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001f626854efbd538a7fc5170b5a945672d21c7c7424c9d157437e35c91fcb7d186010000006a47304402203cf140d1799dd7362424d9c5fde4d626fe53639cc7aba3923ba4b67c751abb14022025b372e48b89b34c6125b3ba3b6adc2c8b3d199c38f535f7d7774031ccb6eafd01210319fc05001cb1e655bde5f78cfbaf99afc6dde8c24ab72ec76a3b7117e3e52a68ffffffff0200c2eb0b000000001976a9140a823bfea253ec344d0d820e36a7c821b4b9a56488ac90d7ae2f000000001976a91406091021a2942d877e0cc114960e14d451f4094b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2qHgdfzNg8NfkXzggryosZrdxcExzNwyF\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787037,\n \"txid\": \"86d1b7fc915ce33774159d4c42c7c7212d6745a9b57051fca738d5fb4e8526f6\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\"\n }\n}"
},
{
"title": "Spread LBC between multiple addresses",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"from_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\" --from_account=\"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"from_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000016cbd18b25215142c6ed3cd910b4232e5a132ffc014607181d3a7338c3f20570d000000006a473044022017d83b4c85717d50123a5546972c87f9a91eaeadfb115b989f59cd3ce19a268502203bd0b5b501a2dc8b86bee47bc89e4e1ef32e6fc07408031dae4fc962dfb26a1d012103695b56b93635a3b926f1c545dc7a8f04589c6b92a0b3cc85b6837001383808bbffffffff03c0687804000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88acc0687804000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88ac6cb9fa02000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1574265352,\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --from_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001bf6d56758c48ec7adb2b8afd43913f4235cea885e1ff844ab58ec5fefa4af5a3000000006a4730440220099ead4341368eb214450dfc6da61605a0917b989625e470764951af9d035719022028a1aecd1117d9a6c5618ab9eb29d88d7cfb035becd79043aea4e47cfbf302be0121020477c5ab886701bae21cc2b1775af6f704dd4a5326686a18139b7bd1b956f38bffffffff03c0687804000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88acc0687804000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88ac6cb9fa02000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\"\n }\n}"
},
{
"title": "Transfer all LBC to a specified account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000034a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555000000006b483045022100b5aa96cd17b50de67f7af1bbe80a6ffa592503d4311f3d30393d0895212f868a022027f9307becff91ad895045143a31cca8a1c2a9e8c9d4c612d44cb51a0d2cbca1012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff4a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555010000006b483045022100e5cb8166ad69572fe6e43b5a15013ddf552c901f2e7b2d55d886202c1a31ff9302204f004c6ba66afa8e4e9ac58d61a11f7d126bbf8e69646a185a626ef51ef8f380012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff4a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555020000006a473044022028da4cb091fb903f6eb27aec53049682039e86161cb12537b2d0d34834475a97022063ae7817c85d47fca9fbc83e81e0ef6f7ce2592a1cd444984626c135df0cc487012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff015027eb0b000000001976a91437f69c006d90d2724662b176517c895b2449b82d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1574265352,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265352,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1574265352,\n \"txid\": \"5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mkcrtKoGQxAsTRVywM8D6Js5rriUM7yzCE\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000035bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3000000006b483045022100ee58553826cedd5b9351ae6f0086d8bd708fb5fa433d5895dbc0f8805b43130702203368391620d0b8de296dff58f2bd803e1407cc77e21168035560866d7cb4f1970121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff5bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3010000006a47304402200a811fc0e2756a3ffa190bc681b6db9d0a256b09caa8c884634979db33e775c202206f377b5ed0cfcbec292fdefcd195d4f6dc819cab494182f892fff1333b6aa3d90121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff5bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3020000006b48304502210085a62bb096663852946d669bac6e1ddfb37cc6e53b5f5a86df3858110f33c11402207fc4485a1a69a2834d0e521ca4b879170c9d755fec917e3d88959ea7301e683c0121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff015027eb0b000000001976a914f4f8881aa702cc7f114d4039d0e39188d368224188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3rEu9EusAUzTr7gVuhYiWGFoM7Vs5SkAb\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\"\n }\n}"
}
]
},
@@ -568,7 +580,7 @@
"curl": "curl -d'{\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YRn7tNGJ5Dm7uXzsaWtuHQyqs1mEfPSa4c6CKM9UNzymW16TriuAq1m53iHmMsCK6XRGNQKFgZrkQmAmKXDa9R1fbsR2SAa\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WSAvo4W9rVBzqqFz2veB26nGaFyLh867KqXWPvQH3dxxJX6cWKQFShiTyqRaSRc3HR4eXmve3sAdXL91GfMvrYRFsqonnsa\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -613,10 +625,10 @@
"examples": [
{
"title": "Remove an account",
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1574265320.0034864,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH\",\n \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.6951761,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
}
]
},
@@ -703,10 +715,10 @@
"examples": [
{
"title": "Modify maximum number of times a change address can be reused",
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\", \"default\": false, \"change_max_uses\": 10}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 10\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1574265320.2819548,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH\",\n \"seed\": \"boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"default\": false, \"change_max_uses\": 10}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 10\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.9331355,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
}
]
}
@@ -742,9 +754,9 @@
"examples": [
{
"title": "Check if address is mine",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV\"}}).json()",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -791,14 +803,14 @@
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet address list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"pubkey\": \"tpubDA9GDAntyJu4NgFPKZxseA97DkktAarw2r6TSR7DrCf1UgkGt9wxMM92tZFgQSAxLUQRj46d2BwVWrVpogjXWbBJ5YmEsCNr9bH1dhZKYvf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE\",\n \"pubkey\": \"tpubDA9GDAntyJu4SViVfoRtyZoEKQTcBWnRGiYQkii83dc39MEtQrVGSavkPFPB2kTc3bFGB3VV9osgpVanZGgcE2XNXU1sBGoo9RETWUWDuCq\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mgQqoGzjchpufkZEJKERzef3iChhdQYsb8\",\n \"pubkey\": \"tpubDA9GDAntyJu5353qrDsn4R91yFpdpNoV78Q9DqPcb1mx8wBh9SwMZSAzBRhQpokcKv5KMBVspC6AK4zKeCrw7vw1e2jx8usK6FH1nv8uwCq\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mhfp8CpSpF7pMhecmJuUNdFdiQe4co28FJ\",\n \"pubkey\": \"tpubDA9GDAntyJu4pKENoSXF3dWWWhCmB9L7UcqJWkruaxvtQYeepdMdz7o8xg1DQBaMRa1rN8F2kUKcKvxJbTKUd28jtQwrfVsEu3EYPrUPG8y\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mii4sVHEHUe2b5ByScY8YRy8uoFHJQQiLL\",\n \"pubkey\": \"tpubDA9GDAntyJu4EdgFqxhSLBqEwjoTSX2HRRiJVFZpbcruFJsso1EKmu19DdBc63G1c1pT8HnUhovm7NCSWeVyvE9Q9wGA4JqdJ2miWqhdzkL\",\n \"used_times\": 1\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mjBSc6kpP2gNzb9zN5LspJaQaRnLwMz9mA\",\n \"pubkey\": \"tpubDA9GDAntyJu4KF3RnQ2xracdQ4o6hVtzzuZPPEkE7S3kJz9bbK3Hu3bPsFm7dJZEJFenc2LGiDSh2PL2DMDe46XgvjuKBGtEv1UcEx7xhBB\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mjCepq2yajcN19LiVjzpp1vv9HaLBohX6p\",\n \"pubkey\": \"tpubDA9GDAntyJu4nBLAumTT2q7zWUbRBG5KHnokuYtP6iZvRprHSgvmbGW6U8rp3qrdc5EwwtA8bfXPr8oHUhWqyFghAuje6duXCUSTwnF5neD\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mjD5Gzs6Y6i1EXrozYTVFvYhtR9yW68zzR\",\n \"pubkey\": \"tpubDA9GDAntyJu56yVj8PtkFqEPv1TFfAJ28esQCsWoWYGwpvjCjogrD6WE4oWWftqUGay1NWQqSpU8zTahTBe4TH8tDqbsJLUaLBUpTh6qKFK\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mjjAfXyvgkN79EVAV2RaRJnEr3zCbYrfik\",\n \"pubkey\": \"tpubDA9GDAntyJu4dVKNCK99aJwfUAtt8Vo2qktd5WbmndJRfEPht2h4nh3w8gAvDWvvFUd3amLZtouL5Ytd3ReHG66ar2my4BHd81oGWTc6pK4\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"moeFade6p3SeJrCCLtW8n5xQeC76MmK6rV\",\n \"pubkey\": \"tpubDA9GDAntyJu54ZMryfAAwwUkRTfV8tB6JRi2zE8DujrgHkAFU3ijtG3BbAJLRk5EuPPvyVXas2B1GDy9R8y244y2BECwLfurm7dEjp6h7b8\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"monUko9N21KhSU64cyR71JmXrCwEgASsZD\",\n \"pubkey\": \"tpubDA9GDAntyJu4sgm88kENFkhGUcJcEVTdeXygAkYdV8CH9Wc4KCRR5CPwk88xTqb1eY5mFpxmLeB66UhsZ5mv6joycS5dbrXzginoo5LdHPt\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"morRT4ExEyDWP11jMcr1HgZEq41QcScjzV\",\n \"pubkey\": \"tpubDA9GDAntyJu4bHxs6B2Zyg7qZyrkWD7TxUPKZgMtB3EyTdQ3EFqCbZbDBbVBDhogS2WyBYvwkdLJv2upYc6qZiKqwFo9cHgLfKEXZnYwbN1\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mqdTgFwnMxuQWtH1ye1aAUrfdB94sZ2KxM\",\n \"pubkey\": \"tpubDA9GDAntyJu4P99V3pyArHs3MKE7Sbc9Kn4tHj8rtfVakDn69xJcpyCF14JNLSMSogKYqkYfHnfdvtrjCoMjLB7yx1opx3AdCvs3Jvp51uj\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm\",\n \"pubkey\": \"tpubDA9GDAntyJu4G5PVHd8A9DHUsQypRnevFAh77zdRoJMrCAW9qd8PfWPKP1muVHBZWhmr9fG4RGmwoy7jZ4geJ2mB8nVgJM67c5bU6krV7bo\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"msXM5XH862HzC7kjS1XKEG7L5whgULwhWS\",\n \"pubkey\": \"tpubDA9GDAntyJu4tuWbToebo9eMR95uiGo6x58botabQunqkyTrGojrJTE9TuTNmN21neDtaENMMbookzSsgpGJg5rNxNbWNBY9dvA3BY6p24X\",\n \"used_times\": 0\n },\n {\n \"account\": \"mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb\",\n \"address\": \"mudPqRHdTfGUwMtpRJpQNJsthhDRjXS53H\",\n \"pubkey\": \"tpubDA9GDAntyJu4Z69jjTHEGyEcf6xjyG7v64NDJcz4cgSWKqoLGis552MY1pAfcrWxfuutTBcdukpq8gPJpgU7BiN3S8MuUTJj4WB726RPJab\",\n \"Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"pubkey\": \"tpubDA9GDAntyJu4TrJhMhaeoxsf3KznrGecoJfwGzrNxMxokxM12paw697yxXMkJdcdCfoTW9Zmi6EMKug2DLsDpCcgCzYqaHbGbKNjbkjS3qk\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mgXfHPzpiAJuPDeBXhDVQmwpQsRwrQ3msZ\",\n \"pubkey\": \"tpubDA9GDAntyJu4vvvuf3ZfJzi1HBXTdrcrpNCZqWrwAmfa7e6Jc6AMb9TRmLvUaSjXrHg1GpqRqwTXkU7KeAsYNoXCr3iuPSoVZKSbcvN5oMM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"pubkey\": \"tpubDA9GDAntyJu4NNvtdYwfqaFhTwjXhymLnRTvLCLuNEbkKpEdChkQyHhkJMzrqMxLYunNimWfatywjrcZogcqCo6CtpPRZfxvsmmTTSisVnG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjoRtVG4ghTdsRuuDorE7RKXwKYDP5jzRV\",\n \"pubkey\": \"tpubDA9GDAntyJu4WHgaUn84C3vaEw2FbBB5tbhNQfsVSmBp1oAinGKakGgLwvDUWjhJnnVGwcBiyNU4xYYmzXEDr3Yy5QHq2HRcR2tKDg91Ryj\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjtFmUSHfvKQ1YJMD7QZKaZoRTV3Et567P\",\n \"pubkey\": \"tpubDA9GDAntyJu4n5NEU7oHd1rj9wiUTMB4TD2im5y4LjxXUKFAAKdhj2qiJLDSjkmMQgxRf9MQwmKWwxDbEeeym48o28FwtG6TNYRRvTtJtu9\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"pubkey\": \"tpubDA9GDAntyJu4QyP6CWsuhNf24A3kpr6hdHur3V8z237Kgg45P5BPXZYJJKd8UVFyroZ3uYSmtDJwhAuzg27ovsTNt9Q98UMx1xUFTYYXM69\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkJx7UPdnqoFcaYB6jZkWUGY3Ji4z7NtJ1\",\n \"pubkey\": \"tpubDA9GDAntyJu52dx53ttzWLsT1mExLJ3MyRYsrVd6cgXB8KHUx6vfqxYc2gVAXEmRp9w1FxukgSV4fMFebVF3oH9d8WcagQg6xeFMoMRrkwJ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkcoQLhx9Cvvx45fNjXmQaarDZCS12gEo5\",\n \"pubkey\": \"tpubDA9GDAntyJu4os9QDdEYzjAdMoNYneChu1mTgpd7y5rtJXULZ1yG2gWhaptyLzZnkPBLEcbu9fno6rpjw1fPXURt1dfc4Cj2ysfTZwwDJvg\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkzzf2aKuyvRjV2uXfBwWTJWaxVeSoeSHh\",\n \"pubkey\": \"tpubDA9GDAntyJu4sg1iqSdVMx5ZDu8PpEs73MGNHngUzhbDN5qbnMdiVbKgtCeV8g45fdaSZmWDEqt5oQQkE3PQd2AEVySthGzJkfDGVk4aAax\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mmwn9tCu54gvAaVXwP5gLUeSpHtyCt3mQr\",\n \"pubkey\": \"tpubDA9GDAntyJu561eFZrne4Uhryk7ya2jRdPVRZuAxMixhefoN4Qu1a1G6PDtNtTXNHy1yW1nmZxHW2GJKiicMSsoSJDRHW6tSkgmYvaL4y2E\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"pubkey\": \"tpubDA9GDAntyJu4h9BTNXfq1EubM3P92YcHsppTtAgKwLt7F6fUb77bQbQzaRCmnsVrAco8QXN4yBS17xWthKmvNYdqzvuLrny7xAYLvedN42k\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\",\n \"pubkey\": \"tpubDA9GDAntyJu4XuRPXtLyopDiZFA4JEK7u7SjGLVNqHvnDsJHKsnhwAm3ghkWMbcDbpA6UA84T6LeTv8H8uHWLSZ1uYx3nUv57jCMo9h7Q1p\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpaFPKG87uCvLBfx3scBqEt2gQmxDHvLEo\",\n \"pubkey\": \"tpubDA9GDAntyJu4iD68JkxhyEVVuMGA9YrZG9sz3FbGPbNeHKoQJvQ27ocYEBNeMsgfWb7FdrbGXVhftFiyRaF3vrLShB5LMA44RREGHePWhpw\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpfngLET5nhTZzvWRD71poTMg3y288NbM1\",\n \"pubkey\": \"tpubDA9GDAntyJu4bKkMM54YZkXFmmw4Rb6RnjazGb4mrkFYDKwRhMTpoRVF8LB8FtPuE1k9bhXXheg9MMQFucyDYyDMnCKzbmxgoaJ5CC8av2F\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"msrzeC3SYYH5DxhMt91jSkUcqguyKKPSJD\",\n \"pubkey\": \"tpubDA9GDAntyJu4z217gK7uH5RVaaFTTifA25guGnMMMt7EQBJDjzvG8NZiRBRfhqc5yoMo7UD9f5bakz9U7sLpBrwdS5NbDdrKxjjHhsudqZD\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mvS5DbYDZnnCA79uE4d49Vg5bxSXyLqScx\",\n \"pubkey\": \"tpubDA9GDAntyJu4JprXk2XBTLWfUw76U3y5pCSRcHdevM8gxhZD5xLZ9XXV3tAfTgxj77RkRiKKhq3KfMuBTaT79P6nwoMjk8XyT2QSWuEWdFM\",\n \"Line truncated
},
{
"title": "List addresses in specified account",
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mgjB6e1ezev8FY1ACnkmkDxjNCp5VC7Ano\",\n \"pubkey\": \"tpubDA9GDAntyJu4TFtXYGczh2A4XxW8noxE1dfMcLqjX9sMs8YNE1owV6ck3e9SN594tJiBdbTTqhbepa4JGFoWQRVCwzkEe5WC9ggfRQm7bQ8\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mgrgFeXbtX4DXFSkP8e4AEWSC6jULkZb63\",\n \"pubkey\": \"tpubDA9GDAntyJu4NVGo2ZA32S4SK3DVfKpYWpm6v9YgPcSobJvf8A5Gc5mAJGDzpnYaN9XyALhegTL21Wg8X8jC8AqfX8WS89q9rExJnPC6Kjv\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mhFB8td4KwVBy7hix8364L3yFSEiYuNbq9\",\n \"pubkey\": \"tpubDA9GDAntyJu4GC3Rh9ZJoxBAg3JS3wAXveny8iZBtXxyjZiyZNrQyTXarfBFfq3MzKntNRvgDAZvAs4f8sxwBgugf4vjEF2gE8ryjz79XM9\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"miKdTrdpBKoTvqSKgLZdibYgzZk5zszndC\",\n \"pubkey\": \"tpubDA9GDAntyJu4R6VQkrvDsNCqXw6buTQKvScS8QNKLwsPQ6NcqhaEDU9hpNYiV71f19DDGZyiQpLrr2xoNtKXELLrBW3uSyBfjrt9To1zQWq\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"miLbiPKfLD7c3T1FxfAtZ5idB18QdKmak2\",\n \"pubkey\": \"tpubDA9GDAntyJu4f5YeA4rhsqJ9yHGLjX7Wqa1DSGaC25bV86s5GGUkTvhb4X6DZ2d2qaBoCoGRkSfekVimbwQk187hzdLj6CCGtknPm7BjcRG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb\",\n \"pubkey\": \"tpubDA9GDAntyJu4P6JJWkvwPzYGCYjdzttU7QaJBHRSEzF8wDTGNPfNQPCShSnLDiqWpxbrEbMEi9Xzwnn3HmgxEKofcnhDLixjQsgAjpf5WD6\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mkGUuHLcLht61VH22buTvPpM3mTPctRBtL\",\n \"pubkey\": \"tpubDA9GDAntyJu4pGUqURvR65CVjtUWWhuNw467D5Cr3aFGRaNavXcYL1fkreM2XJWtPsNfCg1prhe2W3aqW8Ay4a1eWm69Vm6hqNrwTKvy9Nw\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mmgsvuPTWoTUHdD45g1xUveEhhUzRrfVaP\",\n \"pubkey\": \"tpubDA9GDAntyJu4rpvkPkGapDqWw2na6gaGFGX6KEK86WTiEyuoCcbmRvtvcPxnUnKXsacbbpByrQwLkGD9qGjhfk9oUY3DYHEn9m4kJoQuusx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm\",\n \"pubkey\": \"tpubDA9GDAntyJu4Jhq8X7ZmPJQSuUffLMUCAVqdAHwCdh6R26oieaSpFNGBhUk33nXc6uiU3apFynA4CpPBxG3FzPf1TMuYu1P82oeg8dMqTpn\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mpqKcHmmWE1qY727M7ANv9oBXir5VbHkdP\",\n \"pubkey\": \"tpubDA9GDAntyJu4H9XUa4RnDvRodqUrbJkAXamJwoMiXaseyEnwpqwq2XbkceBUsotfYr8r3YcDAwZce4TJ2rToT4MjnKCAoWTwka996khajde\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"msvdBNEf1cFSszvHNcQu3ANaK9g8gj582c\",\n \"pubkey\": \"tpubDA9GDAntyJu4WjEZzxFAUYS8KUcRM8DorcmbRF69PHaeDm3eu8YoJMMut3PL8RZEPSmvtc64F4Bb6GEJTcak1yw6ADZL6LoonK9E1khHzXM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"muB4RCbSL3tF7onRRbUB4gRWTQEoT5ZcMz\",\n \"pubkey\": \"tpubDA9GDAntyJu4zcr2HyFHb3CfU44pYhwiS9TaRQySkVQfeQLzP1Zv9RAAsz3K3n8AcraHwf6Sw8AfRK2nKSm4g5Fto5iy1yTve5vGXEa5B48\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"muC5eaJq2CMrtE7te9cWcXUibWhsJnGuAm\",\n \"pubkey\": \"tpubDA9GDAntyJu4TatXRgBNSPcW8JBr4iB4jQ5v8A94Mm4uYvrFT75kNaXucZvewH9YxDMveySVfGbaxcLNv2A4mSavK6SZ3E6y5nvqJDix7tB\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mucSZwuwbd5xyfLxMu92GEBYSWM1pERa2v\",\n \"pubkey\": \"tpubDA9GDAntyJu52c37bwDHuV6CqiNXMGgnksYsK4hJrHQ79e6aKCpk9Qv2sQdLGm5LLq4J18Q89fdoQN9hBgQCZMkgQhhp5wXC8vF4ctwcXnG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mv2hshHynpW7VyX8Nt7xT5ti9aC9NQyAwr\",\n \"pubkey\": \"tpubDA9GDAntyJu4kmzUa6CmrsCBNmVdHY95RNAkT8T2dBb4oLefiW7etod7B5t3Nh8wf6LoGDDaCrst7YC3NxNxsXibC1QsQGK7LL7HvBxwoxP\",\n \"used_times\": 0\n },\n {\n \"account\": \"mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz\",\n \"address\": \"mv5aGKkDs2VDxQ2u36iSfqcZn51BGMwax2\",\n \"pubkey\": \"tpubDA9GDAntyJu4bFmupNxnkNd8ytpwAGZCtJcVgRzvPSaNn1ok8GGnxgrrdkXQZDyu7Zsk1EWhoMktadaDYSnjFjVd2oacfgWLTFfGHd7NmLV\",\n \"Line truncated
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mfat1w5NsfN7tQqYeGYtK65Zm2ey39DGUC\",\n \"pubkey\": \"tpubDA9GDAntyJu55myzAeyCFYX3RbLMYRp1fKJvKKViW1W4tyeG9ACeBZsKZmrAxep6tHEHL8sXojD7d3yauJJh3aXDEeSKztCXRUFifSYx4Fg\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mfxZThzQEkE5eKzF4B1cS5MLaB87RLAZbi\",\n \"pubkey\": \"tpubDA9GDAntyJu4rwh3fvSRr1EVsRFSvGXXF5GHNzkpoH49s2W5vzcfn533313cyrdMDstefavVQwxEd3jaE9x3d7CZSsGbwJvHiXMTfy2pkLQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"pubkey\": \"tpubDA9GDAntyJu4GonvTxsUMQQNFdwnSwqubdkk3bh7SeBxfBAZ3Wddj7firFd711BXCkDsqC36jBSEYi1SDER3F7Z8vYsYFsUHoRtBHCFtnvK\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"pubkey\": \"tpubDA9GDAntyJu4SA3YfjCsVDofEka7XFaTF1cMfPn3ZmKs9xdZMU6vSdLGb71a8DvcpDWEP6UaDews2Y6AKtm8HHduDv8hmnRW4EC9w1G3ELf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mjRGG3iw1x2EM2mTPW7YRQxjNoYYLQ5fnp\",\n \"pubkey\": \"tpubDA9GDAntyJu4eEFTtCkDYMLLa7ppmgdTgLmUSQSUabXoXasNXthh7vZKzTuh1HgVSnGyyxE37ncqaR2QDG5GvB7kSKv3kLdrpyeU61Q7DZ7\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mk4CenuF879p2u96oqJLzBTeiMW8LCMYbb\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZGGwV5JjN8CRQxdh2nr5afiBiE23zR6SHE118eguHX4iQkzhzZx1L1SrqePkKL1Hc6Ut7vGJ8VnQsH4qvAQSqnqpPYfikUX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mk4VyfUwWurYozf94ZGNTHtWtreNC6fUbU\",\n \"pubkey\": \"tpubDA9GDAntyJu4vPcGm18dbULrbAKAvv5wQ6xKuxN3MpvaxqcEh6X59fHWmDRk19xn7iH4Pxrqtc1aVoqEha2gtoXELLzQ4yjPFhy6xght4UC\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mkLQGh5bwpQ7YGQvPn3QxhndHWsM67ohoT\",\n \"pubkey\": \"tpubDA9GDAntyJu4DzSi6gLMPrLeSJBFhEMbXPJF9tYi5S3uCNUbpFtfUZG3Zpj7hRTLRUeznSzH5jozXXuq72bQ43X32ShSzawhC3ZdxZWekiM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mmt58zLT21KRiCwESwajXAbJh8kwCzo2o3\",\n \"pubkey\": \"tpubDA9GDAntyJu4Tp2hABXqkwJxHFeChbqJ1CfbsaCNqxyFAGQbEGGza9UmBKSbZCxMQizwJiyjNtjsfmSB54odAtwLkuceLitsPYwrvzLmmj8\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mnBSAY9BnmoLPzzXm2Xoc15oGXvDMcnTcS\",\n \"pubkey\": \"tpubDA9GDAntyJu4MHsHpZk2XBCrF5MnTt1rxrtoZTGyXwUUDz3ZLzJipGc8iYthCFGKnTwEGoQrtCR8gwhsMewJAf9T4jWmvvo8nD6CKdB8oZx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrKcp7mf3d1byeZmDfqJ8BdRXDCmCi39V1\",\n \"pubkey\": \"tpubDA9GDAntyJu4EnPW1VYseMJ5rsm8UeyrDyK3t5SohYoTKFkHseexhhMi4C2opLjn6BivojfDhiFe61R1Rhqpz6DWjkiqpB1SJkFPaevdJv9\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrQZgHT4iNRBTKAhuwq7GChomJnaB7bFmp\",\n \"pubkey\": \"tpubDA9GDAntyJu4k3siG2Vpg4FVePFqgc8eFjCtC2FZszwpuqrXzfPiA1X9n9yXeekwkQiXS93j5cUdz1Ai4ACcYhHFUpnw2N7pMiuFpW4BS4K\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrhvBJT8niVCGT4bmZ7ngGDDNm197cNA8p\",\n \"pubkey\": \"tpubDA9GDAntyJu4yJ7wHRBDCnyby95izJiopfRpgKP233hkSmo5w8gshmdg8YZXLXo8wprsM7YEREE47AQ7pyFYFHSWdYW4RHtNkcf3uiq8LH4\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrxxeBwGQYwLm5oJRw7tNYBU8b82FNm6Vb\",\n \"pubkey\": \"tpubDA9GDAntyJu4LeunT5yfFALZJu21VTqaidFLnPHPkZeswvJHNLCeheGakQidVFfW3mNws61eeWUULE4GtEJRSQFQ44au9ZEwVLcTB7epYvs\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mtk5c8YcgDtkF1YhzWwMNztMnJu71G79mP\",\n \"pubkey\": \"tpubDA9GDAntyJu4vgagzy68rLgER3fSxQ9pb2XrQBdYwVx8bcAf97TF55dhB5UM2qFnWkCqvNHCwB9kE2uNwhBMXC7haMWT5cn2H3Lc4ibvrma\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"muuy1gdKpeFDhprf6j2DBZh9zAyMh7PXPB\",\n \"pubkey\": \"tpubDA9GDAntyJu4JxKBQd6Ddrrs8q5zntWfiBzGwiTxCcxMPa6nKcoSicNN4HjJYb3jaCeC6WDq4nz4EHePce6KsVQ7mRjqBKY3wxG5RFrxVV9\",\n \"Line truncated
}
]
},
@@ -826,7 +838,7 @@
"curl": "curl -d'{\"method\": \"address_unused\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet address unused",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_unused\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV\"\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"\n}"
}
]
}
@@ -876,10 +888,10 @@
"examples": [
{
"title": "Delete a blob",
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605\"\n}"
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete 756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted 756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"\n}"
}
]
},
@@ -957,7 +969,7 @@
"curl": "curl -d'{\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet blob list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605\",\n \"0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e\",\n \"ff42b24e4b846dd1baf5e2b0f48c53b75184e2ffef8d20e770797704f0ddbf58ba8c243c7e2658b220d6bae9950e7278\",\n \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\",\n \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"2284855cae256da0a8adf8f8fbfc794cb7ec25c89ddbbe908755d762bc59d997e368356e226b02d0f0984f87ab9016cc\",\n \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1038,10 +1050,10 @@
"examples": [
{
"title": "Abandon a channel claim",
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001252e1cbd42a9e0629e127cc0a74168815a6610900281c90b5193c7660c990087000000006a47304402204023cb7d7bd038b65700e5121ecee2f08505b48561f8ca107f81980d33b220ab0220208af0641036108938197c076d1c9851eca1f0056d8b1e08394bcbd6b75c1d090121036e13c0c6a42f4d830bfadda1c3f130af17ca825ed79348a7de08548fd508cd10ffffffff0134b7f505000000001976a914f078ffcbc1414ec52d95531ae92f24d58a0c38e388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3STRGLnoQSevNzSZWZ9oA67SM4apXpFzn\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"99d49ed84cf7532a89775aa62be74dabb715320a5fe7d21c8e83a97b0e85c6c5\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"99d49ed84cf7532a89775aa62be74dabb715320a5fe7d21c8e83a97b0e85c6c5\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 78e0769111742d63461837d031f318ba33385c77",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012352ea95064b18dbc55a0fef31fec33d26a27f27b5d38ee923372db353d0c22c000000006b483045022100ab6ae56030c41e53f218a52911f250e1d45a1aa508ad757119f8364f8c8f532702206e55772f83786e7574e83b69c434aa4e890068ca9fca5a1377b73628dbfa0466012102525cc908004ae60af279c13dcd258cd78c21008d49cba99f6897e755fbcd8973ffffffff0134b7f505000000001976a91416ea93f6448bc517de5b07dede7816f828ec9a8688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhc8B39XVpZP9KEwQDHjb1B9PmiF91usho\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"9eeb64a183fe004303dc37081669a439c8d8960c49192fe8e0b1828a70c0c1eb\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"9eeb64a183fe004303dc37081669a439c8d8960c49192fe8e0b1828a70c0c1eb\"\n }\n}"
}
]
},
@@ -1171,14 +1183,14 @@
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel create @channel 1.0",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000016cbd18b25215142c6ed3cd910b4232e5a132ffc014607181d3a7338c3f20570d010000006b483045022100e328e296214c79e4cdcce2dd871b1cd931240af509fc7cb2b1d1cdc26b4dd6a30220567de67be6c7cea11fb5210f133c50db08c6ff5c5c4e5b431c63086003b5f50201210248c8856ffe16b8af0ab9914db4b4f1b3ee9caa94822ad6e9cc15e37d2f346d7bffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df0666d7576a914e5a5ec8c00823f369d4ba8abb114ea0b2028f21e88acc462a029000000001976a91477053863f3b082f79e4c835ee7137f0f8dd0725188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265352,\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": null,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001bf6d56758c48ec7adb2b8afd43913f4235cea885e1ff844ab58ec5fefa4af5a3010000006b483045022100d7aeb8e2d3532a5b1dc234ebc1825ddfe969186fb91a7cea8efb18afd41b53300220046a29c67406ff3a94cf38e3bc2330fe01c5aa827f528cad7c8b213d19c318930121029c1a1db6dcdd769b9b0f6386840215fcb12b76768f1dccde101f5b6fca8130d7ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e176d7576a9144f1fcb21dab8b64bb790d10d206273a6c62e2d2488acc462a029000000001976a91434807a5145d4898b3ef0d69b2c83ba658aac505a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": null,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\"\n }\n}"
},
{
"title": "Create a channel claim with all metadata",
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel create @bigchannel 1.0 --title=\"Big Channel\" --description=\"A channel with lots of videos.\" --email=\"creator@smallmedia.com\" --tags=music --tags=art --languages=pt-BR --languages=uk --locations=BR --locations=UA::Kiyv --website_url=\"http://smallmedia.com\" --thumbnail_url=\"http://smallmedia.com/logo.jpg\" --cover_url=\"http://smallmedia.com/logo.jpg\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001252e1cbd42a9e0629e127cc0a74168815a6610900281c90b5193c7660c990087010000006a47304402201c33fd93ea28b6ca66373e0763a49824a461578ba0b695baf0f43a70eaa97b5802200b7b172f3658a846fdf27885f0e2a770fb6096f1bf6ebda0fd854f848b7a70d801210281518437b8629fe82ada4cbc3fa290655706c66a31c477471cfa1fb69c1c64c2ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000493068955eb537a2d82dccbd84950341f5158c5a2a6deaa4950042b55066b248de1a19a75bc85e0c11d64a82d9145ba15601e6ecce51154ab155b14bd34d12308121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914c14a8f51d1028696cf67e23bb5514e0e2431446d88ace221d305000000001976a914b8a9a496d90669cdf7d79dc115a08cc3a82f186388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"myKgmPDaWLycFbgwqF6ei5fg1tYRivVZ2e\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"my8z2awNqM4VKJGTvfryoTeKg1YaCKu1kt\",\n \"amount\": \"1.0\",\n \"claim_id\": \"0dddf44763759c5d48f4b517c4c6edf91a835938\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#0dddf44763759c5d48f4b517c4c6edf91a835938\",\n \"timestamp\": null,\n \"txid\": \"225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a\",\n \"type\": \"claim\",\n \"value\": {\n \"cover\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"description\": \"A channel with lots of videos.\",\n \"email\": \"creator@smallmedia.com\",\n \"languages\": [\n \"pt-BR\",\n \"uk\"\n ],\n \"locations\": [\n {\n \"country\": \"BR\"\n },\n {\n \"city\": \"Kiyv\",\n \"country\": \"UA\"\n }\n ],\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000493068955eb537a2d82dccbd84950341f5158c5a2a6deaa4950042b55066b248de1a19a75bc85e0c11d64a82d9145ba15601e6ecce51154ab155b14bd34d12308\",\n \"public_key_id\": \"mpiMSeZA6qn3GvZk8KfChJgLWcfsskdZS5\",\n \"tags\": [\n \"music\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"title\": \"Big Channel\",\n \"website_url\": \"http://smallmedia.com\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mxMMrM8xQMSSfAaTqjwXds4jjLu5CKjMHD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012352ea95064b18dbc55a0fef31fec33d26a27f27b5d38ee923372db353d0c22c010000006a47304402200d248bab954394c408ac383c04b56e42a33f4a165a54a567b36e499c9d5cbe6a02207e9e01f0c75eb2736b53ab1b9d7c2301f4a8e6e7ace8e0192bc23d0f8c54704b01210377c7f0303e107007fc882517927bf0ba6eaa8220d9cb5d8856fc7badba38c78bffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004bccd90ca1f59750072516c9784f2b7dff52b24c8a6bf7151efe5a632834c3d0f7428e08ed28f4d28e3e1f9a2faaa4540b1ba943cc0e2e8104251f4c76e7e2ce4121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914609fc28b7c0a1f66195d5c51cf140d210f7df2fc88ace221d305000000001976a91428ffdcf0a939d86244b11d5be68013689809080588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msVHKAhna4JmZbwHNA8zm85yJhnATsrGiw\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6ee246f886ba0081b1d0e84dab086ca1b036e234\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#6ee246f886ba0081b1d0e84dab086ca1b036e234\",\n \"timestamp\": null,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"claim\",\n \"value\": {\n \"cover\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"description\": \"A channel with lots of videos.\",\n \"email\": \"creator@smallmedia.com\",\n \"languages\": [\n \"pt-BR\",\n \"uk\"\n ],\n \"locations\": [\n {\n \"country\": \"BR\"\n },\n {\n \"city\": \"Kiyv\",\n \"country\": \"UA\"\n }\n ],\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004bccd90ca1f59750072516c9784f2b7dff52b24c8a6bf7151efe5a632834c3d0f7428e08ed28f4d28e3e1f9a2faaa4540b1ba943cc0e2e8104251f4c76e7e2ce4\",\n \"public_key_id\": \"mzgLp9FA3JfjL2DaTg4aJvY5oNvTcZi1zL\",\n \"tags\": [\n \"music\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"title\": \"Big Channel\",\n \"website_url\": \"http://smallmedia.com\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mjFjqQMMroPbKTLQ2KzTY9UFHsyZLXJnYa\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\"\n }\n}"
}
]
},
@@ -1261,23 +1273,29 @@
"type": "int",
"description": "number of items on page during pagination",
"is_required": false
},
{
"name": "resolve",
"type": "bool",
"description": "resolves each channel to provide additional metadata",
"is_required": false
}
],
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
"examples": [
{
"title": "List your channel claims",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your channel claims",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1434,10 +1452,10 @@
"examples": [
{
"title": "Update a channel claim",
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 76f9b804d1d7a5a36eeebab1fa29333926f8fda1 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000025938959fff1c02e7e0e6d105d4a0e10180084338e0decaba965f2ebd39afc46f000000006b483045022100b276b1a4d919aa367b30a4574b92c1f8180dacd1ad1d69a3cb49fd9dd7e36ef70220037d6ad8f11c92fda22e1222af2ad2580e74921ed251bfbb1059c1556f86e77d0121036e13c0c6a42f4d830bfadda1c3f130af17ca825ed79348a7de08548fd508cd10ffffffff907d4d39af576b3a8887578c4307a3b1cfb8d353cbd9eeab67bd649d9c5366ac000000006b483045022100f6fe619cb0d30e26c3495a53bd4b2fc2a643e5f10b5fa009c2e29d02ac0c22c202207eaa90180ba9e77bb6fd4697a08bb7f853de7e63ee760928e66631354cbd9f2e012103491fd5b5854dc05014d0f7fe31dc357816e104284bb2657c2d2753042aa2d609ffffffff0200e1f50500000000a6b708406368616e6e656c14a1fdf826393329fab1baee6ea3a5d7d104b8f9764c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066420b4e6577204368616e6e656c6d6d76a914e5a5ec8c00823f369d4ba8abb114ea0b2028f21e88ac6ebeea0b000000001976a914c350b9ca410642afa1bcf86adbabbeaa995ff26388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mkcrtKoGQxAsTRVywM8D6Js5rriUM7yzCE\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1574265352,\n \"txid\": \"ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": null,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"myKgmPDaWLycFbgwqF6ei5fg1tYRivVZ2e\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 78e0769111742d63461837d031f318ba33385c77 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000020e0a7f2b61a7a06502fe601413fe7e3c6698ce3bec4eed290d27d08a2a61b699000000006b48304502210092930b1f59557b7f5da4a5d8448de598d65dd3174e69d8aa8fb7011174262e79022023ab1dba1209c3b035c54fcc498e929296110f312a85de2c86e9da4622b3be95012102525cc908004ae60af279c13dcd258cd78c21008d49cba99f6897e755fbcd8973ffffffff6d10c36bc0ba866b7a37c31829c49b5f5d4ecce95850f59d6aa60cc122d2f929000000006a473044022007ae12a8b5fc737d8f20151b3a488dc299b7362b0f44c8a40a3731dbf7cc1aaa022030d0f0580c954b07d07f4fbfd124f1c16cb4c90afe9da30807df97707eac87f3012102aa0c29c64c81687eb888e766b20650fb8847cf07f624d2cea8c910f7a0c0e1b4ffffffff0200e1f50500000000a6b708406368616e6e656c14775c3833ba18f331d0371846632d74119176e0784c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17420b4e6577204368616e6e656c6d6d76a9144f1fcb21dab8b64bb790d10d206273a6c62e2d2488ac6ebeea0b000000001976a91483508dcd88f7825b64342cb079447438b1d237dd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n3rEu9EusAUzTr7gVuhYiWGFoM7Vs5SkAb\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": null,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"msVHKAhna4JmZbwHNA8zm85yJhnATsrGiw\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\"\n }\n}"
}
]
}
@@ -1479,23 +1497,29 @@
"type": "int",
"description": "number of items on page during pagination",
"is_required": false
},
{
"name": "resolve",
"type": "bool",
"description": "resolves each claim to provide additional metadata",
"is_required": false
}
],
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
"examples": [
{
"title": "List all your claims",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your claims",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1713,6 +1737,12 @@
"description": "content download fee (supports equality constraints)",
"is_required": false
},
{
"name": "duration",
"type": "int",
"description": "duration of video or audio in seconds (supports equality constraints)",
"is_required": false
},
{
"name": "any_tags",
"type": "list",
@@ -1805,14 +1835,14 @@
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --channel=@channel",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#6\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1574265353,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1574265352,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": {},\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Search for claims matching a name",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --name=\"astream\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#6\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1574265353,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1574265352,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": {},\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
}
@@ -2220,7 +2250,15 @@
}
],
"returns": "(dict) Object with the `comment_id` passed in as the key, and a flag indicating if it was abandoned\n {\n <comment_id> (str): {\n \"abandoned\": (bool)\n }\n }",
"examples": []
"examples": [
{
"title": "Abandon a comment",
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment abandon b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"abandoned\": false\n }\n}"
}
]
},
{
"name": "comment_create",
@@ -2259,7 +2297,7 @@
{
"name": "channel_account_id",
"type": "str",
"description": "one or more account ids for accounts to look in for channel certificates, defaults to all accounts.",
"description": "one or more account ids for accounts to look in for channel certificates, defaults to all accounts",
"is_required": false
},
{
@@ -2269,8 +2307,23 @@
"is_required": false
}
],
"returns": "(dict) Comment object if successfully made, (None) otherwise\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n }",
"examples": []
"returns": "(dict) Comment object if successfully made, (None) otherwise\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"signing_ts\": (str) The timestamp used to sign the comment,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n }",
"examples": [
{
"title": "Posting a comment as your channel",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=ca642adaf52552f0bfc746c2ebae77724d123aeb",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n}"
},
{
"title": "You can r",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"I have photographic evidence confirming Sasquatch exists\" --channel_name=@channel --parent_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"d618940bf1b976f5fca41771f1ba2b6cbc8aa5bc7899232c37252498eb2c66ed\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"signature\": \"a57c7562d39fcaecb94bed0de0c71c826c3550fe29425b21c9bc3a878c31614082f1125b43d88b34011b6ac59f5bbbbd622c216be28a731966b5daf6268969ea\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n}"
}
]
},
{
"name": "comment_hide",
@@ -2346,7 +2399,56 @@
}
],
"returns": "(dict) Containing the list, and information about the paginated content:\n {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": \"A List of dict objects representing comments.\"\n [\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n },\n ...\n ]\n }",
"examples": []
"examples": [
{
"title": "List all comments on a claim",
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list ca642adaf52552f0bfc746c2ebae77724d123aeb --include_replies",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n },\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"d618940bf1b976f5fca41771f1ba2b6cbc8aa5bc7899232c37252498eb2c66ed\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"signature\": \"a57c7562d39fcaecb94bed0de0c71c826c3550fe29425b21c9bc3a878c31614082f1125b43d88b34011b6ac59f5bbbbd622c216be28a731966b5daf6268969ea\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "List a comment thread replying to a top level comment",
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list ca642adaf52552f0bfc746c2ebae77724d123aeb --parent_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
{
"name": "comment_update",
"description": "Edit a comment published as one of your channels.",
"arguments": [
{
"name": "comment",
"type": "str",
"description": "New comment replacing the old one",
"is_required": true
},
{
"name": "comment_id",
"type": "str",
"description": "Hash identifying the comment to edit",
"is_required": true
},
{
"name": "wallet_id",
"type": "str",
"description": "restrict operation to specific wallet",
"is_required": false
}
],
"returns": "(dict) Comment object if edit was successful, (None) otherwise\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"signing_ts\": (str) Timestamp used to sign the most recent signature,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n }",
"examples": [
{
"title": "Edit the contents of a comment",
"curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": null\n}"
}
]
}
]
},
@@ -2434,9 +2536,9 @@
"examples": [
{
"title": "Delete a file",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"6d779c509a47c97a050540a42863341eed6c47ad\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\"}}).json()",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"ca642adaf52552f0bfc746c2ebae77724d123aeb\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -2567,14 +2669,14 @@
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"f67a8b72104b6dba232cfcd28e7a4766\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879\",\n \"stream_name\": \"tmprsllesnu\",\n \"streaming_url\": \"http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"suggested_file_name\": \"tmprsllesnu\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"written_bytes\": 0\n },\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"c9a6d356aa9bba38a32e15e1be4651601c722462\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"e8d2b17d3193371ca7f6c2d13f5663bd\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3x8BYAScTPWfaCABx8F4oC56DYMc7havg\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1574265329\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpcsxmdo53.png\",\n \"sd_hash\": \"0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"480f1b30819f33b0963eb1fa2bf32ade4d786f722d616389Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 0\n },\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"7580ab9a0a85562a6f6c13bd59e84d0f\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1580787013\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpw_1zp_we.png\",\n \"sd_hash\": \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941cLine truncated
},
{
"title": "List files matching a parameter",
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"6d779c509a47c97a050540a42863341eed6c47ad\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"f67a8b72104b6dba232cfcd28e7a4766\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879\",\n \"stream_name\": \"tmprsllesnu\",\n \"streaming_url\": \"http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"suggested_file_name\": \"tmprsllesnu\",\n \"timestamp\": 1574265353,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"ca642adaf52552f0bfc746c2ebae77724d123aeb\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -2691,10 +2793,10 @@
"examples": [
{
"title": "Save a file to the downloads directory",
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1574265331,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"f67a8b72104b6dba232cfcd28e7a4766\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879\",\n \"stream_name\": \"tmprsllesnu\",\n \"streaming_url\": \"http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"suggested_file_name\": \"tmprsllesnu\",\n \"timestamp\": 1574265353,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"written_bytes\": 0\n }\n}"
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1580787018,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf0g7xmd6\",\n \"download_path\": \"/tmp/tmpf0g7xmd6/tmp2mvj0998_1\",\n \"file_name\": \"tmp2mvj0998_1\",\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -2957,6 +3059,13 @@
"settings": {
"doc": "Settings management.",
"commands": [
{
"name": "settings_clear",
"description": "Clear daemon settings",
"arguments": [],
"returns": "(dict) Updated dictionary of daemon settings",
"examples": []
},
{
"name": "settings_get",
"description": "Get daemon settings",
@@ -2968,7 +3077,7 @@
"curl": "curl -d'{\"method\": \"settings_get\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet settings get",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"settings_get\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"https://comments.lbry.com/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpgnoina61\",\n \"download_dir\": \"/tmp/tmpgnoina61\",\n \"download_timeout\": 30.0,\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"wallet_dir\": \"/tmp/tmpgnoina61\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 192k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"https://comments.lbry.com/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpf0g7xmd6\",\n \"download_dir\": \"/tmp/tmpf0g7xmd6\",\n \"download_timeout\": 30.0,\n \"ffmpeg_folder\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"prometheus_port\": 0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_encoder\": \"libx264 -crf 18 -vf \\\"format=yuv420p\\\"\",\n \"volume_analysis_time\": \"240\",\n \"volume_filter\": \"-af loudnorm\",\n \"wallet_dir\": \"/tmp/tmpf0g7xmd6\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
}
]
},
@@ -3043,10 +3152,10 @@
"examples": [
{
"title": "Abandon a stream claim",
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon 6d779c509a47c97a050540a42863341eed6c47ad",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001c5856fbb7009a85a78c9f9644b2d4f91bf6f7055718c652891939523a2278b6a000000006a47304402201d29042146b7798130463acbd5c6c3c4fa30963e5c45c9692696e719713ebb3702205bedc2f5e736588967442b98781a325a1f1059290d1cff1b1296c05fbde789e8012103f89a894c1453e0cddb844b1eb3f949ca2204d6ba34fc07249e47b55a8534a0b3ffffffff0134b7f505000000001976a914282fd11ceb5364d73f91cce828937eb2e5cd86cf88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjBSc6kpP2gNzb9zN5LspJaQaRnLwMz9mA\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"7c3a90172981e3154ad468ca9c977c0b7fac79f547ea65883dcc9bcbab7a3173\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"7c3a90172981e3154ad468ca9c977c0b7fac79f547ea65883dcc9bcbab7a3173\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon ca642adaf52552f0bfc746c2ebae77724d123aeb",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000124fbe60deb75dc0bb3612fa870e07330706a03e8ef89144f6b183cf2de303a34000000006a47304402204a2c679e653b096f5a8387251f751b74228bae7a70849c6be09fb5b5dc67af5c02205ca7604ebf3dbafae917015eb1e437810a76b36f930e71370b15596e56aeea60012102663f1832b7906bdce2af55d6950114be6d7e4bc3fae658caa6b5f7b8dbbdf47bffffffff0134b7f505000000001976a914991d30b9508a7cd112148485c7e06f11f76ed32288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"muUYeaoUkFAazwbpkdnE3ng5QgVTgnBQdt\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"f96b71572ed7a8fdcfa80aba4ef639cb0b31082ad89ac041edf1e0831334e1eb\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"f96b71572ed7a8fdcfa80aba4ef639cb0b31082ad89ac041edf1e0831334e1eb\"\n }\n}"
}
]
},
@@ -3086,6 +3195,18 @@
"description": "path to file to be associated with name.",
"is_required": true
},
{
"name": "validate_file",
"type": "bool",
"description": "validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required",
"is_required": false
},
{
"name": "optimize_file",
"type": "bool",
"description": "transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required",
"is_required": false
},
{
"name": "allow_duplicate_name",
"type": "bool",
@@ -3247,17 +3368,17 @@
"examples": [
{
"title": "Create a stream claim without metadata",
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmprsllesnu\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmprsllesnu",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmprsllesnu\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015938959fff1c02e7e0e6d105d4a0e10180084338e0decaba965f2ebd39afc46f010000006a47304402207998278ec7f74855a16f282ed334847982ff2f90a0a8126c056a3af85c297c8a022024c09f4335f4b64c506ccd75619a3e4a4e3e485e215519f8388edcf4bebc18cb0121039f01e128d9a2bf76bdac66ef3c860fc36e10ff6189f27a10d0115c85d86993e3ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d6d7576a914032dcda1a00c97492eba9cd3228eff69546c74a088ac38fb9423000000001976a9141de221c42b8c6ffaf4c2133b9c17353fa09fc41f88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265352,\n \"txid\": \"6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"timestamp\": null,\n \"txid\": \"9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"miExnY6VrwasxxmLwov7pxoSkXh5y6VKNE\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp2mvj0998\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmp2mvj0998",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp2mvj0998\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000010e0a7f2b61a7a06502fe601413fe7e3c6698ce3bec4eed290d27d08a2a61b699010000006b483045022100bca41fd4c2fbe78a471862a0cbcada72dec85928c003096b89711262a6afa904022046091f619cbc19cb466d217f9664fb2fea6894a84791bc816e0cdae14390395b01210302992bba48b71d309cebbfa183094de20158f078d0d32b4fd794ec2a00cade1effffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f6d7576a914cfd4d42838e26f3ecaea287f6361f360dcb4288788ac38fb9423000000001976a914ddf9fe5f71d19f344f2d0c54a0f5d85206fd9ad888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": null,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n1kf7K1vAFwRL8xfCUgJFoyc68jrX5Mq4a\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\"\n }\n}"
},
{
"title": "Create an image stream claim with all metadata and fee",
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpcsxmdo53.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1574265329, \"channel_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpcsxmdo53.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title=\"Blank Image\" --description=\"A blank PNG that is 5x7.\" --author=Picaso --license=\"Public Domain\" --license_url=http://public-domain.org --thumbnail_url=\"http://smallmedia.com/thumbnail.jpg\" --release_time=1574265329 --channel_id=\"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpcsxmdo53.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1574265329, \"channel_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001fd942043ff232fd7e14a52fceda82d6504423ec141da78c3c35fa09e7d822097010000006b4830450221008aea0838df805584172337e3496860ee583e2049061a8bf4e05077df3165ed87022077c73e062adb40134c2e0d17f2cc888a6fc3157a432bc110b0846198ef3d480d01210308ef67ea2459f85847112fa55cd5223f5f0ddc3975401b4992fb3f139850b7d9ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101a1fdf826393329fab1baee6ea3a5d7d104b8f9765fef5f401f359208ca5e5e24e0409f4b362a7d4a7d47c43c6793e04e1f29f5ff42d552b9a7a9d0deb138d9f62d6214919fafb6fc43f9c18cd6c5b0f599b641f70ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706373786d646f35332e706e6718632209696d6167652f706e6732300017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728f1c3d5ee053222080112196ff6156b8ae227e28d010fc14256d4848501c063137019cfcd188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914f6156b8ae227e28d010fc14256d4848501c0631388acac5e7d1d000000001976a91467ecfdce4cc9b6f3db9313277bda488868379d7088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miExnY6VrwasxxmLwov7pxoSkXh5y6VKNE\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265353,\n \"txid\": \"9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3x8BYAScTPWfaCABx8F4oC56DYMc7havg\",\n \"amount\": \"1.0\",\n \"claim_id\": \"c9a6d356aa9bba38a32e15e1be4651601c722462\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"blank-image\",\n \"normalized_name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#c9a6d356aa9bba38a32e15e1be4651601c722462\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3x8BYAScTPWfaCABx8F4oC56DYMc7havg\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1574265329\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpcsxmdo53.png\",\n \"sd_hash\": \"0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e\",\n \"size\": \"99\"\n },\n \"strLine truncated
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpw_1zp_we.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1580787013, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpw_1zp_we.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title=\"Blank Image\" --description=\"A blank PNG that is 5x7.\" --author=Picaso --license=\"Public Domain\" --license_url=http://public-domain.org --thumbnail_url=\"http://smallmedia.com/thumbnail.jpg\" --release_time=1580787013 --channel_id=\"78e0769111742d63461837d031f318ba33385c77\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpw_1zp_we.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1580787013, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001756730ee9f4cf6e0b3ac37426a6de788d95f3995a3d474b9ee44b057ac66d295010000006b483045022100cf9ef3f2bdbdc84282ad8655c45bd744c56e235cbce75bb391c999f1e8c942d1022073b534e9e0f98a315d3b2b56c5f3c588427dd46cbea769e47a1ca074a60f1b09012102bce50c23209e12358222c1e0b2a4f0ebb1a52958ffa6bc8f1efcba6cd73c10abffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101775c3833ba18f331d0371846632d74119176e0788971c8a96b0c86b464771c4d2cfdbe1041beaec22d10e1caf5caffe66cdb1ec0d9b244a0ba024bd9318a4f4dac3d95ee4cd5eaaa9ade4d3ed43adda5525bad060ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d70775f317a705f77652e706e6718632209696d6167652f706e6732309872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728c5cae3f1053222080112196f2cb51096ada6af68d92aa5e9256f76a95cd0f761d22acf6a188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9142cb51096ada6af68d92aa5e9256f76a95cd0f76188acac5e7d1d000000001976a914ba12a78dd8482240f8a74dc3d3d9b0cec11cc50d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1kf7K1vAFwRL8xfCUgJFoyc68jrX5Mq4a\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787039,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"blank-image\",\n \"normalized_name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941c5bd3a1cb4cb0c25b\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1580787013\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpw_1zp_we.png\",\n \"sd_hash\": \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\",\n \"size\": \"99\"\n },\n \"strLine truncated
}
]
},
@@ -3288,23 +3409,29 @@
"type": "int",
"description": "number of items on page during pagination",
"is_required": false
},
{
"name": "resolve",
"type": "bool",
"description": "resolves each stream to provide additional metadata",
"is_required": false
}
],
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
"examples": [
{
"title": "List all your stream claims",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your stream claims",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1574265353,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -3625,10 +3752,10 @@
"examples": [
{
"title": "Update a stream claim to add channel",
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update 6d779c509a47c97a050540a42863341eed6c47ad --channel_id=\"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002fd942043ff232fd7e14a52fceda82d6504423ec141da78c3c35fa09e7d822097000000006a473044022071f91293ea6594d24c509c1990817cbfe0192eb82224fefd858e8402c28b84ce02206bf38ebdea5378771a4f97f477a09cd4be32f7422b7c1cfbc37b86df7830057e012103f89a894c1453e0cddb844b1eb3f949ca2204d6ba34fc07249e47b55a8534a0b3ffffffff7ab2225f56b1d5bd85ec6fe6c8a797511308226a78972401ffd47efce0e05c22010000006b483045022100849d93b0e70e0cc615a34bc80d476fcc100ebd1cb7ed42846d64c3a950e47c7c0220651845f579da62189faa08c2559a4917830f717ae6660af44310ddf8d26468c4012103a362e2dc8696716d7a7b8c5235e0c21b3483e62ffa768966996c360c556039f6ffffffff0200e1f50500000000fd2301b7076173747265616d14ad476ced1e346328a44005057ac9479a509c776d4ce801a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d6d6d76a914032dcda1a00c97492eba9cd3228eff69546c74a088ac32a0d205000000001976a914f974bc71e8add27124668d7f9d666f2d0f1bc06088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"timestamp\": 1574265353,\n \"txid\": \"9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmprsllesnu\",\n \"sd_hash\": \"b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mxMMrM8xQMSSfAaTqjwXds4jjLu5CKjMHD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1574265352,\n \"txid\": \"225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6d779c509a47c97a050540a42863341eed6c47ad\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad\",\n \"signing_channel\": {\n \"address\": \"n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1\",\n \"timestamp\": 1574265352,\n \"txid\": \"8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066\",\n \"public_key_id\": \"mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n Line truncated
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update ca642adaf52552f0bfc746c2ebae77724d123aeb --channel_id=\"78e0769111742d63461837d031f318ba33385c77\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002756730ee9f4cf6e0b3ac37426a6de788d95f3995a3d474b9ee44b057ac66d295000000006a473044022017c35e499a06449082d37319300a3ab123d65dfe443ea88471de8b55b899a0ca02204f105a09bee5afd441f7428dc8ec698962ff29d6adc3787e0bb675b23e0e78d4012102663f1832b7906bdce2af55d6950114be6d7e4bc3fae658caa6b5f7b8dbbdf47bffffffffe89ff3143a4eef48aec22c903584af10a706008c73b8175a5cc6b35073de134d010000006b483045022100d84db641a86c6e3d6da6c3a0120a805cdb6e8b6648f6b81fa88aa0fcc48e1d7e0220533ab4b67510263f6732d2be5791fb5fa2747c6d1c08ac4707aefc732b698b7301210265859227aa59bab66198913f4f8486cd39381ca8809f03591e6bd711367c67b7ffffffff0200e1f50500000000fd2301b7076173747265616d14eb3a124d7277aeebc246c7bff05225f5da2a64ca4ce801775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f6d6d76a914cfd4d42838e26f3ecaea287f6361f360dcb4288788ac32a0d205000000001976a914df1c174e484b9f4470019bf89261d761d4bd83fd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": 1580787039,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mjFjqQMMroPbKTLQ2KzTY9UFHsyZLXJnYa\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n Line truncated
}
]
}
@@ -3873,7 +4000,7 @@
"curl": "curl -d'{\"method\": \"transaction_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet transaction list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"transaction_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2019-11-20 10:55\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1574265352,\n \"txid\": \"0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-11-20 10:55\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1574265351,\n \"txid\": \"1bcf4ce39b4f34effb0ecc08a5a33dac9163b8558619968a44b43ca7fb9c6e27\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2020-02-03 22:30\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2020-02-03 22:30\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1580787037,\n \"txid\": \"86d1b7fc915ce33774159d4c42c7c7212d6745a9b57051fca738d5fb4e8526f6\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -4101,6 +4228,13 @@
"returns": "(bool) true if wallet is locked, otherwise false",
"examples": []
},
{
"name": "wallet_reconnect",
"description": "Reconnects ledger network client, applying new configurations.",
"arguments": [],
"returns": "None",
"examples": []
},
{
"name": "wallet_remove",
"description": "Remove an existing wallet.",
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 361 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

-1
View File
@@ -1 +0,0 @@
/CHANGELOG.md merge=union
-14
View File
@@ -1,14 +0,0 @@
.DS_Store
/build
/dist
/.tox
/.idea
/.coverage
/lbry-venv
lbry.egg-info
__pycache__
_trial_temp/
/tests/integration/files
/tests/.coverage.*
-441
View File
@@ -1,441 +0,0 @@
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS,schema
# Add files or directories matching the regex patterns to the
# blacklist. The regex matches against base names, not paths.
# `\.#.*` - add emacs tmp files to the blacklist
ignore-patterns=\.#.*
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=4
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=apsw
# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality.
optimize-ast=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=
anomalous-backslash-in-string,
arguments-differ,
attribute-defined-outside-init,
bad-continuation,
bare-except,
broad-except,
cell-var-from-loop,
consider-iterating-dictionary,
dangerous-default-value,
duplicate-code,
fixme,
invalid-name,
len-as-condition,
locally-disabled,
logging-not-lazy,
missing-docstring,
no-else-return,
no-init,
no-member,
no-self-use,
protected-access,
redefined-builtin,
redefined-outer-name,
redefined-variable-type,
relative-import,
signature-differs,
super-init-not-called,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
trailing-newlines,
undefined-loop-variable,
ungrouped-imports,
unnecessary-lambda,
unused-argument,
unused-variable,
wrong-import-order,
wrong-import-position,
deprecated-lambda,
simplifiable-if-statement,
unidiomatic-typecheck,
inconsistent-return-statements,
keyword-arg-before-vararg,
assignment-from-no-return,
useless-return,
assignment-from-none,
stop-iteration-return
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=no
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx=_$|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,_cb
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[BASIC]
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,input
# Good variable names which should always be accepted, separated by a comma
# allow `d` as its used frequently for deferred callback chains
good-names=i,j,k,ex,Run,_,d
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Include a hint for the correct naming format with invalid-name
include-naming-hint=no
# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[ELIF]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[SPELLING]
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict=
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words=no
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=leveldb,distutils
# Ignoring distutils because: https://github.com/PyCQA/pylint/issues/73
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set). This supports can work
# with qualified names.
# ignored-classes=
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=lbrynet.lbrynet_daemon.LBRYDaemon.Parameters
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[DESIGN]
# Maximum number of arguments for function / method
max-args=10
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=8
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of boolean expressions in a if statement
max-bool-expr=5
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
-56
View File
@@ -1,56 +0,0 @@
# <img src="https://raw.githubusercontent.com/lbryio/lbry-sdk/master/lbry/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [![Build Status](https://travis-ci.org/lbryio/lbry-sdk.svg?branch=master)](https://travis-ci.org/lbryio/lbry-sdk)
LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the [LBRY blockchain](https://github.com/lbryio/lbrycrd) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers.
LBRY SDK for Python is currently the most full featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components:
* Built on Python 3.7+ and `asyncio`.
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/dht)).
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/blob_exchange)).
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/schema)).
* Wallet implementation for the LBRY blockchain ([lbry.wallet](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/wallet)).
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbry.extras.daemon](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/extras/daemon)).
## Installation
Our [releases page](https://github.com/lbryio/lbry-sdk/releases) contains pre-built binaries of the latest release, pre-releases, and past releases for macOS, Debian-based Linux, and Windows. [Automated travis builds](http://build.lbry.io/daemon/) are also available for testing.
## Usage
Run `lbrynet start` to launch the API server.
By default, `lbrynet` will provide a JSON-RPC server at `http://localhost:5279`. It is easy to interact with via cURL or sane programming languages.
Our [quickstart guide](https://lbry.tech/playground) provides a simple walkthrough and examples for learning.
With the daemon running, `lbrynet commands` will show you a list of commands.
The full API is documented [here](https://lbry.tech/api/sdk).
## Running from source
Installing from source is also relatively painless. Full instructions are in [INSTALL.md](INSTALL.md)
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, please check [this](https://lbry.tech/contribute) link.
## License
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our GPG key is here](https://lbry.com/faq/gpg-key) if you need it.
## Contact
The primary contact for this project is [@eukreign](mailto:lex@lbry.com).
## Additional information and links
The documentation for the API can be found [here](https://lbry.tech/api/sdk).
Daemon defaults, ports, and other settings are documented [here](https://lbry.tech/resources/daemon-settings).
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry-sdk/blob/master/lbry/example_daemon_settings.yml).
+2
View File
@@ -0,0 +1,2 @@
__version__ = "0.60.1"
version = tuple(map(int, __version__.split('.'))) # pylint: disable=invalid-name
+6
View File
@@ -0,0 +1,6 @@
from lbry.utils import get_lbry_hash_obj
MAX_BLOB_SIZE = 2 * 2 ** 20
# digest_size is in bytes, and blob hashes are hex encoded
BLOBHASH_LENGTH = get_lbry_hash_obj().digest_size * 2
@@ -9,18 +9,20 @@ from io import BytesIO
from cryptography.hazmat.primitives.ciphers import Cipher, modes
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.padding import PKCS7
from cryptography.hazmat.backends import default_backend
from lbry.cryptoutils import backend, get_lbry_hash_obj
from lbry.utils import get_lbry_hash_obj
from lbry.error import DownloadCancelledError, InvalidBlobHashError, InvalidDataError
from lbry.blob import MAX_BLOB_SIZE, blobhash_length
from lbry.blob import MAX_BLOB_SIZE, BLOBHASH_LENGTH
from lbry.blob.blob_info import BlobInfo
from lbry.blob.writer import HashBlobWriter
log = logging.getLogger(__name__)
_hexmatch = re.compile("^[a-f,0-9]+$")
HEXMATCH = re.compile("^[a-f,0-9]+$")
BACKEND = default_backend()
def is_valid_blobhash(blobhash: str) -> bool:
@@ -31,11 +33,11 @@ def is_valid_blobhash(blobhash: str) -> bool:
@return: True/False
"""
return len(blobhash) == blobhash_length and _hexmatch.match(blobhash)
return len(blobhash) == BLOBHASH_LENGTH and HEXMATCH.match(blobhash)
def encrypt_blob_bytes(key: bytes, iv: bytes, unencrypted: bytes) -> typing.Tuple[bytes, str]:
cipher = Cipher(AES(key), modes.CBC(iv), backend=backend)
cipher = Cipher(AES(key), modes.CBC(iv), backend=BACKEND)
padder = PKCS7(AES.block_size).padder()
encryptor = cipher.encryptor()
encrypted = encryptor.update(padder.update(unencrypted) + padder.finalize()) + encryptor.finalize()
@@ -47,7 +49,7 @@ def encrypt_blob_bytes(key: bytes, iv: bytes, unencrypted: bytes) -> typing.Tupl
def decrypt_blob_bytes(data: bytes, length: int, key: bytes, iv: bytes) -> bytes:
if len(data) != length:
raise ValueError("unexpected length")
cipher = Cipher(AES(key), modes.CBC(iv), backend=backend)
cipher = Cipher(AES(key), modes.CBC(iv), backend=BACKEND)
unpadder = PKCS7(AES.block_size).unpadder()
decryptor = cipher.decryptor()
return unpadder.update(decryptor.update(data) + decryptor.finalize()) + unpadder.finalize()
@@ -142,7 +144,7 @@ class AbstractBlob:
def close(self):
while self.writers:
peer, writer = self.writers.popitem()
_, writer = self.writers.popitem()
if writer and writer.finished and not writer.finished.done() and not self.loop.is_closed():
writer.finished.cancel()
while self.readers:
@@ -165,7 +167,7 @@ class AbstractBlob:
with self.reader_context() as handle:
try:
return await self.loop.sendfile(writer.transport, handle, count=self.get_length())
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError, AttributeError):
except (ConnectionError, BrokenPipeError, RuntimeError, OSError, AttributeError):
return -1
def decrypt(self, key: bytes, iv: bytes) -> bytes:
File renamed without changes.
File renamed without changes.
@@ -3,7 +3,7 @@ import logging
import asyncio
from io import BytesIO
from lbry.error import InvalidBlobHashError, InvalidDataError
from lbry.cryptoutils import get_lbry_hash_obj
from lbry.utils import get_lbry_hash_obj
log = logging.getLogger(__name__)
File renamed without changes.
@@ -95,7 +95,7 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
if self._response_fut and not self._response_fut.done():
self._response_fut.set_exception(err)
async def _download_blob(self) -> typing.Tuple[int, Optional['BlobExchangeClientProtocol']]:
async def _download_blob(self) -> typing.Tuple[int, Optional['BlobExchangeClientProtocol']]: # pylint: disable=too-many-return-statements
"""
:return: download success (bool), connected protocol (BlobExchangeClientProtocol)
"""
@@ -213,11 +213,11 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
self.connection_manager.connection_made(f"{self.peer_address}:{self.peer_port}")
log.debug("connection made to %s:%i", self.peer_address, self.peer_port)
def connection_lost(self, reason):
def connection_lost(self, exc):
if self.connection_manager:
self.connection_manager.outgoing_connection_lost(f"{self.peer_address}:{self.peer_port}")
log.debug("connection lost to %s:%i (reason: %s, %s)", self.peer_address, self.peer_port, str(reason),
str(type(reason)))
log.debug("connection lost to %s:%i (reason: %s, %s)", self.peer_address, self.peer_port, str(exc),
str(type(exc)))
self.close()
File renamed without changes.
@@ -46,7 +46,7 @@ class BlobAvailabilityRequest(BlobMessage):
def __init__(self, requested_blobs: typing.List[str], lbrycrd_address: typing.Optional[bool] = True,
**kwargs) -> None:
assert len(requested_blobs)
assert len(requested_blobs) > 0
self.requested_blobs = requested_blobs
self.lbrycrd_address = lbrycrd_address
@@ -134,9 +134,9 @@ class BlobErrorResponse(BlobMessage):
}
blob_request_types = typing.Union[BlobPriceRequest, BlobAvailabilityRequest, BlobDownloadRequest,
blob_request_types = typing.Union[BlobPriceRequest, BlobAvailabilityRequest, BlobDownloadRequest, # pylint: disable=invalid-name
BlobPaymentAddressRequest]
blob_response_types = typing.Union[BlobPriceResponse, BlobAvailabilityResponse, BlobDownloadResponse,
blob_response_types = typing.Union[BlobPriceResponse, BlobAvailabilityResponse, BlobDownloadResponse, # pylint: disable=invalid-name
BlobErrorResponse, BlobPaymentAddressResponse]
@@ -157,10 +157,10 @@ def _parse_blob_response(response_msg: bytes) -> typing.Tuple[typing.Optional[ty
except ValueError:
continue
possible_response_keys = {
BlobPaymentAddressResponse.key,
BlobAvailabilityResponse.key,
BlobPriceResponse.key,
BlobDownloadResponse.key
BlobPaymentAddressResponse.key,
BlobAvailabilityResponse.key,
BlobPriceResponse.key,
BlobDownloadResponse.key
}
if isinstance(response, dict) and response.keys():
if set(response.keys()).issubset(possible_response_keys):
@@ -179,7 +179,7 @@ class BlobRequest:
return d
def _get_request(self, request_type: blob_request_types):
request = tuple(filter(lambda r: type(r) == request_type, self.requests))
request = tuple(filter(lambda r: type(r) == request_type, self.requests)) # pylint: disable=unidiomatic-typecheck
if request:
return request[0]
@@ -235,7 +235,7 @@ class BlobResponse:
return d
def _get_response(self, response_type: blob_response_types):
response = tuple(filter(lambda r: type(r) == response_type, self.responses))
response = tuple(filter(lambda r: type(r) == response_type, self.responses)) # pylint: disable=unidiomatic-typecheck
if response:
return response[0]
@@ -280,4 +280,3 @@ class BlobResponse:
if response_type.key in response
])
return cls(requests, extra)
@@ -96,27 +96,30 @@ class BlobServerProtocol(asyncio.Protocol):
incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length}
responses.append(BlobDownloadResponse(incoming_blob=incoming_blob))
self.send_response(responses)
bh = blob.blob_hash[:8]
log.debug("send %s to %s:%i", bh, peer_address, peer_port)
blob_hash = blob.blob_hash[:8]
log.debug("send %s to %s:%i", blob_hash, peer_address, peer_port)
self.started_transfer.set()
try:
sent = await asyncio.wait_for(blob.sendfile(self), self.transfer_timeout, loop=self.loop)
if sent and sent > 0:
self.blob_manager.connection_manager.sent_data(self.peer_address_and_port, sent)
log.info("sent %s (%i bytes) to %s:%i", bh, sent, peer_address, peer_port)
log.info("sent %s (%i bytes) to %s:%i", blob_hash, sent, peer_address, peer_port)
else:
log.debug("stopped sending %s to %s:%i", bh, peer_address, peer_port)
except (OSError, asyncio.TimeoutError) as err:
self.close()
log.debug("stopped sending %s to %s:%i", blob_hash, peer_address, peer_port)
return
except (OSError, ValueError, asyncio.TimeoutError) as err:
if isinstance(err, asyncio.TimeoutError):
log.debug("timed out sending blob %s to %s", bh, peer_address)
log.debug("timed out sending blob %s to %s", blob_hash, peer_address)
else:
log.warning("could not read blob %s to send %s:%i", bh, peer_address, peer_port)
log.warning("could not read blob %s to send %s:%i", blob_hash, peer_address, peer_port)
self.close()
return
finally:
self.transfer_finished.set()
else:
log.info("don't have %s to send %s:%i", blob.blob_hash[:8], peer_address, peer_port)
if responses:
if responses and not self.transport.is_closing():
self.send_response(responses)
def data_received(self, data):
@@ -127,7 +130,7 @@ class BlobServerProtocol(asyncio.Protocol):
return
if data:
self.blob_manager.connection_manager.received_data(self.peer_address_and_port, len(data))
message, separator, remainder = data.rpartition(b'}')
_, separator, remainder = data.rpartition(b'}')
if not separator:
self.buf += data
return
@@ -1,3 +1,4 @@
# don't touch this. CI server changes this during build/deployment
BUILD = "dev"
BUILD_COMMIT = "source installation"
COMMIT_HASH = "none"
DOCKER_TAG = "none"
+65 -40
View File
@@ -3,18 +3,19 @@ import re
import sys
import typing
import logging
import yaml
from argparse import ArgumentParser
from contextlib import contextmanager
import yaml
from appdirs import user_data_dir, user_config_dir
from lbry.error import InvalidCurrencyError
from lbry.dht import constants
from torba.client.coinselection import STRATEGIES
from lbry.wallet.coinselection import STRATEGIES
log = logging.getLogger(__name__)
NOT_SET = type('NOT_SET', (object,), {})
NOT_SET = type('NOT_SET', (object,), {}) # pylint: disable=invalid-name
T = typing.TypeVar('T')
CURRENCIES = {
@@ -35,7 +36,7 @@ class Setting(typing.Generic[T]):
self.metavar = metavar
def __set_name__(self, owner, name):
self.name = name
self.name = name # pylint: disable=attribute-defined-outside-init
@property
def cli_name(self):
@@ -63,13 +64,13 @@ class Setting(typing.Generic[T]):
for location in obj.modify_order:
location[self.name] = val
def validate(self, val):
def validate(self, value):
raise NotImplementedError()
def deserialize(self, value):
def deserialize(self, value): # pylint: disable=no-self-use
return value
def serialize(self, value):
def serialize(self, value): # pylint: disable=no-self-use
return value
def contribute_to_argparse(self, parser: ArgumentParser):
@@ -82,14 +83,18 @@ class Setting(typing.Generic[T]):
class String(Setting[str]):
def validate(self, val):
assert isinstance(val, str), \
def validate(self, value):
assert isinstance(value, str), \
f"Setting '{self.name}' must be a string."
# TODO: removes this after pylint starts to understand generics
def __get__(self, obj: typing.Optional['BaseConfig'], owner) -> str: # pylint: disable=useless-super-delegation
return super().__get__(obj, owner)
class Integer(Setting[int]):
def validate(self, val):
assert isinstance(val, int), \
def validate(self, value):
assert isinstance(value, int), \
f"Setting '{self.name}' must be an integer."
def deserialize(self, value):
@@ -97,8 +102,8 @@ class Integer(Setting[int]):
class Float(Setting[float]):
def validate(self, val):
assert isinstance(val, float), \
def validate(self, value):
assert isinstance(value, float), \
f"Setting '{self.name}' must be a decimal."
def deserialize(self, value):
@@ -106,8 +111,8 @@ class Float(Setting[float]):
class Toggle(Setting[bool]):
def validate(self, val):
assert isinstance(val, bool), \
def validate(self, value):
assert isinstance(value, bool), \
f"Setting '{self.name}' must be a true/false value."
def contribute_to_argparse(self, parser: ArgumentParser):
@@ -127,10 +132,10 @@ class Toggle(Setting[bool]):
class Path(String):
def __init__(self, doc: str, default: str = '', *args, **kwargs):
def __init__(self, doc: str, *args, default: str = '', **kwargs):
super().__init__(doc, default, *args, **kwargs)
def __get__(self, obj, owner):
def __get__(self, obj, owner) -> str:
value = super().__get__(obj, owner)
if isinstance(value, str):
return os.path.expanduser(os.path.expandvars(value))
@@ -204,16 +209,16 @@ class StringChoice(String):
raise ValueError(f"Default value must be one of: {', '.join(valid_values)}")
self.valid_values = valid_values
def validate(self, val):
super().validate(val)
if val not in self.valid_values:
def validate(self, value):
super().validate(value)
if value not in self.valid_values:
raise ValueError(f"Setting '{self.name}' value must be one of: {', '.join(self.valid_values)}")
class ListSetting(Setting[list]):
def validate(self, val):
assert isinstance(val, (tuple, list)), \
def validate(self, value):
assert isinstance(value, (tuple, list)), \
f"Setting '{self.name}' must be a tuple or list."
def contribute_to_argparse(self, parser: ArgumentParser):
@@ -226,10 +231,10 @@ class ListSetting(Setting[list]):
class Servers(ListSetting):
def validate(self, val):
assert isinstance(val, (tuple, list)), \
def validate(self, value):
assert isinstance(value, (tuple, list)), \
f"Setting '{self.name}' must be a tuple or list of servers."
for idx, server in enumerate(val):
for idx, server in enumerate(value):
assert isinstance(server, (tuple, list)) and len(server) == 2, \
f"Server defined '{server}' at index {idx} in setting " \
f"'{self.name}' must be a tuple or list of two items."
@@ -260,10 +265,10 @@ class Servers(ListSetting):
class Strings(ListSetting):
def validate(self, val):
assert isinstance(val, (tuple, list)), \
def validate(self, value):
assert isinstance(value, (tuple, list)), \
f"Setting '{self.name}' must be a tuple or list of strings."
for idx, string in enumerate(val):
for idx, string in enumerate(value):
assert isinstance(string, str), \
f"Value of '{string}' at index {idx} in setting " \
f"'{self.name}' must be a string."
@@ -457,7 +462,20 @@ class BaseConfig:
self.persisted.save()
class CLIConfig(BaseConfig):
class TranscodeConfig(BaseConfig):
ffmpeg_folder = String('The path to ffmpeg and ffprobe', '')
video_encoder = String('FFmpeg codec and parameters for the video encoding. '
'Example: libaom-av1 -crf 25 -b:v 0 -strict experimental',
'libx264 -crf 18 -vf "format=yuv420p"')
audio_encoder = String('FFmpeg codec and parameters for the audio encoding. '
'Example: libopus -b:a 128k',
'aac -b:a 192k')
volume_filter = String('FFmpeg filter for audio normalization.', '-af loudnorm')
volume_analysis_time = Integer('Maximum seconds into the file that we examine audio volume (0 to disable).', '240')
class CLIConfig(TranscodeConfig):
api = String('Host name and port for lbrynet daemon API.', 'localhost:5279', metavar='HOST:PORT')
@@ -497,6 +515,7 @@ class Config(CLIConfig):
)
udp_port = Integer("UDP port for communicating on the LBRY DHT", 4444, previous_names=['dht_node_port'])
tcp_port = Integer("TCP port to listen for incoming blob requests", 3333, previous_names=['peer_port'])
prometheus_port = Integer("Port to expose prometheus metrics (off by default)", 0)
network_interface = String("Interface to use for the DHT and blob exchange", '0.0.0.0')
# routing table
@@ -511,7 +530,7 @@ class Config(CLIConfig):
download_timeout = Float("Cumulative timeout for a stream to begin downloading before giving up", 30.0)
blob_download_timeout = Float("Timeout to download a blob from a peer", 30.0)
peer_connect_timeout = Float("Timeout to establish a TCP connection to a peer", 3.0)
node_rpc_timeout = Float("Timeout when making a DHT request", constants.rpc_timeout)
node_rpc_timeout = Float("Timeout when making a DHT request", constants.RPC_TIMEOUT)
# blob announcement and download
save_blobs = Toggle("Save encrypted blob files for hosting, otherwise download blobs to memory only.", True)
@@ -539,6 +558,7 @@ class Config(CLIConfig):
"Don't download streams with fees exceeding this amount. When set to "
"null, the amount is unbounded.", {'currency': 'USD', 'amount': 50.0}
)
max_wallet_server_fee = String("Maximum daily LBC amount allowed as payment for wallet servers.", "0.0")
# reflector settings
reflect_streams = Toggle(
@@ -554,15 +574,15 @@ class Config(CLIConfig):
('reflector.lbry.com', 5566)
])
lbryum_servers = Servers("SPV wallet servers", [
('spv1.lbry.com', 50001),
('spv2.lbry.com', 50001),
('spv3.lbry.com', 50001),
('spv4.lbry.com', 50001),
('spv5.lbry.com', 50001),
('spv6.lbry.com', 50001),
('spv7.lbry.com', 50001),
('spv8.lbry.com', 50001),
('spv9.lbry.com', 50001),
('spv11.lbry.com', 50001),
('spv12.lbry.com', 50001),
('spv13.lbry.com', 50001),
('spv14.lbry.com', 50001),
('spv15.lbry.com', 50001),
('spv16.lbry.com', 50001),
('spv17.lbry.com', 50001),
('spv18.lbry.com', 50001),
('spv19.lbry.com', 50001),
])
known_dht_nodes = Servers("Known nodes for bootstrapping connection to the DHT", [
('lbrynet1.lbry.com', 4444), # US EAST
@@ -582,7 +602,7 @@ class Config(CLIConfig):
save_files = Toggle("Save downloaded files when calling `get` by default", True)
components_to_skip = Strings("components which will be skipped during start-up of daemon", [])
share_usage_data = Toggle(
"Whether to share usage stats and diagnostic info with LBRY.", True,
"Whether to share usage stats and diagnostic info with LBRY.", False,
previous_names=['upload_log', 'upload_log', 'share_debug_info']
)
track_bandwidth = Toggle("Track bandwidth usage", True)
@@ -597,6 +617,11 @@ class Config(CLIConfig):
"Strategy to use when selecting UTXOs for a transaction",
STRATEGIES, "standard")
save_resolved_claims = Toggle(
"Save content claims to the database when they are resolved to keep file_list up to date, "
"only disable this if file_x commands are not needed", True
)
@property
def streaming_host(self):
return self.streaming_server.split(':')[0]
@@ -72,13 +72,13 @@ class ConnectionManager:
self._status['outgoing_bps'].clear()
now = time.perf_counter()
while self.outgoing:
k, v = self.outgoing.popitem()
self._status['total_sent'] += v
self._status['outgoing_bps'][k] = v / (now - last)
k, sent = self.outgoing.popitem()
self._status['total_sent'] += sent
self._status['outgoing_bps'][k] = sent / (now - last)
while self.incoming:
k, v = self.incoming.popitem()
self._status['total_received'] += v
self._status['incoming_bps'][k] = v / (now - last)
k, received = self.incoming.popitem()
self._status['total_received'] += received
self._status['incoming_bps'][k] = received / (now - last)
self._status['total_outgoing_mbs'] = int(sum(list(self._status['outgoing_bps'].values())
)) / 1000000.0
self._status['total_incoming_mbs'] = int(sum(list(self._status['incoming_bps'].values())
+2
View File
@@ -0,0 +1,2 @@
CENT = 1000000
COIN = 100*CENT
File renamed without changes.
+86
View File
@@ -0,0 +1,86 @@
from lbry.crypto.hash import double_sha256
from lbry.crypto.util import bytes_to_int, int_to_bytes
class Base58Error(Exception):
""" Exception used for Base58 errors. """
class Base58:
""" Class providing base 58 functionality. """
chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
assert len(chars) == 58
char_map = {c: n for n, c in enumerate(chars)}
@classmethod
def char_value(cls, c):
val = cls.char_map.get(c)
if val is None:
raise Base58Error(f'invalid base 58 character "{c}"')
return val
@classmethod
def decode(cls, txt):
""" Decodes txt into a big-endian bytearray. """
if isinstance(txt, memoryview):
txt = str(txt)
if isinstance(txt, bytes):
txt = txt.decode()
if not isinstance(txt, str):
raise TypeError('a string is required')
if not txt:
raise Base58Error('string cannot be empty')
value = 0
for c in txt:
value = value * 58 + cls.char_value(c)
result = int_to_bytes(value)
# Prepend leading zero bytes if necessary
count = 0
for c in txt:
if c != '1':
break
count += 1
if count:
result = bytes((0,)) * count + result
return result
@classmethod
def encode(cls, be_bytes):
"""Converts a big-endian bytearray into a base58 string."""
value = bytes_to_int(be_bytes)
txt = ''
while value:
value, mod = divmod(value, 58)
txt += cls.chars[mod]
for byte in be_bytes:
if byte != 0:
break
txt += '1'
return txt[::-1]
@classmethod
def decode_check(cls, txt, hash_fn=double_sha256):
""" Decodes a Base58Check-encoded string to a payload. The version prefixes it. """
be_bytes = cls.decode(txt)
result, check = be_bytes[:-4], be_bytes[-4:]
if check != hash_fn(result)[:4]:
raise Base58Error(f'invalid base 58 checksum for {txt}')
return result
@classmethod
def encode_check(cls, payload, hash_fn=double_sha256):
""" Encodes a payload bytearray (which includes the version byte(s))
into a Base58Check string."""
be_bytes = payload + hash_fn(payload)[:4]
return cls.encode(be_bytes)
+71
View File
@@ -0,0 +1,71 @@
import os
import base64
import typing
from cryptography.hazmat.primitives.kdf.scrypt import Scrypt
from cryptography.hazmat.primitives.ciphers import Cipher, modes
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.padding import PKCS7
from cryptography.hazmat.backends import default_backend
from lbry.error import InvalidPasswordError
from lbry.crypto.hash import double_sha256
def aes_encrypt(secret: str, value: str, init_vector: bytes = None) -> str:
if init_vector is not None:
assert len(init_vector) == 16
else:
init_vector = os.urandom(16)
key = double_sha256(secret.encode())
encryptor = Cipher(AES(key), modes.CBC(init_vector), default_backend()).encryptor()
padder = PKCS7(AES.block_size).padder()
padded_data = padder.update(value.encode()) + padder.finalize()
encrypted_data = encryptor.update(padded_data) + encryptor.finalize()
return base64.b64encode(init_vector + encrypted_data).decode()
def aes_decrypt(secret: str, value: str) -> typing.Tuple[str, bytes]:
try:
data = base64.b64decode(value.encode())
key = double_sha256(secret.encode())
init_vector, data = data[:16], data[16:]
decryptor = Cipher(AES(key), modes.CBC(init_vector), default_backend()).decryptor()
unpadder = PKCS7(AES.block_size).unpadder()
result = unpadder.update(decryptor.update(data)) + unpadder.finalize()
return result.decode(), init_vector
except UnicodeDecodeError:
raise InvalidPasswordError()
except ValueError as e:
if e.args[0] == 'Invalid padding bytes.':
raise InvalidPasswordError()
raise
def better_aes_encrypt(secret: str, value: bytes) -> bytes:
init_vector = os.urandom(16)
key = scrypt(secret.encode(), salt=init_vector)
encryptor = Cipher(AES(key), modes.CBC(init_vector), default_backend()).encryptor()
padder = PKCS7(AES.block_size).padder()
padded_data = padder.update(value) + padder.finalize()
encrypted_data = encryptor.update(padded_data) + encryptor.finalize()
return base64.b64encode(b's:8192:16:1:' + init_vector + encrypted_data)
def better_aes_decrypt(secret: str, value: bytes) -> bytes:
try:
data = base64.b64decode(value)
_, scryp_n, scrypt_r, scrypt_p, data = data.split(b':', maxsplit=4)
init_vector, data = data[:16], data[16:]
key = scrypt(secret.encode(), init_vector, int(scryp_n), int(scrypt_r), int(scrypt_p))
decryptor = Cipher(AES(key), modes.CBC(init_vector), default_backend()).decryptor()
unpadder = PKCS7(AES.block_size).unpadder()
return unpadder.update(decryptor.update(data)) + unpadder.finalize()
except ValueError as e:
if e.args[0] == 'Invalid padding bytes.':
raise InvalidPasswordError()
raise
def scrypt(passphrase, salt, scrypt_n=1<<13, scrypt_r=16, scrypt_p=1):
kdf = Scrypt(salt, length=32, n=scrypt_n, r=scrypt_r, p=scrypt_p, backend=default_backend())
return kdf.derive(passphrase)
+47
View File
@@ -0,0 +1,47 @@
import hashlib
import hmac
from binascii import hexlify, unhexlify
def sha256(x):
""" Simple wrapper of hashlib sha256. """
return hashlib.sha256(x).digest()
def sha512(x):
""" Simple wrapper of hashlib sha512. """
return hashlib.sha512(x).digest()
def ripemd160(x):
""" Simple wrapper of hashlib ripemd160. """
h = hashlib.new('ripemd160')
h.update(x)
return h.digest()
def double_sha256(x):
""" SHA-256 of SHA-256, as used extensively in bitcoin. """
return sha256(sha256(x))
def hmac_sha512(key, msg):
""" Use SHA-512 to provide an HMAC. """
return hmac.new(key, msg, hashlib.sha512).digest()
def hash160(x):
""" RIPEMD-160 of SHA-256.
Used to make bitcoin addresses from pubkeys. """
return ripemd160(sha256(x))
def hash_to_hex_str(x):
""" Convert a big-endian binary hash to displayed hex string.
Display form of a binary hash is reversed and converted to hex. """
return hexlify(reversed(x))
def hex_str_to_hash(x):
""" Convert a displayed hex string to a binary hash. """
return reversed(unhexlify(x))
+13
View File
@@ -0,0 +1,13 @@
from binascii import unhexlify, hexlify
def bytes_to_int(be_bytes):
""" Interprets a big-endian sequence of bytes as an integer. """
return int(hexlify(be_bytes), 16)
def int_to_bytes(value):
""" Converts an integer to a big-endian sequence of bytes. """
length = (value.bit_length() + 7) // 8
s = '%x' % value
return unhexlify(('0' * (len(s) % 2) + s).zfill(length * 2))
File renamed without changes.
@@ -24,7 +24,7 @@ class BlobAnnouncer:
else:
log.debug("failed to announce %s, could only find %d peers, retrying soon.", blob_hash[:8], peers)
except Exception as err:
if isinstance(err, asyncio.CancelledError):
if isinstance(err, asyncio.CancelledError): # TODO: remove when updated to 3.8
raise err
log.warning("error announcing %s: %s", blob_hash[:8], str(err))
@@ -38,7 +38,7 @@ class BlobAnnouncer:
continue
self.announce_queue.extend(await self.storage.get_blobs_to_announce())
log.debug("announcer task wake up, %d blobs to announce", len(self.announce_queue))
while len(self.announce_queue):
while len(self.announce_queue) > 0:
log.info("%i blobs to announce", len(self.announce_queue))
announced = await asyncio.gather(*[
self._submit_announcement(
+41
View File
@@ -0,0 +1,41 @@
import hashlib
import os
HASH_CLASS = hashlib.sha384 # pylint: disable=invalid-name
HASH_LENGTH = HASH_CLASS().digest_size
HASH_BITS = HASH_LENGTH * 8
ALPHA = 5
K = 8
SPLIT_BUCKETS_UNDER_INDEX = 1
REPLACEMENT_CACHE_SIZE = 8
RPC_TIMEOUT = 5.0
RPC_ATTEMPTS = 5
RPC_ATTEMPTS_PRUNING_WINDOW = 600
ITERATIVE_LOOKUP_DELAY = RPC_TIMEOUT / 2.0 # TODO: use config val / 2 if rpc timeout is provided
REFRESH_INTERVAL = 3600 # 1 hour
REPLICATE_INTERVAL = REFRESH_INTERVAL
DATA_EXPIRATION = 86400 # 24 hours
TOKEN_SECRET_REFRESH_INTERVAL = 300 # 5 minutes
MAYBE_PING_DELAY = 300 # 5 minutes
CHECK_REFRESH_INTERVAL = REFRESH_INTERVAL / 5
RPC_ID_LENGTH = 20
PROTOCOL_VERSION = 1
BOTTOM_OUT_LIMIT = 3
MSG_SIZE_LIMIT = 1400
def digest(data: bytes) -> bytes:
h = HASH_CLASS()
h.update(data)
return h.digest()
def generate_id(num=None) -> bytes:
if num is not None:
return digest(str(num).encode())
else:
return digest(os.urandom(32))
def generate_rpc_id(num=None) -> bytes:
return generate_id(num)[:RPC_ID_LENGTH]
File renamed without changes.
+16 -14
View File
@@ -19,8 +19,8 @@ log = logging.getLogger(__name__)
class Node:
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', node_id: bytes, udp_port: int,
internal_udp_port: int, peer_port: int, external_ip: str, rpc_timeout: float = constants.rpc_timeout,
split_buckets_under_index: int = constants.split_buckets_under_index,
internal_udp_port: int, peer_port: int, external_ip: str, rpc_timeout: float = constants.RPC_TIMEOUT,
split_buckets_under_index: int = constants.SPLIT_BUCKETS_UNDER_INDEX,
storage: typing.Optional['SQLiteStorage'] = None):
self.loop = loop
self.internal_udp_port = internal_udp_port
@@ -62,7 +62,7 @@ class Node:
if force_once:
break
fut = asyncio.Future(loop=self.loop)
self.loop.call_later(constants.refresh_interval // 4, fut.set_result, None)
self.loop.call_later(constants.REFRESH_INTERVAL // 4, fut.set_result, None)
await fut
continue
@@ -76,12 +76,12 @@ class Node:
break
fut = asyncio.Future(loop=self.loop)
self.loop.call_later(constants.refresh_interval, fut.set_result, None)
self.loop.call_later(constants.REFRESH_INTERVAL, fut.set_result, None)
await fut
async def announce_blob(self, blob_hash: str) -> typing.List[bytes]:
hash_value = binascii.unhexlify(blob_hash.encode())
assert len(hash_value) == constants.hash_length
assert len(hash_value) == constants.HASH_LENGTH
peers = await self.peer_search(hash_value)
if not self.protocol.external_ip:
@@ -94,8 +94,10 @@ class Node:
)
stored_to = [node_id for node_id, contacted in stored_to_tup if contacted]
if stored_to:
log.debug("Stored %s to %i of %i attempted peers", binascii.hexlify(hash_value).decode()[:8],
len(stored_to), len(peers))
log.debug(
"Stored %s to %i of %i attempted peers", binascii.hexlify(hash_value).decode()[:8],
len(stored_to), len(peers)
)
else:
log.debug("Failed announcing %s, stored to 0 peers", blob_hash[:8])
return stored_to
@@ -175,8 +177,8 @@ class Node:
self._join_task = self.loop.create_task(self.join_network(interface, known_node_urls))
def get_iterative_node_finder(self, key: bytes, shortlist: typing.Optional[typing.List['KademliaPeer']] = None,
bottom_out_limit: int = constants.bottom_out_limit,
max_results: int = constants.k) -> IterativeNodeFinder:
bottom_out_limit: int = constants.BOTTOM_OUT_LIMIT,
max_results: int = constants.K) -> IterativeNodeFinder:
return IterativeNodeFinder(self.loop, self.protocol.peer_manager, self.protocol.routing_table, self.protocol,
key, bottom_out_limit, max_results, None, shortlist)
@@ -188,7 +190,7 @@ class Node:
return IterativeValueFinder(self.loop, self.protocol.peer_manager, self.protocol.routing_table, self.protocol,
key, bottom_out_limit, max_results, None, shortlist)
async def peer_search(self, node_id: bytes, count=constants.k, max_results=constants.k*2,
async def peer_search(self, node_id: bytes, count=constants.K, max_results=constants.K * 2,
bottom_out_limit=20, shortlist: typing.Optional[typing.List['KademliaPeer']] = None
) -> typing.List['KademliaPeer']:
peers = []
@@ -252,7 +254,7 @@ class Node:
result_queue.put_nowait(to_put)
def accumulate_peers(self, search_queue: asyncio.Queue,
peer_queue: typing.Optional[asyncio.Queue] = None) -> typing.Tuple[
asyncio.Queue, asyncio.Task]:
q = peer_queue or asyncio.Queue(loop=self.loop)
return q, self.loop.create_task(self._accumulate_peers_for_value(search_queue, q))
peer_queue: typing.Optional[asyncio.Queue] = None
) -> typing.Tuple[asyncio.Queue, asyncio.Task]:
queue = peer_queue or asyncio.Queue(loop=self.loop)
return queue, self.loop.create_task(self._accumulate_peers_for_value(search_queue, queue))
+12 -12
View File
@@ -21,8 +21,8 @@ def make_kademlia_peer(node_id: typing.Optional[bytes], address: typing.Optional
# the ipaddress module does not show these subnets as reserved
carrier_grade_NAT_subnet = ipaddress.ip_network('100.64.0.0/10')
ip4_to_6_relay_subnet = ipaddress.ip_network('192.88.99.0/24')
CARRIER_GRADE_NAT_SUBNET = ipaddress.ip_network('100.64.0.0/10')
IPV4_TO_6_RELAY_SUBNET = ipaddress.ip_network('192.88.99.0/24')
ALLOW_LOCALHOST = False
@@ -36,8 +36,8 @@ def is_valid_public_ipv4(address, allow_localhost: bool = False):
return not any((parsed_ip.version != 4, parsed_ip.is_unspecified, parsed_ip.is_link_local,
parsed_ip.is_loopback, parsed_ip.is_multicast, parsed_ip.is_reserved, parsed_ip.is_private,
parsed_ip.is_reserved,
carrier_grade_NAT_subnet.supernet_of(ipaddress.ip_network(f"{address}/32")),
ip4_to_6_relay_subnet.supernet_of(ipaddress.ip_network(f"{address}/32"))))
CARRIER_GRADE_NAT_SUBNET.supernet_of(ipaddress.ip_network(f"{address}/32")),
IPV4_TO_6_RELAY_SUBNET.supernet_of(ipaddress.ip_network(f"{address}/32"))))
except ipaddress.AddressValueError:
return False
@@ -85,7 +85,7 @@ class PeerManager:
def get_node_token(self, node_id: bytes) -> typing.Optional[bytes]:
ts, token = self._node_tokens.get(node_id, (0, None))
if ts and ts > self._loop.time() - constants.token_secret_refresh_interval:
if ts and ts > self._loop.time() - constants.TOKEN_SECRET_REFRESH_INTERVAL:
return token
def get_last_replied(self, address: str, udp_port: int) -> typing.Optional[float]:
@@ -108,23 +108,23 @@ class PeerManager:
now = self._loop.time()
to_pop = []
for (address, udp_port), (_, last_failure) in self._rpc_failures.items():
if last_failure and last_failure < now - constants.rpc_attempts_pruning_window:
if last_failure and last_failure < now - constants.RPC_ATTEMPTS_PRUNING_WINDOW:
to_pop.append((address, udp_port))
while to_pop:
del self._rpc_failures[to_pop.pop()]
to_pop = []
for node_id, (age, token) in self._node_tokens.items():
if age < now - constants.token_secret_refresh_interval:
for node_id, (age, token) in self._node_tokens.items(): # pylint: disable=unused-variable
if age < now - constants.TOKEN_SECRET_REFRESH_INTERVAL:
to_pop.append(node_id)
while to_pop:
del self._node_tokens[to_pop.pop()]
def contact_triple_is_good(self, node_id: bytes, address: str, udp_port: int):
def contact_triple_is_good(self, node_id: bytes, address: str, udp_port: int): # pylint: disable=too-many-return-statements
"""
:return: False if peer is bad, None if peer is unknown, or True if peer is good
"""
delay = self._loop.time() - constants.check_refresh_interval
delay = self._loop.time() - constants.CHECK_REFRESH_INTERVAL
# fixme: find a way to re-enable that without breaking other parts
# if node_id not in self._node_id_reverse_mapping or (address, udp_port) not in self._node_id_mapping:
@@ -154,7 +154,7 @@ class PeerManager:
def peer_is_good(self, peer: 'KademliaPeer'):
return self.contact_triple_is_good(peer.node_id, peer.address, peer.udp_port)
def decode_tcp_peer_from_compact_address(self, compact_address: bytes) -> 'KademliaPeer':
def decode_tcp_peer_from_compact_address(self, compact_address: bytes) -> 'KademliaPeer': # pylint: disable=no-self-use
node_id, address, tcp_port = decode_compact_address(compact_address)
return make_kademlia_peer(node_id, address, udp_port=None, tcp_port=tcp_port)
@@ -170,7 +170,7 @@ class KademliaPeer:
def __post_init__(self):
if self._node_id is not None:
if not len(self._node_id) == constants.hash_length:
if not len(self._node_id) == constants.HASH_LENGTH:
raise ValueError("invalid node_id: {}".format(hexlify(self._node_id).decode()))
if self.udp_port is not None and not 1 <= self.udp_port <= 65535:
raise ValueError("invalid udp port")
File renamed without changes.
@@ -22,7 +22,7 @@ class DictDataStore:
for key in keys:
to_remove = []
for (peer, ts) in self._data_store[key]:
if ts + constants.data_expiration < now or self._peer_manager.peer_is_good(peer) is False:
if ts + constants.DATA_EXPIRATION < now or self._peer_manager.peer_is_good(peer) is False:
to_remove.append((peer, ts))
for item in to_remove:
self._data_store[key].remove(item)
@@ -43,7 +43,7 @@ class DictDataStore:
"""
now = self.loop.time()
for (peer, ts) in self._data_store.get(key, []):
if ts + constants.data_expiration > now:
if ts + constants.DATA_EXPIRATION > now:
yield peer
def has_peers_for_blob(self, key: bytes) -> bool:
@@ -53,7 +53,7 @@ class DictDataStore:
now = self.loop.time()
if key in self._data_store:
current = list(filter(lambda x: x[0] == contact, self._data_store[key]))
if len(current):
if len(current) > 0:
self._data_store[key][self._data_store[key].index(current[0])] = contact, now
else:
self._data_store[key].append((contact, now))
@@ -65,6 +65,6 @@ class DictDataStore:
def get_storing_contacts(self) -> typing.List['KademliaPeer']:
peers = set()
for key, stored in self._data_store.items():
for _, stored in self._data_store.items():
peers.update(set(map(lambda tup: tup[0], stored)))
return list(peers)
@@ -9,17 +9,17 @@ class Distance:
"""
def __init__(self, key: bytes):
if len(key) != constants.hash_length:
if len(key) != constants.HASH_LENGTH:
raise ValueError(f"invalid key length: {len(key)}")
self.key = key
self.val_key_one = int.from_bytes(key, 'big')
def __call__(self, key_two: bytes) -> int:
if len(key_two) != constants.hash_length:
if len(key_two) != constants.HASH_LENGTH:
raise ValueError(f"invalid length of key to compare: {len(key_two)}")
val_key_two = int.from_bytes(key_two, 'big')
return self.val_key_one ^ val_key_two
def is_closer(self, a: bytes, b: bytes) -> bool:
"""Returns true is `a` is closer to `key` than `b` is"""
return self(a) < self(b)
def is_closer(self, key_a: bytes, key_b: bytes) -> bool:
"""Returns true is `key_a` is closer to `key` than `key_b` is"""
return self(key_a) < self(key_b)
@@ -4,13 +4,13 @@ from itertools import chain
from collections import defaultdict
import typing
import logging
from typing import TYPE_CHECKING
from lbry.dht import constants
from lbry.dht.error import RemoteException, TransportNotConnected
from lbry.dht.protocol.distance import Distance
from lbry.dht.peer import make_kademlia_peer
from lbry.dht.serialization.datagram import PAGE_KEY
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from lbry.dht.protocol.routing_table import TreeRoutingTable
from lbry.dht.protocol.protocol import KademliaProtocol
@@ -67,7 +67,7 @@ def get_shortlist(routing_table: 'TreeRoutingTable', key: bytes,
:param shortlist: optional manually provided shortlist, this is done during bootstrapping when there are no
peers in the routing table. During bootstrap the shortlist is set to be the seed nodes.
"""
if len(key) != constants.hash_length:
if len(key) != constants.HASH_LENGTH:
raise ValueError("invalid key length: %i" % len(key))
return shortlist or routing_table.find_close_peers(key)
@@ -75,10 +75,10 @@ def get_shortlist(routing_table: 'TreeRoutingTable', key: bytes,
class IterativeFinder:
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.K,
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
shortlist: typing.Optional[typing.List['KademliaPeer']] = None):
if len(key) != constants.hash_length:
if len(key) != constants.HASH_LENGTH:
raise ValueError("invalid key length: %i" % len(key))
self.loop = loop
self.peer_manager = peer_manager
@@ -132,7 +132,7 @@ class IterativeFinder:
"""
raise NotImplementedError()
def get_initial_result(self) -> typing.List['KademliaPeer']:
def get_initial_result(self) -> typing.List['KademliaPeer']: #pylint: disable=no-self-use
"""
Get an initial or cached result to be put into the Queue. Used for findValue requests where the blob
has peers in the local data store of blobs announced to us
@@ -185,7 +185,7 @@ class IterativeFinder:
to_probe = list(self.active - self.contacted)
to_probe.sort(key=lambda peer: self.distance(self.key))
for peer in to_probe:
if added >= constants.alpha:
if added >= constants.ALPHA:
break
origin_address = (peer.address, peer.udp_port)
if origin_address in self.exclude:
@@ -216,7 +216,7 @@ class IterativeFinder:
t.add_done_callback(callback)
self.running_probes.add(t)
async def _search_task(self, delay: typing.Optional[float] = constants.iterative_lookup_delay):
async def _search_task(self, delay: typing.Optional[float] = constants.ITERATIVE_LOOKUP_DELAY):
try:
if self.running:
await self._search_round()
@@ -263,7 +263,7 @@ class IterativeFinder:
class IterativeNodeFinder(IterativeFinder):
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.K,
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
shortlist: typing.Optional[typing.List['KademliaPeer']] = None):
super().__init__(loop, peer_manager, routing_table, protocol, key, bottom_out_limit, max_results, exclude,
@@ -282,11 +282,11 @@ class IterativeNodeFinder(IterativeFinder):
not_yet_yielded = [
peer for peer in from_iter
if peer not in self.yielded_peers
and peer.node_id != self.protocol.node_id
and self.peer_manager.peer_is_good(peer) is not False
and peer.node_id != self.protocol.node_id
and self.peer_manager.peer_is_good(peer) is not False
]
not_yet_yielded.sort(key=lambda peer: self.distance(peer.node_id))
to_yield = not_yet_yielded[:min(constants.k, len(not_yet_yielded))]
to_yield = not_yet_yielded[:min(constants.K, len(not_yet_yielded))]
if to_yield:
self.yielded_peers.update(to_yield)
self.iteration_queue.put_nowait(to_yield)
@@ -314,7 +314,7 @@ class IterativeNodeFinder(IterativeFinder):
class IterativeValueFinder(IterativeFinder):
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.K,
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
shortlist: typing.Optional[typing.List['KademliaPeer']] = None):
super().__init__(loop, peer_manager, routing_table, protocol, key, bottom_out_limit, max_results, exclude,
@@ -348,7 +348,7 @@ class IterativeValueFinder(IterativeFinder):
if len(self.discovered_peers[peer]) != already_known + len(parsed.found_compact_addresses):
log.warning("misbehaving peer %s:%i returned duplicate peers for blob", peer.address, peer.udp_port)
parsed.found_compact_addresses.clear()
elif len(parsed.found_compact_addresses) >= constants.k and self.peer_pages[peer] < parsed.pages:
elif len(parsed.found_compact_addresses) >= constants.K and self.peer_pages[peer] < parsed.pages:
# the peer returned a full page and indicates it has more
self.peer_pages[peer] += 1
if peer in self.contacted:
@@ -23,7 +23,7 @@ if typing.TYPE_CHECKING:
log = logging.getLogger(__name__)
old_protocol_errors = {
OLD_PROTOCOL_ERRORS = {
"findNode() takes exactly 2 arguments (5 given)": "0.19.1",
"findValue() takes exactly 2 arguments (5 given)": "0.19.1"
}
@@ -48,13 +48,13 @@ class KademliaRPC:
return b'pong'
def store(self, rpc_contact: 'KademliaPeer', blob_hash: bytes, token: bytes, port: int) -> bytes:
if len(blob_hash) != constants.hash_bits // 8:
if len(blob_hash) != constants.HASH_BITS // 8:
raise ValueError(f"invalid length of blob hash: {len(blob_hash)}")
if not 0 < port < 65535:
raise ValueError(f"invalid tcp port: {port}")
rpc_contact.update_tcp_port(port)
if not self.verify_token(token, rpc_contact.compact_ip()):
if self.loop.time() - self.protocol.started_listening_time < constants.token_secret_refresh_interval:
if self.loop.time() - self.protocol.started_listening_time < constants.TOKEN_SECRET_REFRESH_INTERVAL:
pass
else:
raise ValueError("Invalid token")
@@ -64,19 +64,19 @@ class KademliaRPC:
return b'OK'
def find_node(self, rpc_contact: 'KademliaPeer', key: bytes) -> typing.List[typing.Tuple[bytes, str, int]]:
if len(key) != constants.hash_length:
if len(key) != constants.HASH_LENGTH:
raise ValueError("invalid contact node_id length: %i" % len(key))
contacts = self.protocol.routing_table.find_close_peers(key, sender_node_id=rpc_contact.node_id)
contact_triples = []
for contact in contacts[:constants.k * 2]:
for contact in contacts[:constants.K * 2]:
contact_triples.append((contact.node_id, contact.address, contact.udp_port))
return contact_triples
def find_value(self, rpc_contact: 'KademliaPeer', key: bytes, page: int = 0):
page = page if page > 0 else 0
if len(key) != constants.hash_length:
if len(key) != constants.HASH_LENGTH:
raise ValueError("invalid blob_exchange hash length: %i" % len(key))
response = {
@@ -84,7 +84,7 @@ class KademliaRPC:
}
if not page:
response[b'contacts'] = self.find_node(rpc_contact, key)[:constants.k]
response[b'contacts'] = self.find_node(rpc_contact, key)[:constants.K]
if self.protocol.protocol_version:
response[b'protocolVersion'] = self.protocol.protocol_version
@@ -96,16 +96,16 @@ class KademliaRPC:
if not rpc_contact.tcp_port or peer.compact_address_tcp() != rpc_contact.compact_address_tcp()
]
# if we don't have k storing peers to return and we have this hash locally, include our contact information
if len(peers) < constants.k and binascii.hexlify(key).decode() in self.protocol.data_store.completed_blobs:
if len(peers) < constants.K and binascii.hexlify(key).decode() in self.protocol.data_store.completed_blobs:
peers.append(self.compact_address())
if not peers:
response[PAGE_KEY] = 0
else:
response[PAGE_KEY] = (len(peers) // (constants.k + 1)) + 1 # how many pages of peers we have for the blob
if len(peers) > constants.k:
response[PAGE_KEY] = (len(peers) // (constants.K + 1)) + 1 # how many pages of peers we have for the blob
if len(peers) > constants.K:
random.Random(self.protocol.node_id).shuffle(peers)
if page * constants.k < len(peers):
response[key] = peers[page * constants.k:page * constants.k + constants.k]
if page * constants.K < len(peers):
response[key] = peers[page * constants.K:page * constants.K + constants.K]
return response
def refresh_token(self): # TODO: this needs to be called periodically
@@ -154,7 +154,7 @@ class RemoteKademliaRPC:
:param blob_hash: blob hash as bytes
:return: b'OK'
"""
if len(blob_hash) != constants.hash_bits // 8:
if len(blob_hash) != constants.HASH_BITS // 8:
raise ValueError(f"invalid length of blob hash: {len(blob_hash)}")
if not self.protocol.peer_port or not 0 < self.protocol.peer_port < 65535:
raise ValueError(f"invalid tcp port: {self.protocol.peer_port}")
@@ -171,7 +171,7 @@ class RemoteKademliaRPC:
"""
:return: [(node_id, address, udp_port), ...]
"""
if len(key) != constants.hash_bits // 8:
if len(key) != constants.HASH_BITS // 8:
raise ValueError(f"invalid length of find node key: {len(key)}")
response = await self.protocol.send_request(
self.peer, RequestDatagram.make_find_node(self.protocol.node_id, key)
@@ -186,7 +186,7 @@ class RemoteKademliaRPC:
<key bytes>: [<blob_peer_compact_address, ...]
}
"""
if len(key) != constants.hash_bits // 8:
if len(key) != constants.HASH_BITS // 8:
raise ValueError(f"invalid length of find value key: {len(key)}")
response = await self.protocol.send_request(
self.peer, RequestDatagram.make_find_value(self.protocol.node_id, key, page=page)
@@ -203,7 +203,7 @@ class PingQueue:
self._process_task: asyncio.Task = None
self._running = False
self._running_pings: typing.Set[asyncio.Task] = set()
self._default_delay = constants.maybe_ping_delay
self._default_delay = constants.MAYBE_PING_DELAY
@property
def running(self):
@@ -224,7 +224,7 @@ class PingQueue:
self._protocol.add_peer(peer)
return
await self._protocol.get_rpc_peer(peer).ping()
except asyncio.TimeoutError:
except (asyncio.TimeoutError, RemoteException):
pass
task = self._loop.create_task(ping_task())
@@ -260,8 +260,8 @@ class PingQueue:
class KademliaProtocol(DatagramProtocol):
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', node_id: bytes, external_ip: str,
udp_port: int, peer_port: int, rpc_timeout: float = constants.rpc_timeout,
split_buckets_under_index: int = constants.split_buckets_under_index):
udp_port: int, peer_port: int, rpc_timeout: float = constants.RPC_TIMEOUT,
split_buckets_under_index: int = constants.SPLIT_BUCKETS_UNDER_INDEX):
self.peer_manager = peer_manager
self.loop = loop
self.node_id = node_id
@@ -271,7 +271,7 @@ class KademliaProtocol(DatagramProtocol):
self.is_seed_node = False
self.partial_messages: typing.Dict[bytes, typing.Dict[bytes, bytes]] = {}
self.sent_messages: typing.Dict[bytes, typing.Tuple['KademliaPeer', asyncio.Future, RequestDatagram]] = {}
self.protocol_version = constants.protocol_version
self.protocol_version = constants.PROTOCOL_VERSION
self.started_listening_time = 0
self.transport: DatagramTransport = None
self.old_token_secret = constants.generate_id()
@@ -326,9 +326,9 @@ class KademliaProtocol(DatagramProtocol):
if not peer.node_id:
log.warning("Tried adding a peer with no node id!")
return False
for p in self.routing_table.get_peers():
if (p.address, p.udp_port) == (peer.address, peer.udp_port) and p.node_id != peer.node_id:
self.routing_table.remove_peer(p)
for my_peer in self.routing_table.get_peers():
if (my_peer.address, my_peer.udp_port) == (peer.address, peer.udp_port) and my_peer.node_id != peer.node_id:
self.routing_table.remove_peer(my_peer)
self.routing_table.join_buckets()
bucket_index = self.routing_table.kbucket_index(peer.node_id)
if self.routing_table.buckets[bucket_index].add_peer(peer):
@@ -367,10 +367,10 @@ class KademliaProtocol(DatagramProtocol):
not_good_contacts = self.routing_table.buckets[bucket_index].get_bad_or_unknown_peers()
not_recently_replied = []
for p in not_good_contacts:
last_replied = self.peer_manager.get_last_replied(p.address, p.udp_port)
for my_peer in not_good_contacts:
last_replied = self.peer_manager.get_last_replied(my_peer.address, my_peer.udp_port)
if not last_replied or last_replied + 60 < self.loop.time():
not_recently_replied.append(p)
not_recently_replied.append(my_peer)
if not_recently_replied:
to_replace = not_recently_replied[0]
else:
@@ -421,20 +421,20 @@ class KademliaProtocol(DatagramProtocol):
raise AttributeError('Invalid method: %s' % message.method.decode())
if message.args and isinstance(message.args[-1], dict) and b'protocolVersion' in message.args[-1]:
# args don't need reformatting
args, kw = tuple(message.args[:-1]), message.args[-1]
args, kwargs = tuple(message.args[:-1]), message.args[-1]
else:
args, kw = self._migrate_incoming_rpc_args(sender_contact, message.method, *message.args)
args, kwargs = self._migrate_incoming_rpc_args(sender_contact, message.method, *message.args)
log.debug("%s:%i RECV CALL %s %s:%i", self.external_ip, self.udp_port, message.method.decode(),
sender_contact.address, sender_contact.udp_port)
if method == b'ping':
result = self.node_rpc.ping()
elif method == b'store':
blob_hash, token, port, original_publisher_id, age = args[:5]
blob_hash, token, port, original_publisher_id, age = args[:5] # pylint: disable=unused-variable
result = self.node_rpc.store(sender_contact, blob_hash, token, port)
else:
key = args[0]
page = kw.get(PAGE_KEY, 0)
page = kwargs.get(PAGE_KEY, 0)
if method == b'findNode':
result = self.node_rpc.find_node(sender_contact, key)
else:
@@ -484,25 +484,25 @@ class KademliaProtocol(DatagramProtocol):
def handle_response_datagram(self, address: typing.Tuple[str, int], response_datagram: ResponseDatagram):
# Find the message that triggered this response
if response_datagram.rpc_id in self.sent_messages:
peer, df, request = self.sent_messages[response_datagram.rpc_id]
peer, future, _ = self.sent_messages[response_datagram.rpc_id]
if peer.address != address[0]:
df.set_exception(RemoteException(
f"response from {address[0]}, expected {peer.address}")
future.set_exception(
RemoteException(f"response from {address[0]}, expected {peer.address}")
)
return
# We got a result from the RPC
if peer.node_id == self.node_id:
df.set_exception(RemoteException("node has our node id"))
future.set_exception(RemoteException("node has our node id"))
return
elif response_datagram.node_id == self.node_id:
df.set_exception(RemoteException("incoming message is from our node id"))
future.set_exception(RemoteException("incoming message is from our node id"))
return
peer = make_kademlia_peer(response_datagram.node_id, address[0], address[1])
self.peer_manager.report_last_replied(address[0], address[1])
self.peer_manager.update_contact_triple(peer.node_id, address[0], address[1])
if not df.cancelled():
df.set_result(response_datagram)
if not future.cancelled():
future.set_result(response_datagram)
self.add_peer(peer)
else:
log.warning("%s:%i replied, but after we cancelled the request attempt",
@@ -516,11 +516,13 @@ class KademliaProtocol(DatagramProtocol):
# The RPC request raised a remote exception; raise it locally
remote_exception = RemoteException(f"{error_datagram.exception_type}({error_datagram.response})")
if error_datagram.rpc_id in self.sent_messages:
peer, df, request = self.sent_messages.pop(error_datagram.rpc_id)
peer, future, request = self.sent_messages.pop(error_datagram.rpc_id)
if (peer.address, peer.udp_port) != address:
df.set_exception(RemoteException(
f"response from {address[0]}:{address[1]}, "
f"expected {peer.address}:{peer.udp_port}")
future.set_exception(
RemoteException(
f"response from {address[0]}:{address[1]}, "
f"expected {peer.address}:{peer.udp_port}"
)
)
return
error_msg = f"" \
@@ -529,23 +531,27 @@ class KademliaProtocol(DatagramProtocol):
f"Raised: {str(remote_exception)}"
if 'Invalid token' in error_msg:
log.debug(error_msg)
elif error_datagram.response not in old_protocol_errors:
elif error_datagram.response not in OLD_PROTOCOL_ERRORS:
log.warning(error_msg)
else:
log.debug("known dht protocol backwards compatibility error with %s:%i (lbrynet v%s)",
peer.address, peer.udp_port, old_protocol_errors[error_datagram.response])
df.set_exception(remote_exception)
log.debug(
"known dht protocol backwards compatibility error with %s:%i (lbrynet v%s)",
peer.address, peer.udp_port, OLD_PROTOCOL_ERRORS[error_datagram.response]
)
future.set_exception(remote_exception)
return
else:
if error_datagram.response not in old_protocol_errors:
if error_datagram.response not in OLD_PROTOCOL_ERRORS:
msg = f"Received error from {address[0]}:{address[1]}, but it isn't in response to a " \
f"pending request: {str(remote_exception)}"
log.warning(msg)
else:
log.debug("known dht protocol backwards compatibility error with %s:%i (lbrynet v%s)",
address[0], address[1], old_protocol_errors[error_datagram.response])
log.debug(
"known dht protocol backwards compatibility error with %s:%i (lbrynet v%s)",
address[0], address[1], OLD_PROTOCOL_ERRORS[error_datagram.response]
)
def datagram_received(self, datagram: bytes, address: typing.Tuple[str, int]) -> None:
def datagram_received(self, datagram: bytes, address: typing.Tuple[str, int]) -> None: # pylint: disable=arguments-differ
try:
message = decode_datagram(datagram)
except (ValueError, TypeError):
@@ -589,12 +595,12 @@ class KademliaProtocol(DatagramProtocol):
raise TransportNotConnected()
data = message.bencode()
if len(data) > constants.msg_size_limit:
if len(data) > constants.MSG_SIZE_LIMIT:
log.warning("cannot send datagram larger than %i bytes (packet is %i bytes)",
constants.msg_size_limit, len(data))
constants.MSG_SIZE_LIMIT, len(data))
log.debug("Packet is too large to send: %s", binascii.hexlify(data[:3500]).decode())
raise ValueError(
f"cannot send datagram larger than {constants.msg_size_limit} bytes (packet is {len(data)} bytes)"
f"cannot send datagram larger than {constants.MSG_SIZE_LIMIT} bytes (packet is {len(data)} bytes)"
)
if isinstance(message, (RequestDatagram, ResponseDatagram)):
assert message.node_id == self.node_id, message
@@ -637,16 +643,16 @@ class KademliaProtocol(DatagramProtocol):
return constants.digest(self.token_secret + compact_ip)
def verify_token(self, token, compact_ip):
h = constants.hash_class()
h = constants.HASH_CLASS()
h.update(self.token_secret + compact_ip)
if self.old_token_secret and not token == h.digest(): # TODO: why should we be accepting the previous token?
h = constants.hash_class()
h = constants.HASH_CLASS()
h.update(self.old_token_secret + compact_ip)
if not token == h.digest():
return False
return True
async def store_to_peer(self, hash_value: bytes, peer: 'KademliaPeer',
async def store_to_peer(self, hash_value: bytes, peer: 'KademliaPeer', # pylint: disable=too-many-return-statements
retry: bool = True) -> typing.Tuple[bytes, bool]:
async def __store():
res = await self.get_rpc_peer(peer).store(hash_value)
@@ -661,14 +667,14 @@ class KademliaProtocol(DatagramProtocol):
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)
return peer.node_id, False
except ValueError as err:
log.error("Unexpected response: %s" % err)
log.error("Unexpected response: %s", err)
return peer.node_id, False
except RemoteException as err:
if 'findValue() takes exactly 2 arguments (5 given)' in str(err):
log.debug("peer %s:%i is running an incompatible version of lbrynet", peer.address, peer.udp_port)
return peer.node_id, False
if 'Invalid token' not in str(err):
log.exception("Unexpected error while storing blob_hash")
log.warning("Unexpected error while storing blob_hash: %s", err)
return peer.node_id, False
self.peer_manager.clear_token(peer.node_id)
if not retry:
@@ -51,12 +51,12 @@ class KBucket:
return True
else:
for i in range(len(self.peers)):
p = self.peers[i]
if p.node_id == peer.node_id:
self.peers.remove(p)
local_peer = self.peers[i]
if local_peer.node_id == peer.node_id:
self.peers.remove(local_peer)
self.peers.append(peer)
return True
if len(self.peers) < constants.k:
if len(self.peers) < constants.K:
self.peers.append(peer)
return True
else:
@@ -101,8 +101,8 @@ class KBucket:
current_len = len(peers)
# If count greater than k - return only k contacts
if count > constants.k:
count = constants.k
if count > constants.K:
count = constants.K
if not current_len:
return peers
@@ -164,14 +164,14 @@ class TreeRoutingTable:
"""
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', parent_node_id: bytes,
split_buckets_under_index: int = constants.split_buckets_under_index):
split_buckets_under_index: int = constants.SPLIT_BUCKETS_UNDER_INDEX):
self._loop = loop
self._peer_manager = peer_manager
self._parent_node_id = parent_node_id
self._split_buckets_under_index = split_buckets_under_index
self.buckets: typing.List[KBucket] = [
KBucket(
self._peer_manager, range_min=0, range_max=2 ** constants.hash_bits, node_id=self._parent_node_id
self._peer_manager, range_min=0, range_max=2 ** constants.HASH_BITS, node_id=self._parent_node_id
)
]
@@ -185,7 +185,7 @@ class TreeRoutingTable:
contacts = self.get_peers()
distance = Distance(self._parent_node_id)
contacts.sort(key=lambda c: distance(c.node_id))
kth_contact = contacts[-1] if len(contacts) < constants.k else contacts[constants.k - 1]
kth_contact = contacts[-1] if len(contacts) < constants.K else contacts[constants.K - 1]
return distance(to_add) < distance(kth_contact.node_id)
def find_close_peers(self, key: bytes, count: typing.Optional[int] = None,
@@ -193,7 +193,7 @@ class TreeRoutingTable:
exclude = [self._parent_node_id]
if sender_node_id:
exclude.append(sender_node_id)
count = count or constants.k
count = count or constants.K
distance = Distance(key)
contacts = self.get_peers()
contacts = [c for c in contacts if c.node_id not in exclude]
@@ -214,7 +214,7 @@ class TreeRoutingTable:
refresh_ids = []
now = int(self._loop.time())
for bucket in self.buckets[start_index:]:
if force or now - bucket.last_accessed >= constants.refresh_interval:
if force or now - bucket.last_accessed >= constants.REFRESH_INTERVAL:
to_search = self.midpoint_id_in_bucket_range(bucket_index)
refresh_ids.append(to_search)
bucket_index += 1
@@ -248,13 +248,13 @@ class TreeRoutingTable:
random_id = int(random.randrange(self.buckets[bucket_index].range_min, self.buckets[bucket_index].range_max))
return Distance(
self._parent_node_id
)(random_id.to_bytes(constants.hash_length, 'big')).to_bytes(constants.hash_length, 'big')
)(random_id.to_bytes(constants.HASH_LENGTH, 'big')).to_bytes(constants.HASH_LENGTH, 'big')
def midpoint_id_in_bucket_range(self, bucket_index: int) -> bytes:
half = int((self.buckets[bucket_index].range_max - self.buckets[bucket_index].range_min) // 2)
return Distance(self._parent_node_id)(
int(self.buckets[bucket_index].range_min + half).to_bytes(constants.hash_length, 'big')
).to_bytes(constants.hash_length, 'big')
int(self.buckets[bucket_index].range_min + half).to_bytes(constants.HASH_LENGTH, 'big')
).to_bytes(constants.HASH_LENGTH, 'big')
def split_bucket(self, old_bucket_index: int) -> None:
""" Splits the specified k-bucket into two new buckets which together
@@ -283,7 +283,7 @@ class TreeRoutingTable:
def join_buckets(self):
if len(self.buckets) == 1:
return
to_pop = [i for i, bucket in enumerate(self.buckets) if not len(bucket)]
to_pop = [i for i, bucket in enumerate(self.buckets) if len(bucket) == 0]
if not to_pop:
return
log.info("join buckets %i", len(to_pop))
@@ -314,6 +314,6 @@ class TreeRoutingTable:
def buckets_with_contacts(self) -> int:
count = 0
for bucket in self.buckets:
if len(bucket):
if len(bucket) > 0:
count += 1
return count
File renamed without changes.
@@ -52,8 +52,7 @@ def _bdecode(data: bytes, start_index: int = 0) -> typing.Tuple[typing.Union[int
raise DecodeError(err)
start_index = split_pos + 1
end_pos = start_index + length
b = data[start_index:end_pos]
return b, end_pos
return data[start_index:end_pos], end_pos
def bencode(data: typing.Dict) -> bytes:
@@ -34,9 +34,9 @@ class KademliaDatagramBase:
self.packet_type = packet_type
if self.expected_packet_type != packet_type:
raise ValueError(f"invalid packet type: {packet_type}, expected {self.expected_packet_type}")
if len(rpc_id) != constants.rpc_id_length:
if len(rpc_id) != constants.RPC_ID_LENGTH:
raise ValueError(f"invalid rpc node_id: {len(rpc_id)} bytes (expected 20)")
if not len(node_id) == constants.hash_length:
if not len(node_id) == constants.HASH_LENGTH:
raise ValueError(f"invalid node node_id: {len(node_id)} bytes (expected 48)")
self.rpc_id = rpc_id
self.node_id = node_id
@@ -46,9 +46,9 @@ class KademliaDatagramBase:
i: getattr(self, k) for i, k in enumerate(self.required_fields)
}
for i, k in enumerate(OPTIONAL_FIELDS):
v = getattr(self, k, None)
if v is not None:
datagram[i + OPTIONAL_ARG_OFFSET] = v
value = getattr(self, k, None)
if value is not None:
datagram[i + OPTIONAL_ARG_OFFSET] = value
return bencode(datagram)
@@ -77,18 +77,18 @@ class RequestDatagram(KademliaDatagramBase):
@classmethod
def make_ping(cls, from_node_id: bytes, rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
rpc_id = rpc_id or constants.generate_id()[:constants.RPC_ID_LENGTH]
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'ping')
@classmethod
def make_store(cls, from_node_id: bytes, blob_hash: bytes, token: bytes, port: int,
rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
if len(blob_hash) != constants.hash_bits // 8:
rpc_id = rpc_id or constants.generate_id()[:constants.RPC_ID_LENGTH]
if len(blob_hash) != constants.HASH_BITS // 8:
raise ValueError(f"invalid blob hash length: {len(blob_hash)}")
if not 0 < port < 65536:
raise ValueError(f"invalid port: {port}")
if len(token) != constants.hash_bits // 8:
if len(token) != constants.HASH_BITS // 8:
raise ValueError(f"invalid token length: {len(token)}")
store_args = [blob_hash, token, port, from_node_id, 0]
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'store', store_args)
@@ -96,16 +96,16 @@ class RequestDatagram(KademliaDatagramBase):
@classmethod
def make_find_node(cls, from_node_id: bytes, key: bytes,
rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
if len(key) != constants.hash_bits // 8:
rpc_id = rpc_id or constants.generate_id()[:constants.RPC_ID_LENGTH]
if len(key) != constants.HASH_BITS // 8:
raise ValueError(f"invalid key length: {len(key)}")
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'findNode', [key])
@classmethod
def make_find_value(cls, from_node_id: bytes, key: bytes,
rpc_id: typing.Optional[bytes] = None, page: int = 0) -> 'RequestDatagram':
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
if len(key) != constants.hash_bits // 8:
rpc_id = rpc_id or constants.generate_id()[:constants.RPC_ID_LENGTH]
if len(key) != constants.HASH_BITS // 8:
raise ValueError(f"invalid key length: {len(key)}")
if page < 0:
raise ValueError(f"cannot request a negative page ({page})")
@@ -162,7 +162,7 @@ def decode_datagram(datagram: bytes) -> typing.Union[RequestDatagram, ResponseDa
for i, k in enumerate(datagram_class.required_fields)
if i in primitive # pylint: disable=unsupported-membership-test
}
for i, k in enumerate(OPTIONAL_FIELDS):
for i, _ in enumerate(OPTIONAL_FIELDS):
if i + OPTIONAL_ARG_OFFSET in primitive:
decoded[i + OPTIONAL_ARG_OFFSET] = primitive[i + OPTIONAL_ARG_OFFSET]
return datagram_class(**decoded)
@@ -179,7 +179,7 @@ def make_compact_address(node_id: bytes, address: str, port: int) -> bytearray:
compact_ip = make_compact_ip(address)
if not 0 < port < 65536:
raise ValueError(f'Invalid port: {port}')
if len(node_id) != constants.hash_bits // 8:
if len(node_id) != constants.HASH_BITS // 8:
raise ValueError(f"invalid node node_id length")
return compact_ip + port.to_bytes(2, 'big') + node_id
@@ -190,6 +190,6 @@ def decode_compact_address(compact_address: bytes) -> typing.Tuple[bytes, str, i
node_id = compact_address[6:]
if not 0 < port < 65536:
raise ValueError(f'Invalid port: {port}')
if len(node_id) != constants.hash_bits // 8:
if len(node_id) != constants.HASH_BITS // 8:
raise ValueError(f"invalid node node_id length")
return node_id, address, port
File renamed without changes.
@@ -47,14 +47,19 @@ Code | Name | Message
401 | TransactionRejected | Transaction rejected, unknown reason.
402 | TransactionFeeTooLow | Fee too low.
403 | TransactionInvalidSignature | Invalid signature.
404 | InsufficientFunds | Insufficient funds. -- determined by wallet prior to attempting to broadcast a tx; this is different for example from a TX being created and sent but then rejected by lbrycrd for unspendable utxos.
404 | InsufficientFunds | Not enough funds to cover this transaction. -- determined by wallet prior to attempting to broadcast a tx; this is different for example from a TX being created and sent but then rejected by lbrycrd for unspendable utxos.
405 | ChannelKeyNotFound | Channel signing key not found.
406 | ChannelKeyInvalid | Channel signing key is out of date. -- For example, channel was updated but you don't have the updated key.
407 | DataDownload | Failed to download blob. *generic*
408 | Resolve | Failed to resolve '{url}'.
409 | ResolveTimeout | Failed to resolve '{url}' within the timeout.
410 | KeyFeeAboveMaxAllowed | {message}
411 | InvalidPassword | Password is invalid.
410 | Resolve | Failed to resolve '{url}'.
411 | ResolveTimeout | Failed to resolve '{url}' within the timeout.
411 | ResolveCensored | Resolve of '{url}' was censored by channel with claim id '{claim_id(censor_hash)}'.
420 | KeyFeeAboveMaxAllowed | {message}
421 | InvalidPassword | Password is invalid.
422 | IncompatibleWalletServer | '{server}:{port}' has an incompatibly old version.
431 | ServerPaymentInvalidAddress | Invalid address from wallet server: '{address}' - skipping payment round.
432 | ServerPaymentWalletLocked | Cannot spend funds with locked wallet, skipping payment round.
433 | ServerPaymentFeeAboveMaxAllowed | Daily server fee of {daily_fee} exceeds maximum configured of {max_fee} LBC.
**5xx** | Blob | **Blobs**
500 | BlobNotFound | Blob not found.
501 | BlobPermissionDenied | Permission denied to read blob.
@@ -1,4 +1,4 @@
from .base import BaseError
from .base import BaseError, claim_id
class UserInputError(BaseError):
@@ -16,18 +16,22 @@ class CommandError(UserInputError):
class CommandDoesNotExistError(CommandError):
def __init__(self, command):
self.command = command
super().__init__(f"Command '{command}' does not exist.")
class CommandDeprecatedError(CommandError):
def __init__(self, command):
self.command = command
super().__init__(f"Command '{command}' is deprecated.")
class CommandInvalidArgumentError(CommandError):
def __init__(self, argument, command):
self.argument = argument
self.command = command
super().__init__(f"Invalid argument '{argument}' to command '{command}'.")
@@ -37,6 +41,7 @@ class CommandTemporarilyUnavailableError(CommandError):
"""
def __init__(self, command):
self.command = command
super().__init__(f"Command '{command}' is temporarily unavailable.")
@@ -46,6 +51,7 @@ class CommandPermanentlyUnavailableError(CommandError):
"""
def __init__(self, command):
self.command = command
super().__init__(f"Command '{command}' is permanently unavailable.")
@@ -58,12 +64,15 @@ class InputValueError(UserInputError, ValueError):
class GenericInputValueError(InputValueError):
def __init__(self, value, argument):
self.value = value
self.argument = argument
super().__init__(f"The value '{value}' for argument '{argument}' is not valid.")
class InputValueIsNoneError(InputValueError):
def __init__(self, argument):
self.argument = argument
super().__init__(f"None or null is not valid value for argument '{argument}'.")
@@ -79,6 +88,7 @@ class ConfigWriteError(ConfigurationError):
"""
def __init__(self, path):
self.path = path
super().__init__(f"Cannot write configuration file '{path}'.")
@@ -88,6 +98,7 @@ class ConfigReadError(ConfigurationError):
"""
def __init__(self, path):
self.path = path
super().__init__(f"Cannot find provided configuration file '{path}'.")
@@ -97,18 +108,21 @@ class ConfigParseError(ConfigurationError):
"""
def __init__(self, path):
self.path = path
super().__init__(f"Failed to parse the configuration file '{path}'.")
class ConfigMissingError(ConfigurationError):
def __init__(self, path):
self.path = path
super().__init__(f"Configuration file '{path}' is missing setting that has no default / fallback.")
class ConfigInvalidError(ConfigurationError):
def __init__(self, path):
self.path = path
super().__init__(f"Configuration file '{path}' has setting with invalid value.")
@@ -161,7 +175,7 @@ class InsufficientFundsError(WalletError):
"""
def __init__(self):
super().__init__("Insufficient funds.")
super().__init__("Not enough funds to cover this transaction.")
class ChannelKeyNotFoundError(WalletError):
@@ -188,18 +202,29 @@ class DataDownloadError(WalletError):
class ResolveError(WalletError):
def __init__(self, url):
self.url = url
super().__init__(f"Failed to resolve '{url}'.")
class ResolveTimeoutError(WalletError):
def __init__(self, url):
self.url = url
super().__init__(f"Failed to resolve '{url}' within the timeout.")
class ResolveCensoredError(WalletError):
def __init__(self, url, censor_hash):
self.url = url
self.censor_hash = censor_hash
super().__init__(f"Resolve of '{url}' was censored by channel with claim id '{claim_id(censor_hash)}'.")
class KeyFeeAboveMaxAllowedError(WalletError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
@@ -209,6 +234,35 @@ class InvalidPasswordError(WalletError):
super().__init__("Password is invalid.")
class IncompatibleWalletServerError(WalletError):
def __init__(self, server, port):
self.server = server
self.port = port
super().__init__(f"'{server}:{port}' has an incompatibly old version.")
class ServerPaymentInvalidAddressError(WalletError):
def __init__(self, address):
self.address = address
super().__init__(f"Invalid address from wallet server: '{address}' - skipping payment round.")
class ServerPaymentWalletLockedError(WalletError):
def __init__(self):
super().__init__("Cannot spend funds with locked wallet, skipping payment round.")
class ServerPaymentFeeAboveMaxAllowedError(WalletError):
def __init__(self, daily_fee, max_fee):
self.daily_fee = daily_fee
self.max_fee = max_fee
super().__init__(f"Daily server fee of {daily_fee} exceeds maximum configured of {max_fee} LBC.")
class BlobError(BaseError):
"""
**Blobs**
@@ -266,30 +320,35 @@ class DownloadCancelledError(BlobError):
class DownloadSDTimeoutError(BlobError):
def __init__(self, download):
self.download = download
super().__init__(f"Failed to download sd blob {download} within timeout.")
class DownloadDataTimeoutError(BlobError):
def __init__(self, download):
self.download = download
super().__init__(f"Failed to download data blobs for sd hash {download} within timeout.")
class InvalidStreamDescriptorError(BlobError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
class InvalidDataError(BlobError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
class InvalidBlobHashError(BlobError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
@@ -302,12 +361,14 @@ class ComponentError(BaseError):
class ComponentStartConditionNotMetError(ComponentError):
def __init__(self, components):
self.components = components
super().__init__(f"Unresolved dependencies for: {components}")
class ComponentsNotStartedError(ComponentError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
@@ -320,16 +381,20 @@ class CurrencyExchangeError(BaseError):
class InvalidExchangeRateResponseError(CurrencyExchangeError):
def __init__(self, source, reason):
self.source = source
self.reason = reason
super().__init__(f"Failed to get exchange rate from {source}: {reason}")
class CurrencyConversionError(CurrencyExchangeError):
def __init__(self, message):
self.message = message
super().__init__(f"{message}")
class InvalidCurrencyError(CurrencyExchangeError):
def __init__(self, currency):
self.currency = currency
super().__init__(f"Invalid currency: {currency} is not a supported currency.")
+9
View File
@@ -0,0 +1,9 @@
from binascii import hexlify
def claim_id(claim_hash):
return hexlify(claim_hash[::-1]).decode()
class BaseError(Exception):
pass
@@ -13,10 +13,12 @@ class {name}({parents}):{doc}
"""
INIT = """
def __init__({args}):
def __init__({args}):{fields}
super().__init__({format}"{message}")
"""
FUNCTIONS = ['claim_id']
class ErrorClass:
@@ -50,11 +52,22 @@ class ErrorClass:
def get_arguments(self):
args = ['self']
for arg in re.findall('{([a-z0-1]+)}', self.message):
for arg in re.findall('{([a-z0-1_()]+)}', self.message):
for func in FUNCTIONS:
if arg.startswith(f'{func}('):
arg = arg[len(f'{func}('):-1]
break
args.append(arg)
return args
def get_doc_string(self, doc):
@staticmethod
def get_fields(args):
if len(args) > 1:
return f''.join(f'\n{INDENT*2}self.{field} = {field}' for field in args[1:])
return ''
@staticmethod
def get_doc_string(doc):
if doc:
return f'\n{INDENT}"""\n{indent(fill(doc, 100), INDENT)}\n{INDENT}"""'
return ""
@@ -68,7 +81,8 @@ class ErrorClass:
args = self.get_arguments()
if self.is_leaf:
out.write((CLASS + INIT).format(
name=self.class_name, parents=', '.join(parents), args=', '.join(args),
name=self.class_name, parents=', '.join(parents),
args=', '.join(args), fields=self.get_fields(args),
message=self.message, doc=self.get_doc_string(self.comment), format='f' if len(args) > 1 else ''
))
else:
@@ -101,7 +115,7 @@ def find_parent(stack, child):
def generate(out):
out.write('from .base import BaseError\n')
out.write(f"from .base import BaseError, {', '.join(FUNCTIONS)}\n")
stack = {}
for error in get_errors():
error.render(out, find_parent(stack, error))
@@ -139,7 +153,7 @@ def analyze():
print(f' - {error}')
if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser()
parser.add_argument("action", choices=['generate', 'analyze'])
args = parser.parse_args()
@@ -147,3 +161,7 @@ if __name__ == "__main__":
analyze()
elif args.action == "generate":
generate(sys.stdout)
if __name__ == "__main__":
main()
File renamed without changes.
+21 -14
View File
@@ -3,6 +3,7 @@ import sys
import shutil
import signal
import pathlib
import platform
import json
import asyncio
import argparse
@@ -15,8 +16,8 @@ from docopt import docopt
from lbry import __version__ as lbrynet_version
from lbry.extras.daemon.loggly_handler import get_loggly_handler
from lbry.extras.daemon.daemon import Daemon
from lbry.conf import Config, CLIConfig
from lbry.extras.daemon.Daemon import Daemon
log = logging.getLogger('lbry')
@@ -168,16 +169,16 @@ def add_command_parser(parent, command):
def get_argument_parser():
main = ArgumentParser(
root = ArgumentParser(
'lbrynet', description='An interface to the LBRY Network.', allow_abbrev=False,
)
main.add_argument(
root.add_argument(
'-v', '--version', dest='cli_version', action="store_true",
help='Show lbrynet CLI version and exit.'
)
main.set_defaults(group=None, command=None)
CLIConfig.contribute_to_argparse(main)
sub = main.add_subparsers(metavar='COMMAND')
root.set_defaults(group=None, command=None)
CLIConfig.contribute_to_argparse(root)
sub = root.add_subparsers(metavar='COMMAND')
start = sub.add_parser(
'start',
usage='lbrynet start [--config FILE] [--data-dir DIR] [--wallet-dir DIR] [--download-dir DIR] ...',
@@ -187,6 +188,10 @@ def get_argument_parser():
'--quiet', dest='quiet', action="store_true",
help='Disable all console output.'
)
start.add_argument(
'--no-logging', dest='no_logging', action="store_true",
help='Disable all logging of any kind.'
)
start.add_argument(
'--verbose', nargs="*",
help=('Enable debug output for lbry logger and event loop. Optionally specify loggers for which debug output '
@@ -217,7 +222,7 @@ def get_argument_parser():
else:
add_command_parser(groups[command['group']], command)
return main
return root
def ensure_directory_exists(path: str):
@@ -225,7 +230,7 @@ def ensure_directory_exists(path: str):
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
LOG_MODULES = ('lbry', 'torba', 'aioupnp')
LOG_MODULES = 'lbry', 'aioupnp'
def setup_logging(logger: logging.Logger, args: argparse.Namespace, conf: Config):
@@ -241,7 +246,6 @@ def setup_logging(logger: logging.Logger, args: argparse.Namespace, conf: Config
logger.getChild(module_name).addHandler(handler)
logger.getChild('lbry').setLevel(logging.INFO)
logger.getChild('torba').setLevel(logging.INFO)
logger.getChild('aioupnp').setLevel(logging.WARNING)
logger.getChild('aiohttp').setLevel(logging.CRITICAL)
@@ -252,17 +256,20 @@ def setup_logging(logger: logging.Logger, args: argparse.Namespace, conf: Config
else:
logger.getChild('lbry').setLevel(logging.DEBUG)
if conf.share_usage_data:
loggly_handler = get_loggly_handler()
loggly_handler.setLevel(logging.ERROR)
logger.getChild('lbry').addHandler(loggly_handler)
loggly_handler = get_loggly_handler(conf)
loggly_handler.setLevel(logging.ERROR)
logger.getChild('lbry').addHandler(loggly_handler)
def run_daemon(args: argparse.Namespace, conf: Config):
if sys.version_info < (3, 8) and platform.system() == "Windows":
# TODO: remove after we move to requiring Python 3.8
asyncio.set_event_loop(asyncio.ProactorEventLoop())
loop = asyncio.get_event_loop()
if args.verbose is not None:
loop.set_debug(True)
setup_logging(logging.getLogger(), args, conf)
if not args.no_logging:
setup_logging(logging.getLogger(), args, conf)
daemon = Daemon(conf)
def __exit():
File renamed without changes.
@@ -1,8 +1,8 @@
import asyncio
import collections
import logging
import aiohttp
import typing
import aiohttp
from lbry import utils
from lbry.conf import Config
from lbry.extras import system_info
@@ -110,7 +110,6 @@ class AnalyticsManager:
self.cookies = {}
self.url = ANALYTICS_ENDPOINT
self._write_key = utils.deobfuscate(ANALYTICS_TOKEN)
self._enabled = conf.share_usage_data
self._tracked_data = collections.defaultdict(list)
self.context = _make_context(system_info.get_platform())
self.installation_id = installation_id
@@ -118,20 +117,24 @@ class AnalyticsManager:
self.task: typing.Optional[asyncio.Task] = None
self.external_ip: typing.Optional[str] = None
@property
def enabled(self):
return self.conf.share_usage_data
@property
def is_started(self):
return self.task is not None
async def start(self):
if self._enabled and self.task is None:
self.external_ip = await utils.get_external_ip()
if self.task is None:
self.task = asyncio.create_task(self.run())
async def run(self):
while True:
await self._send_heartbeat()
if self.enabled:
self.external_ip = await utils.get_external_ip()
await self._send_heartbeat()
await asyncio.sleep(1800)
self.external_ip = await utils.get_external_ip()
def stop(self):
if self.task is not None and not self.task.done():
@@ -154,7 +157,7 @@ class AnalyticsManager:
async def track(self, event: typing.Dict):
"""Send a single tracking event"""
if self._enabled:
if self.enabled:
log.debug('Sending track event: %s', event)
await self._post(event)
File renamed without changes.
@@ -3,16 +3,16 @@ import time
import hashlib
import binascii
from lbry import utils
import ecdsa
from torba.client.hash import sha256
from lbry import utils
from lbry.crypto.hash import sha256
from lbry.wallet.transaction import Output
log = logging.getLogger(__name__)
def get_encoded_signature(signature):
signature = signature.encode() if type(signature) is str else signature
signature = signature.encode() if isinstance(signature, str) else signature
r = int(signature[:int(len(signature) / 2)], 16)
s = int(signature[int(len(signature) / 2):], 16)
return ecdsa.util.sigencode_der(r, s, len(signature) * 4)
@@ -23,7 +23,7 @@ def cid2hash(claim_id: str) -> bytes:
def is_comment_signed_by_channel(comment: dict, channel: Output, abandon=False):
if type(channel) is Output:
if isinstance(channel, Output):
try:
signing_field = comment['comment_id'] if abandon else comment['comment']
pieces = [
@@ -1,7 +1,7 @@
import asyncio
import logging
from lbry.conf import Config
from lbry.extras.daemon.ComponentManager import ComponentManager
from lbry.extras.daemon.componentmanager import ComponentManager
log = logging.getLogger(__name__)
@@ -17,10 +17,11 @@ from lbry.dht.blob_announcer import BlobAnnouncer
from lbry.blob.blob_manager import BlobManager
from lbry.blob_exchange.server import BlobServer
from lbry.stream.stream_manager import StreamManager
from lbry.extras.daemon.Component import Component
from lbry.extras.daemon.component import Component
from lbry.extras.daemon.exchange_rate_manager import ExchangeRateManager
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.wallet import LbryWalletManager
from lbry.wallet import WalletManager
from lbry.wallet.usage_payment import WalletServerPayer
log = logging.getLogger(__name__)
@@ -29,6 +30,7 @@ log = logging.getLogger(__name__)
DATABASE_COMPONENT = "database"
BLOB_COMPONENT = "blob_manager"
WALLET_COMPONENT = "wallet"
WALLET_SERVER_PAYMENTS_COMPONENT = "wallet_server_payments"
DHT_COMPONENT = "dht"
HASH_ANNOUNCER_COMPONENT = "hash_announcer"
STREAM_MANAGER_COMPONENT = "stream_manager"
@@ -112,7 +114,13 @@ class WalletComponent(Component):
return
session_pool = self.wallet_manager.ledger.network.session_pool
sessions = session_pool.sessions
connected = None
if self.wallet_manager.ledger.network.client:
addr_and_port = self.wallet_manager.ledger.network.client.server_address_and_port
if addr_and_port:
connected = f"{addr_and_port[0]}:{addr_and_port[1]}"
result = {
'connected': connected,
'servers': [
{
'host': session.server[0],
@@ -128,11 +136,13 @@ class WalletComponent(Component):
if self.wallet_manager.ledger.network.remote_height:
local_height = self.wallet_manager.ledger.local_height_including_downloaded_height
disk_height = len(self.wallet_manager.ledger.headers)
download_height = local_height - disk_height if disk_height != local_height else local_height
remote_height = self.wallet_manager.ledger.network.remote_height
target_height = remote_height - disk_height if disk_height != local_height else remote_height
download_height, target_height = local_height - disk_height, remote_height - disk_height
if target_height > 0:
progress = min(max(math.ceil(float(download_height) / float(target_height) * 100), 0), 100)
else:
progress = 100
best_hash = self.wallet_manager.get_best_blockhash()
progress = min(max(math.ceil(float(download_height) / float(target_height) * 100), 0), 100)
result.update({
'headers_synchronization_progress': progress,
'blocks': max(local_height, 0),
@@ -143,8 +153,8 @@ class WalletComponent(Component):
return result
async def start(self):
log.info("Starting torba wallet")
self.wallet_manager = await LbryWalletManager.from_lbrynet_config(self.conf)
log.info("Starting wallet")
self.wallet_manager = await WalletManager.from_lbrynet_config(self.conf)
await self.wallet_manager.start()
async def stop(self):
@@ -152,6 +162,34 @@ class WalletComponent(Component):
self.wallet_manager = None
class WalletServerPaymentsComponent(Component):
component_name = WALLET_SERVER_PAYMENTS_COMPONENT
depends_on = [WALLET_COMPONENT]
def __init__(self, component_manager):
super().__init__(component_manager)
self.usage_payment_service = WalletServerPayer(
max_fee=self.conf.max_wallet_server_fee, analytics_manager=self.component_manager.analytics_manager,
)
@property
def component(self) -> typing.Optional[WalletServerPayer]:
return self.usage_payment_service
async def start(self):
wallet_manager = self.component_manager.get_component(WALLET_COMPONENT)
await self.usage_payment_service.start(wallet_manager.ledger, wallet_manager.default_wallet)
async def stop(self):
await self.usage_payment_service.stop()
async def get_status(self):
return {
'max_fee': self.usage_payment_service.max_fee,
'running': self.usage_payment_service.running
}
class BlobComponent(Component):
component_name = BLOB_COMPONENT
depends_on = [DATABASE_COMPONENT]
@@ -331,9 +369,8 @@ class PeerProtocolServerComponent(Component):
async def start(self):
log.info("start blob server")
upnp = self.component_manager.get_component(UPNP_COMPONENT)
blob_manager: BlobManager = self.component_manager.get_component(BLOB_COMPONENT)
wallet: LbryWalletManager = self.component_manager.get_component(WALLET_COMPONENT)
wallet: WalletManager = self.component_manager.get_component(WALLET_COMPONENT)
peer_port = self.conf.tcp_port
address = await wallet.get_unused_address()
self.blob_server = BlobServer(asyncio.get_event_loop(), blob_manager, address)
@@ -375,7 +412,7 @@ class UPnPComponent(Component):
self.upnp = await UPnP.discover(loop=self.component_manager.loop)
log.info("found upnp gateway: %s", self.upnp.gateway.manufacturer_string)
except Exception as err:
if isinstance(err, asyncio.CancelledError):
if isinstance(err, asyncio.CancelledError): # TODO: remove when updated to 3.8
raise
log.warning("upnp discovery failed: %s", err)
self.upnp = None
@@ -440,9 +477,9 @@ class UPnPComponent(Component):
log.info("refreshed upnp redirect for peer port: %i", tcp_port)
except (asyncio.TimeoutError, UPnPError, NotImplementedError):
del self.upnp_redirects['TCP']
if ('TCP' in self.upnp_redirects
and PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components) and (
'UDP' in self.upnp_redirects and DHT_COMPONENT not in self.component_manager.skip_components):
if ('TCP' in self.upnp_redirects and
PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components) and \
('UDP' in self.upnp_redirects and DHT_COMPONENT not in self.component_manager.skip_components):
if self.upnp_redirects:
log.debug("upnp redirects are still active")
@@ -468,8 +505,10 @@ class UPnPComponent(Component):
if self.external_ip:
log.info("detected external ip using lbry.com fallback")
if self.component_manager.analytics_manager:
await self.component_manager.analytics_manager.send_upnp_setup_success_fail(
success, await self.get_status()
self.component_manager.loop.create_task(
self.component_manager.analytics_manager.send_upnp_setup_success_fail(
success, await self.get_status()
)
)
self._maintain_redirects_task = self.component_manager.loop.create_task(
self._repeatedly_maintain_redirects(now=False)
File diff suppressed because it is too large. Load diff
@@ -4,6 +4,7 @@ import asyncio
import logging
from decimal import Decimal
from typing import Optional, Iterable, Type
from aiohttp.client_exceptions import ContentTypeError
from lbry.error import InvalidExchangeRateResponseError, CurrencyConversionError
from lbry.utils import aiohttp_request
from lbry.wallet.dewies import lbc_to_dewies
@@ -29,9 +30,9 @@ class ExchangeRate:
class MarketFeed:
name: str
market: str
url: str
name: str = ""
market: str = ""
url: str = ""
params = {}
fee = 0
@@ -53,12 +54,17 @@ class MarketFeed:
def is_online(self):
return self.last_check+self.update_interval+self.request_timeout > time.time()
def get_rate_from_response(self, response):
def get_rate_from_response(self, json_response):
raise NotImplementedError()
async def get_response(self):
async with aiohttp_request('get', self.url, params=self.params, timeout=self.request_timeout) as response:
self._last_response = await response.json()
try:
self._last_response = await response.json()
except ContentTypeError as e:
self._last_response = {}
log.warning("Could not parse exchange rate response from %s: %s", self.name, e.message)
log.debug(await response.text())
return self._last_response
async def get_rate(self):
@@ -160,8 +166,8 @@ FEEDS: Iterable[Type[MarketFeed]] = (
LBRYFeed,
LBRYBTCFeed,
BittrexFeed,
CryptonatorFeed,
CryptonatorBTCFeed,
# CryptonatorFeed,
# CryptonatorBTCFeed,
)
@@ -186,7 +192,7 @@ class ExchangeRateManager:
def convert_currency(self, from_currency, to_currency, amount):
rates = [market.rate for market in self.market_feeds]
log.debug("Converting %f %s to %s, rates: %s" % (amount, from_currency, to_currency, rates))
log.debug("Converting %f %s to %s, rates: %s", amount, from_currency, to_currency, rates)
if from_currency == to_currency:
return round(amount, 8)
@@ -6,11 +6,9 @@ from json import JSONEncoder
from google.protobuf.message import DecodeError
from torba.client.wallet import Wallet
from torba.client.bip32 import PubKey
from lbry.schema.claim import Claim
from lbry.wallet.ledger import MainNetLedger, Account
from lbry.wallet.transaction import Transaction, Output
from lbry.wallet import Wallet, Ledger, Account, Transaction, Output
from lbry.wallet.bip32 import PubKey
from lbry.wallet.dewies import dewies_to_lbc
from lbry.stream.managed_stream import ManagedStream
@@ -114,12 +112,12 @@ def encode_file_doc():
class JSONResponseEncoder(JSONEncoder):
def __init__(self, *args, ledger: MainNetLedger, include_protobuf=False, **kwargs):
def __init__(self, *args, ledger: Ledger, include_protobuf=False, **kwargs):
super().__init__(*args, **kwargs)
self.ledger = ledger
self.include_protobuf = include_protobuf
def default(self, obj): # pylint: disable=method-hidden
def default(self, obj): # pylint: disable=method-hidden,arguments-differ,too-many-return-statements
if isinstance(obj, Account):
return self.encode_account(obj)
if isinstance(obj, Wallet):
@@ -250,7 +248,8 @@ class JSONResponseEncoder(JSONEncoder):
result['is_default'] = self.ledger.accounts[0] == account
return result
def encode_wallet(self, wallet):
@staticmethod
def encode_wallet(wallet):
return {
'id': wallet.id,
'name': wallet.name
@@ -295,7 +294,8 @@ class JSONResponseEncoder(JSONEncoder):
'added_on': managed_stream.added_on,
'height': tx_height,
'confirmations': (best_height + 1) - tx_height if tx_height > 0 else tx_height,
'timestamp': self.ledger.headers[tx_height]['timestamp'] if 0 < tx_height <= best_height else None
'timestamp': self.ledger.headers[tx_height]['timestamp'] if 0 < tx_height <= best_height else None,
'is_fully_reflected': managed_stream.is_fully_reflected
}
def encode_claim(self, claim):
@@ -1,11 +1,14 @@
import asyncio
from aiohttp.client_exceptions import ClientError
import json
import logging.handlers
import traceback
import typing
from aiohttp.client_exceptions import ClientError
import aiohttp
from lbry import utils, __version__
if typing.TYPE_CHECKING:
from lbry.conf import Config
LOGGLY_TOKEN = 'BQEzZmMzLJHgAGxkBF00LGD0YGuyATVgAmqxAQEuAQZ2BQH4'
@@ -14,6 +17,7 @@ class JsonFormatter(logging.Formatter):
"""Format log records using json serialization"""
def __init__(self, **kwargs):
super().__init__()
self.attributes = kwargs
def format(self, record):
@@ -34,19 +38,22 @@ class JsonFormatter(logging.Formatter):
class HTTPSLogglyHandler(logging.Handler):
def __init__(self, loggly_token: str, fqdn=False, localname=None, facility=None, cookies=None):
def __init__(self, loggly_token: str, config: 'Config'):
super().__init__()
self.fqdn = fqdn
self.localname = localname
self.facility = facility
self.cookies = cookies or {}
self.cookies = {}
self.url = "https://logs-01.loggly.com/inputs/{token}/tag/{tag}".format(
token=utils.deobfuscate(loggly_token), tag='lbrynet-' + __version__
)
self._loop = asyncio.get_event_loop()
self._session = aiohttp.ClientSession()
self._config = config
def get_full_message(self, record):
@property
def enabled(self):
return self._config.share_usage_data
@staticmethod
def get_full_message(record):
if record.exc_info:
return '\n'.join(traceback.format_exception(*record.exc_info))
else:
@@ -59,13 +66,19 @@ class HTTPSLogglyHandler(logging.Handler):
cookies=self.cookies) as response:
self.cookies.update(response.cookies)
except ClientError:
if self._loop.is_running() and retry:
if self._loop.is_running() and retry and self.enabled:
await self._session.close()
self._session = aiohttp.ClientSession()
return await self._emit(record, retry=False)
def emit(self, record):
asyncio.ensure_future(self._emit(record))
if not self.enabled:
return
try:
asyncio.ensure_future(self._emit(record), loop=self._loop)
except RuntimeError: # TODO: use a second loop
print(f"\nfailed to send traceback to loggly, please file an issue with the following traceback:\n"
f"{self.format(record)}")
def close(self):
super().close()
@@ -76,7 +89,7 @@ class HTTPSLogglyHandler(logging.Handler):
pass
def get_loggly_handler():
handler = HTTPSLogglyHandler(LOGGLY_TOKEN)
def get_loggly_handler(config):
handler = HTTPSLogglyHandler(LOGGLY_TOKEN, config=config)
handler.setFormatter(JsonFormatter())
return handler
File renamed without changes.
@@ -65,7 +65,7 @@ def do_migration(conf):
added_on
from file;
insert into new_content_claim (stream_hash, bt_infohash, claim_outpoint)
insert or ignore into new_content_claim (stream_hash, bt_infohash, claim_outpoint)
select stream_hash, NULL, claim_outpoint from content_claim;
drop table file;
Loaded 100 of 386 files, more files were not shown because too many files have changed in this diff. Show more