Compare commits

...
205 Commits
Author SHA1 Message Date
Victor Shyba 92258a2764 add concurrent_hub_requests conf 2021-05-04 22:38:59 -03:00
Victor Shyba ac88ada50e move request semaphore to session and apply to all requests 2021-05-04 22:38:46 -03:00
Victor Shyba e7fdf2aeb3 add hub_timeout and propagate it to network code 2021-05-04 22:38:39 -03:00
Lex Berezhny 99f56f5d22 v0.96.0 2021-04-28 15:26:58 -04:00
Jack Robison ad6281090d Merge pull request #3275 from lbryio/search_caching_issues
add caching to "search ahead" code and invalidate short_url cache on every block
2021-04-28 14:14:29 -04:00
Victor Shyba f0d334d3e2 refactor from review 2021-04-28 13:28:38 -03:00
Victor Shyba 5f829b048f use separator to avoid cache key conflicts 2021-04-27 22:57:04 -03:00
Victor Shyba 1a961e66ff invalidate short_id cache on new block 2021-04-27 22:57:04 -03:00
Victor Shyba fdb0e22656 cache search_ahead 2021-04-27 22:57:04 -03:00
Jack Robison 132ee1915f Merge pull request #3283 from lbryio/fix_multiprocessing_db
fix multiprocessing support on client db
2021-04-27 16:46:28 -04:00
Victor Shyba 44bf4f3c8f fix if statement from always evaluating a string 2021-04-27 17:10:04 -03:00
Alex Grintsvayg 6237767d5a Merge branch 'make-test'
* make-test:
  run tests using make
2021-04-23 15:26:26 -04:00
Alex Grintsvayg dec9d96417 run tests using make 2021-04-23 15:25:40 -04:00
Lex Berezhny b167c87267 v0.95.0 2021-04-23 14:55:38 -04:00
Lex Berezhny 2280fe8e8e default has_source to 1 2021-04-23 14:54:51 -04:00
Lex Berezhny 575d6dcd2d migration specifically for upgrading from client db v1.5 to v1.6 2021-04-23 14:54:51 -04:00
Lex Berezhny f729490c6b pending claims ordered towards top in claim_list 2021-04-23 11:00:58 -04:00
Lex Berezhny b32124cdd6 regenerate docs 2021-04-23 10:24:48 -04:00
Lex Berezhny 3d4321ee38 added --has_source/--has_no_source filters to claim_list 2021-04-23 10:24:48 -04:00
Alex Grintsvayg 85034b382e Revert "run tests using make"
This reverts commit 77a51d1ad4.
2021-04-21 11:41:16 -04:00
Alex Grintsvayg 77a51d1ad4 run tests using make 2021-04-20 15:41:09 -04:00
Alex Grin 33e0cdc2d7 Update docker-compose-wallet-server.yml 2021-04-16 11:58:02 -04:00
Alex Grin 6519faa2fe Update docker-compose-wallet-server.yml 2021-04-16 11:53:16 -04:00
Lex Berezhny 5e3a234cbe v0.94.1 2021-04-16 11:18:24 -04:00
Lex Berezhny e54c31d2d5 fix bug in how reserved balance is calculated 2021-04-16 11:17:51 -04:00
Alex Grin 66c0537251 Create ossar-analysis.yml 2021-04-15 15:24:26 -04:00
Alex Grin ac58516593 Create codeql-analysis.yml 2021-04-15 15:22:57 -04:00
Alex Grin c3da6322b5 Create SECURITY.md 2021-04-15 15:21:17 -04:00
Lex Berezhny 3d241500cf v0.94.0 2021-04-14 19:55:35 -04:00
Lex Berezhny ded8224f66 update docs 2021-04-14 19:52:50 -04:00
Lex Berezhny f8814881a1 ability to set sd_hash, file_name and file_hash when updating a stream claim 2021-04-14 19:52:50 -04:00
Victor Shyba cc2852cd48 new implementation for limit_claims_per_channel 2021-04-14 18:32:16 -04:00
Lex Berezhny 467637a9eb fix test 2021-04-14 11:24:58 -04:00
Lex Berezhny 3cfc292d84 lint 2021-04-14 11:24:58 -04:00
Lex Berezhny 6acf94a810 moved balance calculation to SQL 2021-04-14 11:24:58 -04:00
Jack Robison 31367fb4c4 show hostnames of spvs 2021-04-13 11:51:27 -04:00
Jack Robison 12d6074e3b fix typing 2021-04-13 11:51:27 -04:00
Lex Berezhny ff30386051 lint 2021-04-06 21:22:27 -04:00
shubhendra 601f99ac16 Remove unnecessary generator
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
shubhendra 87fe5c6101 Refactor the comparison involving not
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
shubhendra 68399ca31c Iterate dictionary directly
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
shubhendra 2a6d7fd80f Remove methods with unnecessary super delegation.
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
shubhendra 4725f510d8 Remove unnecessary use of comprehension
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
shubhendra be0ba22222 Remove unnecessary comprehension
Signed-off-by: shubhendra <withshubh@gmail.com>
2021-04-06 21:22:27 -04:00
Lex Berezhny c8781392be added unit test for Access-Control HTTP headers 2021-04-06 17:12:05 -04:00
John Leith b97164fcfb adding access control headers 2021-04-06 17:12:05 -04:00
Lex Berezhny 0dfb92281b v0.93.0 2021-03-30 20:59:47 -04:00
Victor Shyba 4fe80c40da also apply to test:json-api 2021-03-30 17:00:15 -04:00
Victor Shyba f0fac5115a update tox to pass ELASTIC_HOST 2021-03-30 17:00:15 -04:00
Victor Shyba 46dd389d0d add elasticsearch service to gitlab 2021-03-30 17:00:15 -04:00
Jack Robison 1e28e21ab5 Merge pull request #3248 from lbryio/add-es-host-setting
add ELASTIC_HOST and ELASTIC_PORT settings to hub
2021-03-30 13:09:18 -04:00
Jack Robison 7832c62c5d add ELASTIC_HOST and ELASTIC_PORT settings to hub 2021-03-30 12:48:13 -04:00
Lex Berezhny d025ee9dbe revert release 2021-03-30 11:29:17 -04:00
Lex Berezhny a9a9cb4319 v0.93.0 2021-03-30 10:15:31 -04:00
Victor Shyba aa727cb9b1 show channels regardless of no_source 2021-03-30 09:47:08 -04:00
Victor Shyba b8c9a99f20 fix no_source for reposts 2021-03-30 09:47:08 -04:00
Lex Berezhny aff995b0d0 temporary fix for mempool sync failing during reorg 2021-03-29 16:11:03 -04:00
Jack Robison 2cc7e5dfdc Merge pull request #3153 from lbryio/elasticsearch
hub: use Elasticsearch for `claim_search` and `resolve` calls
2021-03-24 16:44:14 -04:00
Victor Shyba 5235a150b1 add prog name to sync arg parser 2021-03-24 17:07:17 -03:00
Victor Shyba c6372ea9de hub->lbry-hub 2021-03-24 17:03:57 -03:00
Victor Shyba 7df4cc44c4 fixes from review 2021-03-24 16:30:33 -03:00
Victor Shyba d47cf40544 add reader.py for test_sqldb tests 2021-03-19 19:58:13 -03:00
Victor Shyba 7f5d88e95c remove dead/broken/unused API 2021-03-19 19:58:13 -03:00
Victor Shyba d09663c066 remove flush call 2021-03-19 19:58:13 -03:00
Victor Shyba ef97c9b69f torba-server -> hub 2021-03-19 19:58:13 -03:00
Victor Shyba d855e6c8b1 move elasticsearch things into its own module 2021-03-19 19:58:13 -03:00
Victor Shyba cd66f7eb43 if not no_totals, use default page size 2021-03-19 19:58:13 -03:00
Victor Shyba 6a35a7ba4c expand content filtering tests for no_totals 2021-03-19 19:58:13 -03:00
Victor Shyba a3e146dc68 sort on index time 2021-03-19 19:58:13 -03:00
Victor Shyba b81305a4a9 index and allow has_source 2021-03-19 19:58:13 -03:00
Victor Shyba 73884b34bc apply no_totals 2021-03-19 19:58:13 -03:00
Victor Shyba 6166a34db2 check cache item before locking 2021-03-19 19:58:13 -03:00
Victor Shyba 6fa7da4b1c less slices 2021-03-19 19:58:13 -03:00
Victor Shyba c3e426c491 fix search by channel for invalid channel 2021-03-19 19:58:13 -03:00
Victor Shyba 21e023f0db fix search by channel 2021-03-19 19:58:13 -03:00
Victor Shyba 063be001b3 cache inner parsing 2021-03-19 19:58:13 -03:00
Victor Shyba 5dff02e8bc on resolve, get all claims at once 2021-03-19 19:58:13 -03:00
Victor Shyba 60a59407d8 cache the encoded output instead 2021-03-19 19:58:13 -03:00
Victor Shyba 20a5aecfca fix lib exception to asyncio TimeoutError 2021-03-19 19:58:13 -03:00
Victor Shyba c2e7b5a67d restore some of the interrupt metrics 2021-03-19 19:58:13 -03:00
Victor Shyba 8f32303d07 apply search timeout 2021-03-19 19:58:13 -03:00
Victor Shyba 891b1e7782 track results up to 200 2021-03-19 19:58:13 -03:00
Victor Shyba f26394fd3b report deletions on docs that doesnt exist, but dont raise 2021-03-19 19:58:13 -03:00
Victor Shyba 4d83d42b4c fix equality instead of mod 2021-03-19 19:58:13 -03:00
Victor Shyba 57f1108df2 fix query being json serializable 2021-03-19 19:58:13 -03:00
Victor Shyba 2641a9abe5 make better resolve cache 2021-03-19 19:58:13 -03:00
Victor Shyba 6b193ab350 make indexing cooperative 2021-03-19 19:58:13 -03:00
Victor Shyba b1bb37511c use right key on cache 2021-03-19 19:58:13 -03:00
Victor Shyba 319187d6d6 log mempool task exceptions 2021-03-19 19:58:13 -03:00
Victor Shyba 02eb789f84 caching for resolve 2021-03-19 19:58:13 -03:00
Victor Shyba 5a9338a27f use a dict on set_reference 2021-03-19 19:58:13 -03:00
Victor Shyba eb6924277f round time to 10 minutes and fetch referenced by id 2021-03-19 19:58:13 -03:00
Victor Shyba 325419404d update dockerfile 2021-03-19 19:58:13 -03:00
Victor Shyba bd8f371fd5 bump referenced rows query limit up 2021-03-19 19:58:13 -03:00
Victor Shyba 1783ff2845 dont delete claims on reorg 2021-03-19 19:58:13 -03:00
Victor Shyba d388527ffa log indexing errors 2021-03-19 19:58:13 -03:00
Victor Shyba 19494088bd generate from queue 2021-03-19 19:58:13 -03:00
Victor Shyba 920dad524a simplify sync and use asyncio Queue instead 2021-03-19 19:58:13 -03:00
Victor Shyba ec89bcac8e improve sync script for no-downtime maintenance 2021-03-19 19:58:13 -03:00
Victor Shyba a916c1f4ad check if db file exists before sync 2021-03-19 19:58:13 -03:00
Victor Shyba a9a0ac92d7 ignore unset flag 2021-03-19 19:58:13 -03:00
Victor Shyba da8a8bd1ef filter+fts and tests for edge cases 2021-03-19 19:58:13 -03:00
Victor Shyba d9c746891d pin python3.7 2021-03-19 19:58:13 -03:00
Victor Shyba 67817005b5 check ES synced without a process and wait for ES 2021-03-19 19:58:13 -03:00
Jack Robison 24d11de5a7 torba-elastic-sync 2021-03-19 19:58:13 -03:00
Victor Shyba 9251c87323 refresh after sync 2021-03-19 19:58:13 -03:00
Victor Shyba e12fab90d1 docker compose update 2021-03-19 19:58:13 -03:00
Victor Shyba 0a194b5b01 claim_ids query 2021-03-19 19:58:13 -03:00
Victor Shyba 8d028adc53 be a writer by default 2021-03-19 19:58:13 -03:00
Victor Shyba dfca15395e claim id is also a keyword 2021-03-19 19:58:13 -03:00
Victor Shyba e21f2362fe apply reorg deletion as well 2021-03-19 19:58:13 -03:00
Victor Shyba 1ce328e8a9 cache signature inspection 2021-03-19 19:58:13 -03:00
Victor Shyba 038a5f999f cache encoded headers 2021-03-19 19:58:13 -03:00
Victor Shyba 5d3704c7ea reader mode 2021-03-19 19:58:13 -03:00
Victor Shyba 87037c06c9 remove reader code 2021-03-19 19:58:13 -03:00
Victor Shyba dd412c0f50 delete sqlite fts 2021-03-19 19:58:13 -03:00
Victor Shyba bf44befff6 backport fixes from server 2021-03-19 19:58:13 -03:00
Victor Shyba e61874bb6f only repeat search if it has blocked items 2021-03-19 19:58:13 -03:00
Victor Shyba 1e5331768f fix some of the tests 2021-03-19 19:58:13 -03:00
Victor Shyba ec9a3a4f7c do not page filtered 2021-03-19 19:58:13 -03:00
Victor Shyba e439a3a8dc advanced resolve 2021-03-19 19:58:13 -03:00
Victor Shyba 19f70d7a11 create changelog trigger 2021-03-19 19:58:13 -03:00
Victor Shyba afe7ed5b05 adjust size 2021-03-19 19:58:13 -03:00
Victor Shyba d4bf004d74 use a thread pool to sync changes 2021-03-19 19:58:13 -03:00
Victor Shyba e4d06a088b include the channel being filtered/blocked 2021-03-19 19:58:13 -03:00
Victor Shyba 0929088b12 missing refresh step 2021-03-19 19:58:13 -03:00
Victor Shyba 7b4838fc9b dont update more than 400 items a time 2021-03-19 19:58:13 -03:00
Victor Shyba 0cf9533248 narrow update by query 2021-03-19 19:58:13 -03:00
Victor Shyba 84ff0b8a9f general timeout 2021-03-19 19:58:13 -03:00
Victor Shyba d467dcfeaf increase sync queue 2021-03-19 19:58:13 -03:00
Victor Shyba 8e68ba4751 fix join, refresh before update 2021-03-19 19:58:13 -03:00
Victor Shyba 0f2a85ba9f simplify sync 2021-03-19 19:58:13 -03:00
Victor Shyba 7674a0a91e backport fixes from testing server 2021-03-19 19:58:13 -03:00
Victor Shyba 5bc1a66572 32 slices and add censor type to fields 2021-03-19 19:58:13 -03:00
Victor Shyba 9b56067213 raise request timeout for content filtering 2021-03-19 19:58:13 -03:00
Victor Shyba 9a9df2fc3c apply filtering only to whats unfiltered 2021-03-19 19:58:13 -03:00
Victor Shyba 9989d8d1d4 refresh after delete 2021-03-19 19:58:13 -03:00
Victor Shyba f9471f297e apply filter and block from ES script lang 2021-03-19 19:58:13 -03:00
Victor Shyba 146b693e4a exclude title and description 2021-03-19 19:58:13 -03:00
Victor Shyba 7295b7e329 make sync parallel 2021-03-19 19:58:13 -03:00
Victor Shyba e2441ea3e7 use prefix from ES docs 2021-03-19 19:58:13 -03:00
Victor Shyba 119e51912e fix partial id 2021-03-19 19:58:13 -03:00
Victor Shyba dd950f5b0d tag can have empty space 2021-03-19 19:58:13 -03:00
Victor Shyba 78a9bad1e1 no indexer_task 2021-03-19 19:58:13 -03:00
Victor Shyba 0c6eaf5484 fix resolve partial id 2021-03-19 19:58:13 -03:00
Victor Shyba 1010068ddb disable refresh interval. start with 3 shards 2021-03-19 19:58:13 -03:00
Victor Shyba 82eec3d8d7 use multiple clients on sync script indexing 2021-03-19 19:58:13 -03:00
Victor Shyba ee7b37d3f3 also normalize the name supplied by user 2021-03-19 19:58:13 -03:00
Victor Shyba 143d82d242 normalized, not normalized_name 2021-03-19 19:58:13 -03:00
Victor Shyba 8b91b38855 update winners in one go 2021-03-19 19:58:13 -03:00
Victor Shyba 1098f0d2a3 use normalized name instead 2021-03-19 19:58:13 -03:00
Victor Shyba ab53cec022 fix is_controlling sync 2021-03-19 19:58:13 -03:00
Victor Shyba 6f5f8e5648 add elasticsearch dep 2021-03-19 19:58:13 -03:00
Victor Shyba edfd707c22 run ES on github actions 2021-03-19 19:58:13 -03:00
Victor Shyba 1870f30af8 add sync script 2021-03-19 19:58:13 -03:00
Victor Shyba 90106f5f08 all test_claim_commands tests green 2021-03-19 19:58:13 -03:00
Victor Shyba 9924b7b438 reposts and tag inheritance 2021-03-19 19:58:13 -03:00
Victor Shyba aa37faab0a use porter analyzer with weights on full text search 2021-03-19 19:58:13 -03:00
Victor Shyba dc10f8ce72 ignore errors when deleting 2021-03-19 19:58:13 -03:00
Victor Shyba 996686c1da claim search and resolve translated to ES queries 2021-03-19 19:58:13 -03:00
Victor Shyba 488785d013 add indexer task 2021-03-19 19:58:13 -03:00
Victor Shyba 3abdc01230 index ES during sync 2021-03-19 19:58:13 -03:00
Victor Shyba 8da04a584f start waiting before generate 2021-03-19 18:01:29 -03:00
Victor Shyba 27cc61d45e limit test time to 2 minutes, then consider it a failure and log what was running 2021-03-19 18:01:29 -03:00
Lex Berezhny 7371c30064 v0.92.0 2021-03-15 13:07:30 -04:00
Lex Berezhny 140d163895 removed redundant comment 2021-03-14 10:11:42 -04:00
Victor Shyba dc33bdc1dc update api json 2021-03-14 10:11:42 -04:00
Victor Shyba 74df4fab83 change column to has_source and document both flags 2021-03-14 10:11:42 -04:00
Victor Shyba 1e5cd3d7a1 typo, fix tests 2021-03-14 10:11:42 -04:00
Victor Shyba a54e9b64aa add no_source claim_search filter 2021-03-14 10:11:42 -04:00
Victor Shyba 74660704e3 fix update 2021-03-14 10:11:42 -04:00
Victor Shyba 7439893a2a fix get for sourceless claims 2021-03-14 10:11:42 -04:00
Victor Shyba e27e49e9dc call update only once 2021-03-14 10:11:42 -04:00
Victor Shyba 34ed729c59 there is no 'sd_hash' parameter for this API 2021-03-14 10:11:42 -04:00
Victor Shyba adaeeca3fd let file_path be optional 2021-03-14 10:11:42 -04:00
Jack Robison dac75563d3 add --no_file_path param to publish, stream_create, and stream_update 2021-03-14 10:11:42 -04:00
Alex Grintsvayg cbc76adcaa only return unspent txos if is_spent flag is not used. fixes #2923 2021-03-13 06:44:20 -05:00
Lex Berezhny 69a9cb383d oops 2021-03-12 13:29:55 -05:00
Lex Berezhny 4343073c00 clients can connect to wallet server even when they are not reachable by UDP 2021-03-12 13:29:55 -05:00
Jack Robison fe60d4be88 Merge pull request #3221 from lbryio/subscribe_hash_on_call
Improve performance of address subscriptions and transaction proofs
2021-03-10 15:58:50 -05:00
Victor Shyba ae337807f5 get merkles outside thread cooperatively 2021-03-10 13:05:17 -03:00
Victor Shyba 9ae30ac08e during subscribe, hash address only when its time 2021-03-10 12:51:58 -03:00
Lex Berezhny 62fa85c0a4 fix test 2021-03-09 13:27:36 -05:00
Lex Berezhny 7bb873dad9 removed connection_status field from the status command, use wallet.connected instead to determine if SDK is connected 2021-03-09 13:27:36 -05:00
Lex Berezhny 5f6c1c14cb v0.91.0 2021-03-04 00:04:25 -05:00
Lex Berezhny d43189ad33 regenerate docs 2021-03-04 00:03:16 -05:00
Lex Berezhny fcad76fc51 lint 2021-03-04 00:03:16 -05:00
Lex Berezhny 97e6e1684e simplifying 2021-03-04 00:03:16 -05:00
zeppi 67a0d3e926 update docs 2021-03-04 00:03:16 -05:00
zeppi 183fb9f9ff provide --resolve tag for collection claim, separate from resolving its contents
bugfix and docs generation

review changes
2021-03-04 00:03:16 -05:00
Lex Berezhny 9815ddef1f fixes stalling client reconnect issue 2021-03-03 23:31:59 -05:00
Lex Berezhny f6d0847453 v0.90.1 2021-03-01 11:57:40 -05:00
Lex Berezhny b0b9f0d65f regenerate docs 2021-03-01 11:52:17 -05:00
Lex Berezhny 0cec80f676 fixes transaction signing bug when tx had no change outputs 2021-03-01 11:20:08 -05:00
Patrick Keane 48c64143e3 Add no_totals argument to claim search 2021-02-26 10:41:15 -05:00
Patrick Keane a8712422bc Update daemon.py 2021-02-21 23:45:18 -05:00
Patrick Keane 97f65bd283 Minor spelling correction(s). 2021-02-21 23:45:18 -05:00
Lex Berezhny fd3c1c50f1 v0.90.0 2021-02-16 11:13:14 -05:00
Lex Berezhny b153e4bb9f added support to claim_search for filtering collections via --claim_type 2021-02-16 11:08:54 -05:00
Lex Berezhny db9856a8db use median exchange rate when several exchange rates are available 2021-02-15 14:09:32 -05:00
Lex Berezhny 75ecea265d ensures content purchase fails appropriately when exchange rate is not available 2021-02-11 13:57:33 -05:00
Lex Berezhny be8751cb73 integration test fixes 2021-02-10 22:14:13 -05:00
Lex Berezhny fb25ecb4a1 unittest 2021-02-10 22:14:13 -05:00
Lex Berezhny f1cb7d27ac lint 2021-02-10 22:14:13 -05:00
Lex Berezhny dee494e12f converting from USD, BTC to LBC is now done via several exchange rate providers: Bittrex, Cryptonator, CoinEx, hotbit and UPbit 2021-02-10 22:14:13 -05:00
65 changed files with 2146 additions and 1056 deletions

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '21 0 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
+13 -3
View File
@@ -22,10 +22,9 @@ jobs:
with:
python-version: '3.7'
- run: make install tools
- working-directory: lbry
env:
- env:
HOME: /tmp
run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
run: make test-unit-coverage
tests-integration:
name: "tests / integration"
@@ -37,6 +36,17 @@ jobs:
- blockchain
- other
steps:
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
+44
View File
@@ -0,0 +1,44 @@
# This workflow integrates a collection of open source static analysis tools
# with GitHub code scanning. For documentation, or to provide feedback, visit
# https://github.com/github/ossar-action
name: OSSAR
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '28 17 * * 1'
jobs:
OSSAR-Scan:
# OSSAR runs on windows-latest.
# ubuntu-latest and macos-latest support coming soon
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
# For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar
# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
+11 -4
View File
@@ -1,5 +1,11 @@
default:
image: python:3.7
services:
- name: docker.elastic.co/elasticsearch/elasticsearch:7.11.2
alias: elasticsearch
command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ]
variables:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
#cache:
@@ -41,13 +47,14 @@ test:datanetwork-integration:
stage: test
script:
- pip install tox-travis
- tox -e datanetwork --recreate
- ELASTIC_HOST=elasticsearch tox -e datanetwork --recreate
test:blockchain-integration:
stage: test
script:
- curl "http://elasticsearch:9200/_cat/health"
- pip install tox-travis
- tox -e blockchain
- ELASTIC_HOST=elasticsearch tox -e blockchain
test:other-integration:
stage: test
@@ -55,13 +62,13 @@ test:other-integration:
- apt-get update
- apt-get install -y --no-install-recommends ffmpeg
- pip install tox-travis
- tox -e other
- ELASTIC_HOST=elasticsearch tox -e other
test:json-api:
stage: test
script:
- make install tools
- HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
- ELASTIC_HOST=elasticsearch HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
+10 -2
View File
@@ -1,4 +1,4 @@
.PHONY: install tools lint test idea
.PHONY: install tools lint test test-unit test-unit-coverage test-integration idea
install:
pip install https://s3.amazonaws.com/files.lbry.io/python_libtorrent-1.2.4-py3-none-any.whl
@@ -16,7 +16,15 @@ lint:
pylint --rcfile=setup.cfg lbry
#mypy --ignore-missing-imports lbry
test:
test: test-unit test-integration
test-unit:
python -m unittest discover tests.unit
test-unit-coverage:
coverage run -p --source=lbry -m unittest discover -vv tests.unit
test-integration:
tox
idea:
+9
View File
@@ -0,0 +1,9 @@
# Security Policy
## Supported Versions
While we are not at v1.0 yet, only the latest release will be supported.
## Reporting a Vulnerability
See https://lbry.com/faq/security
+4 -2
View File
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM debian:10-slim
ARG user=lbry
ARG db_dir=/database
@@ -13,7 +13,9 @@ RUN apt-get update && \
wget \
tar unzip \
build-essential \
python3 \
pkg-config \
libleveldb-dev \
python3.7 \
python3-dev \
python3-pip \
python3-wheel \
+31 -22
View File
@@ -1,36 +1,45 @@
version: "3"
volumes:
lbrycrd:
wallet_server:
es01:
services:
lbrycrd:
image: lbry/lbrycrd:${LBRYCRD_TAG:-latest-release}
restart: always
ports: # accessible from host
- "9246:9246" # rpc port
expose: # internal to docker network. also this doesn't do anything. its for documentation only.
- "9245" # node-to-node comms port
volumes:
- "lbrycrd:/data/.lbrycrd"
environment:
- RUN_MODE=default
# Curently not snapshot provided
#- SNAPSHOT_URL=${LBRYCRD_SNAPSHOT_URL-https://lbry.com/snapshot/blockchain}
- RPC_ALLOW_IP=0.0.0.0/0
wallet_server:
depends_on:
- es01
image: lbry/wallet-server:${WALLET_SERVER_TAG:-latest-release}
depends_on:
- lbrycrd
restart: always
network_mode: host
ports:
- "50001:50001" # rpc port
- "50005:50005" # websocket port
#- "2112:2112" # uncomment to enable prometheus
- "2112:2112" # uncomment to enable prometheus
volumes:
- "wallet_server:/database"
environment:
# Curently not snapshot provided
# - SNAPSHOT_URL=${WALLET_SERVER_SNAPSHOT_URL-https://lbry.com/snapshot/wallet}
- DAEMON_URL=http://lbry:lbry@lbrycrd:9245
- DAEMON_URL=http://lbry:lbry@127.0.0.1:9245
- TCP_PORT=50001
- PROMETHEUS_PORT=2112
- QUERY_TIMEOUT_MS=3000 # how long search queries allowed to run before cancelling, in milliseconds
- TRENDING_ALGORITHMS=variable_decay
- MAX_SEND=10000000000000 # deprecated. leave it high until its removed
- MAX_SUBS=1000000000000 # deprecated. leave it high until its removed
- FILTERING_CHANNEL_IDS=770bd7ecba84fd2f7607fb15aedd2b172c2e153f 95e5db68a3101df19763f3a5182e4b12ba393ee8
- BLOCKING_CHANNEL_IDS=dd687b357950f6f271999971f43c785e8067c3a9 06871aa438032244202840ec59a469b303257cad b4a2528f436eca1bf3bf3e10ff3f98c57bd6c4c6 e4e230b131082f6b10c8f7994bbb83f29e8e6fb9
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
container_name: es01
environment:
- node.name=es01
- discovery.type=single-node
- indices.query.bool.max_clause_count=4096
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms8g -Xmx8g" # no more than 32, remember to disable swap
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es01:/usr/share/elasticsearch/data
ports:
- 127.0.0.1:9200:9200
+3 -1
View File
@@ -20,4 +20,6 @@ if [[ -n "$SNAPSHOT_URL" ]] && [[ ! -f /database/claims.db ]]; then
rm "$filename"
fi
/home/lbry/.local/bin/torba-server "$@"
/home/lbry/.local/bin/lbry-hub-elastic-sync /database/claims.db
echo 'starting server'
/home/lbry/.local/bin/lbry-hub "$@"
+253 -153
View File
@@ -46,7 +46,7 @@
{
"name": "wallet_id",
"type": "str",
"description": "wallet to check for claim purchase reciepts",
"description": "wallet to check for claim purchase receipts",
"is_required": false
}
],
@@ -54,10 +54,10 @@
"examples": [
{
"title": "Get a file",
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1611869247,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpjwnofwu8\",\n \"download_path\": \"/tmp/tmpjwnofwu8/tmpc5ym6vx_\",\n \"file_name\": \"tmpc5ym6vx_\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"c4169cac48bf35c480c6d152bb2a663e\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01113f10c2d15ae542f1ffe92608fbf6457284e540b744fbe796c11ebf7ca4f39c1e41df8085d3ebcd8a02f3e164960744c92bf2733bf43c65c31d8b7e3061374177a6875e8220e07e8ebfe75848282ff154301b570a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"f3bd0df688fd55cd363c769b3ec6ba871ee457a79c2353bb9e0c4845583202531c2942d213a84952c07f4c932189950d\",\n \"stream_name\": \"tmpc5ym6vx_\",\n \"streaming_url\": \"http://localhost:5280/stream/ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"suggested_file_name\": \"tmpc5ym6vx_\",\n \"timestamp\": 1611869265,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1619186574,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp3yjc8ttn\",\n \"download_path\": \"/tmp/tmp3yjc8ttn/tmp12xihy6s\",\n \"file_name\": \"tmp12xihy6s\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -83,6 +83,18 @@
"description": "path to file to be associated with name.",
"is_required": false
},
{
"name": "file_name",
"type": "str",
"description": "name of file to be associated with stream.",
"is_required": false
},
{
"name": "file_hash",
"type": "str",
"description": "hash of file to be associated with stream.",
"is_required": false
},
{
"name": "validate_file",
"type": "bool",
@@ -191,6 +203,12 @@
"description": "audio/video duration in seconds, automatically calculated",
"is_required": false
},
{
"name": "sd_hash",
"type": "str",
"description": "sd_hash of stream",
"is_required": false
},
{
"name": "channel_id",
"type": "str",
@@ -250,10 +268,10 @@
"examples": [
{
"title": "Publish a file",
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp7djhncmf\", \"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/tmp7djhncmf",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp7djhncmf\", \"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\": \"0100000001d4dc123e149eec9ce0847dfbb494077fca33b2dfb003bd9d78e30203c69e51fc010000006b483045022100c24c6c9650be3c5ac0e183f109beb96c3508e4bedf2cf9ddb7d449891b0b36ff022007c904d69f5556c74b5b14e012d90372643e03331e266b4ece4b8fe871657517012103d11b0e230905de433309d7c862d4541c761ec112ea2d5fc14123489b20e3bdc2ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7037646a686e636d66180b22186170706c69636174696f6e2f6f637465742d73747265616d3230865e699a1545dbc5ba66037edd5da424ada86be39d9ee60008eba7db764f7fae8981977077087155a1d81f683e0b3cff6d7576a91481e8fcf79ca5ef4691c5d8fcb0eb18be9e2f3d1888ace0b46217000000001976a9145c0f2741b68394b7bbf1bbd4477389202dee4cf288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"moHgNwZY5iwYcVY8Yy3kbnDMCHZ6PUy2aq\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"nout\": 1,\n \"timestamp\": 1611869265,\n \"txid\": \"fc519ec60302e3789dbd03b0dfb233ca7f0794b4fb7d84e09cec9e143e12dcd4\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"msMra6oTV5z669WhofU1RJTcswwnG2hMPz\",\n \"amount\": \"1.0\",\n \"claim_id\": \"829747f51ecb52d5c58de6608a2db24c5703e22c\",\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#829747f51ecb52d5c58de6608a2db24c5703e22c\",\n \"timestamp\": null,\n \"txid\": \"fee529c6b102999377cf34fdfc1788a47e7e701edd63ec8dcca558560113100e\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp7djhncmf\",\n \"sd_hash\": \"865e699a1545dbc5ba66037edd5da424ada86be39d9ee60008eba7db764f7fae8981977077087155a1d81f683e0b3cff\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mouicaKryWxtm6rF8H1xZSZTH3jc1Shnsr\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"fee529c6b102999377cf34fdfc1788a47e7e701edd63ec8dcca558560113100e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"fee529c6b102999377cf34fdfc1788a47e7e701edd63ec8dcca558560113100e\"\n }\n}"
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpqedr4hf_\", \"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/tmpqedr4hf_",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpqedr4hf_\", \"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\": \"01000000012bb08a103ff362cdf211bf509a3a315369d42e8dd89fdbe043e3b3a17fb63145010000006a473044022076b7b102c80e4063523944b71575ad015f69ab44758b49e9674d112aa7d8e65e02203179a6488f9ccd64d640ff14c49d80ccb5ccf10cbda4b01173ac3a01ab4e387e01210214d28c7227f0b3eef47cb2b5704bde364b40747f97b9d7edf806da068aaaabd2ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70716564723468665f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d4d0e089925b0a7f5ab287cf39ff511ef380b0fb7e04b62d72964bb416baf4211e713dab967e600aa2a39f4b5c9f88da6d7576a9141b195fe77318659029c07b32b2de8df7820e5c9e88ac54826311000000001976a9143c14aa564481f9d0f771e740377fc0ed17791e7788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mztSRbjwzK9k7BUDXWybL8ZJs2KYQAq6hP\",\n \"amount\": \"3.941448\",\n \"confirmations\": 3,\n \"height\": 217,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhzEwHxzVtn29ZSiSGWrCvNkS8tvxULAPx\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3750860c465d9b7b30f197e01b1d767bf2f6427c\",\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#3750860c465d9b7b30f197e01b1d767bf2f6427c\",\n \"timestamp\": null,\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpqedr4hf_\",\n \"sd_hash\": \"d4d0e089925b0a7f5ab287cf39ff511ef380b0fb7e04b62d72964bb416baf4211e713dab967e600aa2a39f4b5c9f88da\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mkzdbRHazFEn4s2w2MVvGqSQoMuprZPxDo\",\n \"amount\": \"2.917341\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"3.941448\",\n \"total_output\": \"3.917341\",\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\"\n }\n}"
}
]
},
@@ -270,7 +288,7 @@
{
"name": "wallet_id",
"type": "str",
"description": "wallet to check for claim purchase reciepts",
"description": "wallet to check for claim purchase receipts",
"is_required": false
},
{
@@ -314,10 +332,10 @@
"examples": [
{
"title": "Resolve a claim",
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\": {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4/astream#1\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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\": 1611869265,\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#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"short_url\": \"lbry://astream#1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\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\": 1611869264,\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#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"short_url\": \"lbry://@channel#4\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\": {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
}
]
},
@@ -339,7 +357,7 @@
"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\": \"network_connection\",\n \"message\": \"Your internet connection appears to have been interrupted\"\n },\n \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"file_manager\": {\n \"managed_files\": 0\n },\n \"installation_id\": \"7mEn9npYgwZAZ5aZ6m9cRYvJhZCgnVGeC3UVkwa1eYCsHprqJ5VDTHsSModPobMBTQ\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"file_manager\": true,\n \"wallet\": true,\n \"wallet_server_payments\": true\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"a574f36fcfc8b69456957f1969c9881277a67c42daa7efba699872073b2faa2d\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"127.0.0.1:50002\",\n \"connected_features\": {\n \"daily_fee\": \"0\",\n \"description\": \"\",\n \"donation_address\": \"\",\n \"genesis_hash\": \"6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556\",\n \"hash_function\": \"sha256\",\n \"hosts\": {},\n \"payment_address\": \"\",\n \"protocol_max\": \"0.99.0\",\n \"protocol_min\": \"0.54.0\",\n \"pruning\": null,\n \"server_version\": \"0.88.0\",\n \"trending_algorithm\": \"zscore\"\n },\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"127.0.0.1\",\n \"latency\": 0.0075637230183929205,\n \"port\": 50002\n }\n ]\n },\n \"wallet_server_payments\": {\n \"max_fee\": \"0.0\",\n \"running\": false\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 \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"file_manager\": {\n \"managed_files\": 0\n },\n \"installation_id\": \"4PfwRLRLRYVBzAH9BztZYLG9kWdaBF3rd9248ACo1ft7L7TMa4ohEijLmXDXn2bnBs\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"file_manager\": true,\n \"wallet\": true,\n \"wallet_server_payments\": true\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"dc9c04cc674a7123a0ac3dfbf2b03838664490c0fa9845fc2a5bfb5eb7a25a19\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"localhost:50002\",\n \"connected_features\": {\n \"daily_fee\": \"0\",\n \"description\": \"\",\n \"donation_address\": \"\",\n \"genesis_hash\": \"6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556\",\n \"hash_function\": \"sha256\",\n \"hosts\": {},\n \"payment_address\": \"\",\n \"protocol_max\": \"0.99.0\",\n \"protocol_min\": \"0.54.0\",\n \"pruning\": null,\n \"server_version\": \"0.94.1\",\n \"trending_algorithm\": \"zscore\"\n },\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.0034657910000532866,\n \"port\": 50002\n }\n ]\n },\n \"wallet_server_payments\": {\n \"max_fee\": \"0.0\",\n \"running\": false\n }\n }\n}"
}
]
},
@@ -361,7 +379,7 @@
"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\": \"XFCE\",\n \"distro\": {\n \"codename\": \"bionic\",\n \"id\": \"ubuntu\",\n \"like\": \"debian\",\n \"version\": \"18.04\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"18\",\n \"minor\": \"04\"\n }\n },\n \"lbrynet_version\": \"0.88.0\",\n \"os_release\": \"5.4.0-62-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-5.4.0-62-generic-x86_64-with-Ubuntu-18.04-bionic\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.5\",\n \"version\": \"0.88.0\"\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.94.1\",\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.9\",\n \"version\": \"0.94.1\"\n }\n}"
}
]
}
@@ -415,10 +433,10 @@
"examples": [
{
"title": "Add an account from seed",
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"profit dash parent blur problem rain moral cupboard slide ugly become uncover\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\", \"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\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1611869236,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdAdaLnXR3benQnkduTLwoVqpys1KkkKPAgbCmpf8ReivmWUf8s4nqk9gHDjujgy8rcEVPomoHbbgGLDE9KYSf4f1GZod5hJ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WdfNESC1T1JtypGa4nXrNoScGP3dB27n1AqyQDUic9Lnwecu1fC4EZtut8pQEypvbRTxfkPTzQJmFxgsxhaFCbjxR1cm6hH\",\n \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"alley cattle pig switch demise guide use thing monkey club setup post\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\", \"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\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
}
]
},
@@ -456,9 +474,9 @@
},
{
"title": "Get balance for specific account by id",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}).json()",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).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}"
}
]
@@ -493,7 +511,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\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1611869235,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdAdaLnXR3benQnkduTLwoVqpys1KkkKPAgbCmpf8ReivmWUf8s4nqk9gHDjujgy8rcEVPomoHbbgGLDE9KYSf4f1GZod5hJ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WdfNESC1T1JtypGa4nXrNoScGP3dB27n1AqyQDUic9Lnwecu1fC4EZtut8pQEypvbRTxfkPTzQJmFxgsxhaFCbjxR1cm6hH\",\n \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\"\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\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
}
]
},
@@ -548,24 +566,24 @@
"examples": [
{
"title": "Transfer 2 LBC from default account to specific account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ba05126e11e5578536f50620190ebd9873be103e3931e51fd7e59899ccc0ad2d010000006b483045022100ff0fa8bb13f313585edd8b8656223d56787df8a55745e01be6afe272ba0e2d9402206aafbf466566a4098519541c5be8fe73e43c9f4af594ce5fed020827f94dbc2a012102126bbfa549860b749cf7ec39afcdf3e9c1c69e757ac6a05641b747ec47ca28bfffffffff0200c2eb0b000000001976a9141b4df769373c0b5107ca0d6af28d8be357e26e7788ac90d7ae2f000000001976a9145fe75806700bdde1218c0450adae59e8117ef66b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mpXyJ4wc2UVPTC1WQMFqUNSvWGERLiGr2n\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"nout\": 1,\n \"timestamp\": 1611869263,\n \"txid\": \"2dadc0cc9998e5d71fe531393e10be7398bd0e192006f5368557e5116e1205ba\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mi1KwSKLspT54T5DwCWRNYuSZeGYBFbran\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mpG3dL7KrGjH3EhzCrKrfeUYsWvKxAu3Us\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000140b6a1a9e9d645fdc13d610f5ea726f6f3632d573d710fd9fd653b7bf26e7b7c000000006b483045022100d98c7aee6bf787a8baab3ad7dda342cbb3a40f97b0e3f7acb8d5ec6d8cdf46330220500ffb8e927c309f8c27eb16a2a63990f393501b54f7993198efb8fe5b8b03560121030b674794d96c8f25504064a3fa083612eeaa9725611c65882f6c09124b9fd90effffffff0200c2eb0b000000001976a9141d34f625de59642aee534ce63fbeff7c629ecc3888ac90d7ae2f000000001976a914d2ba6ed7df0d95eccf902d5e4057e5e49e32343488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"moncvibtkcp8X8EEAaA5Qx5vNGcBJPsZbM\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"nout\": 0,\n \"timestamp\": 1619186593,\n \"txid\": \"7c7b6ef27b3b65fdd90f713d572d63f3f626a75e0f613dc1fd45d6e9a9a1b640\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mzjBXvqaeQQUHpxocqhqtdRStrmpW4Ho45\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\"\n }\n}"
},
{
"title": "Spread LBC between multiple addresses",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"from_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\" --from_account=\"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"from_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ff4bd76164fb6eb49dfbcf923b214ecad11652a7544709c0b55fa7476a973dc7000000006a4730440220449ee85661074f1ea185cfd114218de9a6cb8e51e7587a01d18b113f3a2c98df022035051065db09dfb0fac4608e821d510e4cb422f43c8601bca70c9200cbd244b70121024ce22932b275d87036b3696a60821be60e54994407d101a3224d8aff73e0d609ffffffff03c0687804000000001976a91423dc5f90801d4be789c1d5aaa01a091d54c03f2b88acc0687804000000001976a91423dc5f90801d4be789c1d5aaa01a091d54c03f2b88ac6cb9fa02000000001976a91448fc3bc54370d28dd1ecb256746ca665a3d84b8588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mi1KwSKLspT54T5DwCWRNYuSZeGYBFbran\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"nout\": 0,\n \"timestamp\": 1611869264,\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"minZwaCsKrVyHSAvnoFLeARkm6SQqqYb7E\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"minZwaCsKrVyHSAvnoFLeARkm6SQqqYb7E\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnAs7MZ17wPdabiUziQgaS9yA8XNnVHFie\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --from_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ca8922cd1c37b7d77e41a53a11b7cb791defa2a4eecfc6ba3cfef78d7d2f6c03000000006b483045022100c90c3a19f2df1bf1804182b956ac026c49a3ae5c5b4683e752d0b0f790a2ffcc02201585e4a89be8d9a8a89390955f52652981b5334d773dddf4b532b1c0cf5c10ef012102cd0bfe93207b243de0c9e94c14acb266d2c0e8cbd9cd8e5bc392b9ea854a7525ffffffff03c0687804000000001976a914dcd3b9091b6c5476b0c3ca5e2a1ce803d9690f1688acc0687804000000001976a914dcd3b9091b6c5476b0c3ca5e2a1ce803d9690f1688ac6cb9fa02000000001976a914ab9a29a2d32193a63d1bdae31881e80dce7c72b388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwAJXGL1Aw4U5BRnTYjKiZKHHUkLbxJwTs\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\"\n }\n}"
},
{
"title": "Transfer all LBC to a specified account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000003c332ae3716e97a0a7ad1cd5af52ec5eba2c9235f1a60288383cecb046f726530000000006b483045022100ca4453a10b64b3ea20eb7b80083da2e82429219f88c445879f339e2c68d6c6020220701bf64abfdf3e52ce81613532d2a147289f6eecf1a4df70ffe6af7f05320c660121034fc66b2ed3f1fd2ee6779ea8fcab34f0dab1a62cfbcbca0273aaa7602933b8dfffffffffc332ae3716e97a0a7ad1cd5af52ec5eba2c9235f1a60288383cecb046f726530010000006b483045022100ef789f7a66b3d25b3ea0adad3a90dc9d6e2c678b36fee3ef976e1cfde986d3e902202fae406940a427a625070561547d77b74eb752599e3ab50010655fe2bf14c4bb0121034fc66b2ed3f1fd2ee6779ea8fcab34f0dab1a62cfbcbca0273aaa7602933b8dfffffffffc332ae3716e97a0a7ad1cd5af52ec5eba2c9235f1a60288383cecb046f726530020000006b483045022100a18c2be528e295f14bc73153da49fc26e7673ce54a244d56bde5e837338a13d602203617ea4bbaf6afba9cef0f2bae643c3a07c1ba7c1a0a6f4e0eb3e51a8558dc7e012102eac9ad662cb072c604035bde6b872f8e6d66a78afdf41fee8081952f71fd134cffffffff015027eb0b000000001976a91482236255af83ff8a98a3c23a09c890165642ef8988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"minZwaCsKrVyHSAvnoFLeARkm6SQqqYb7E\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 0,\n \"timestamp\": 1611869264,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"minZwaCsKrVyHSAvnoFLeARkm6SQqqYb7E\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 1,\n \"timestamp\": 1611869264,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnAs7MZ17wPdabiUziQgaS9yA8XNnVHFie\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 2,\n \"timestamp\": 1611869264,\n \"txid\": \"3065726f04cbce838328601a5f23c9a2ebc52ef55acdd17a0a7ae91637ae32c3\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"msP4XXL5v1gSiU4qdFsAapuWM9Utj3CEgQ\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"64a621b9a05391ee0ca2b0bb06a43893db47b75aea6de6141b9d434356e6d575\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"64a621b9a05391ee0ca2b0bb06a43893db47b75aea6de6141b9d434356e6d575\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000037626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784000000006b483045022100cc8ab1133f9aa023984758dc6028daabbe9898fab43db8e7a7f03cd98b7a52a102207679d5b8825642dbf7e04e8cc7adab6c16859470815cf9e7b8546e294c0a248d0121031a0a1bb2d064d4b10274f214f972b78e12d7f024568e0cb478a1e6738bbe826dffffffff7626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784010000006b48304502210085c8b09788fdf20a1d7662d6281f2d3a13a16bafda968bb5aaa090329f2524af02205a18a3ffcd85d0887b88a01b41c9e530b7f5c1d4644b37adc764cda8cb66747a0121031a0a1bb2d064d4b10274f214f972b78e12d7f024568e0cb478a1e6738bbe826dffffffff7626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784020000006a47304402203ac347806d77cba6bb1cdc3f79638a4f254f9e2bdbc42d348d52de859487c5e502204af387abc826923a9033b674ecef4a712cbe7f7b29fa531188600543271a98eb0121037a661ea7428fcd9c1ad331f049646bfbf17f210ba0ce9c27e16b17ddef5c72d0ffffffff015027eb0b000000001976a9140953009b4f066787a0aa01eb98f8fbf233feacb788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwAJXGL1Aw4U5BRnTYjKiZKHHUkLbxJwTs\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 2,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgNFotMcVkNSmVwGpZHi6dACpVsMKBgFZB\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\"\n }\n}"
}
]
},
@@ -623,7 +641,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\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Y8jCeVTvY6N7n6oSCWd1UWMuAXwaPo25yHXdmGTQhf9nUvJzb6Y6BvvjrY3pFX1nKLbpfbckQ8MGuBShhjqJWgE7FTZ5aR6\",\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\": \"mkPwiscpsmDM8ECQrLYS3vnq16MaXsTZVD\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mkPwiscpsmDM8ECQrLYS3vnq16MaXsTZVD\",\n \"public_key\": \"tpubD6NzVbkrYhZ4We9GS84h1j7L9Xs5T2QcCqABCJqEAMAXeBXqsR1FUwZXjLpMuGUtr3VLB95No1ax4HevXK2MwUZ39FSKkGMDWs4PL7kiSp1\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -668,10 +686,10 @@
"examples": [
{
"title": "Remove an account",
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}).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\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1611869235,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdAdaLnXR3benQnkduTLwoVqpys1KkkKPAgbCmpf8ReivmWUf8s4nqk9gHDjujgy8rcEVPomoHbbgGLDE9KYSf4f1GZod5hJ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WdfNESC1T1JtypGa4nXrNoScGP3dB27n1AqyQDUic9Lnwecu1fC4EZtut8pQEypvbRTxfkPTzQJmFxgsxhaFCbjxR1cm6hH\",\n \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).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\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
}
]
},
@@ -764,10 +782,10 @@
"examples": [
{
"title": "Modify maximum number of times a change address can be reused",
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7 --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\", \"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\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1611869236,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdAdaLnXR3benQnkduTLwoVqpys1KkkKPAgbCmpf8ReivmWUf8s4nqk9gHDjujgy8rcEVPomoHbbgGLDE9KYSf4f1GZod5hJ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WdfNESC1T1JtypGa4nXrNoScGP3dB27n1AqyQDUic9Lnwecu1fC4EZtut8pQEypvbRTxfkPTzQJmFxgsxhaFCbjxR1cm6hH\",\n \"seed\": \"profit dash parent blur problem rain moral cupboard slide ugly become uncover\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"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\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
}
]
}
@@ -803,9 +821,9 @@
"examples": [
{
"title": "Check if address is mine",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mmUrBHXsVkHXy8TQ64P1ZGAone2uW2QmtP\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mmUrBHXsVkHXy8TQ64P1ZGAone2uW2QmtP",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mmUrBHXsVkHXy8TQ64P1ZGAone2uW2QmtP\"}}).json()",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -852,14 +870,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\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mgdGseinwQCiDSJKceS6vmvjdigCHugqAK\",\n \"pubkey\": \"tpubDA9GDAntyJu4H6EacLkPSd54jmNdv8NkcrFu6eGZS4KF1kPcp9UMBWzLdoJWgdX3pouNNwYb3vMDMFcnBKZZauWBsHEoDB1n7iDq9yqRmwb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mhauHJiP2XmK5mjJdhFuBKUakztZ95JBtX\",\n \"pubkey\": \"tpubDA9GDAntyJu4p78LzCFttyQ4yDyy8J3fGfeBsY8hjDc4BMzD53b83LLXgP5WEgCYjNPpCkxFw2WrBrqpR4cCxsgRoyZvRuwjcj3FsQS7dyV\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"pubkey\": \"tpubDA9GDAntyJu4jXL61pc7bdfAhy1LjRBqKfvXWPEk1TH2aq8JUzJm2h8CDTCUTJ7shvGkX8tKsybUgNm13VU2a3ypMaG8JamSUchZ6y11Yq1\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mj6mgRxeCrBqjEPxat4FGCjKV1qVp4Rz4w\",\n \"pubkey\": \"tpubDA9GDAntyJu4cs2MyEinAoduEQWtdwmnxebeK92BWyrZ4z7C9z2FR6MooEcQeF5XGYfy76rJia578rR2TSAc7U5Rd6N6Ae1eLmAndBLUnKz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mm4DDPyWJs9V5SfaXg94nkjtQKx6yw72gx\",\n \"pubkey\": \"tpubDA9GDAntyJu4nmncAA1KRJeWfuRMoWr4EeTM8YVZcVEJYGB8C98rYwM6eGD4oCGKYpTGQ1KuHCWG3U9yzbKoqoMrtUom9DFD7eYcXKshQvs\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mmUrBHXsVkHXy8TQ64P1ZGAone2uW2QmtP\",\n \"pubkey\": \"tpubDA9GDAntyJu4MwhUoMuXdeYxnhc52mguRd1mK6Ag8wXs8cZriS1cEp348mCafzgkU7haPdTgASprqSQTLykiAsR8YDR5B2w6UeCGywbJeTq\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mmrL4RfDN3eTD7cmnPdm2sWtbqeyjaPaom\",\n \"pubkey\": \"tpubDA9GDAntyJu4QMsYxEctH4XCmGwosAznBUZTedgXEGusSSnrD3Xx8ZmcNicZRHqZbL99qtSgJKfLgHDaAeHJrzcuJs5MzYvGitd9DLexSZG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mnEXKY3N4Kn8pBdQEZrLS4KWbUhBg9mwTW\",\n \"pubkey\": \"tpubDA9GDAntyJu4TGSb9D5pdLefW8vawgYw3qbiudnj8aLjL8kgWEwAGtzegXPFjgySteL7i3jNuvATz9BzaWbbr7S7v1KkxCq7HMA34YtxSQf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mncXU2ny9iASjfpmmXHB5tsRFRqbUL6UAo\",\n \"pubkey\": \"tpubDA9GDAntyJu4GrhdwCKAQnBojDhZb9VAxpy9Qwao3xGBjuesFvvGFXbtyauwd28uAMS3hBEXhoPUxCxoKuRAdwhe6tFsWfYRjNb5GrTY83L\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mnqCR72yJW5VkzmS4Xhet5LCyizPNiqknP\",\n \"pubkey\": \"tpubDA9GDAntyJu4baFJhJoEwNbie4a2E2Ud35ow8fzJMAJRJtR9ivDKkZKj44hoWPpXoZUfzJpgzHoBZZhPdoS4YtPKY8x61mDC2JatMqauNNb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"moLNxch2F95NrHq4UjPjQWmrgCuzhUPDFw\",\n \"pubkey\": \"tpubDA9GDAntyJu58WHkm7XussHGKf21o4nqDYyypo8uon3mRhsJUCYbBS23By2xj96tRSpaY7qwKHxuY7h7bgrebXZYUx3fWSiU8pztQNuyZ7G\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mp6rug4eFHFGgiWoHWdsSUD4zgZbMfJDjt\",\n \"pubkey\": \"tpubDA9GDAntyJu4wHQUavPWftJrLS2nCVChAY6kK7RiaBQAbrah5FSHkNLFxxz8FEiLEDa3hLeuh58wjfnR2bKpxEG9D5yqSZSdn3s6bv4EoPt\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mpG3dL7KrGjH3EhzCrKrfeUYsWvKxAu3Us\",\n \"pubkey\": \"tpubDA9GDAntyJu4E1spcTeugejAo5kPnWrygPCd8WJkXPto54AdpcxSErxQ3d63SSm4VJfHGVNEp7u3V8Co56HkQQdK6YRdwevXpQPGwfJ1gbv\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mpQHSuaFpsuRQyfPFkmRWC9HnbyvDCp6un\",\n \"pubkey\": \"tpubDA9GDAntyJu4N5zCW6ELfmrd4DYPP8uTkT2w1cMPb95Bo1eS5aLqZdiLWE7snsMjJnXeLTLPXJoU31jZtQs5v3rhSS7kJtq9UoWTP6dgGJY\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mpXyJ4wc2UVPTC1WQMFqUNSvWGERLiGr2n\",\n \"pubkey\": \"tpubDA9GDAntyJu4F5TaNDgnkRswJVsKoR8EHaEWx1WuoZxaa5WvCktxJKmyaEwQh3soFXaQTnxoNcCkyUFhqM2YmYMSoePpSme4ZR3JTY1p65h\",\n \"used_times\": 1\n },\n {\n \"account\": \"mgKCkaxcF54rqJZ3QvuSSTpCQnqvgEorcA\",\n \"address\": \"mrZFJKVxsJYTPg14tmgdBDkJ973s1Qzpxa\",\n \"pubkey\": \"tpubDA9GDAntyJu53ea7vqupqsvfWsvUncjJAMRn2PKfsn1rxfQqKqPRbGgBu82i875URskLQWRm2CUgMthJoMb6TN3aYwbL9zyfTnw9zrAEnzb\",\n \"Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mfmhc92HaRe3va3ebMqfkjACWE7Efg7WQo\",\n \"pubkey\": \"tpubDA9GDAntyJu4osD8fGNsDznW1DxdJz31FNzUUgq4F5Aamjn2PRv3CFKWHwg8pLTprfRkNZaZDeUDgDsBfiY7Q8ZjgjEApjnenkZyJ2KideH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mgbap1vfAiBNVKqUUT7W5xnxmrjsbU3fQk\",\n \"pubkey\": \"tpubDA9GDAntyJu4JHowiMKECSVPkkntXycNgaLidDnum3oF5pgvEq7PaRoyqK7Ls9xtPHfyVLVuQu9YGJ4Gd1CrtZaSispuLPgjpvDzDA41wy3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"pubkey\": \"tpubDA9GDAntyJu4R9T8QWqc7PvQs7AU9wKyG6xyct6WN1huKHPZjmvVh1wbFKuCc2yLjXP1qQ188rLS87tvqXPutEz71stE6E14Ux3F3DpsVVH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mjebtHKV24PApa9fR5mQ8gSCAits93Ecb4\",\n \"pubkey\": \"tpubDA9GDAntyJu4KfYLGfo16i1S39nfrDVVe3tAbNuXfzftkSRbASzo9UT1X9j8oGLRfTjnUQF1rGP3FnSQUDfEweRqiZUXhv6WDVDRUHRGoWu\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mm3VT4W1vwPRrPQqCTZytyeVnzbUkmWyTA\",\n \"pubkey\": \"tpubDA9GDAntyJu4N1hoLeYF6TuJuAnv9aZE6k4pAhwgm6hDaFzzMxSSTYMLed637xt7QAMhmB7iVpjn9d55kgmp3z4KKuEooYQeAaqVwJVSqLz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mmKWdxNhFhFAXNsGTy2tVRwhbpkijgK2bm\",\n \"pubkey\": \"tpubDA9GDAntyJu4PsNjmu5LaSbS7DtcdGC7mjF9NH3Jyu2UrR8FxZK8PErhJHg3cskG7D6GUgLmLJ6LaEnVFFS3WCdnU2gT54YXW9BBtGQQHb6\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mnDP2uk38XSLorT95aqq9N5gy8bf3Wjt9y\",\n \"pubkey\": \"tpubDA9GDAntyJu4dQDNMhay8bq1f5QyCXzL8SQLj11i1pbg1pbrgUUFoJcAbCS56eqe6Xqs3CPKW4DTkir1HJ64uriFBT4xw9FA1unJKFKpGSx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"moSi1CqRyZzfkLgT1kkrtHS6oYChRvJxqd\",\n \"pubkey\": \"tpubDA9GDAntyJu4mDpFcwkSwF4Hyvn5VSWp2bskbKd9iNqDwdNLbwkzxLwQGF1JArVWEEwk2xV76BXa1hk1nQMQmPd1Ab6tcJPpfKhY8pFZXMX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mr2s4EoTgVBE4r9JLkwAHDnFX3uGvgufW6\",\n \"pubkey\": \"tpubDA9GDAntyJu4FQqtS3XjPowNGLHcBXgaFZVwwVZa8uK1cFk2mhG4ZbSWQszY7REB1wiauhsbFNU5e8TfpQWChL1uwmoxkW35ytVmWFXfSMG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msJmZvJqs2e8C23hovmZKeVdCkitGxbrru\",\n \"pubkey\": \"tpubDA9GDAntyJu4hBpsMFjvMc9AawthJSRgKTRjX5aJ96VS81xaha6fURbWbaJ1d9sTpBk43JQB6oxcaRRBdSkz83s3YVVx6Rxs4B3xp4fpXQV\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msMFJbadB5dzHvz5oWscZUKvQYEYPk7Ncd\",\n \"pubkey\": \"tpubDA9GDAntyJu4ENuarHFHHvkPf1MQKFyXtS18GUuqFeAmqgmYkWvboJpbm9dZnTFUu1WN3YeyyNMRDVmpU81ad9j18SjGFVXq9rvDyktKDDb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mt6JggawxBTj1GrZ5DcDHFgmvkDtmBtw8P\",\n \"pubkey\": \"tpubDA9GDAntyJu4rGaqwnidtFkzNjDdbeZxtaVhXWXSkzAgsf5fmcXuFuMAtSHApnmpnawbcjQpLzJzoY9BBJmhXHV8ZTv7iUQTVmQHKzspkZr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtESjA4yH9XhMV1TTRPDahQcswXGokjJEQ\",\n \"pubkey\": \"tpubDA9GDAntyJu4kGNiwQwsfXo9MQiNv4zvppZMZG5rJsRuU9yuy5hdbkkyNTYEAPdDfW27WfC1yWd2mtMiUsWkhKk6xGouuZzFwQSepqdFj4m\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtSMa8yjkyumAEpuu27w5mBKDvtV8WuwUS\",\n \"pubkey\": \"tpubDA9GDAntyJu4bDz5PUjqeS6vDQGgFZ67ttpxoeAh8FMsHmgYXe5MEUHDLmVtSmdjxqzpLsCkLc9efBvVn1qqzuSFV5gffcEHjWD3QmjoAMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mu3Fgd4fLSMmPdBG8M7pMDM9mVgqBsNa2P\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZYzCJS7DcSKHDiEwRLUSG5VkfS5fubFz3fQnrZ32LMAK1fVG6xucP5GLdEtaPtFXmbVd7kzLp5j2viUfWJ8n7HHX9e3rFMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"muTdW8b65cWxqTbCnrGyxEMwfNXX1ZYuoa\",\n \"pubkey\": \"tpubDA9GDAntyJu54zEFL428ce3vX5ehsYh4AEaXi3GRtwyLftHLfwJisf7Q1JyQehhw77Q1xvgy4qrc7CSNxn8aBM8xikmNpUwFNSzdUEQyUQ8\",\n \"Line truncated
},
{
"title": "List addresses in specified account",
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mgSUtMkJx1jyxRzQsMjxxcJdwqsBkQmfoy\",\n \"pubkey\": \"tpubDA9GDAntyJu4KzmQTQ8pPjGLNYbM5mG5kThbd9xN24bWAHEpAzXvYP7k74wXQ59HZxeoMETPEzjp4YTFhqRwuZjP3uDwVh4Xi6hQBf3SBYf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mhABfjzTrh4gfwLfgavrhdAs99wXeVSJa9\",\n \"pubkey\": \"tpubDA9GDAntyJu4SuhLVrBmfzkkHxkQpnzyjFJzyWHECwCw1r4KVXFCpfwjRxS2MDXKDRNYAN8G7TovB9SMQUnV4XUZJNgsaMnPvNe38pAaZo2\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mhWkVXsaG1uvo95ZKRWpg9nKzeHXx9Ds3t\",\n \"pubkey\": \"tpubDA9GDAntyJu4TeTsPnMRBWizQoGoxJFtVnMhLBG8HaTUgZbgPUovtz7HHJK9QzH9zXr4a54qShUyDPm9FEdTPePsAp5ij91JixgwZdVABSF\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mhxFYxuYZmGLKWkMbCsBMHBt8VLxzL4fTT\",\n \"pubkey\": \"tpubDA9GDAntyJu4mJi8D3f9B7ywbx3f1kbbfy2r7uffe2GeFNFGJdQg4HH9iCya94ZmuTBV4XBzCrcWo5bUZSCcJoLRAKjhpwqaV9CvEiDaWvU\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mi1KwSKLspT54T5DwCWRNYuSZeGYBFbran\",\n \"pubkey\": \"tpubDA9GDAntyJu4M1Vc9chTufQF1KxaWddRd2sPPJgYHBbCNaLeUNgQzPTdrkNaDwWypyqvu2LVNsdibVa9YMHhMs419u3xJi4bjnMZMxg5Ge2\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mjkoZpfqjje8vobqKHAbZpwsgzKKSdi7By\",\n \"pubkey\": \"tpubDA9GDAntyJu4jfB1KeiTMrp2BzM9ojnfCcJpDkNZ4XpAFQS35rJaWnk5RNAdmNdkYnPXVdAs5rBbMpT9ogSct67yBdFpxanNWDzJNKP2Dyr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mmNNzK7FUNW4LpcGhQLU4SBb7pFS23wvyJ\",\n \"pubkey\": \"tpubDA9GDAntyJu4Wa67YwEm4pYv5GUFz7B8jNhPt2p3XRAMHLvoL3KDvmebZ45obLdfTdGeAD7VMmDgHcPwg6ioztg5th7PgtQvhEWkTK4iqd3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mmWrCZM2hKKsmXhJhsBwnhe8QJvfGb3mFj\",\n \"pubkey\": \"tpubDA9GDAntyJu4Y3WMvMnxHPMy5cQ1x83yavwXdKCya4iGde61oksiacdgZYhAa59aiZEMkegR4aDvPwnN7vz6kVeBvcJUxjzJ7jLsUGkECQa\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mmc95QN2beZGjfRdSbST52fvGbEoe4WN9d\",\n \"pubkey\": \"tpubDA9GDAntyJu4osHdZ23vVKn4zLndcGQay4i9gZiSPgiqHqevDzurpUpxM9R1WLRGsHGE9MQHtAFSEGXQchxLAS4SHi2WJxsr2nnNqF7mEgt\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mmnUa4RkXRiWzrRRDA8MsccUwzEpQsSNG8\",\n \"pubkey\": \"tpubDA9GDAntyJu4S3tEVtju4Vd942fS8ZTDwZf3vkMBXu4uxv6K7SHKCR7xcUNHeZnYkoMnUD8tASsyTSKtKPhvP47hE4m1HscwQnHBB9ZwYRD\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mmngfPUDHwde3qEpCfUR5zwJpjqfgz6ua2\",\n \"pubkey\": \"tpubDA9GDAntyJu4FGKYazkYyF4eZTicEtFE2YyJWn3JSgh4p96mH71rkREHAXC2S9zaGenDPR77vmdR24Tpx9M6sUhTNBC4tZvNdHiBeRay3nf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mnCJymbUXGt1y5iSi9RMbQoi8EmddkN2UB\",\n \"pubkey\": \"tpubDA9GDAntyJu4foDog9Uq6FwfSiwtNYSUCFKUKeaiMGEnviwmE24sQje3tknEkZkDBuaKZw2mg8C8HdZhK3Fx4QVahyC39Zs45YfPYZ787Ur\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mq96HtssEwc3rok7tEWPKG3LQ3yrXAvMYn\",\n \"pubkey\": \"tpubDA9GDAntyJu4Hi5GW4G9MV85RPYvbCZe4Ddif2QSfzy7frrPsmdQmzJMMhgXwjaoq3cxXWUbh9MMJLKnJ4LVEJuTgUef8wmRBJ3FNDA32qi\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mqUh3YNyQ5JwvNbY1tf2pTXq1QUr8FUgDy\",\n \"pubkey\": \"tpubDA9GDAntyJu4san1KN6r689TABX1JmuaTDDuNYswEnRsPnW5Cnpw7DcqZCNVrYpWWiHyVNyD86GATSUKF4HyGV1kjJvb853E3L62tfsj7T3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mqrhHUxtGWYLXD7bKFR9w7EfuEhpJok92C\",\n \"pubkey\": \"tpubDA9GDAntyJu4NjN6dTfR6soM1zF8XxWDRzt2A1hsoYdBZ2XDNApJfe19uf43LvNVA7J84yXBTorQWmrfATQ7dXLun7sSktfUZfDrnyGTmFJ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mvuCYFHAzLTEtPJnoDaNzs3KVmPeRfyTX7\",\n \"address\": \"mqwGzi1bK1euZxj6EK4bPokkE3w5BvRUrP\",\n \"pubkey\": \"tpubDA9GDAntyJu4PqCcGiUeVgNNh9hNEmTYWxZExqihjJiwTWuhN2QfgDxvNDGiQk8ws5ESyHjTT3z5TRgmLuTVuNj7c1euAHGzecBfAFY5Xgn\",\n \"Line truncated
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mfmhc92HaRe3va3ebMqfkjACWE7Efg7WQo\",\n \"pubkey\": \"tpubDA9GDAntyJu4osD8fGNsDznW1DxdJz31FNzUUgq4F5Aamjn2PRv3CFKWHwg8pLTprfRkNZaZDeUDgDsBfiY7Q8ZjgjEApjnenkZyJ2KideH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mgbap1vfAiBNVKqUUT7W5xnxmrjsbU3fQk\",\n \"pubkey\": \"tpubDA9GDAntyJu4JHowiMKECSVPkkntXycNgaLidDnum3oF5pgvEq7PaRoyqK7Ls9xtPHfyVLVuQu9YGJ4Gd1CrtZaSispuLPgjpvDzDA41wy3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"pubkey\": \"tpubDA9GDAntyJu4R9T8QWqc7PvQs7AU9wKyG6xyct6WN1huKHPZjmvVh1wbFKuCc2yLjXP1qQ188rLS87tvqXPutEz71stE6E14Ux3F3DpsVVH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mjebtHKV24PApa9fR5mQ8gSCAits93Ecb4\",\n \"pubkey\": \"tpubDA9GDAntyJu4KfYLGfo16i1S39nfrDVVe3tAbNuXfzftkSRbASzo9UT1X9j8oGLRfTjnUQF1rGP3FnSQUDfEweRqiZUXhv6WDVDRUHRGoWu\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mm3VT4W1vwPRrPQqCTZytyeVnzbUkmWyTA\",\n \"pubkey\": \"tpubDA9GDAntyJu4N1hoLeYF6TuJuAnv9aZE6k4pAhwgm6hDaFzzMxSSTYMLed637xt7QAMhmB7iVpjn9d55kgmp3z4KKuEooYQeAaqVwJVSqLz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mmKWdxNhFhFAXNsGTy2tVRwhbpkijgK2bm\",\n \"pubkey\": \"tpubDA9GDAntyJu4PsNjmu5LaSbS7DtcdGC7mjF9NH3Jyu2UrR8FxZK8PErhJHg3cskG7D6GUgLmLJ6LaEnVFFS3WCdnU2gT54YXW9BBtGQQHb6\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mnDP2uk38XSLorT95aqq9N5gy8bf3Wjt9y\",\n \"pubkey\": \"tpubDA9GDAntyJu4dQDNMhay8bq1f5QyCXzL8SQLj11i1pbg1pbrgUUFoJcAbCS56eqe6Xqs3CPKW4DTkir1HJ64uriFBT4xw9FA1unJKFKpGSx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"moSi1CqRyZzfkLgT1kkrtHS6oYChRvJxqd\",\n \"pubkey\": \"tpubDA9GDAntyJu4mDpFcwkSwF4Hyvn5VSWp2bskbKd9iNqDwdNLbwkzxLwQGF1JArVWEEwk2xV76BXa1hk1nQMQmPd1Ab6tcJPpfKhY8pFZXMX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mr2s4EoTgVBE4r9JLkwAHDnFX3uGvgufW6\",\n \"pubkey\": \"tpubDA9GDAntyJu4FQqtS3XjPowNGLHcBXgaFZVwwVZa8uK1cFk2mhG4ZbSWQszY7REB1wiauhsbFNU5e8TfpQWChL1uwmoxkW35ytVmWFXfSMG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msJmZvJqs2e8C23hovmZKeVdCkitGxbrru\",\n \"pubkey\": \"tpubDA9GDAntyJu4hBpsMFjvMc9AawthJSRgKTRjX5aJ96VS81xaha6fURbWbaJ1d9sTpBk43JQB6oxcaRRBdSkz83s3YVVx6Rxs4B3xp4fpXQV\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msMFJbadB5dzHvz5oWscZUKvQYEYPk7Ncd\",\n \"pubkey\": \"tpubDA9GDAntyJu4ENuarHFHHvkPf1MQKFyXtS18GUuqFeAmqgmYkWvboJpbm9dZnTFUu1WN3YeyyNMRDVmpU81ad9j18SjGFVXq9rvDyktKDDb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mt6JggawxBTj1GrZ5DcDHFgmvkDtmBtw8P\",\n \"pubkey\": \"tpubDA9GDAntyJu4rGaqwnidtFkzNjDdbeZxtaVhXWXSkzAgsf5fmcXuFuMAtSHApnmpnawbcjQpLzJzoY9BBJmhXHV8ZTv7iUQTVmQHKzspkZr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtESjA4yH9XhMV1TTRPDahQcswXGokjJEQ\",\n \"pubkey\": \"tpubDA9GDAntyJu4kGNiwQwsfXo9MQiNv4zvppZMZG5rJsRuU9yuy5hdbkkyNTYEAPdDfW27WfC1yWd2mtMiUsWkhKk6xGouuZzFwQSepqdFj4m\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtSMa8yjkyumAEpuu27w5mBKDvtV8WuwUS\",\n \"pubkey\": \"tpubDA9GDAntyJu4bDz5PUjqeS6vDQGgFZ67ttpxoeAh8FMsHmgYXe5MEUHDLmVtSmdjxqzpLsCkLc9efBvVn1qqzuSFV5gffcEHjWD3QmjoAMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mu3Fgd4fLSMmPdBG8M7pMDM9mVgqBsNa2P\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZYzCJS7DcSKHDiEwRLUSG5VkfS5fubFz3fQnrZ32LMAK1fVG6xucP5GLdEtaPtFXmbVd7kzLp5j2viUfWJ8n7HHX9e3rFMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"muTdW8b65cWxqTbCnrGyxEMwfNXX1ZYuoa\",\n \"pubkey\": \"tpubDA9GDAntyJu54zEFL428ce3vX5ehsYh4AEaXi3GRtwyLftHLfwJisf7Q1JyQehhw77Q1xvgy4qrc7CSNxn8aBM8xikmNpUwFNSzdUEQyUQ8\",\n \"Line truncated
}
]
},
@@ -887,7 +905,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\": \"mmUrBHXsVkHXy8TQ64P1ZGAone2uW2QmtP\"\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"\n}"
}
]
}
@@ -937,10 +955,10 @@
"examples": [
{
"title": "Delete a blob",
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"e1bb5963dcf11782f3b3b4b5bce734a6de24c840256cd19ed4cc798461defd25356ab2807f49a066dcd48c829450cfce\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete e1bb5963dcf11782f3b3b4b5bce734a6de24c840256cd19ed4cc798461defd25356ab2807f49a066dcd48c829450cfce",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"e1bb5963dcf11782f3b3b4b5bce734a6de24c840256cd19ed4cc798461defd25356ab2807f49a066dcd48c829450cfce\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted e1bb5963dcf11782f3b3b4b5bce734a6de24c840256cd19ed4cc798461defd25356ab2807f49a066dcd48c829450cfce\"\n}"
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"\n}"
}
]
},
@@ -1018,7 +1036,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 \"e1bb5963dcf11782f3b3b4b5bce734a6de24c840256cd19ed4cc798461defd25356ab2807f49a066dcd48c829450cfce\",\n \"a72855d3b976a81d575805d305da8180a78a18d777a19d3c8b78c6173f1f51ea71881ce9fa7e61dcbc4e11888b14450b\",\n \"9d8531f7cb149b56422d5464298e745ef499190f37e80ce6a58d4bb3358ecdb3a61f24c3c03a0e13de6e9cb712d60c97\",\n \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\"\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 \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"3e9c701f71aa9df9dc13e18a1a2d96a0c8f834a4218a3c2cddea815e6bccd3ddf3b96ae3aa0e338cd797b781596a1584\",\n \"8433ac4f1eef3d06976ab7ed852be501ecbbee9c4901e72469183e17a08a1f70d2e994d226bf7c9f570c93fffb42ddb4\",\n \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1099,10 +1117,10 @@
"examples": [
{
"title": "Abandon a channel claim",
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 40e5847245f6fb0826e9fff142e55ad1c2103f11",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001cf7cf2d93deb1c9716607f02e189ed9911e7622e8dfc3847dd41691e4f099cdb000000006a47304402200b440efb3ad7a72da1c502133cbae844f34473d07bd66bfc84994f79cfc079ef02205c6bda751a8c7896f02a5bcbdd0fc3767f8b30ed3b40aafd077233cfd9bc3aee012103e9f7d41d30dce29b3d1a4bbd0ae004967be9c61d9854c266f1b137be198622adffffffff0134b7f505000000001976a9142b65ddd223e1532f4bb662a2d66ccfa735e633d988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjURP7MZxZcL8CBj5NLPYSG7W1xR73FAic\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"8e2e97c0df18f119cd2d344b2d17192f06f4a85f4ba7aba3aa390ae06d861f0a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"8e2e97c0df18f119cd2d344b2d17192f06f4a85f4ba7aba3aa390ae06d861f0a\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 5c15c266bf34c683523ce06cfb7fe5c984221375",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000123097a98778ac14275b0c3b444748a09911c5c44ea2d11c4b507c36f74a7cb7d000000006b4830450221008cdfde561c68c5bc509bf87206794b930c8e51ad147e1dc40025cf929d04d32d02206923e395f867551cf8273aa98497cd8339da18e1b81e04b07e4fefa89f932a730121032c31a47c0f8bc4a0c8565f56f796f3cca09b86524b74dea8c16715240134ab1fffffffff0134b7f505000000001976a91425783ce606316d3bac10802a371e229c1363246888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 9,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miw5LRgpz1FvHDgCLQT3hMoKD5bwSRSK9M\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"17c121e283ad21ec0c0bd05b59007ff9abd789cc736377336327aa73d34b4a62\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"17c121e283ad21ec0c0bd05b59007ff9abd789cc736377336327aa73d34b4a62\"\n }\n}"
}
]
},
@@ -1232,14 +1250,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\": \"0100000001ff4bd76164fb6eb49dfbcf923b214ecad11652a7544709c0b55fa7476a973dc7010000006a4730440220166cbca054062bac457ebe71fc04370c5be574953dc758b3568e08628fd5465002207cfd22872fa8e2616a0fd51aaefde27c3ee6f098972c3c623a406f562e957e3a012102344733a4b8ff92b050c1438c880cb5d85fb67de2370e63d0a7a7acbb31ab65c0ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa6d7576a914d59b0409a7ea3002353f05fa868b78822a86559588acc462a029000000001976a9144dd6a6a21a5461d2092ec15de5a585891b0d567688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mpG3dL7KrGjH3EhzCrKrfeUYsWvKxAu3Us\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"nout\": 1,\n \"timestamp\": 1611869264,\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\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#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": null,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mncXU2ny9iASjfpmmXHB5tsRFRqbUL6UAo\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ca8922cd1c37b7d77e41a53a11b7cb791defa2a4eecfc6ba3cfef78d7d2f6c03010000006b48304502210094ac6bbd1833b430dadb4f835843e8895d7420cb0c8146ac3037f55b0b668ebc02202a178a2c108fef944f28b71fc71c1f8f76403bcfec8a208a41361a809be333b5012103335f36c7b695d71f35a4345aa590f2b3f1efaec93eda106a6fcf083a89877a85ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d6d7576a9149fcb81549737993f898614438f3dcddefe43ba5388acc462a029000000001976a914cc111fc1cabd8cda886b054333a7239bf339ab5188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzjBXvqaeQQUHpxocqhqtdRStrmpW4Ho45\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": null,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mz7xezDeGSCCwsT1RAV6VSnZvx1Y48GWBz\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\"\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\": \"0100000001cf7cf2d93deb1c9716607f02e189ed9911e7622e8dfc3847dd41691e4f099cdb010000006b483045022100e64da2b7f528b49c79c4505794688f288fc5316a8a90600b8ff840de9116b3de02203e150c5ef68562980581dbeb22fca77a3aa5bed01fc19bdf83124db82b6b3a6a012102667bb4e5fb7452c96bc3303b7114ff6b0f6a052639653a6fee1a3bd541db2dcdffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000418ecd168d91c3d11b37d909ad3c5f26dc3d4277c3fecc68e3984f8959bec4b51961a98021688e4cc8bcb9ea7c14796405ccafdec1922a14114e5b501121b61ce121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914503c27e84c262847c82354e64fca16616c80e83a88ace221d305000000001976a914d9991753a54a18cf34d09acdf9350af3ed7e103288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2gXLVkWoPdarGoShHSrrn8KMJByYfN84K\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"nout\": 1,\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnqCR72yJW5VkzmS4Xhet5LCyizPNiqknP\",\n \"amount\": \"1.0\",\n \"claim_id\": \"a5767825c85badc219b5c8e7ecdadbeced51dd02\",\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#a5767825c85badc219b5c8e7ecdadbeced51dd02\",\n \"timestamp\": null,\n \"txid\": \"92ade6df5b40f0c43c278c96b42bc5d67e62155aa36b7176f5866fc8b5a2f656\",\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\": \"3056301006072a8648ce3d020106052b8104000a0342000418ecd168d91c3d11b37d909ad3c5f26dc3d4277c3fecc68e3984f8959bec4b51961a98021688e4cc8bcb9ea7c14796405ccafdec1922a14114e5b501121b61ce\",\n \"public_key_id\": \"mrXPJ3MJpKV22ep7iUZjAhfPnX7jLdTDZq\",\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\": \"n1MWKdzvKyD3Dgzwda2MLuKSn9R1rYXYsV\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"92ade6df5b40f0c43c278c96b42bc5d67e62155aa36b7176f5866fc8b5a2f656\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"92ade6df5b40f0c43c278c96b42bc5d67e62155aa36b7176f5866fc8b5a2f656\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000123097a98778ac14275b0c3b444748a09911c5c44ea2d11c4b507c36f74a7cb7d010000006b483045022100c4562df8bef779b2f494ef275f2dff0e6b5034e1b1b354fa4aadd0999c50633c0220671886610ed3b99c1e78836b1696ae39150a8a680e7ecbc2e6b72cce95ad25790121025a25bd09226e9bfd30e70205841bbe4588502ced799970bcfc5c32b19f10710affffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000403a4c9063ae880abb9e7a4f2b0f31b33aa0f2eb00432d0fc3dc6263a0cc4f03f4e8762f2b0549d6e433e28754ff9b9aa86f66fc4779d8ad4392430ea18e86e23121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914755f01af82d2a8dd32fc3dfde402e9ecb6b8107588ace221d305000000001976a9148f28c757d1d8d84faa35f1af1c1c3c52bc1efba288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mh5rVtpeDVSih7YixfMP6SQoQ8re4iy8gX\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mrDZAfto9XzQP3SjvshVZL4vcsTfSXvLje\",\n \"amount\": \"1.0\",\n \"claim_id\": \"87d1232c6284d36467b41ebe8c8b3d2dfdce01ce\",\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#87d1232c6284d36467b41ebe8c8b3d2dfdce01ce\",\n \"timestamp\": null,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\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\": \"3056301006072a8648ce3d020106052b8104000a0342000403a4c9063ae880abb9e7a4f2b0f31b33aa0f2eb00432d0fc3dc6263a0cc4f03f4e8762f2b0549d6e433e28754ff9b9aa86f66fc4779d8ad4392430ea18e86e23\",\n \"public_key_id\": \"mizH8bDDSiitsoUdZc4wycocXccrY3j4Vi\",\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\": \"mtZumqabuzJQ9UMvtN5a58XCcrBBCPL1BD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\"\n }\n}"
}
]
},
@@ -1361,14 +1379,14 @@
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\"\n },\n \"value_type\": \"channel\"\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\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\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\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\"\n },\n \"value_type\": \"channel\"\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\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1563,10 +1581,10 @@
"examples": [
{
"title": "Update a channel claim",
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"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 40e5847245f6fb0826e9fff142e55ad1c2103f11 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"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\": \"01000000025d14d8ee65741f52c41a1aee29eb3a6f64f081406bfb7e298bc7c99725984f1b000000006b483045022100ada1cccea4b3ed15c85cb3ea51d32415f7912ce7b7adb2eb892e4278713a8b4802202e001d324a5f3d31bf7a66cf2caf84a6fab9ab997223b46040849a2acfbb2e1e012103e9f7d41d30dce29b3d1a4bbd0ae004967be9c61d9854c266f1b137be198622adffffffff75d5e65643439d1b14e66dea5ab747db9338a406bbb0a20cee9153a0b921a664000000006a473044022035517b47d323c1a32bc38ac2577022eafff7df6ea53fd12243ed9cea7b20bdd502205f6774848dc9194b6ef3ed0083e344b437bcce8679cd9c3ab9fee3d7b6f79cca0121025b3aa957522f62be56fc67a02528018bab66138e705fd691f39fe87f8d61e465ffffffff0200e1f50500000000a6b708406368616e6e656c14113f10c2d15ae542f1ffe92608fbf6457284e5404c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa420b4e6577204368616e6e656c6d6d76a914d59b0409a7ea3002353f05fa868b78822a86559588ac6ebeea0b000000001976a914e829f79fc11c0e823cd5cd53b692f932725df49888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"msP4XXL5v1gSiU4qdFsAapuWM9Utj3CEgQ\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"nout\": 0,\n \"timestamp\": 1611869264,\n \"txid\": \"64a621b9a05391ee0ca2b0bb06a43893db47b75aea6de6141b9d434356e6d575\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\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#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": null,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n2gXLVkWoPdarGoShHSrrn8KMJByYfN84K\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"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 5c15c266bf34c683523ce06cfb7fe5c984221375 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"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\": \"01000000020d9532306586cdcb59cc30c6bcc8ed810faf1d38e2b01e06a720ce34b203f93d000000006a473044022025740699e7c92648b58019fd6b1d7a78285195bfafeb115f4b5a5e485d1df4de02203f8fc26159454b07e5580ff0b9be8ba8f9aecfd5b1573c00b707b41193b8e1980121032c31a47c0f8bc4a0c8565f56f796f3cca09b86524b74dea8c16715240134ab1fffffffffeed7f31a5c0b04a61481a56e0cc1c71c1fa5f898cabd52efef6ac1445b26057f000000006b483045022100d26d8fa7ff5e1be2f486278c059a6e6c3fb9a002ff14059cd0aa96d3a34e48880220108d5900346d266eae1a6091e0d6e34de4a9f18bdbdced164450a98c5fc975920121035e9a676a6c96274e2da7647804cf7f567df88f4db16aea223caf0d201526df65ffffffff0200e1f50500000000a6b708406368616e6e656c1475132284c9e57ffb6ce03c5283c634bf66c2155c4c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d420b4e6577204368616e6e656c6d6d76a9149fcb81549737993f898614438f3dcddefe43ba5388ac6ebeea0b000000001976a914113103aeb6cd62f58efa54a0d0b51dba991e49c888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mgNFotMcVkNSmVwGpZHi6dACpVsMKBgFZB\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": null,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mh5rVtpeDVSih7YixfMP6SQoQ8re4iy8gX\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\"\n }\n}"
}
]
}
@@ -1621,6 +1639,18 @@
"description": "restrict results to specific wallet",
"is_required": false
},
{
"name": "has_source",
"type": "bool",
"description": "list claims containing a source field",
"is_required": false
},
{
"name": "has_no_source",
"type": "bool",
"description": "list claims not containing a source field",
"is_required": false
},
{
"name": "page",
"type": "int",
@@ -1654,7 +1684,7 @@
{
"name": "include_received_tips",
"type": "bool",
"description": "calculate the amount of tips recieved for claim outputs",
"description": "calculate the amount of tips received for claim outputs",
"is_required": false
}
],
@@ -1662,17 +1692,17 @@
"examples": [
{
"title": "List all your claims",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\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\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\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\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\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\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\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}"
}
]
},
@@ -1869,7 +1899,7 @@
{
"name": "claim_type",
"type": "str",
"description": "filter by 'channel', 'stream' or 'unknown'",
"description": "filter by 'channel', 'stream', 'repost' or 'collection'",
"is_required": false
},
{
@@ -1983,7 +2013,7 @@
{
"name": "wallet_id",
"type": "str",
"description": "wallet to check for claim purchase reciepts",
"description": "wallet to check for claim purchase receipts",
"is_required": false
},
{
@@ -1998,6 +2028,18 @@
"description": "lookup and include a boolean indicating if claim being resolved is yours",
"is_required": false
},
{
"name": "has_source",
"type": "bool",
"description": "find claims containing a source field",
"is_required": false
},
{
"name": "has_no_source",
"type": "bool",
"description": "find claims not containing a source field",
"is_required": false
},
{
"name": "new_sdk_server",
"type": "str",
@@ -2009,17 +2051,17 @@
"examples": [
{
"title": "Search for all claims in channel",
"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\": [], \"include_purchase_receipt\": false, \"include_is_my_output\": false}}' http://localhost:5279/",
"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\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}' 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\": [], \"include_purchase_receipt\": false, \"include_is_my_output\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4/astream#1\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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\": 1611869265,\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#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"short_url\": \"lbry://astream#1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\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\": 1611869264,\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#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"short_url\": \"lbry://@channel#4\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\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\": \"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\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\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\": 1619186595,\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\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\": 1619186594,\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\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\": [], \"include_purchase_receipt\": false, \"include_is_my_output\": false}}' http://localhost:5279/",
"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\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}' 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\": [], \"include_purchase_receipt\": false, \"include_is_my_output\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4/astream#1\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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\": 1611869265,\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#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"short_url\": \"lbry://astream#1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#4\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\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\": 1611869264,\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#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"short_url\": \"lbry://@channel#4\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\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\": \"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\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\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\": 1619186595,\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\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\": 1619186594,\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\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}"
}
]
}
@@ -2098,7 +2140,7 @@
"name": "claims",
"type": "list",
"description": "claim ids to be included in the collection",
"is_required": true
"is_required": false
},
{
"name": "allow_duplicate_name",
@@ -2148,6 +2190,24 @@
"description": "thumbnail url",
"is_required": false
},
{
"name": "channel_id",
"type": "str",
"description": "claim id of the publisher channel",
"is_required": false
},
{
"name": "channel_name",
"type": "str",
"description": "name of the publisher channel",
"is_required": false
},
{
"name": "channel_account_id",
"type": "str",
"description": "one or more account ids for accounts to look in for channel certificates, defaults to all accounts.",
"is_required": false
},
{
"name": "account_id",
"type": "str",
@@ -2186,12 +2246,26 @@
}
],
"returns": " {\n \"txid\": \"hash of transaction in hex\",\n \"height\": \"block where transaction was recorded\",\n \"inputs\": [\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_received\": \"true if txo was sent from external account to this account\",\n \"is_spent\": \"true if txo is spent\",\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 \"outputs\": [\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_received\": \"true if txo was sent from external account to this account\",\n \"is_spent\": \"true if txo is spent\",\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 \"total_input\": \"sum of inputs as a decimal\",\n \"total_output\": \"sum of outputs, sans fee, as a decimal\",\n \"total_feLine truncated
"examples": []
"examples": [
{
"title": "Create a collection of one stream",
"curl": "curl -d'{\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet collection create --name=tom --bid=1.0 --channel_id=5c15c266bf34c683523ce06cfb7fe5c984221375 --claims=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001daef8df5dd59c4ef2e5b64332013dabc2ef12ba695cbe481e6cf15211fdd1bfd010000006a47304402204aa8d205ac5000d87b6c4040cb20efb23a97d6f7d590ab4f96c2b32c4214f3f8022074f7e20dc877e683fce13b8fddb84dd3083093b014b8ad0b02aa6a4557f57c2c012102bbf7a3d450aede8d5f60a6889a8e1b66e5f22d7079944623d779d19e2b270973ffffffff0200e1f5050000000091b503746f6d4c6f0175132284c9e57ffb6ce03c5283c634bf66c2155c256e3b7258258dac89ac426b7e6634a8ce11544475ef77194abd183a9de6bb75539bfa416b69f85e5191fca61dfabaac8766ba96f47718d7ab581e06344b26ef1a1812160a149d4935f781af62d81034a194560fabc96b3ad0bc6d7576a91442d128bf839fcc82c9596282d0cdd3bcd5170ee588ac202c7e17000000001976a914d47a9b5eb4d22ce83b0717df98b9022ecd15f36488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mqsLA2uT7pBfhzPBEQPrXiHtXpMtys7jRb\",\n \"amount\": \"4.947555\",\n \"confirmations\": 2,\n \"height\": 215,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"fd1bdd1f2115cfe681e4cb95a62bf12ebcda132033645b2eefc459ddf58defda\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmcFTMBvn5a1YdH1hWZaQzYbXY8n1ULESS\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"tom\",\n \"normalized_name\": \"tom\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://tom#1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"claim\",\n \"value\": {\n \"claims\": [\n \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"\n ]\n },\n \"value_type\": \"collection\"\n },\n {\n \"address\": \"mztSRbjwzK9k7BUDXWybL8ZJs2KYQAq6hP\",\n \"amount\": \"3.941448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.006107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.941448\",\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\"\n }\n}"
}
]
},
{
"name": "collection_list",
"description": "List my collection claims.",
"arguments": [
{
"name": "resolve",
"type": "bool",
"description": "resolve collection claim",
"is_required": false
},
{
"name": "resolve_claims",
"type": "int",
@@ -2224,7 +2298,15 @@
}
],
"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_received\": \"true if txo was sent from external account to this account\",\n \"is_spent\": \"true if txo is spent\",\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": []
"examples": [
{
"title": "List collections",
"curl": "curl -d'{\"method\": \"collection_list\", \"params\": {\"resolve_claims\": 1, \"resolve\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet collection list --resolve --resolve_claims=1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"collection_list\", \"params\": {\"resolve_claims\": 1, \"resolve\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmcFTMBvn5a1YdH1hWZaQzYbXY8n1ULESS\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/tom#1\",\n \"claim_id\": \"1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"claim_op\": \"create\",\n \"claims\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\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#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"confirmations\": 1,\n \"height\": 217,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 217,\n \"creation_height\": 217,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263191,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 217,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\"Line truncated
}
]
},
{
"name": "collection_resolve",
@@ -2370,12 +2452,6 @@
"description": "address where the collection is sent",
"is_required": false
},
{
"name": "new_signing_key",
"type": "bool",
"description": "generate a new signing key, will invalidate all previous publishes",
"is_required": false
},
{
"name": "preview",
"type": "bool",
@@ -2424,10 +2500,10 @@
"examples": [
{
"title": "Abandon a comment",
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment abandon b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\": {\n \"abandoned\": true\n }\n }\n}"
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment abandon 5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\": {\n \"abandoned\": true\n }\n }\n}"
}
]
},
@@ -2482,17 +2558,17 @@
"examples": [
{
"title": "Posting a comment as your channel",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=1b430d33d4efa0aac39a9cebf95736ed0517a4c1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"3576658331e9d868415b7bdaab9f3708eed0d873196261ae240d9e29f9790ec87667d8882a3c22553d705f5a216fa8c60e1a4e0664915637b6e0c2935189c015\",\n \"signing_ts\": \"1611869246\",\n \"timestamp\": \"1611869246\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n}"
},
{
"title": "Use the parent_id param to make replies",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\", \"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=b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43 --claim_id=1b430d33d4efa0aac39a9cebf95736ed0517a4c1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"92b869e21ffd5886eea527c688dc5af3e82878d3f2a68ad6fd90b88326184a858c3c69e3537536a2d2ad5030bdd6c3d4a6bf685e656c9e8f14496638c7da3ab5\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"signature\": \"516d798c7d73bf6bbd8a3757406fdf6f570237b7ce20b968b89955f6ad50c667202a18afa87a1d1ace30a4b1c20d81628967638a80889258221ca2c97b6f20e7\",\n \"signing_ts\": \"1611869247\",\n \"timestamp\": \"1611869247\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"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=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030 --claim_id=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n}"
}
]
},
@@ -2579,17 +2655,17 @@
"examples": [
{
"title": "List all comments on a claim",
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list 1b430d33d4efa0aac39a9cebf95736ed0517a4c1 --include_replies",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"include_replies\": true, \"skip_validation\": 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\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"92b869e21ffd5886eea527c688dc5af3e82878d3f2a68ad6fd90b88326184a858c3c69e3537536a2d2ad5030bdd6c3d4a6bf685e656c9e8f14496638c7da3ab5\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"signature\": \"516d798c7d73bf6bbd8a3757406fdf6f570237b7ce20b968b89955f6ad50c667202a18afa87a1d1ace30a4b1c20d81628967638a80889258221ca2c97b6f20e7\",\n \"signing_ts\": \"1611869247\",\n \"timestamp\": \"1611869247\"\n },\n {\n \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"3576658331e9d868415b7bdaab9f3708eed0d873196261ae240d9e29f9790ec87667d8882a3c22553d705f5a216fa8c60e1a4e0664915637b6e0c2935189c015\",\n \"signing_ts\": \"1611869246\",\n \"timestamp\": \"1611869246\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list bcd03a6bc9ab0f5694a13410d862af81f735499d --include_replies",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"include_replies\": true, \"skip_validation\": 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\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n },\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\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\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list 1b430d33d4efa0aac39a9cebf95736ed0517a4c1 --parent_id=b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\", \"include_replies\": false, \"skip_validation\": 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\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"92b869e21ffd5886eea527c688dc5af3e82878d3f2a68ad6fd90b88326184a858c3c69e3537536a2d2ad5030bdd6c3d4a6bf685e656c9e8f14496638c7da3ab5\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"signature\": \"516d798c7d73bf6bbd8a3757406fdf6f570237b7ce20b968b89955f6ad50c667202a18afa87a1d1ace30a4b1c20d81628967638a80889258221ca2c97b6f20e7\",\n \"signing_ts\": \"1611869247\",\n \"timestamp\": \"1611869247\"\n },\n {\n \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"3576658331e9d868415b7bdaab9f3708eed0d873196261ae240d9e29f9790ec87667d8882a3c22553d705f5a216fa8c60e1a4e0664915637b6e0c2935189c015\",\n \"signing_ts\": \"1611869246\",\n \"timestamp\": \"1611869246\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list bcd03a6bc9ab0f5694a13410d862af81f735499d --parent_id=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"include_replies\": false, \"skip_validation\": 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\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n },\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -2758,10 +2834,10 @@
"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\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"comment\": \"Where there was once sasquatch, there is not\",\n \"comment_id\": \"b83776179745d928f3c23ca157a7063f3bc67b8c5a415a3351147f9955f6f934bf778dc3c09481789d1a9f23580c5ccc673a445f94a33c87ecc19255784dbc43\",\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": null,\n \"signature\": \"77b4aa21d44ae3cbf8adb9003ba79abed52ea7f80033d4e764c1e38b84a93c11f0f69863c733d44b09ee2300e43e72aba44cc3e6b6dee0f82c33bd867a3999e8\",\n \"signing_ts\": \"1611869247\",\n \"timestamp\": \"1611869246\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Where there was once sasquatch, there is not\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": null,\n \"signature\": \"b37359c9301ab871acf14a0327b6151b89f639c2490134006687bcee4bd4c627b25ce2a520973a769cd32fa3cbbe43323ce23a9a1141dc768c992d146c5ca1d1\",\n \"signing_ts\": \"1619186573\",\n \"timestamp\": \"1619186572\"\n }\n}"
}
]
}
@@ -2851,9 +2927,9 @@
"examples": [
{
"title": "Delete a file",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"}}).json()",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -3014,14 +3090,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\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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 \"is_fully_reflected\": true,\n \"key\": \"c4169cac48bf35c480c6d152bb2a663e\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01113f10c2d15ae542f1ffe92608fbf6457284e540b744fbe796c11ebf7ca4f39c1e41df8085d3ebcd8a02f3e164960744c92bf2733bf43c65c31d8b7e3061374177a6875e8220e07e8ebfe75848282ff154301b570a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"f3bd0df688fd55cd363c769b3ec6ba871ee457a79c2353bb9e0c4845583202531c2942d213a84952c07f4c932189950d\",\n \"stream_name\": \"tmpc5ym6vx_\",\n \"streaming_url\": \"http://localhost:5280/stream/ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"suggested_file_name\": \"tmpc5ym6vx_\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"uploading_to_reflector\": false,\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\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"660d41f1b5dd5655a6ccfc17e56c890ce0f9ecf3\",\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 \"is_fully_reflected\": true,\n \"key\": \"39869ae1c7ca480dcfd69e59c7b696ca\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mmrL4RfDN3eTD7cmnPdm2sWtbqeyjaPaom\",\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\": \"1611869245\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpktl2l846.png\",\n \"sd_hash\": \"9d8531f7cb149b56422d5464298e745ef499190f37e80ce6a58d4bb3358ecdb3a61f24c3c03a0e13de6e9cb712d60c97\",\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\": \"Line 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\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\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 \"is_fully_reflected\": true,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\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\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"30a49013449a01baf6c5a15adca029bbd3cb8487\",\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 \"is_fully_reflected\": true,\n \"key\": \"0ac74e9ad025a7b43c7088801dbcad53\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\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\": \"1619186570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpie38oo39.png\",\n \"sd_hash\": \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\",\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\": \"Line truncated
},
{
"title": "List files matching a parameter",
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"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\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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 \"is_fully_reflected\": true,\n \"key\": \"c4169cac48bf35c480c6d152bb2a663e\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01113f10c2d15ae542f1ffe92608fbf6457284e540b744fbe796c11ebf7ca4f39c1e41df8085d3ebcd8a02f3e164960744c92bf2733bf43c65c31d8b7e3061374177a6875e8220e07e8ebfe75848282ff154301b570a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"f3bd0df688fd55cd363c769b3ec6ba871ee457a79c2353bb9e0c4845583202531c2942d213a84952c07f4c932189950d\",\n \"stream_name\": \"tmpc5ym6vx_\",\n \"streaming_url\": \"http://localhost:5280/stream/ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"suggested_file_name\": \"tmpc5ym6vx_\",\n \"timestamp\": 1611869265,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"uploading_to_reflector\": false,\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\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"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\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"is_fully_reflected\": true,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -3138,10 +3214,10 @@
"examples": [
{
"title": "Save a file to the downloads directory",
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1611869247,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpjwnofwu8\",\n \"download_path\": \"/tmp/tmpjwnofwu8/tmpc5ym6vx__1\",\n \"file_name\": \"tmpc5ym6vx__1\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"c4169cac48bf35c480c6d152bb2a663e\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01113f10c2d15ae542f1ffe92608fbf6457284e540b744fbe796c11ebf7ca4f39c1e41df8085d3ebcd8a02f3e164960744c92bf2733bf43c65c31d8b7e3061374177a6875e8220e07e8ebfe75848282ff154301b570a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"f3bd0df688fd55cd363c769b3ec6ba871ee457a79c2353bb9e0c4845583202531c2942d213a84952c07f4c932189950d\",\n \"stream_name\": \"tmpc5ym6vx_\",\n \"streaming_url\": \"http://localhost:5280/stream/ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"suggested_file_name\": \"tmpc5ym6vx_\",\n \"timestamp\": 1611869265,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1619186574,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp3yjc8ttn\",\n \"download_path\": \"/tmp/tmp3yjc8ttn/tmp12xihy6s_1\",\n \"file_name\": \"tmp12xihy6s_1\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -3422,7 +3498,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 \"allowed_origin\": \"\",\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 160k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"http://localhost:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/jessop/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpjwnofwu8\",\n \"download_dir\": \"/tmp/tmpjwnofwu8\",\n \"download_timeout\": 30.0,\n \"ffmpeg_path\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"fixed_peers\": [\n [\n \"127.0.0.1\",\n 5567\n ]\n ],\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 \"max_wallet_server_fee\": \"0.0\",\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 \"save_blobs\": true,\n \"save_files\": true,\n \"save_resolved_claims\": 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 \"transaction_cache_size\": 10000,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_bitrate_maximum\": 5000000,\n \"video_encoder\": \"libx264 -crf 24 -preset faster -pix_fmt yuv420p\",\n \"video_scaler\": \"-vf \\\"scale=if(gte(iw\\\\,ih)\\\\,min(1920\\\\,iw)\\\\,-2):if(lt(iw\\\\,ih)\\\\,min(1920\\\\,ih)\\\\,-2)\\\" -maxrate 5500K -bufsize 5000K\",\n \"volume_analysis_time\": 240,\n \"volume_filter\": \"\",\n \"wallet_dir\": \"/tmp/tmpjwnofwu8\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"allowed_origin\": \"\",\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 160k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"http://localhost:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\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/tmp3yjc8ttn\",\n \"download_dir\": \"/tmp/tmp3yjc8ttn\",\n \"download_timeout\": 30.0,\n \"ffmpeg_path\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"fixed_peers\": [\n [\n \"127.0.0.1\",\n 5567\n ]\n ],\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 \"max_wallet_server_fee\": \"0.0\",\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 \"save_blobs\": true,\n \"save_files\": true,\n \"save_resolved_claims\": 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 \"transaction_cache_size\": 10000,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_bitrate_maximum\": 5000000,\n \"video_encoder\": \"libx264 -crf 24 -preset faster -pix_fmt yuv420p\",\n \"video_scaler\": \"-vf \\\"scale=if(gte(iw\\\\,ih)\\\\,min(1920\\\\,iw)\\\\,-2):if(lt(iw\\\\,ih)\\\\,min(1920\\\\,ih)\\\\,-2)\\\" -maxrate 5500K -bufsize 5000K\",\n \"volume_analysis_time\": 240,\n \"volume_filter\": \"\",\n \"wallet_dir\": \"/tmp/tmp3yjc8ttn\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
}
]
},
@@ -3497,10 +3573,10 @@
"examples": [
{
"title": "Abandon a stream claim",
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon 1b430d33d4efa0aac39a9cebf95736ed0517a4c1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001b8c1615df39bcfd787aa8a9ac37fe25834e84925086b0307ceed03b43965c924000000006a47304402201900920e615261e3a8c34f7d7725961dcb3e2c54412b949ad67a818aa874b018022070d7359b65dd4a161fb8e8492b32103e0a0033ca0a3d4ab337ef3bbbb2f9fd130121023e7db47dfef3c13f0bce4c2ac55b19b1fe1fe0cccd9339b77b9a45a8130c511fffffffff0134b7f505000000001976a91460c8715797575fc3c35d7de2eaa0c11efdd872ee88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mpLhHUYPyHRPBt9Se1hdu4bHfGNQsbHSen\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"891537422fd108d157c4653c35bb21d2071711ef8e9a48980ad88cca8342c9b8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"891537422fd108d157c4653c35bb21d2071711ef8e9a48980ad88cca8342c9b8\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000137bea49efcbfa290749f4df97b298fde15e94a91f7074db0c5824ee871d29a7b000000006a47304402203412da1fa2b96cc1191e36deab1bad5e822ec9cb4f88e9267632e87dd5dd4bf7022031daa32521dcf4f69d0ba71261dd33f7e97fbfe0f3dfa29eb9704f0c8e94bab6012103a0f9331ba7bb5ec620354ccaf4579e1195929316a8a03269f0389e6aa40e103dffffffff0134b7f505000000001976a9148ce9b7e1af3519b3ac3d6fc6dd79e8b2fb82f2a688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtN2swZj3Wynoe9L6R82xxk7xaTWs5N6kb\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"6021f8bfa24e637732164e17f2272ced687f4b1256a9cc6ff5715bda6a71e42c\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"6021f8bfa24e637732164e17f2272ced687f4b1256a9cc6ff5715bda6a71e42c\"\n }\n}"
}
]
},
@@ -3538,7 +3614,19 @@
"name": "file_path",
"type": "str",
"description": "path to file to be associated with name.",
"is_required": true
"is_required": false
},
{
"name": "file_name",
"type": "str",
"description": "name of file to be associated with stream.",
"is_required": false
},
{
"name": "file_hash",
"type": "str",
"description": "hash of file to be associated with stream.",
"is_required": false
},
{
"name": "validate_file",
@@ -3654,6 +3742,12 @@
"description": "audio/video duration in seconds, automatically calculated",
"is_required": false
},
{
"name": "sd_hash",
"type": "str",
"description": "sd_hash of stream",
"is_required": false
},
{
"name": "channel_id",
"type": "str",
@@ -3713,17 +3807,17 @@
"examples": [
{
"title": "Create a stream claim without metadata",
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpc5ym6vx_\", \"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/tmpc5ym6vx_",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpc5ym6vx_\", \"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\": \"01000000015d14d8ee65741f52c41a1aee29eb3a6f64f081406bfb7e298bc7c99725984f1b010000006b483045022100effcf91d911bc4599facb799c5207ec20ce0d4f39278a31c68ef096808b0914f02206c6ddec97694e47f3e29c2c57defa52ddbe0764d1cc0f9f93803305cad3fcb880121025ca79c60d9256ea9edec1ac527587b3e0c1922131a58385d9c170c6426d2b6e6ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa56d7576a914222be234ed511463ee136350e1d969682566bbe088ac38fb9423000000001976a914c4dd4c6072bc2034e75b40eb17575e13baf37b5a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mncXU2ny9iASjfpmmXHB5tsRFRqbUL6UAo\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"nout\": 1,\n \"timestamp\": 1611869264,\n \"txid\": \"1b4f982597c9c78b297efb6b4081f0646f3aeb29ee1a1ac4521f7465eed8145d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"timestamp\": null,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"myTsqjNvY4RkE24zsi85BdFf1zYYwLCVfh\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp12xihy6s\", \"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/tmp12xihy6s",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp12xihy6s\", \"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\": \"01000000010d9532306586cdcb59cc30c6bcc8ed810faf1d38e2b01e06a720ce34b203f93d010000006b483045022100b3aec529900a8019a269482d77b7da0cd65170365839702814db3e724b93f0b50220298b277f4c06ca9f1192523284880f73e4ef67b30b3a266efa7dc94e538a1fb5012103784172862f04b1e6c2c6973ad24461b7f1a5afb65814b7d3eefb434c7dad0792ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea6d7576a91445207a9e9642daffd510f3394e2275ffecb3dfa288ac38fb9423000000001976a914e17fa7172490e99ae32889b75416ab97a7934c9b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mz7xezDeGSCCwsT1RAV6VSnZvx1Y48GWBz\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": null,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n25HFgSFcDw1unkj8wTi2tVq6LB3hpd3DX\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\"\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/tmpktl2l846.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\": 1611869245, \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpktl2l846.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=1611869245 --channel_id=\"40e5847245f6fb0826e9fff142e55ad1c2103f11\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpktl2l846.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\": 1611869245, \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001628540dd68fb2884eb566df6fb4261664a1f2fb73ef3c26dca7efe8ad76f249d010000006a47304402204178a4ff4d94741fcf4cc09db2fe842e64fc567f9f77f0e84ee9ae29b0067df202207405bf82d20bf0ac2f9addba5345167e6a1a57befa4ee538838f573b399d5a0b0121026912ae6039902f830c970c966ce82bf0e3cb528132f609933da1cadab001779effffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101113f10c2d15ae542f1ffe92608fbf6457284e540a6ec29900fc13634ec5b190d20ed602f42eb2b507b7445dd9d1c346524fe392c47ed3efad8313a8c184c458188f08a8ac7795639e4a257d7f8f213c9249de2180ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706b746c326c3834362e706e6718632209696d6167652f706e6732309d8531f7cb149b56422d5464298e745ef499190f37e80ce6a58d4bb3358ecdb3a61f24c3c03a0e13de6e9cb712d60c97120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728bdd8cc80063222080112196f457ad3964601bd031638e3d1ef2dd8c6d49b93ffa424b17c188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914457ad3964601bd031638e3d1ef2dd8c6d49b93ff88acac5e7d1d000000001976a914553e501f9c763eb28a7c7ba9376053f674e88d4c88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"myTsqjNvY4RkE24zsi85BdFf1zYYwLCVfh\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"nout\": 1,\n \"timestamp\": 1611869265,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmrL4RfDN3eTD7cmnPdm2sWtbqeyjaPaom\",\n \"amount\": \"1.0\",\n \"claim_id\": \"660d41f1b5dd5655a6ccfc17e56c890ce0f9ecf3\",\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#660d41f1b5dd5655a6ccfc17e56c890ce0f9ecf3\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"fc519ec60302e3789dbd03b0dfb233ca7f0794b4fb7d84e09cec9e143e12dcd4\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mmrL4RfDN3eTD7cmnPdm2sWtbqeyjaPaom\",\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\": \"1611869245\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpktl2l846.png\",\n \"sd_hash\": \"9d8531f7cb149b56422d5464298e745ef499190f37e80ce6a58d4bb3358ecdb3a61f24c3c03a0e13de6e9cb712d60c97\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbLine truncated
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpie38oo39.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\": 1619186570, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpie38oo39.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=1619186570 --channel_id=\"5c15c266bf34c683523ce06cfb7fe5c984221375\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpie38oo39.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\": 1619186570, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001badbf685df67ec9d66f01be500d92b417ea1871625ed0c3fbd4353530a829ff7010000006b4830450221009e4c32407bee4da0c778760a72b2bf7886304a7353791b46f1c988c2b1af1b8b0220135bb6146bf859fa673047c369ed69b0ea8afda19bbf966e4f3bc6e634eada4d0121030e089bbbe50c6d7ccd1fed871a8a122110790d52807de6ca8c62c62a1132160cffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db1010175132284c9e57ffb6ce03c5283c634bf66c2155c6a58b698a1aa43f0e8a6c902011194d0f2e3f1ac4fe0cab54c3d690845f73bfcaeff030384ab3ba2372a57e58daf5579d0a39eb55964fae5a823c3e5e69b357b0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d70696533386f6f33392e706e6718632209696d6167652f706e67323066615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f7267288aa78b84063222080112196f1ccf2a77c401281744e1ee1b91bb59fde2b1982051d1686f188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9141ccf2a77c401281744e1ee1b91bb59fde2b1982088acac5e7d1d000000001976a914718bd3897a6f10f3e7ef8dd0521654677826a57b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n25HFgSFcDw1unkj8wTi2tVq6LB3hpd3DX\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"30a49013449a01baf6c5a15adca029bbd3cb8487\",\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#30a49013449a01baf6c5a15adca029bbd3cb8487\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"fd1bdd1f2115cfe681e4cb95a62bf12ebcda132033645b2eefc459ddf58defda\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\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\": \"1619186570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpie38oo39.png\",\n \"sd_hash\": \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thuLine truncated
}
]
},
@@ -3793,14 +3887,14 @@
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"timestamp\": 1611869265,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\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\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\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\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your stream claims",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1611869265,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"timestamp\": 1611869265,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\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\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\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\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -4062,6 +4156,12 @@
"description": "audio/video duration in seconds, automatically calculated",
"is_required": false
},
{
"name": "sd_hash",
"type": "str",
"description": "sd_hash of stream",
"is_required": false
},
{
"name": "channel_id",
"type": "str",
@@ -4133,10 +4233,10 @@
"examples": [
{
"title": "Update a stream claim to add channel",
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update 1b430d33d4efa0aac39a9cebf95736ed0517a4c1 --channel_id=\"40e5847245f6fb0826e9fff142e55ad1c2103f11\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\", \"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\": \"0100000002628540dd68fb2884eb566df6fb4261664a1f2fb73ef3c26dca7efe8ad76f249d000000006b4830450221008ef72aeb8f185fa190d6fca9a6abf374cdfc7f2c215fabbbbdacfc114d54a9e902206716689c471e51df710ca790c5e98d382b75d17ac7d1ea07d2b486f10a59831a0121023e7db47dfef3c13f0bce4c2ac55b19b1fe1fe0cccd9339b77b9a45a8130c511fffffffff56f6a2b5c86f86f576716ba35a15627ed6c52bb4968c273cc4f0405bdfe6ad92010000006b483045022100e66763c6a3790c5a9f90c744fc9058b639b9ad68856e2696aeedecf5a775ef3a02203624a9f36377d2334d74725f1b42e08be0386834d828c86c6aecd59b684c432b0121036db504484afe77cb6af56d5b5b1ace594cac85103aa74844fd10055fc32a701effffffff0200e1f50500000000fd2301b7076173747265616d14c1a41705ed3657f9eb9c9ac3aaa0efd4330d431b4ce801113f10c2d15ae542f1ffe92608fbf6457284e540b744fbe796c11ebf7ca4f39c1e41df8085d3ebcd8a02f3e164960744c92bf2733bf43c65c31d8b7e3061374177a6875e8220e07e8ebfe75848282ff154301b570a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706335796d3676785f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa56d6d76a914222be234ed511463ee136350e1d969682566bbe088ac32a0d205000000001976a9144274565b05d3410efed90e7dd2f62e1c6a817fb388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"timestamp\": 1611869265,\n \"txid\": \"9d246fd78afe7eca6dc2f33eb72f1f4a666142fbf66d56eb8428fb68dd408562\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc5ym6vx_\",\n \"sd_hash\": \"ff6562454cdefc42732e97c8cf5f81c1278aff3cac9f2ea30b5de8bffcd83b9a37d9e307f564c642aae5bf8eaca7efa5\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n1MWKdzvKyD3Dgzwda2MLuKSn9R1rYXYsV\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"nout\": 1,\n \"timestamp\": 1611869264,\n \"txid\": \"92ade6df5b40f0c43c278c96b42bc5d67e62155aa36b7176f5866fc8b5a2f656\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"middqfSidoJ4Bv17qheAFaPvnikcnnGuXQ\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\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#1b430d33d4efa0aac39a9cebf95736ed0517a4c1\",\n \"signing_channel\": {\n \"address\": \"mzzPvbftpTErnMzQmbsRK5gKuqVPdX8SEU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#40e5847245f6fb0826e9fff142e55ad1c2103f11\",\n \"timestamp\": 1611869264,\n \"txid\": \"db9c094f1e6941dd4738fc8d2e62e71199ed89e1027f6016971ceb3dd9f27ccf\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c3428de368e9414410cdc9cde9de03e6a0786f096b033cbc5d7fa581bde7f123515f5d6292ad595fc285caf1755128f15c54834d7aa7101ed5a1e07893d496fa\",\n \"public_key_id\": \"mnrdQ1NyMZTQWHiPjcpdAytckwXN43NuF2\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"24c96539b403edce07036b082549e83458e27fc39a8aaa87d7cf9bf35d61c1b8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n Line truncated
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update bcd03a6bc9ab0f5694a13410d862af81f735499d --channel_id=\"5c15c266bf34c683523ce06cfb7fe5c984221375\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"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\": \"0100000002badbf685df67ec9d66f01be500d92b417ea1871625ed0c3fbd4353530a829ff7000000006a47304402202f8600123db5731f4702cddf0f8f56aba57555b124ce30c6282475c3fdfb0a150220286c133895326dcc9a0f3ea1cda7bbaa2c5ab24d802e1a28ecfea296408ddb4f012103a0f9331ba7bb5ec620354ccaf4579e1195929316a8a03269f0389e6aa40e103dffffffff2b20bfe244cdca1f5be113c9c0fc43f187632ca5ed391207233909bc20619bb2010000006a47304402206828757a2a417405079bd345bdd495e6b2a4937cb7f20d5c1b22626bc28d8475022004ee827093b6c2a091aeda2493d0ab47283dcd78d765bbfcb4b8b454e88e711e0121038564fc7ee856388d69c509f057b6aa7d7d9b341ebccb7d6452bc0adb0c6d50e7ffffffff0200e1f50500000000fd2301b7076173747265616d149d4935f781af62d81034a194560fabc96b3ad0bc4ce80175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea6d6d76a91445207a9e9642daffd510f3394e2275ffecb3dfa288ac32a0d205000000001976a914eb1c5433f3da0f37cd32430383e5614e02e412ca88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtZumqabuzJQ9UMvtN5a58XCcrBBCPL1BD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\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#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n Line truncated
}
]
}
@@ -4512,7 +4612,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\": \"2021-01-28 16:27\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1611869264,\n \"txid\": \"c73d976a47a75fb5c0094754a75216d1ca4e213b92cffb9db46efb6461d74bff\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2021-01-28 16:27\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1611869263,\n \"txid\": \"2dadc0cc9998e5d71fe531393e10be7398bd0e192006f5368557e5116e1205ba\",\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\": \"2021-04-23 10:03\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2021-04-23 10:03\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1619186593,\n \"txid\": \"7c7b6ef27b3b65fdd90f713d572d63f3f626a75e0f613dc1fd45d6e9a9a1b640\",\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}"
}
]
},
@@ -4626,7 +4726,7 @@
{
"name": "include_received_tips",
"type": "bool",
"description": "calculate the amount of tips recieved for claim outputs",
"description": "calculate the amount of tips received for claim outputs",
"is_required": false
},
{
+1 -1
View File
@@ -1,2 +1,2 @@
__version__ = "0.89.0"
__version__ = "0.96.0"
version = tuple(map(int, __version__.split('.'))) # pylint: disable=invalid-name
+2
View File
@@ -544,6 +544,7 @@ class Config(CLIConfig):
# protocol timeouts
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)
hub_timeout = Float("Timeout when making a hub request", 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)
@@ -565,6 +566,7 @@ class Config(CLIConfig):
"Maximum number of peers to connect to while downloading a blob", 4,
previous_names=['max_connections_per_stream']
)
concurrent_hub_requests = Integer("Maximum number of concurrent hub requests", 32)
fixed_peer_delay = Float(
"Amount of seconds before adding the reflector servers as potential peers to download from in case dht"
"peers are not found or are slow", 2.0
+4 -2
View File
@@ -539,8 +539,10 @@ class UPnPComponent(Component):
success = False
await self._maintain_redirects()
if self.upnp:
if not self.upnp_redirects and not all([x in self.component_manager.skip_components for x in
(DHT_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT)]):
if not self.upnp_redirects and not all(
x in self.component_manager.skip_components
for x in (DHT_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT)
):
log.error("failed to setup upnp")
else:
success = True
+81 -83
View File
@@ -119,13 +119,6 @@ STREAM_STAGES = [
(DOWNLOAD_TIMEOUT_CODE, 'Stream timed out')
]
CONNECTION_STATUS_CONNECTED = 'connected'
CONNECTION_STATUS_NETWORK = 'network_connection'
CONNECTION_MESSAGES = {
CONNECTION_STATUS_CONNECTED: 'No connection problems detected',
CONNECTION_STATUS_NETWORK: "Your internet connection appears to have been interrupted",
}
SHORT_ID_LEN = 20
MAX_UPDATE_FEE_ESTIMATE = 0.3
DEFAULT_PAGE_SIZE = 20
@@ -339,13 +332,13 @@ class Daemon(metaclass=JSONRPCServerType):
skip_components=conf.components_to_skip or []
)
self.component_startup_task = None
self._connection_status: typing.Tuple[float, bool] = (self.component_manager.loop.time(), False)
logging.getLogger('aiohttp.access').setLevel(logging.WARN)
rpc_app = web.Application()
rpc_app.router.add_get('/lbryapi', self.handle_old_jsonrpc)
rpc_app.router.add_post('/lbryapi', self.handle_old_jsonrpc)
rpc_app.router.add_post('/', self.handle_old_jsonrpc)
rpc_app.router.add_options('/', self.add_cors_headers)
self.rpc_runner = web.AppRunner(rpc_app)
streaming_app = web.Application()
@@ -358,9 +351,6 @@ class Daemon(metaclass=JSONRPCServerType):
prom_app.router.add_get('/metrics', self.handle_metrics_get_request)
self.metrics_runner = web.AppRunner(prom_app)
self.need_connection_status_refresh = asyncio.Event()
self._connection_status_task: Optional[asyncio.Task] = None
@property
def dht_node(self) -> typing.Optional['Node']:
return self.component_manager.get_component(DHT_COMPONENT)
@@ -465,31 +455,10 @@ class Daemon(metaclass=JSONRPCServerType):
if not os.path.isdir(self.conf.download_dir):
os.makedirs(self.conf.download_dir)
async def update_connection_status(self):
connected = await utils.async_check_connection()
if connected and not self._connection_status[1]:
log.info("detected internet connection is working")
elif not connected and self._connection_status[1]:
log.warning("detected internet connection was lost")
self._connection_status = (self.component_manager.loop.time(), connected)
async def keep_connection_status_up_to_date(self):
while True:
try:
await asyncio.wait_for(self.need_connection_status_refresh.wait(), 300)
except asyncio.TimeoutError:
pass
await self.update_connection_status()
self.need_connection_status_refresh.clear()
async def start(self):
log.info("Starting LBRYNet Daemon")
log.debug("Settings: %s", json.dumps(self.conf.settings_dict, indent=2))
log.info("Platform: %s", json.dumps(self.platform_info, indent=2))
self.need_connection_status_refresh.set()
self._connection_status_task = self.component_manager.loop.create_task(
self.keep_connection_status_up_to_date()
)
await self.analytics_manager.send_server_startup()
await self.rpc_runner.setup()
@@ -549,10 +518,6 @@ class Daemon(metaclass=JSONRPCServerType):
await self.component_startup_task
async def stop(self):
if self._connection_status_task:
if not self._connection_status_task.done():
self._connection_status_task.cancel()
self._connection_status_task = None
if self.component_startup_task is not None:
if self.component_startup_task.done():
await self.component_manager.stop()
@@ -575,6 +540,17 @@ class Daemon(metaclass=JSONRPCServerType):
self.analytics_manager.stop()
log.info("finished shutting down")
async def add_cors_headers(self, request):
if self.conf.allowed_origin:
return web.Response(
headers={
'Access-Control-Allow-Origin': self.conf.allowed_origin,
'Access-Control-Allow-Methods': self.conf.allowed_origin,
'Access-Control-Allow-Headers': self.conf.allowed_origin,
}
)
return None
async def handle_old_jsonrpc(self, request):
ensure_request_allowed(request, self.conf)
data = await request.json()
@@ -595,8 +571,16 @@ class Daemon(metaclass=JSONRPCServerType):
'After successfully executing the command, failed to encode result for JSON RPC response.',
{'traceback': format_exc()}
), ledger=ledger)
headers = {}
if self.conf.allowed_origin:
headers.update({
'Access-Control-Allow-Origin': self.conf.allowed_origin,
'Access-Control-Allow-Methods': self.conf.allowed_origin,
'Access-Control-Allow-Headers': self.conf.allowed_origin,
})
return web.Response(
text=encoded_result,
headers=headers,
content_type='application/json'
)
@@ -936,10 +920,6 @@ class Daemon(metaclass=JSONRPCServerType):
}
}
"""
if not self._connection_status[1]:
self.need_connection_status_refresh.set()
connection_code = CONNECTION_STATUS_CONNECTED if self._connection_status[1] else CONNECTION_STATUS_NETWORK
ffmpeg_status = await self._video_file_analyzer.status()
running_components = self.component_manager.get_components_status()
response = {
@@ -947,10 +927,6 @@ class Daemon(metaclass=JSONRPCServerType):
'is_running': all(running_components.values()),
'skipped_components': self.component_manager.skip_components,
'startup_status': running_components,
'connection_status': {
'code': connection_code,
'message': CONNECTION_MESSAGES[connection_code],
},
'ffmpeg_status': ffmpeg_status
}
for component in self.component_manager.components:
@@ -999,7 +975,7 @@ class Daemon(metaclass=JSONRPCServerType):
Options:
--urls=<urls> : (str, list) one or more urls to resolve
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase reciepts
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase receipts
--new_sdk_server=<new_sdk_server> : (str) URL of the new SDK server (EXPERIMENTAL)
--include_purchase_receipt : (bool) lookup and include a receipt if this wallet
has purchased the claim being resolved
@@ -1112,7 +1088,7 @@ class Daemon(metaclass=JSONRPCServerType):
--download_directory=<download_directory> : (str) full path to the directory to download into
--timeout=<timeout> : (int) download timeout in number of seconds
--save_file=<save_file> : (bool) save the file to the downloads directory
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase reciepts
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase receipts
Returns: {File}
"""
@@ -1580,7 +1556,7 @@ class Daemon(metaclass=JSONRPCServerType):
wallet = self.wallet_manager.get_wallet_or_default(wallet_id)
account = wallet.get_account_or_default(account_id)
balance = await account.get_detailed_balance(
confirmations=confirmations, reserved_subtotals=True, read_only=True
confirmations=confirmations, read_only=True
)
return dict_values_to_lbc(balance)
@@ -2278,7 +2254,7 @@ class Daemon(metaclass=JSONRPCServerType):
Usage:
claim_list [--claim_type=<claim_type>...] [--claim_id=<claim_id>...] [--name=<name>...] [--is_spent]
[--channel_id=<channel_id>...] [--account_id=<account_id>] [--wallet_id=<wallet_id>]
[--page=<page>] [--page_size=<page_size>]
[--has_source | --has_no_source] [--page=<page>] [--page_size=<page_size>]
[--resolve] [--order_by=<order_by>] [--no_totals] [--include_received_tips]
Options:
@@ -2289,13 +2265,15 @@ class Daemon(metaclass=JSONRPCServerType):
--is_spent : (bool) shows previous claim updates and abandons
--account_id=<account_id> : (str) id of the account to query
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
--has_source : (bool) list claims containing a source field
--has_no_source : (bool) list claims not containing a source field
--page=<page> : (int) page to return during paginating
--page_size=<page_size> : (int) number of items on page during pagination
--resolve : (bool) resolves each claim to provide additional metadata
--order_by=<order_by> : (str) field to order by: 'name', 'height', 'amount'
--no_totals : (bool) do not calculate the total number of pages and items in result set
(significant performance boost)
--include_received_tips : (bool) calculate the amount of tips recieved for claim outputs
--include_received_tips : (bool) calculate the amount of tips received for claim outputs
Returns: {Paginated[Output]}
"""
@@ -2372,8 +2350,9 @@ class Daemon(metaclass=JSONRPCServerType):
[--not_languages=<not_languages>...]
[--any_locations=<any_locations>...] [--all_locations=<all_locations>...]
[--not_locations=<not_locations>...]
[--order_by=<order_by>...] [--page=<page>] [--page_size=<page_size>]
[--order_by=<order_by>...] [--no_totals] [--page=<page>] [--page_size=<page_size>]
[--wallet_id=<wallet_id>] [--include_purchase_receipt] [--include_is_my_output]
[--has_source | --has_no_source]
[--new_sdk_server=<new_sdk_server>]
Options:
@@ -2451,7 +2430,7 @@ class Daemon(metaclass=JSONRPCServerType):
--reposted_claim_id=<reposted_claim_id>: (str) all reposts of the specified original claim id
--reposted=<reposted> : (int) claims reposted this many times (supports
equality constraints)
--claim_type=<claim_type> : (str) filter by 'channel', 'stream' or 'unknown'
--claim_type=<claim_type> : (str) filter by 'channel', 'stream', 'repost' or 'collection'
--stream_types=<stream_types> : (list) filter by 'video', 'image', 'document', etc
--media_types=<media_types> : (list) filter by 'video/mp4', 'image/png', etc
--fee_currency=<fee_currency> : (string) specify fee currency: LBC, BTC, USD
@@ -2477,11 +2456,13 @@ class Daemon(metaclass=JSONRPCServerType):
'trending_local', 'trending_global', 'activation_height'
--no_totals : (bool) do not calculate the total number of pages and items in result set
(significant performance boost)
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase reciepts
--wallet_id=<wallet_id> : (str) wallet to check for claim purchase receipts
--include_purchase_receipt : (bool) lookup and include a receipt if this wallet
has purchased the claim
--include_is_my_output : (bool) lookup and include a boolean indicating
if claim being resolved is yours
--has_source : (bool) find claims containing a source field
--has_no_source : (bool) find claims not containing a source field
--new_sdk_server=<new_sdk_server> : (str) URL of the new SDK server (EXPERIMENTAL)
Returns: {Paginated[Output]}
@@ -2493,6 +2474,8 @@ class Daemon(metaclass=JSONRPCServerType):
kwargs['signature_valid'] = 1
if kwargs.pop('invalid_channel_signature', False):
kwargs['signature_valid'] = 0
if 'has_no_source' in kwargs:
kwargs['has_source'] = not kwargs.pop('has_no_source')
page_num, page_size = abs(kwargs.pop('page', 1)), min(abs(kwargs.pop('page_size', DEFAULT_PAGE_SIZE)), 50)
kwargs.update({'offset': page_size * (page_num - 1), 'limit': page_size})
txos, blocked, _, total = await self.ledger.claim_search(wallet.accounts, **kwargs)
@@ -2617,7 +2600,6 @@ class Daemon(metaclass=JSONRPCServerType):
)
txo = tx.outputs[0]
await txo.generate_channel_private_key()
tx._reset()
await tx.sign(funding_accounts)
@@ -2774,7 +2756,6 @@ class Daemon(metaclass=JSONRPCServerType):
new_txo.private_key = old_txo.private_key
new_txo.script.generate()
tx._reset()
await tx.sign(funding_accounts)
@@ -2908,7 +2889,7 @@ class Daemon(metaclass=JSONRPCServerType):
Returns: {Paginated[Output]}
"""
kwargs['type'] = 'channel'
if 'is_spent' not in kwargs:
if 'is_spent' not in kwargs or not kwargs['is_spent']:
kwargs['is_not_spent'] = True
return self.jsonrpc_txo_list(*args, **kwargs)
@@ -3017,13 +2998,13 @@ class Daemon(metaclass=JSONRPCServerType):
Usage:
publish (<name> | --name=<name>) [--bid=<bid>] [--file_path=<file_path>]
[--validate_file] [--optimize_file]
[--file_name=<file_name>] [--file_hash=<file_hash>] [--validate_file] [--optimize_file]
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
[--title=<title>] [--description=<description>] [--author=<author>]
[--tags=<tags>...] [--languages=<languages>...] [--locations=<locations>...]
[--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>]
[--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>]
[--channel_id=<channel_id> | --channel_name=<channel_name>]
[--sd_hash=<sd_hash>] [--channel_id=<channel_id> | --channel_name=<channel_name>]
[--channel_account_id=<channel_account_id>...]
[--account_id=<account_id>] [--wallet_id=<wallet_id>]
[--claim_address=<claim_address>] [--funding_account_ids=<funding_account_ids>...]
@@ -3033,6 +3014,8 @@ class Daemon(metaclass=JSONRPCServerType):
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
--bid=<bid> : (decimal) amount to back the claim
--file_path=<file_path> : (str) path to file to be associated with name.
--file_name=<file_name> : (str) name of file to be associated with stream.
--file_hash=<file_hash> : (str) hash of file to be associated with stream.
--validate_file : (bool) validate that the video container and encodings match
common web browser support or that optimization succeeds if specified.
FFmpeg is required
@@ -3095,6 +3078,7 @@ class Daemon(metaclass=JSONRPCServerType):
--width=<width> : (int) image/video width, automatically calculated from media file
--height=<height> : (int) image/video height, automatically calculated from media file
--duration=<duration> : (int) audio/video duration in seconds, automatically calculated
--sd_hash=<sd_hash> : (str) sd_hash of stream
--channel_id=<channel_id> : (str) claim id of the publisher channel
--channel_name=<channel_name> : (str) name of publisher channel
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
@@ -3121,8 +3105,6 @@ class Daemon(metaclass=JSONRPCServerType):
if len(claims) == 0:
if 'bid' not in kwargs:
raise Exception("'bid' is a required argument for new publishes.")
if 'file_path' not in kwargs:
raise Exception("'file_path' is a required argument for new publishes.")
return await self.jsonrpc_stream_create(name, **kwargs)
elif len(claims) == 1:
assert claims[0].claim.is_stream, f"Claim at name '{name}' is not a stream claim."
@@ -3206,7 +3188,7 @@ class Daemon(metaclass=JSONRPCServerType):
@requires(WALLET_COMPONENT, FILE_MANAGER_COMPONENT, BLOB_COMPONENT, DATABASE_COMPONENT)
async def jsonrpc_stream_create(
self, name, bid, file_path, allow_duplicate_name=False,
self, name, bid, file_path=None, allow_duplicate_name=False,
channel_id=None, channel_name=None, channel_account_id=None,
account_id=None, wallet_id=None, claim_address=None, funding_account_ids=None,
preview=False, blocking=False, validate_file=False, optimize_file=False, **kwargs):
@@ -3214,15 +3196,15 @@ class Daemon(metaclass=JSONRPCServerType):
Make a new stream claim and announce the associated file to lbrynet.
Usage:
stream_create (<name> | --name=<name>) (<bid> | --bid=<bid>) (<file_path> | --file_path=<file_path>)
[--validate_file] [--optimize_file]
stream_create (<name> | --name=<name>) (<bid> | --bid=<bid>) [<file_path> | --file_path=<file_path>]
[--file_name=<file_name>] [--file_hash=<file_hash>] [--validate_file] [--optimize_file]
[--allow_duplicate_name=<allow_duplicate_name>]
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
[--title=<title>] [--description=<description>] [--author=<author>]
[--tags=<tags>...] [--languages=<languages>...] [--locations=<locations>...]
[--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>]
[--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>]
[--channel_id=<channel_id> | --channel_name=<channel_name>]
[--sd_hash=<sd_hash>] [--channel_id=<channel_id> | --channel_name=<channel_name>]
[--channel_account_id=<channel_account_id>...]
[--account_id=<account_id>] [--wallet_id=<wallet_id>]
[--claim_address=<claim_address>] [--funding_account_ids=<funding_account_ids>...]
@@ -3232,6 +3214,8 @@ class Daemon(metaclass=JSONRPCServerType):
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
--bid=<bid> : (decimal) amount to back the claim
--file_path=<file_path> : (str) path to file to be associated with name.
--file_name=<file_name> : (str) name of file to be associated with stream.
--file_hash=<file_hash> : (str) hash of file to be associated with stream.
--validate_file : (bool) validate that the video container and encodings match
common web browser support or that optimization succeeds if specified.
FFmpeg is required
@@ -3296,6 +3280,7 @@ class Daemon(metaclass=JSONRPCServerType):
--width=<width> : (int) image/video width, automatically calculated from media file
--height=<height> : (int) image/video height, automatically calculated from media file
--duration=<duration> : (int) audio/video duration in seconds, automatically calculated
--sd_hash=<sd_hash> : (str) sd_hash of stream
--channel_id=<channel_id> : (str) claim id of the publisher channel
--channel_name=<channel_name> : (str) name of the publisher channel
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
@@ -3328,24 +3313,27 @@ class Daemon(metaclass=JSONRPCServerType):
f"Use --allow-duplicate-name flag to override."
)
file_path, spec = await self._video_file_analyzer.verify_or_repair(
validate_file, optimize_file, file_path, ignore_non_video=True
)
kwargs.update(spec)
if file_path is not None:
file_path, spec = await self._video_file_analyzer.verify_or_repair(
validate_file, optimize_file, file_path, ignore_non_video=True
)
kwargs.update(spec)
claim = Claim()
claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs)
if file_path is not None:
claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs)
else:
claim.stream.update(**kwargs)
tx = await Transaction.claim_create(
name, claim, amount, claim_address, funding_accounts, funding_accounts[0], channel
)
new_txo = tx.outputs[0]
file_stream = None
if not preview:
if not preview and file_path is not None:
file_stream = await self.file_manager.create_stream(file_path)
claim.stream.source.sd_hash = file_stream.sd_hash
new_txo.script.generate()
tx._reset()
if channel:
new_txo.sign(channel)
@@ -3358,7 +3346,8 @@ class Daemon(metaclass=JSONRPCServerType):
await self.storage.save_claims([self._old_get_temp_claim_info(
tx, new_txo, claim_address, claim, name, dewies_to_lbc(amount)
)])
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)
if file_path is not None:
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)
self.component_manager.loop.create_task(save_claims())
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
@@ -3388,7 +3377,7 @@ class Daemon(metaclass=JSONRPCServerType):
[--locations=<locations>...] [--clear_locations]
[--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>]
[--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>]
[--channel_id=<channel_id> | --channel_name=<channel_name> | --clear_channel]
[--sd_hash=<sd_hash>] [--channel_id=<channel_id> | --channel_name=<channel_name> | --clear_channel]
[--channel_account_id=<channel_account_id>...]
[--account_id=<account_id>] [--wallet_id=<wallet_id>]
[--claim_address=<claim_address>] [--funding_account_ids=<funding_account_ids>...]
@@ -3467,6 +3456,7 @@ class Daemon(metaclass=JSONRPCServerType):
--width=<width> : (int) image/video width, automatically calculated from media file
--height=<height> : (int) image/video height, automatically calculated from media file
--duration=<duration> : (int) audio/video duration in seconds, automatically calculated
--sd_hash=<sd_hash> : (str) sd_hash of stream
--channel_id=<channel_id> : (str) claim id of the publisher channel
--channel_name=<channel_name> : (str) name of the publisher channel
--clear_channel : (bool) remove channel signature
@@ -3538,9 +3528,10 @@ class Daemon(metaclass=JSONRPCServerType):
if replace:
claim = Claim()
claim.stream.message.source.CopyFrom(
old_txo.claim.stream.message.source
)
if old_txo.claim.stream.has_source:
claim.stream.message.source.CopyFrom(
old_txo.claim.stream.message.source
)
stream_type = old_txo.claim.stream.stream_type
if stream_type:
old_stream_type = getattr(old_txo.claim.stream.message, stream_type)
@@ -3565,7 +3556,6 @@ class Daemon(metaclass=JSONRPCServerType):
file_stream = await self.file_manager.create_stream(file_path)
new_txo.claim.stream.source.sd_hash = file_stream.sd_hash
new_txo.script.generate()
tx._reset()
stream_hash = file_stream.stream_hash
elif old_stream:
stream_hash = old_stream.stream_hash
@@ -3960,9 +3950,6 @@ class Daemon(metaclass=JSONRPCServerType):
)
new_txo = tx.outputs[0]
new_txo.script.generate()
tx._reset()
if channel:
new_txo.sign(channel)
await tx.sign(funding_accounts)
@@ -4000,15 +3987,18 @@ class Daemon(metaclass=JSONRPCServerType):
return await self.jsonrpc_stream_abandon(*args, **kwargs)
@requires(WALLET_COMPONENT)
def jsonrpc_collection_list(self, resolve_claims=0, account_id=None, wallet_id=None, page=None, page_size=None):
def jsonrpc_collection_list(
self, resolve_claims=0, resolve=False, account_id=None,
wallet_id=None, page=None, page_size=None):
"""
List my collection claims.
Usage:
collection_list [--resolve_claims=<resolve_claims>] [<account_id> | --account_id=<account_id>]
collection_list [--resolve_claims=<resolve_claims>] [--resolve] [<account_id> | --account_id=<account_id>]
[--wallet_id=<wallet_id>] [--page=<page>] [--page_size=<page_size>]
Options:
--resolve : (bool) resolve collection claim
--resolve_claims=<resolve_claims> : (int) resolve every claim
--account_id=<account_id> : (str) id of the account to use
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
@@ -4025,7 +4015,10 @@ class Daemon(metaclass=JSONRPCServerType):
else:
collections = partial(self.ledger.get_collections, wallet=wallet, accounts=wallet.accounts)
collection_count = partial(self.ledger.get_collection_count, wallet=wallet, accounts=wallet.accounts)
return paginate_rows(collections, collection_count, page, page_size, resolve_claims=resolve_claims)
return paginate_rows(
collections, collection_count, page, page_size,
resolve=resolve, resolve_claims=resolve_claims
)
async def jsonrpc_collection_resolve(
self, claim_id=None, url=None, wallet_id=None, page=1, page_size=DEFAULT_PAGE_SIZE):
@@ -4360,6 +4353,7 @@ class Daemon(metaclass=JSONRPCServerType):
claim_id=None, channel_id=None, not_channel_id=None,
name=None, reposted_claim_id=None,
is_spent=False, is_not_spent=False,
has_source=None, has_no_source=None,
is_my_input_or_output=None, exclude_internal_transfers=False,
is_my_output=None, is_not_my_output=None,
is_my_input=None, is_not_my_input=None):
@@ -4367,6 +4361,10 @@ class Daemon(metaclass=JSONRPCServerType):
constraints['is_spent'] = True
elif is_not_spent:
constraints['is_spent'] = False
if has_source:
constraints['has_source'] = True
elif has_no_source:
constraints['has_source'] = False
constraints['exclude_internal_transfers'] = exclude_internal_transfers
if is_my_input_or_output is True:
constraints['is_my_input_or_output'] = True
@@ -4427,7 +4425,7 @@ class Daemon(metaclass=JSONRPCServerType):
"--is_my_input --is_my_output --type=other"
this allows to exclude "change" payments, this
flag can be used in combination with any of the other flags
--include_received_tips : (bool) calculate the amount of tips recieved for claim outputs
--include_received_tips : (bool) calculate the amount of tips received for claim outputs
--account_id=<account_id> : (str) id of the account to query
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
--page=<page> : (int) page to return during paginating
+107 -46
View File
@@ -2,6 +2,7 @@ import json
import time
import asyncio
import logging
from statistics import median
from decimal import Decimal
from typing import Optional, Iterable, Type
from aiohttp.client_exceptions import ContentTypeError
@@ -58,9 +59,12 @@ class MarketFeed:
raise NotImplementedError()
async def get_response(self):
async with aiohttp_request('get', self.url, params=self.params, timeout=self.request_timeout) as response:
async with aiohttp_request(
'get', self.url, params=self.params,
timeout=self.request_timeout, headers={"User-Agent": "lbrynet"}
) as response:
try:
self._last_response = await response.json()
self._last_response = await response.json(content_type=None)
except ContentTypeError as e:
self._last_response = {}
log.warning("Could not parse exchange rate response from %s: %s", self.name, e.message)
@@ -104,10 +108,10 @@ class MarketFeed:
self.event.clear()
class BittrexFeed(MarketFeed):
class BaseBittrexFeed(MarketFeed):
name = "Bittrex"
market = "BTCLBC"
url = "https://api.bittrex.com/v3/markets/LBC-BTC/ticker"
market = None
url = None
fee = 0.0025
def get_rate_from_response(self, json_response):
@@ -116,49 +120,103 @@ class BittrexFeed(MarketFeed):
return 1.0 / float(json_response['lastTradeRate'])
class LBRYFeed(MarketFeed):
name = "lbry.com"
class BittrexBTCFeed(BaseBittrexFeed):
market = "BTCLBC"
url = "https://api.lbry.com/lbc/exchange_rate"
url = "https://api.bittrex.com/v3/markets/LBC-BTC/ticker"
class BittrexUSDFeed(BaseBittrexFeed):
market = "USDLBC"
url = "https://api.bittrex.com/v3/markets/LBC-USD/ticker"
class BaseCryptonatorFeed(MarketFeed):
name = "Cryptonator"
market = None
url = None
def get_rate_from_response(self, json_response):
if 'data' not in json_response:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return 1.0 / json_response['data']['lbc_btc']
class LBRYBTCFeed(LBRYFeed):
market = "USDBTC"
def get_rate_from_response(self, json_response):
if 'data' not in json_response:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return 1.0 / json_response['data']['btc_usd']
class CryptonatorFeed(MarketFeed):
name = "cryptonator.com"
market = "BTCLBC"
url = "https://api.cryptonator.com/api/ticker/btc-lbc"
def get_rate_from_response(self, json_response):
if 'ticker' not in json_response or len(json_response['ticker']) == 0 or \
'success' not in json_response or json_response['success'] is not True:
if 'ticker' not in json_response or 'price' not in json_response['ticker']:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return float(json_response['ticker']['price'])
class CryptonatorBTCFeed(CryptonatorFeed):
market = "USDBTC"
url = "https://api.cryptonator.com/api/ticker/usd-btc"
class CryptonatorBTCFeed(BaseCryptonatorFeed):
market = "BTCLBC"
url = "https://api.cryptonator.com/api/ticker/btc-lbc"
class CryptonatorUSDFeed(BaseCryptonatorFeed):
market = "USDLBC"
url = "https://api.cryptonator.com/api/ticker/usd-lbc"
class BaseCoinExFeed(MarketFeed):
name = "CoinEx"
market = None
url = None
def get_rate_from_response(self, json_response):
if 'data' not in json_response or \
'ticker' not in json_response['data'] or \
'last' not in json_response['data']['ticker']:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return 1.0 / float(json_response['data']['ticker']['last'])
class CoinExBTCFeed(BaseCoinExFeed):
market = "BTCLBC"
url = "https://api.coinex.com/v1/market/ticker?market=LBCBTC"
class CoinExUSDFeed(BaseCoinExFeed):
market = "USDLBC"
url = "https://api.coinex.com/v1/market/ticker?market=LBCUSDT"
class BaseHotbitFeed(MarketFeed):
name = "hotbit"
market = None
url = "https://api.hotbit.io/api/v1/market.last"
def get_rate_from_response(self, json_response):
if 'result' not in json_response:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return 1.0 / float(json_response['result'])
class HotbitBTCFeed(BaseHotbitFeed):
market = "BTCLBC"
params = {"market": "LBC/BTC"}
class HotbitUSDFeed(BaseHotbitFeed):
market = "USDLBC"
params = {"market": "LBC/USDT"}
class UPbitBTCFeed(MarketFeed):
name = "UPbit"
market = "BTCLBC"
url = "https://api.upbit.com/v1/ticker"
params = {"markets": "BTC-LBC"}
def get_rate_from_response(self, json_response):
if len(json_response) != 1 or 'trade_price' not in json_response[0]:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return 1.0 / float(json_response[0]['trade_price'])
FEEDS: Iterable[Type[MarketFeed]] = (
LBRYFeed,
LBRYBTCFeed,
BittrexFeed,
# CryptonatorFeed,
# CryptonatorBTCFeed,
BittrexBTCFeed,
BittrexUSDFeed,
CryptonatorBTCFeed,
CryptonatorUSDFeed,
CoinExBTCFeed,
CoinExUSDFeed,
HotbitBTCFeed,
HotbitUSDFeed,
UPbitBTCFeed,
)
@@ -182,20 +240,23 @@ class ExchangeRateManager:
source.stop()
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,
[market.rate for market in self.market_feeds]
)
if from_currency == to_currency:
return round(amount, 8)
rates = []
for market in self.market_feeds:
if (market.has_rate and market.is_online and
market.rate.currency_pair == (from_currency, to_currency)):
return round(amount * Decimal(market.rate.spot), 8)
for market in self.market_feeds:
if (market.has_rate and market.is_online and
market.rate.currency_pair[0] == from_currency):
return round(self.convert_currency(
market.rate.currency_pair[1], to_currency, amount * Decimal(market.rate.spot)), 8)
rates.append(market.rate.spot)
if rates:
return round(amount * Decimal(median(rates)), 8)
raise CurrencyConversionError(
f'Unable to convert {amount} from {from_currency} to {to_currency}')
+3 -1
View File
@@ -117,9 +117,11 @@ class FileManager:
if claim.stream.source.bt_infohash:
source_manager = self.source_managers['torrent']
existing = source_manager.get_filtered(bt_infohash=claim.stream.source.bt_infohash)
else:
elif claim.stream.source.sd_hash:
source_manager = self.source_managers['stream']
existing = source_manager.get_filtered(sd_hash=claim.stream.source.sd_hash)
else:
raise ResolveError(f"There is nothing to download at {uri} - Source is unknown or unset")
# resume or update an existing stream, if the stream changed: download it and delete the old one after
to_replace, updated_stream = None, None
+4
View File
@@ -303,6 +303,10 @@ class Stream(BaseClaim):
def has_fee(self) -> bool:
return self.message.HasField('fee')
@property
def has_source(self) -> bool:
return self.message.HasField('source')
@property
def source(self) -> Source:
return Source(self.message.source)
+34 -45
View File
@@ -13,57 +13,45 @@ NOT_FOUND = ErrorMessage.Code.Name(ErrorMessage.NOT_FOUND)
BLOCKED = ErrorMessage.Code.Name(ErrorMessage.BLOCKED)
def set_reference(reference, claim_hash, rows):
if claim_hash:
for txo in rows:
if claim_hash == txo['claim_hash']:
reference.tx_hash = txo['txo_hash'][:32]
reference.nout = struct.unpack('<I', txo['txo_hash'][32:])[0]
reference.height = txo['height']
return
def set_reference(reference, txo_row):
if txo_row:
reference.tx_hash = txo_row['txo_hash'][:32]
reference.nout = struct.unpack('<I', txo_row['txo_hash'][32:])[0]
reference.height = txo_row['height']
class Censor:
__slots__ = 'streams', 'channels', 'limit_claims_per_channel', 'censored', 'claims_in_channel', 'total'
NOT_CENSORED = 0
SEARCH = 1
RESOLVE = 2
def __init__(self, streams: dict = None, channels: dict = None, limit_claims_per_channel: int = None):
self.streams = streams or {}
self.channels = channels or {}
self.limit_claims_per_channel = limit_claims_per_channel # doesn't count as censored
__slots__ = 'censor_type', 'censored'
def __init__(self, censor_type):
self.censor_type = censor_type
self.censored = {}
self.claims_in_channel = {}
self.total = 0
def is_censored(self, row):
return (row.get('censor_type') or self.NOT_CENSORED) >= self.censor_type
def apply(self, rows):
return [row for row in rows if not self.censor(row)]
def censor(self, row) -> bool:
was_censored = False
for claim_hash, lookup in (
(row['claim_hash'], self.streams),
(row['claim_hash'], self.channels),
(row['channel_hash'], self.channels),
(row['reposted_claim_hash'], self.streams),
(row['reposted_claim_hash'], self.channels)):
censoring_channel_hash = lookup.get(claim_hash)
if censoring_channel_hash:
was_censored = True
self.censored.setdefault(censoring_channel_hash, 0)
self.censored[censoring_channel_hash] += 1
break
if was_censored:
self.total += 1
if not was_censored and self.limit_claims_per_channel is not None and row['channel_hash']:
self.claims_in_channel.setdefault(row['channel_hash'], 0)
self.claims_in_channel[row['channel_hash']] += 1
if self.claims_in_channel[row['channel_hash']] > self.limit_claims_per_channel:
return True
return was_censored
if self.is_censored(row):
censoring_channel_hash = row['censoring_channel_hash']
self.censored.setdefault(censoring_channel_hash, set())
self.censored[censoring_channel_hash].add(row['tx_hash'])
return True
return False
def to_message(self, outputs: OutputsMessage, extra_txo_rows):
outputs.blocked_total = self.total
def to_message(self, outputs: OutputsMessage, extra_txo_rows: dict):
for censoring_channel_hash, count in self.censored.items():
blocked = outputs.blocked.add()
blocked.count = count
set_reference(blocked.channel, censoring_channel_hash, extra_txo_rows)
blocked.count = len(count)
set_reference(blocked.channel, extra_txo_rows.get(censoring_channel_hash))
outputs.blocked_total += len(count)
class Outputs:
@@ -168,6 +156,7 @@ class Outputs:
@classmethod
def to_bytes(cls, txo_rows, extra_txo_rows, offset=0, total=None, blocked: Censor = None) -> bytes:
extra_txo_rows = {row['claim_hash']: row for row in extra_txo_rows}
page = OutputsMessage()
page.offset = offset
if total is not None:
@@ -176,12 +165,12 @@ class Outputs:
blocked.to_message(page, extra_txo_rows)
for row in txo_rows:
cls.row_to_message(row, page.txos.add(), extra_txo_rows)
for row in extra_txo_rows:
for row in extra_txo_rows.values():
cls.row_to_message(row, page.extra_txos.add(), extra_txo_rows)
return page.SerializeToString()
@classmethod
def row_to_message(cls, txo, txo_message, extra_txo_rows):
def row_to_message(cls, txo, txo_message, extra_row_dict: dict):
if isinstance(txo, Exception):
txo_message.error.text = txo.args[0]
if isinstance(txo, ValueError):
@@ -190,7 +179,7 @@ class Outputs:
txo_message.error.code = ErrorMessage.NOT_FOUND
elif isinstance(txo, ResolveCensoredError):
txo_message.error.code = ErrorMessage.BLOCKED
set_reference(txo_message.error.blocked.channel, txo.censor_hash, extra_txo_rows)
set_reference(txo_message.error.blocked.channel, extra_row_dict.get(txo.censor_hash))
return
txo_message.tx_hash = txo['txo_hash'][:32]
txo_message.nout, = struct.unpack('<I', txo['txo_hash'][32:])
@@ -213,5 +202,5 @@ class Outputs:
txo_message.claim.trending_mixed = txo['trending_mixed']
txo_message.claim.trending_local = txo['trending_local']
txo_message.claim.trending_global = txo['trending_global']
set_reference(txo_message.claim.channel, txo['channel_hash'], extra_txo_rows)
set_reference(txo_message.claim.repost, txo['reposted_claim_hash'], extra_txo_rows)
set_reference(txo_message.claim.channel, extra_row_dict.get(txo['channel_hash']))
set_reference(txo_message.claim.repost, extra_row_dict.get(txo['reposted_claim_hash']))
+8
View File
@@ -55,6 +55,14 @@ class PathSegment(NamedTuple):
def normalized(self):
return normalize_name(self.name)
@property
def is_shortid(self):
return self.claim_id is not None and len(self.claim_id) < 40
@property
def is_fullid(self):
return self.claim_id is not None and len(self.claim_id) == 40
def to_dict(self):
q = {'name': self.name}
if self.claim_id is not None:
+2 -2
View File
@@ -183,11 +183,11 @@ class StreamDescriptor:
raise InvalidStreamDescriptorError("Does not decode as valid JSON")
if decoded['blobs'][-1]['length'] != 0:
raise InvalidStreamDescriptorError("Does not end with a zero-length blob.")
if any([blob_info['length'] == 0 for blob_info in decoded['blobs'][:-1]]):
if any(blob_info['length'] == 0 for blob_info in decoded['blobs'][:-1]):
raise InvalidStreamDescriptorError("Contains zero-length data blob")
if 'blob_hash' in decoded['blobs'][-1]:
raise InvalidStreamDescriptorError("Stream terminator blob should not have a hash")
if any([i != blob_info['blob_num'] for i, blob_info in enumerate(decoded['blobs'])]):
if any(i != blob_info['blob_num'] for i, blob_info in enumerate(decoded['blobs'])):
raise InvalidStreamDescriptorError("Stream contains out of order or skipped blobs")
descriptor = cls(
loop, blob_dir,
+16 -6
View File
@@ -29,7 +29,7 @@ from lbry.extras.daemon.components import (
)
from lbry.extras.daemon.componentmanager import ComponentManager
from lbry.extras.daemon.exchange_rate_manager import (
ExchangeRateManager, ExchangeRate, LBRYFeed, LBRYBTCFeed
ExchangeRateManager, ExchangeRate, BittrexBTCFeed, BittrexUSDFeed
)
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.blob.blob_manager import BlobManager
@@ -84,6 +84,7 @@ class AsyncioTestCase(unittest.TestCase):
# https://bugs.python.org/issue32972
LOOP_SLOW_CALLBACK_DURATION = 0.2
TIMEOUT = 120.0
maxDiff = None
@@ -137,6 +138,8 @@ class AsyncioTestCase(unittest.TestCase):
with outcome.testPartExecutor(self, isTest=True):
maybe_coroutine = testMethod()
if asyncio.iscoroutine(maybe_coroutine):
if self.TIMEOUT:
self.loop.call_later(self.TIMEOUT, self.cancel)
self.loop.run_until_complete(maybe_coroutine)
outcome.expecting_failure = False
with outcome.testPartExecutor(self):
@@ -189,6 +192,12 @@ class AsyncioTestCase(unittest.TestCase):
if asyncio.iscoroutine(maybe_coroutine):
self.loop.run_until_complete(maybe_coroutine)
def cancel(self):
for task in asyncio.all_tasks(self.loop):
if not task.done():
task.print_stack()
task.cancel()
class AdvanceTimeTestCase(AsyncioTestCase):
@@ -282,8 +291,8 @@ class FakeExchangeRateManager(ExchangeRateManager):
def get_fake_exchange_rate_manager(rates=None):
return FakeExchangeRateManager(
[LBRYFeed(), LBRYBTCFeed()],
rates or {'BTCLBC': 3.0, 'USDBTC': 2.0}
[BittrexBTCFeed(), BittrexUSDFeed()],
rates or {'BTCLBC': 3.0, 'USDLBC': 2.0}
)
@@ -410,7 +419,7 @@ class CommandTestCase(IntegrationTestCase):
daemon = Daemon(conf, ComponentManager(
conf, skip_components=conf.components_to_skip, wallet=wallet_maker,
exchange_rate_manager=partial(ExchangeRateManagerComponent, rates={
'BTCLBC': 1.0, 'USDBTC': 2.0
'BTCLBC': 1.0, 'USDLBC': 2.0
})
))
await daemon.initialize()
@@ -439,8 +448,9 @@ class CommandTestCase(IntegrationTestCase):
async def generate(self, blocks):
""" Ask lbrycrd to generate some blocks and wait until ledger has them. """
prepare = self.ledger.on_header.where(self.blockchain.is_expected_block)
await self.blockchain.generate(blocks)
await self.ledger.on_header.where(self.blockchain.is_expected_block)
await prepare # no guarantee that it didn't happen already, so start waiting from before calling generate
async def blockchain_claim_name(self, name: str, value: str, amount: str, confirm=True):
txid = await self.blockchain._cli_cmnd('claimname', name, value, amount)
@@ -480,7 +490,7 @@ class CommandTestCase(IntegrationTestCase):
async def stream_create(
self, name='hovercraft', bid='1.0', file_path=None,
data=b'hi!', confirm=True, prefix=None, suffix=None, **kwargs):
if file_path is None:
if file_path is None and data is not None:
file_path = self.create_upload_file(data=data, prefix=prefix, suffix=suffix)
return await self.confirm_and_render(
self.daemon.jsonrpc_stream_create(name, bid, file_path=file_path, **kwargs), confirm
+1 -5
View File
@@ -105,10 +105,6 @@ def check_connection(server="lbry.com", port=80, timeout=5) -> bool:
return False
async def async_check_connection(server="lbry.com", port=80, timeout=1) -> bool:
return await asyncio.get_event_loop().run_in_executor(None, check_connection, server, port, timeout)
def random_string(length=10, chars=string.ascii_lowercase):
return ''.join([random.choice(chars) for _ in range(length)])
@@ -375,7 +371,7 @@ def get_ssl_context() -> ssl.SSLContext:
@contextlib.asynccontextmanager
async def aiohttp_request(method, url, **kwargs) -> typing.AsyncContextManager[aiohttp.ClientResponse]:
async with aiohttp.ClientSession() as session:
async with session.request(method, url, ssl=get_ssl_context(), **kwargs) as response:
async with session.request(method, url, **kwargs) as response:
yield response
+9 -31
View File
@@ -5,7 +5,6 @@ import logging
import typing
import asyncio
import random
from functools import partial
from hashlib import sha256
from string import hexdigits
from typing import Type, Dict, Tuple, Optional, Any, List
@@ -16,7 +15,7 @@ from lbry.crypto.crypt import aes_encrypt, aes_decrypt
from .bip32 import PrivateKey, PubKey, from_extended_key_string
from .mnemonic import Mnemonic
from .constants import COIN, CLAIM_TYPES, TXO_TYPES
from .constants import COIN, TXO_TYPES
from .transaction import Transaction, Input, Output
if typing.TYPE_CHECKING:
@@ -566,35 +565,14 @@ class Account:
if gap_changed:
self.wallet.save()
async def get_detailed_balance(self, confirmations=0, reserved_subtotals=False, read_only=False):
tips_balance, supports_balance, claims_balance = 0, 0, 0
get_total_balance = partial(self.get_balance, read_only=read_only, confirmations=confirmations,
include_claims=True)
total = await get_total_balance()
if reserved_subtotals:
claims_balance = await get_total_balance(txo_type__in=CLAIM_TYPES)
for txo in await self.get_support_summary():
if confirmations > 0 and not 0 < txo.tx_ref.height <= self.ledger.headers.height - (confirmations - 1):
continue
if txo.is_my_input:
supports_balance += txo.amount
else:
tips_balance += txo.amount
reserved = claims_balance + supports_balance + tips_balance
else:
reserved = await self.get_balance(
confirmations=confirmations, include_claims=True, txo_type__gt=0
)
return {
'total': total,
'available': total - reserved,
'reserved': reserved,
'reserved_subtotals': {
'claims': claims_balance,
'supports': supports_balance,
'tips': tips_balance
} if reserved_subtotals else None
}
async def get_detailed_balance(self, confirmations=0, read_only=False):
constraints = {}
if confirmations > 0:
height = self.ledger.headers.height - (confirmations-1)
constraints.update({'height__lte': height, 'height__gt': 0})
return await self.ledger.db.get_detailed_balance(
accounts=[self], read_only=read_only, **constraints
)
def get_transaction_history(self, read_only=False, **constraints):
return self.ledger.get_transaction_history(
+48 -4
View File
@@ -18,7 +18,7 @@ from .constants import TXO_TYPES, CLAIM_TYPES
from .util import date_to_julian_day
from concurrent.futures.thread import ThreadPoolExecutor # pylint: disable=wrong-import-order
if platform.system() == 'Windows' or 'ANDROID_ARGUMENT' or 'KIVY_BUILD' in os.environ:
if platform.system() == 'Windows' or ({'ANDROID_ARGUMENT', 'KIVY_BUILD'} & os.environ.keys()):
from concurrent.futures.thread import ThreadPoolExecutor as ReaderExecutorClass # pylint: disable=reimported
else:
from concurrent.futures.process import ProcessPoolExecutor as ReaderExecutorClass
@@ -446,6 +446,10 @@ class SQLiteMixin:
version = await self.db.execute_fetchone("SELECT version FROM version LIMIT 1;")
if version == (self.SCHEMA_VERSION,):
return
if version == ("1.5",) and self.SCHEMA_VERSION == "1.6":
await self.db.execute("ALTER TABLE txo ADD COLUMN has_source bool DEFAULT 1;")
await self.db.execute("UPDATE version SET version = ?", (self.SCHEMA_VERSION,))
return
await self.db.executescript('\n'.join(
f"DROP TABLE {table};" for table in tables
) + '\n' + 'PRAGMA WAL_CHECKPOINT(FULL);' + '\n' + 'VACUUM;')
@@ -592,7 +596,7 @@ def get_and_reserve_spendable_utxos(transaction: sqlite3.Connection, accounts: L
class Database(SQLiteMixin):
SCHEMA_VERSION = "1.5"
SCHEMA_VERSION = "1.6"
PRAGMAS = """
pragma journal_mode=WAL;
@@ -646,6 +650,7 @@ class Database(SQLiteMixin):
txo_type integer not null default 0,
claim_id text,
claim_name text,
has_source bool,
channel_id text,
reposted_claim_id text
@@ -690,7 +695,8 @@ class Database(SQLiteMixin):
'address': txo.get_address(self.ledger),
'position': txo.position,
'amount': txo.amount,
'script': sqlite3.Binary(txo.script.source)
'script': sqlite3.Binary(txo.script.source),
'has_source': False,
}
if txo.is_claim:
if txo.can_decode_claim:
@@ -698,8 +704,11 @@ class Database(SQLiteMixin):
row['txo_type'] = TXO_TYPES.get(claim.claim_type, TXO_TYPES['stream'])
if claim.is_repost:
row['reposted_claim_id'] = claim.repost.reference.claim_id
row['has_source'] = True
if claim.is_signed:
row['channel_id'] = claim.signing_channel_id
if claim.is_stream:
row['has_source'] = claim.stream.has_source
else:
row['txo_type'] = TXO_TYPES['stream']
elif txo.is_support:
@@ -1015,7 +1024,7 @@ class Database(SQLiteMixin):
if 'order_by' not in constraints or constraints['order_by'] == 'height':
constraints['order_by'] = [
"tx.height=0 DESC", "tx.height DESC", "tx.position DESC", "txo.position"
"tx.height in (0, -1) DESC", "tx.height DESC", "tx.position DESC", "txo.position"
]
elif constraints.get('order_by', None) == 'none':
del constraints['order_by']
@@ -1142,6 +1151,41 @@ class Database(SQLiteMixin):
)
return balance[0]['total'] or 0
async def get_detailed_balance(self, accounts, read_only=False, **constraints):
constraints['accounts'] = accounts
result = (await self.select_txos(
f"COALESCE(SUM(amount), 0) AS total,"
f"COALESCE(SUM("
f" CASE WHEN"
f" txo_type NOT IN ({TXO_TYPES['other']}, {TXO_TYPES['purchase']})"
f" THEN amount ELSE 0 END), 0) AS reserved,"
f"COALESCE(SUM("
f" CASE WHEN"
f" txo_type IN ({','.join(map(str, CLAIM_TYPES))})"
f" THEN amount ELSE 0 END), 0) AS claims,"
f"COALESCE(SUM(CASE WHEN txo_type = {TXO_TYPES['support']} THEN amount ELSE 0 END), 0) AS supports,"
f"COALESCE(SUM("
f" CASE WHEN"
f" txo_type = {TXO_TYPES['support']} AND"
f" TXI.address IS NOT NULL AND"
f" TXI.address IN (SELECT address FROM account_address WHERE account = :$account__in0)"
f" THEN amount ELSE 0 END), 0) AS my_supports",
is_spent=False,
include_is_my_input=True,
read_only=read_only,
**constraints
))[0]
return {
"total": result["total"],
"available": result["total"] - result["reserved"],
"reserved": result["reserved"],
"reserved_subtotals": {
"claims": result["claims"],
"supports": result["my_supports"],
"tips": result["supports"] - result["my_supports"]
}
}
async def select_addresses(self, cols, read_only=False, **constraints):
return await self.db.execute_fetchall(*query(
f"SELECT {cols} FROM pubkey_address JOIN account_address USING (address)",
+7 -4
View File
@@ -538,7 +538,7 @@ class Ledger(metaclass=LedgerRegistry):
"request %i transactions, %i/%i for %s are already synced", len(to_request), len(already_synced),
len(remote_history), address
)
remote_history_txids = set(txid for txid, _ in remote_history)
remote_history_txids = {txid for txid, _ in remote_history}
async for tx in self.request_synced_transactions(to_request, remote_history_txids, address):
pending_synced_history[tx_indexes[tx.id]] = f"{tx.id}:{tx.height}:"
if len(pending_synced_history) % 100 == 0:
@@ -1022,8 +1022,10 @@ class Ledger(metaclass=LedgerRegistry):
claims.append(None)
return claims
async def get_collections(self, resolve_claims=0, **constraints):
async def get_collections(self, resolve_claims=0, resolve=False, **constraints):
collections = await self.db.get_collections(**constraints)
if resolve:
collections = await self._resolve_for_local_results(constraints.get('accounts', []), collections)
if resolve_claims > 0:
for collection in collections:
collection.claims = await self.resolve_collection(collection, page_size=resolve_claims)
@@ -1058,7 +1060,7 @@ class Ledger(metaclass=LedgerRegistry):
'abandon_info': [],
'purchase_info': []
}
is_my_inputs = all([txi.is_my_input for txi in tx.inputs])
is_my_inputs = all(txi.is_my_input for txi in tx.inputs)
if is_my_inputs:
# fees only matter if we are the ones paying them
item['value'] = dewies_to_lbc(tx.net_account_balance + tx.fee)
@@ -1169,7 +1171,7 @@ class Ledger(metaclass=LedgerRegistry):
balance = self._balance_cache.get(account.id)
if not balance:
balance = self._balance_cache[account.id] = \
await account.get_detailed_balance(confirmations, reserved_subtotals=True)
await account.get_detailed_balance(confirmations)
for key, value in balance.items():
if key == 'reserved_subtotals':
for subkey, subvalue in value.items():
@@ -1178,6 +1180,7 @@ class Ledger(metaclass=LedgerRegistry):
result[key] += value
return result
class TestNetLedger(Ledger):
network_name = 'testnet'
pubkey_address_prefix = bytes((111,))
+4
View File
@@ -182,7 +182,9 @@ class WalletManager:
ledger_config = {
'auto_connect': True,
'hub_timeout': config.hub_timeout,
'default_servers': config.lbryum_servers,
'concurrent_hub_requests': config.concurrent_hub_requests,
'data_path': config.wallet_dir,
'tx_cache_size': config.transaction_cache_size
}
@@ -226,6 +228,8 @@ class WalletManager:
self.ledger.config = {
'auto_connect': True,
'default_servers': self.config.lbryum_servers,
'hub_timeout': self.config.hub_timeout,
'concurrent_hub_requests': self.config.concurrent_hub_requests,
'data_path': self.config.wallet_dir,
}
await self.ledger.stop()
+38 -31
View File
@@ -2,6 +2,7 @@ import logging
import asyncio
import json
import socket
import random
from time import perf_counter
from collections import defaultdict
from typing import Dict, Optional, Tuple
@@ -18,7 +19,7 @@ log = logging.getLogger(__name__)
class ClientSession(BaseClientSession):
def __init__(self, *args, network: 'Network', server, timeout=30, **kwargs):
def __init__(self, *args, network: 'Network', server, timeout=30, concurrency=32, **kwargs):
self.network = network
self.server = server
super().__init__(*args, **kwargs)
@@ -28,7 +29,11 @@ class ClientSession(BaseClientSession):
self.response_time: Optional[float] = None
self.connection_latency: Optional[float] = None
self._response_samples = 0
self.pending_amount = 0
self._concurrency = asyncio.Semaphore(concurrency)
@property
def concurrency(self):
return self._concurrency._value
@property
def available(self):
@@ -54,9 +59,9 @@ class ClientSession(BaseClientSession):
return result
async def send_request(self, method, args=()):
self.pending_amount += 1
log.debug("send %s%s to %s:%i (%i timeout)", method, tuple(args), self.server[0], self.server[1], self.timeout)
try:
await self._concurrency.acquire()
if method == 'server.version':
return await self.send_timed_server_version_request(args, self.timeout)
request = asyncio.ensure_future(super().send_request(method, args))
@@ -90,7 +95,7 @@ class ClientSession(BaseClientSession):
# self.synchronous_close()
raise
finally:
self.pending_amount -= 1
self._concurrency.release()
async def ensure_server_version(self, required=None, timeout=3):
required = required or self.network.PROTOCOL_VERSION
@@ -153,7 +158,6 @@ class Network:
# self._switch_task: Optional[asyncio.Task] = None
self.running = False
self.remote_height: int = 0
self._concurrency = asyncio.Semaphore(16)
self._on_connected_controller = StreamController()
self.on_connected = self._on_connected_controller.stream
@@ -218,14 +222,14 @@ class Network:
await asyncio.gather(*(resolve_spv(server, port) for (server, port) in self.config['default_servers']))
return hostname_to_ip, ip_to_hostnames
async def get_n_fastest_spvs(self, n=5, timeout=3.0) -> Dict[Tuple[str, int], SPVPong]:
async def get_n_fastest_spvs(self, timeout=3.0) -> Dict[Tuple[str, int], Optional[SPVPong]]:
loop = asyncio.get_event_loop()
pong_responses = asyncio.Queue()
connection = SPVStatusClientProtocol(pong_responses)
sent_ping_timestamps = {}
_, ip_to_hostnames = await self.resolve_spv_dns()
log.info("%i possible spv servers to try (%i urls in config)", len(ip_to_hostnames),
len(self.config['default_servers']))
n = len(ip_to_hostnames)
log.info("%i possible spv servers to try (%i urls in config)", n, len(self.config['default_servers']))
pongs = {}
try:
await loop.create_datagram_endpoint(lambda: connection, ('0.0.0.0', 0))
@@ -242,24 +246,28 @@ class Network:
pong.available, pong.height)
if pong.available:
pongs[remote] = pong
pongs[(ip_to_hostnames[remote][0], remote[1])] = pong
return pongs
except asyncio.TimeoutError:
if pongs:
log.info("%i/%i probed spv servers are accepting connections", len(pongs), len(ip_to_hostnames))
return pongs
else:
log.warning("%i spv status probes failed, retrying later. servers tried: %s",
len(sent_ping_timestamps),
', '.join('/'.join(hosts) + f' ({ip})' for ip, hosts in ip_to_hostnames.items()))
return pongs
random_server = random.choice(list(ip_to_hostnames.keys()))
host, port = random_server
log.warning("trying fallback to randomly selected spv: %s:%i", host, port)
return {(host, port): None}
finally:
connection.close()
async def connect_to_fastest(self) -> Optional[ClientSession]:
fastest_spvs = await self.get_n_fastest_spvs()
for (host, port) in fastest_spvs:
client = ClientSession(network=self, server=(host, port))
client = ClientSession(network=self, server=(host, port), timeout=self.config['hub_timeout'],
concurrency=self.config['concurrent_hub_requests'])
try:
await client.create_connection()
log.warning("Connected to spv server %s:%i", host, port)
@@ -296,10 +304,13 @@ class Network:
log.info("maintaining connection to spv server %s", server_str)
self._keepalive_task = asyncio.create_task(self.client.keepalive_loop())
try:
await asyncio.wait(
[self._keepalive_task, self._urgent_need_reconnect.wait()],
return_when=asyncio.FIRST_COMPLETED
)
if not self._urgent_need_reconnect.is_set():
await asyncio.wait(
[self._keepalive_task, self._urgent_need_reconnect.wait()],
return_when=asyncio.FIRST_COMPLETED
)
else:
await self._keepalive_task
if self._urgent_need_reconnect.is_set():
log.warning("urgent reconnect needed")
self._urgent_need_reconnect.clear()
@@ -337,18 +348,17 @@ class Network:
raise ConnectionError("Attempting to send rpc request when connection is not available.")
async def retriable_call(self, function, *args, **kwargs):
async with self._concurrency:
while self.running:
if not self.is_connected:
log.warning("Wallet server unavailable, waiting for it to come back and retry.")
self._urgent_need_reconnect.set()
await self.on_connected.first
try:
return await function(*args, **kwargs)
except asyncio.TimeoutError:
log.warning("Wallet server call timed out, retrying.")
except ConnectionError:
log.warning("connection error")
while self.running:
if not self.is_connected:
log.warning("Wallet server unavailable, waiting for it to come back and retry.")
self._urgent_need_reconnect.set()
await self.on_connected.first
try:
return await function(*args, **kwargs)
except asyncio.TimeoutError:
log.warning("Wallet server call timed out, retrying.")
except ConnectionError:
log.warning("connection error")
raise asyncio.CancelledError() # if we got here, we are shutting down
@@ -412,9 +422,6 @@ class Network:
def get_server_features(self):
return self.rpc('server.features', (), restricted=True)
def get_claims_by_ids(self, claim_ids):
return self.rpc('blockchain.claimtrie.getclaimsbyids', claim_ids)
def resolve(self, urls, session_override=None):
return self.rpc('blockchain.claimtrie.resolve', urls, False, session_override)
+11 -2
View File
@@ -11,6 +11,7 @@ import importlib
from binascii import hexlify
from typing import Type, Optional
import urllib.request
from uuid import uuid4
import lbry
from lbry.wallet.server.server import Server
@@ -130,7 +131,9 @@ class WalletNode:
self.ledger_class.get_id(): {
'api_port': self.port,
'default_servers': [(spv_node.hostname, spv_node.port)],
'data_path': self.data_path
'data_path': self.data_path,
'hub_timeout': 30,
'concurrent_hub_requests': 32,
}
},
'wallets': [wallet_file_name]
@@ -168,6 +171,7 @@ class SPVNode:
self.server = None
self.hostname = 'localhost'
self.port = 50001 + node_number # avoid conflict with default daemon
self.udp_port = self.port
self.session_timeout = 600
self.rpc_port = '0' # disabled by default
@@ -182,10 +186,13 @@ class SPVNode:
'REORG_LIMIT': '100',
'HOST': self.hostname,
'TCP_PORT': str(self.port),
'UDP_PORT': str(self.udp_port),
'SESSION_TIMEOUT': str(self.session_timeout),
'MAX_QUERY_WORKERS': '0',
'INDIVIDUAL_TAG_INDEXES': '',
'RPC_PORT': self.rpc_port
'RPC_PORT': self.rpc_port,
'ES_INDEX_PREFIX': uuid4().hex,
'ES_MODE': 'writer',
}
if extraconf:
conf.update(extraconf)
@@ -197,6 +204,8 @@ class SPVNode:
async def stop(self, cleanup=True):
try:
await self.server.db.search_index.delete_index()
await self.server.db.search_index.stop()
await self.server.stop()
finally:
cleanup and self.cleanup()
-3
View File
@@ -108,9 +108,6 @@ class Response:
class CodeMessageError(Exception):
def __init__(self, code, message):
super().__init__(code, message)
@property
def code(self):
return self.args[0]
+3
View File
@@ -32,10 +32,13 @@ import inspect
# other_params: None means cannot be called with keyword arguments only
# any means any name is good
from functools import lru_cache
SignatureInfo = namedtuple('SignatureInfo', 'min_args max_args '
'required_names other_names')
@lru_cache(256)
def signature_info(func):
params = inspect.signature(func).parameters
min_args = max_args = 0
+18 -24
View File
@@ -5,7 +5,6 @@ from concurrent.futures.thread import ThreadPoolExecutor
from typing import Optional
from prometheus_client import Gauge, Histogram
import lbry
from lbry.schema.claim import Claim
from lbry.wallet.server.db.writer import SQLDB
from lbry.wallet.server.daemon import DaemonError
from lbry.wallet.server.hash import hash_to_hex_str, HASHX_LEN
@@ -215,6 +214,8 @@ class BlockProcessor:
if hprevs == chain:
start = time.perf_counter()
await self.run_in_thread_with_lock(self.advance_blocks, blocks)
if self.sql:
await self.db.search_index.claim_consumer(self.sql.claim_producer())
for cache in self.search_cache.values():
cache.clear()
self.history_cache.clear()
@@ -228,6 +229,9 @@ class BlockProcessor:
s = '' if len(blocks) == 1 else 's'
self.logger.info('processed {:,d} block{} in {:.1f}s'.format(len(blocks), s, processed_time))
if self._caught_up_event.is_set():
if self.sql:
await self.db.search_index.apply_filters(self.sql.blocked_streams, self.sql.blocked_channels,
self.sql.filtered_streams, self.sql.filtered_channels)
await self.notifications.on_block(self.touched, self.height)
self.touched = set()
elif hprevs[0] != chain[0]:
@@ -282,7 +286,6 @@ class BlockProcessor:
await self.run_in_thread_with_lock(flush_backup)
last -= len(raw_blocks)
await self.run_in_thread_with_lock(self.db.sql.delete_claims_above_height, self.height)
await self.prefetcher.reset_height(self.height)
self.reorg_count_metric.inc()
except:
@@ -602,8 +605,7 @@ class BlockProcessor:
# Key: b'h' + compressed_tx_hash + tx_idx + tx_num
# Value: hashX
prefix = b'h' + tx_hash[:4] + idx_packed
candidates = {db_key: hashX for db_key, hashX
in self.db.utxo_db.iterator(prefix=prefix)}
candidates = dict(self.db.utxo_db.iterator(prefix=prefix))
for hdb_key, hashX in candidates.items():
tx_num_packed = hdb_key[-4:]
if len(candidates) > 1:
@@ -651,7 +653,11 @@ class BlockProcessor:
self.reorg_count = 0
else:
blocks = self.prefetcher.get_prefetched_blocks()
await self.check_and_advance_blocks(blocks)
try:
await self.check_and_advance_blocks(blocks)
except Exception:
self.logger.exception("error while processing txs")
raise
async def _first_caught_up(self):
self.logger.info(f'caught up to height {self.height}')
@@ -782,15 +788,17 @@ class LBRYBlockProcessor(BlockProcessor):
self.timer = Timer('BlockProcessor')
def advance_blocks(self, blocks):
self.sql.begin()
if self.sql:
self.sql.begin()
try:
self.timer.run(super().advance_blocks, blocks)
except:
self.logger.exception(f'Error while advancing transaction in new block.')
raise
finally:
self.sql.commit()
if self.db.first_sync and self.height == self.daemon.cached_height():
if self.sql:
self.sql.commit()
if self.sql and self.db.first_sync and self.height == self.daemon.cached_height():
self.timer.run(self.sql.execute, self.sql.SEARCH_INDEXES, timer_name='executing SEARCH_INDEXES')
if self.env.individual_tag_indexes:
self.timer.run(self.sql.execute, self.sql.TAG_INDEXES, timer_name='executing TAG_INDEXES')
@@ -799,22 +807,8 @@ class LBRYBlockProcessor(BlockProcessor):
def advance_txs(self, height, txs, header, block_hash):
timer = self.timer.sub_timers['advance_blocks']
undo = timer.run(super().advance_txs, height, txs, header, block_hash, timer_name='super().advance_txs')
timer.run(self.sql.advance_txs, height, txs, header, self.daemon.cached_height(), forward_timer=True)
if self.sql:
timer.run(self.sql.advance_txs, height, txs, header, self.daemon.cached_height(), forward_timer=True)
if (height % 10000 == 0 or not self.db.first_sync) and self.logger.isEnabledFor(10):
self.timer.show(height=height)
return undo
def _checksig(self, value, address):
try:
claim_dict = Claim.from_bytes(value)
cert_id = claim_dict.signing_channel_hash
if not self.should_validate_signatures:
return cert_id
if cert_id:
cert_claim = self.db.get_claim_info(cert_id)
if cert_claim:
certificate = Claim.from_bytes(cert_claim.value)
claim_dict.validate_signature(address, certificate)
return cert_id
except Exception:
pass
+3 -1
View File
@@ -8,7 +8,7 @@ from lbry.wallet.server.server import Server
def get_argument_parser():
parser = argparse.ArgumentParser(
prog="torba-server"
prog="lbry-hub"
)
parser.add_argument("spvserver", type=str, help="Python class path to SPV server implementation.",
nargs="?", default="lbry.wallet.server.coin.LBC")
@@ -27,6 +27,8 @@ def main():
coin_class = get_coin_class(args.spvserver)
logging.basicConfig(level=logging.INFO)
logging.info('lbry.server starting')
logging.getLogger('aiohttp').setLevel(logging.WARNING)
logging.getLogger('elasticsearch').setLevel(logging.WARNING)
try:
server = Server(Env(coin_class))
server.run()
+3 -2
View File
@@ -1,7 +1,8 @@
CLAIM_TYPES = {
'stream': 1,
'channel': 2,
'repost': 3
'repost': 3,
'collection': 4,
}
STREAM_TYPES = {
@@ -10,7 +11,7 @@ STREAM_TYPES = {
'image': 3,
'document': 4,
'binary': 5,
'model': 6
'model': 6,
}
# 9/21/2020
@@ -0,0 +1 @@
from .search import SearchIndex
@@ -0,0 +1,61 @@
INDEX_DEFAULT_SETTINGS = {
"settings":
{"analysis":
{"analyzer": {
"default": {"tokenizer": "whitespace", "filter": ["lowercase", "porter_stem"]}}},
"index":
{"refresh_interval": -1,
"number_of_shards": 1,
"number_of_replicas": 0,
"sort": {
"field": ["trending_mixed", "release_time"],
"order": ["desc", "desc"]
}}
},
"mappings": {
"properties": {
"claim_id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text",
"index_prefixes": {
"min_chars": 1,
"max_chars": 10
}
},
"height": {"type": "integer"},
"claim_type": {"type": "byte"},
"censor_type": {"type": "byte"},
"trending_mixed": {"type": "float"},
"release_time": {"type": "long"},
}
}
}
FIELDS = {'is_controlling', 'last_take_over_height', 'claim_id', 'claim_name', 'normalized', 'tx_position', 'amount',
'timestamp', 'creation_timestamp', 'height', 'creation_height', 'activation_height', 'expiration_height',
'release_time', 'short_url', 'canonical_url', 'title', 'author', 'description', 'claim_type', 'reposted',
'stream_type', 'media_type', 'fee_amount', 'fee_currency', 'duration', 'reposted_claim_hash', 'censor_type',
'claims_in_channel', 'channel_join', 'signature_valid', 'effective_amount', 'support_amount',
'trending_group', 'trending_mixed', 'trending_local', 'trending_global', 'channel_id', 'tx_id', 'tx_nout',
'signature', 'signature_digest', 'public_key_bytes', 'public_key_hash', 'public_key_id', '_id', 'tags',
'reposted_claim_id'}
TEXT_FIELDS = {'author', 'canonical_url', 'channel_id', 'claim_name', 'description', 'claim_id',
'media_type', 'normalized', 'public_key_bytes', 'public_key_hash', 'short_url', 'signature',
'signature_digest', 'stream_type', 'title', 'tx_id', 'fee_currency', 'reposted_claim_id', 'tags'}
RANGE_FIELDS = {
'height', 'creation_height', 'activation_height', 'expiration_height',
'timestamp', 'creation_timestamp', 'duration', 'release_time', 'fee_amount',
'tx_position', 'channel_join', 'reposted', 'limit_claims_per_channel',
'amount', 'effective_amount', 'support_amount',
'trending_group', 'trending_mixed', 'censor_type',
'trending_local', 'trending_global',
}
REPLACEMENTS = {
'name': 'normalized',
'txid': 'tx_id',
'claim_hash': '_id'
}
@@ -0,0 +1,590 @@
import asyncio
import struct
from binascii import unhexlify
from collections import Counter, deque
from decimal import Decimal
from operator import itemgetter
from typing import Optional, List, Iterable, Union
from elasticsearch import AsyncElasticsearch, NotFoundError, ConnectionError
from elasticsearch.helpers import async_streaming_bulk
from lbry.crypto.base58 import Base58
from lbry.error import ResolveCensoredError, claim_id as parse_claim_id
from lbry.schema.result import Outputs, Censor
from lbry.schema.tags import clean_tags
from lbry.schema.url import URL, normalize_name
from lbry.utils import LRUCache
from lbry.wallet.server.db.common import CLAIM_TYPES, STREAM_TYPES
from lbry.wallet.server.db.elasticsearch.constants import INDEX_DEFAULT_SETTINGS, REPLACEMENTS, FIELDS, TEXT_FIELDS, \
RANGE_FIELDS
from lbry.wallet.server.util import class_logger
class ChannelResolution(str):
@classmethod
def lookup_error(cls, url):
return LookupError(f'Could not find channel in "{url}".')
class StreamResolution(str):
@classmethod
def lookup_error(cls, url):
return LookupError(f'Could not find claim at "{url}".')
class SearchIndex:
def __init__(self, index_prefix: str, search_timeout=3.0, elastic_host='localhost', elastic_port=9200):
self.search_timeout = search_timeout
self.sync_timeout = 600 # wont hit that 99% of the time, but can hit on a fresh import
self.search_client: Optional[AsyncElasticsearch] = None
self.sync_client: Optional[AsyncElasticsearch] = None
self.index = index_prefix + 'claims'
self.logger = class_logger(__name__, self.__class__.__name__)
self.claim_cache = LRUCache(2 ** 15)
self.short_id_cache = LRUCache(2 ** 17)
self.search_cache = LRUCache(2 ** 17)
self.resolution_cache = LRUCache(2 ** 17)
self._elastic_host = elastic_host
self._elastic_port = elastic_port
async def start(self):
if self.sync_client:
return
hosts = [{'host': self._elastic_host, 'port': self._elastic_port}]
self.sync_client = AsyncElasticsearch(hosts, timeout=self.sync_timeout)
self.search_client = AsyncElasticsearch(hosts, timeout=self.search_timeout)
while True:
try:
await self.sync_client.cluster.health(wait_for_status='yellow')
break
except ConnectionError:
self.logger.warning("Failed to connect to Elasticsearch. Waiting for it!")
await asyncio.sleep(1)
res = await self.sync_client.indices.create(self.index, INDEX_DEFAULT_SETTINGS, ignore=400)
return res.get('acknowledged', False)
def stop(self):
clients = [self.sync_client, self.search_client]
self.sync_client, self.search_client = None, None
return asyncio.ensure_future(asyncio.gather(*(client.close() for client in clients)))
def delete_index(self):
return self.sync_client.indices.delete(self.index, ignore_unavailable=True)
async def _consume_claim_producer(self, claim_producer):
count = 0
for op, doc in claim_producer:
if op == 'delete':
yield {'_index': self.index, '_op_type': 'delete', '_id': doc}
else:
yield extract_doc(doc, self.index)
count += 1
if count % 100 == 0:
self.logger.info("Indexing in progress, %d claims.", count)
self.logger.info("Indexing done for %d claims.", count)
async def claim_consumer(self, claim_producer):
touched = set()
async for ok, item in async_streaming_bulk(self.sync_client, self._consume_claim_producer(claim_producer),
raise_on_error=False):
if not ok:
self.logger.warning("indexing failed for an item: %s", item)
else:
item = item.popitem()[1]
touched.add(item['_id'])
await self.sync_client.indices.refresh(self.index)
self.logger.info("Indexing done.")
def update_filter_query(self, censor_type, blockdict, channels=False):
blockdict = {key[::-1].hex(): value[::-1].hex() for key, value in blockdict.items()}
if channels:
update = expand_query(channel_id__in=list(blockdict.keys()), censor_type=f"<{censor_type}")
else:
update = expand_query(claim_id__in=list(blockdict.keys()), censor_type=f"<{censor_type}")
key = 'channel_id' if channels else 'claim_id'
update['script'] = {
"source": f"ctx._source.censor_type={censor_type}; ctx._source.censoring_channel_hash=params[ctx._source.{key}]",
"lang": "painless",
"params": blockdict
}
return update
async def apply_filters(self, blocked_streams, blocked_channels, filtered_streams, filtered_channels):
if filtered_streams:
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.SEARCH, filtered_streams), slices=4)
await self.sync_client.indices.refresh(self.index)
if filtered_channels:
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.SEARCH, filtered_channels), slices=4)
await self.sync_client.indices.refresh(self.index)
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.SEARCH, filtered_channels, True), slices=4)
await self.sync_client.indices.refresh(self.index)
if blocked_streams:
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.RESOLVE, blocked_streams), slices=4)
await self.sync_client.indices.refresh(self.index)
if blocked_channels:
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.RESOLVE, blocked_channels), slices=4)
await self.sync_client.indices.refresh(self.index)
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.RESOLVE, blocked_channels, True), slices=4)
await self.sync_client.indices.refresh(self.index)
self.search_cache.clear()
self.short_id_cache.clear()
self.claim_cache.clear()
self.resolution_cache.clear()
async def session_query(self, query_name, kwargs):
offset, total = kwargs.get('offset', 0) if isinstance(kwargs, dict) else 0, 0
total_referenced = []
if query_name == 'resolve':
total_referenced, response, censor = await self.resolve(*kwargs)
else:
cache_item = ResultCacheItem.from_cache(str(kwargs), self.search_cache)
if cache_item.result is not None:
return cache_item.result
async with cache_item.lock:
if cache_item.result:
return cache_item.result
censor = Censor(Censor.SEARCH)
if kwargs.get('no_totals'):
response, offset, total = await self.search(**kwargs, censor_type=Censor.NOT_CENSORED)
else:
response, offset, total = await self.search(**kwargs)
censor.apply(response)
total_referenced.extend(response)
if censor.censored:
response, _, _ = await self.search(**kwargs, censor_type=Censor.NOT_CENSORED)
total_referenced.extend(response)
result = Outputs.to_base64(
response, await self._get_referenced_rows(total_referenced), offset, total, censor
)
cache_item.result = result
return result
return Outputs.to_base64(response, await self._get_referenced_rows(total_referenced), offset, total, censor)
async def resolve(self, *urls):
censor = Censor(Censor.RESOLVE)
results = [await self.resolve_url(url) for url in urls]
# just heat the cache
await self.populate_claim_cache(*filter(lambda x: isinstance(x, str), results))
results = [self._get_from_cache_or_error(url, result) for url, result in zip(urls, results)]
censored = [
result if not isinstance(result, dict) or not censor.censor(result)
else ResolveCensoredError(url, result['censoring_channel_hash'])
for url, result in zip(urls, results)
]
return results, censored, censor
def _get_from_cache_or_error(self, url: str, resolution: Union[LookupError, StreamResolution, ChannelResolution]):
cached = self.claim_cache.get(resolution)
return cached or (resolution if isinstance(resolution, LookupError) else resolution.lookup_error(url))
async def get_many(self, *claim_ids):
await self.populate_claim_cache(*claim_ids)
return filter(None, map(self.claim_cache.get, claim_ids))
async def populate_claim_cache(self, *claim_ids):
missing = [claim_id for claim_id in claim_ids if self.claim_cache.get(claim_id) is None]
if missing:
results = await self.search_client.mget(
index=self.index, body={"ids": missing}
)
for result in expand_result(filter(lambda doc: doc['found'], results["docs"])):
self.claim_cache.set(result['claim_id'], result)
async def full_id_from_short_id(self, name, short_id, channel_id=None):
key = '#'.join((channel_id or '', name, short_id))
if key not in self.short_id_cache:
query = {'name': name, 'claim_id': short_id}
if channel_id:
query['channel_id'] = channel_id
query['order_by'] = ['^channel_join']
query['signature_valid'] = True
else:
query['order_by'] = '^creation_height'
result, _, _ = await self.search(**query, limit=1)
if len(result) == 1:
result = result[0]['claim_id']
self.short_id_cache[key] = result
return self.short_id_cache.get(key, None)
async def search(self, **kwargs):
if 'channel' in kwargs:
kwargs['channel_id'] = await self.resolve_url(kwargs.pop('channel'))
if not kwargs['channel_id'] or not isinstance(kwargs['channel_id'], str):
return [], 0, 0
try:
if 'limit_claims_per_channel' in kwargs:
return await self.search_ahead(**kwargs), 0, 0
else:
result = (await self.search_client.search(
expand_query(**kwargs), index=self.index,
track_total_hits=False if kwargs.get('no_totals') else 10_000
))['hits']
except NotFoundError:
return [], 0, 0
return expand_result(result['hits']), 0, result.get('total', {}).get('value', 0)
async def search_ahead(self, **kwargs):
# 'limit_claims_per_channel' case. Fetch 1000 results, reorder, slice, inflate and return
per_channel_per_page = kwargs.pop('limit_claims_per_channel')
page_size = kwargs.pop('limit', 10)
offset = kwargs.pop('offset', 0)
kwargs['limit'] = 1000
cache_item = ResultCacheItem.from_cache(f"ahead{per_channel_per_page}{kwargs}", self.search_cache)
if cache_item.result is not None:
reordered_hits = cache_item.result
else:
async with cache_item.lock:
if cache_item.result:
reordered_hits = cache_item.result
else:
query = expand_query(**kwargs)
reordered_hits = await self.__search_ahead(query, page_size, per_channel_per_page)
cache_item.result = reordered_hits
return list(await self.get_many(*(claim_id for claim_id, _ in reordered_hits[offset:(offset + page_size)])))
async def __search_ahead(self, query: dict, page_size: int, per_channel_per_page: int):
search_hits = deque((await self.search_client.search(
query, index=self.index, track_total_hits=False, _source_includes=['_id', 'channel_id']
))['hits']['hits'])
reordered_hits = []
channel_counters = Counter()
next_page_hits_maybe_check_later = deque()
while search_hits or next_page_hits_maybe_check_later:
if reordered_hits and len(reordered_hits) % page_size == 0:
channel_counters.clear()
elif not reordered_hits:
pass
else:
break # means last page was incomplete and we are left with bad replacements
for _ in range(len(next_page_hits_maybe_check_later)):
claim_id, channel_id = next_page_hits_maybe_check_later.popleft()
if channel_counters[channel_id] < per_channel_per_page:
reordered_hits.append((claim_id, channel_id))
channel_counters[channel_id] += 1
else:
next_page_hits_maybe_check_later.append((claim_id, channel_id))
while search_hits:
hit = search_hits.popleft()
hit_id, hit_channel_id = hit['_id'], hit['_source']['channel_id']
if hit_channel_id is None:
reordered_hits.append((hit_id, hit_channel_id))
elif channel_counters[hit_channel_id] < per_channel_per_page:
reordered_hits.append((hit_id, hit_channel_id))
channel_counters[hit_channel_id] += 1
if len(reordered_hits) % page_size == 0:
break
else:
next_page_hits_maybe_check_later.append((hit_id, hit_channel_id))
return reordered_hits
async def resolve_url(self, raw_url):
if raw_url not in self.resolution_cache:
self.resolution_cache[raw_url] = await self._resolve_url(raw_url)
return self.resolution_cache[raw_url]
async def _resolve_url(self, raw_url):
try:
url = URL.parse(raw_url)
except ValueError as e:
return e
stream = LookupError(f'Could not find claim at "{raw_url}".')
channel_id = await self.resolve_channel_id(url)
if isinstance(channel_id, LookupError):
return channel_id
stream = (await self.resolve_stream(url, channel_id if isinstance(channel_id, str) else None)) or stream
if url.has_stream:
return StreamResolution(stream)
else:
return ChannelResolution(channel_id)
async def resolve_channel_id(self, url: URL):
if not url.has_channel:
return
if url.channel.is_fullid:
return url.channel.claim_id
if url.channel.is_shortid:
channel_id = await self.full_id_from_short_id(url.channel.name, url.channel.claim_id)
if not channel_id:
return LookupError(f'Could not find channel in "{url}".')
return channel_id
query = url.channel.to_dict()
if set(query) == {'name'}:
query['is_controlling'] = True
else:
query['order_by'] = ['^creation_height']
matches, _, _ = await self.search(**query, limit=1)
if matches:
channel_id = matches[0]['claim_id']
else:
return LookupError(f'Could not find channel in "{url}".')
return channel_id
async def resolve_stream(self, url: URL, channel_id: str = None):
if not url.has_stream:
return None
if url.has_channel and channel_id is None:
return None
query = url.stream.to_dict()
if url.stream.claim_id is not None:
if url.stream.is_fullid:
claim_id = url.stream.claim_id
else:
claim_id = await self.full_id_from_short_id(query['name'], query['claim_id'], channel_id)
return claim_id
if channel_id is not None:
if set(query) == {'name'}:
# temporarily emulate is_controlling for claims in channel
query['order_by'] = ['effective_amount', '^height']
else:
query['order_by'] = ['^channel_join']
query['channel_id'] = channel_id
query['signature_valid'] = True
elif set(query) == {'name'}:
query['is_controlling'] = True
matches, _, _ = await self.search(**query, limit=1)
if matches:
return matches[0]['claim_id']
async def _get_referenced_rows(self, txo_rows: List[dict]):
txo_rows = [row for row in txo_rows if isinstance(row, dict)]
referenced_ids = set(filter(None, map(itemgetter('reposted_claim_id'), txo_rows)))
referenced_ids |= set(filter(None, (row['channel_id'] for row in txo_rows)))
referenced_ids |= set(map(parse_claim_id, filter(None, (row['censoring_channel_hash'] for row in txo_rows))))
referenced_txos = []
if referenced_ids:
referenced_txos.extend(await self.get_many(*referenced_ids))
referenced_ids = set(filter(None, (row['channel_id'] for row in referenced_txos)))
if referenced_ids:
referenced_txos.extend(await self.get_many(*referenced_ids))
return referenced_txos
def extract_doc(doc, index):
doc['claim_id'] = doc.pop('claim_hash')[::-1].hex()
if doc['reposted_claim_hash'] is not None:
doc['reposted_claim_id'] = doc.pop('reposted_claim_hash')[::-1].hex()
else:
doc['reposted_claim_id'] = None
channel_hash = doc.pop('channel_hash')
doc['channel_id'] = channel_hash[::-1].hex() if channel_hash else channel_hash
channel_hash = doc.pop('censoring_channel_hash')
doc['censoring_channel_hash'] = channel_hash[::-1].hex() if channel_hash else channel_hash
txo_hash = doc.pop('txo_hash')
doc['tx_id'] = txo_hash[:32][::-1].hex()
doc['tx_nout'] = struct.unpack('<I', txo_hash[32:])[0]
doc['is_controlling'] = bool(doc['is_controlling'])
doc['signature'] = (doc.pop('signature') or b'').hex() or None
doc['signature_digest'] = (doc.pop('signature_digest') or b'').hex() or None
doc['public_key_bytes'] = (doc.pop('public_key_bytes') or b'').hex() or None
doc['public_key_hash'] = (doc.pop('public_key_hash') or b'').hex() or None
doc['signature_valid'] = bool(doc['signature_valid'])
doc['claim_type'] = doc.get('claim_type', 0) or 0
doc['stream_type'] = int(doc.get('stream_type', 0) or 0)
doc['has_source'] = bool(doc['has_source'])
return {'doc': doc, '_id': doc['claim_id'], '_index': index, '_op_type': 'update', 'doc_as_upsert': True}
def expand_query(**kwargs):
if "amount_order" in kwargs:
kwargs["limit"] = 1
kwargs["order_by"] = "effective_amount"
kwargs["offset"] = int(kwargs["amount_order"]) - 1
if 'name' in kwargs:
kwargs['name'] = normalize_name(kwargs.pop('name'))
if kwargs.get('is_controlling') is False:
kwargs.pop('is_controlling')
query = {'must': [], 'must_not': []}
collapse = None
for key, value in kwargs.items():
key = key.replace('claim.', '')
many = key.endswith('__in') or isinstance(value, list)
if many:
key = key.replace('__in', '')
value = list(filter(None, value))
if value is None or isinstance(value, list) and len(value) == 0:
continue
key = REPLACEMENTS.get(key, key)
if key in FIELDS:
partial_id = False
if key == 'claim_type':
if isinstance(value, str):
value = CLAIM_TYPES[value]
else:
value = [CLAIM_TYPES[claim_type] for claim_type in value]
if key == '_id':
if isinstance(value, Iterable):
value = [item[::-1].hex() for item in value]
else:
value = value[::-1].hex()
if not many and key in ('_id', 'claim_id') and len(value) < 20:
partial_id = True
if key == 'public_key_id':
key = 'public_key_hash'
value = Base58.decode(value)[1:21].hex()
if key == 'signature_valid':
continue # handled later
if key in TEXT_FIELDS:
key += '.keyword'
ops = {'<=': 'lte', '>=': 'gte', '<': 'lt', '>': 'gt'}
if partial_id:
query['must'].append({"prefix": {"claim_id": value}})
elif key in RANGE_FIELDS and isinstance(value, str) and value[0] in ops:
operator_length = 2 if value[:2] in ops else 1
operator, value = value[:operator_length], value[operator_length:]
if key == 'fee_amount':
value = str(Decimal(value)*1000)
query['must'].append({"range": {key: {ops[operator]: value}}})
elif many:
query['must'].append({"terms": {key: value}})
else:
if key == 'fee_amount':
value = str(Decimal(value)*1000)
query['must'].append({"term": {key: {"value": value}}})
elif key == 'not_channel_ids':
for channel_id in value:
query['must_not'].append({"term": {'channel_id.keyword': channel_id}})
query['must_not'].append({"term": {'_id': channel_id}})
elif key == 'channel_ids':
query['must'].append({"terms": {'channel_id.keyword': value}})
elif key == 'claim_ids':
query['must'].append({"terms": {'claim_id.keyword': value}})
elif key == 'media_types':
query['must'].append({"terms": {'media_type.keyword': value}})
elif key == 'stream_types':
query['must'].append({"terms": {'stream_type': [STREAM_TYPES[stype] for stype in value]}})
elif key == 'any_languages':
query['must'].append({"terms": {'languages': clean_tags(value)}})
elif key == 'any_languages':
query['must'].append({"terms": {'languages': value}})
elif key == 'all_languages':
query['must'].extend([{"term": {'languages': tag}} for tag in value])
elif key == 'any_tags':
query['must'].append({"terms": {'tags.keyword': clean_tags(value)}})
elif key == 'all_tags':
query['must'].extend([{"term": {'tags.keyword': tag}} for tag in clean_tags(value)])
elif key == 'not_tags':
query['must_not'].extend([{"term": {'tags.keyword': tag}} for tag in clean_tags(value)])
elif key == 'not_claim_id':
query['must_not'].extend([{"term": {'claim_id.keyword': cid}} for cid in value])
elif key == 'limit_claims_per_channel':
collapse = ('channel_id.keyword', value)
if kwargs.get('has_channel_signature'):
query['must'].append({"exists": {"field": "signature_digest"}})
if 'signature_valid' in kwargs:
query['must'].append({"term": {"signature_valid": bool(kwargs["signature_valid"])}})
elif 'signature_valid' in kwargs:
query.setdefault('should', [])
query["minimum_should_match"] = 1
query['should'].append({"bool": {"must_not": {"exists": {"field": "signature_digest"}}}})
query['should'].append({"term": {"signature_valid": bool(kwargs["signature_valid"])}})
if 'has_source' in kwargs:
query.setdefault('should', [])
query["minimum_should_match"] = 1
is_stream_or_repost = {"terms": {"claim_type": [CLAIM_TYPES['stream'], CLAIM_TYPES['repost']]}}
query['should'].append(
{"bool": {"must": [{"match": {"has_source": kwargs['has_source']}}, is_stream_or_repost]}})
query['should'].append({"bool": {"must_not": [is_stream_or_repost]}})
if kwargs.get('text'):
query['must'].append(
{"simple_query_string":
{"query": kwargs["text"], "fields": [
"claim_name^4", "channel_name^8", "title^1", "description^.5", "author^1", "tags^.5"
]}})
query = {
"_source": {"excludes": ["description", "title"]},
'query': {'bool': query},
"sort": [],
}
if "limit" in kwargs:
query["size"] = kwargs["limit"]
if 'offset' in kwargs:
query["from"] = kwargs["offset"]
if 'order_by' in kwargs:
if isinstance(kwargs["order_by"], str):
kwargs["order_by"] = [kwargs["order_by"]]
for value in kwargs['order_by']:
if 'trending_group' in value:
# fixme: trending_mixed is 0 for all records on variable decay, making sort slow.
continue
is_asc = value.startswith('^')
value = value[1:] if is_asc else value
value = REPLACEMENTS.get(value, value)
if value in TEXT_FIELDS:
value += '.keyword'
query['sort'].append({value: "asc" if is_asc else "desc"})
if collapse:
query["collapse"] = {
"field": collapse[0],
"inner_hits": {
"name": collapse[0],
"size": collapse[1],
"sort": query["sort"]
}
}
return query
def expand_result(results):
inner_hits = []
expanded = []
for result in results:
if result.get("inner_hits"):
for _, inner_hit in result["inner_hits"].items():
inner_hits.extend(inner_hit["hits"]["hits"])
continue
result = result['_source']
result['claim_hash'] = unhexlify(result['claim_id'])[::-1]
if result['reposted_claim_id']:
result['reposted_claim_hash'] = unhexlify(result['reposted_claim_id'])[::-1]
else:
result['reposted_claim_hash'] = None
result['channel_hash'] = unhexlify(result['channel_id'])[::-1] if result['channel_id'] else None
result['txo_hash'] = unhexlify(result['tx_id'])[::-1] + struct.pack('<I', result['tx_nout'])
result['tx_hash'] = unhexlify(result['tx_id'])[::-1]
if result['censoring_channel_hash']:
result['censoring_channel_hash'] = unhexlify(result['censoring_channel_hash'])[::-1]
expanded.append(result)
if inner_hits:
return expand_result(inner_hits)
return expanded
class ResultCacheItem:
__slots__ = '_result', 'lock', 'has_result'
def __init__(self):
self.has_result = asyncio.Event()
self.lock = asyncio.Lock()
self._result = None
@property
def result(self) -> str:
return self._result
@result.setter
def result(self, result: str):
self._result = result
if result is not None:
self.has_result.set()
@classmethod
def from_cache(cls, cache_key, cache):
cache_item = cache.get(cache_key)
if cache_item is None:
cache_item = cache[cache_key] = ResultCacheItem()
return cache_item
+114
View File
@@ -0,0 +1,114 @@
import argparse
import asyncio
import logging
import os
from collections import namedtuple
from multiprocessing import Process
import apsw
from elasticsearch import AsyncElasticsearch
from elasticsearch.helpers import async_bulk
from lbry.wallet.server.env import Env
from lbry.wallet.server.coin import LBC
from lbry.wallet.server.db.elasticsearch.search import extract_doc, SearchIndex
INDEX = 'claims'
async def get_all(db, shard_num, shards_total, limit=0):
logging.info("shard %d starting", shard_num)
def exec_factory(cursor, statement, bindings):
tpl = namedtuple('row', (d[0] for d in cursor.getdescription()))
cursor.setrowtrace(lambda cursor, row: tpl(*row))
return True
db.setexectrace(exec_factory)
total = db.execute(f"select count(*) as total from claim where height % {shards_total} = {shard_num};").fetchone()[0]
for num, claim in enumerate(db.execute(f"""
SELECT claimtrie.claim_hash as is_controlling,
claimtrie.last_take_over_height,
(select group_concat(tag, ',,') from tag where tag.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as tags,
(select group_concat(language, ' ') from language where language.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as languages,
(select cr.has_source from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_has_source,
claim.*
FROM claim LEFT JOIN claimtrie USING (claim_hash)
WHERE claim.height % {shards_total} = {shard_num}
ORDER BY claim.height desc
""")):
claim = dict(claim._asdict())
claim['has_source'] = bool(claim.pop('reposted_has_source') or claim['has_source'])
claim['censor_type'] = 0
claim['censoring_channel_hash'] = None
claim['tags'] = claim['tags'].split(',,') if claim['tags'] else []
claim['languages'] = claim['languages'].split(' ') if claim['languages'] else []
if num % 10_000 == 0:
logging.info("%d/%d", num, total)
yield extract_doc(claim, INDEX)
if 0 < limit <= num:
break
async def consume(producer):
env = Env(LBC)
logging.info("ES sync host: %s:%i", env.elastic_host, env.elastic_port)
es = AsyncElasticsearch([{'host': env.elastic_host, 'port': env.elastic_port}])
try:
await async_bulk(es, producer, request_timeout=120)
await es.indices.refresh(index=INDEX)
finally:
await es.close()
async def make_es_index():
env = Env(LBC)
index = SearchIndex('', elastic_host=env.elastic_host, elastic_port=env.elastic_port)
try:
return await index.start()
finally:
index.stop()
async def run(args, shard):
def itsbusy(*_):
logging.info("shard %d: db is busy, retry", shard)
return True
db = apsw.Connection(args.db_path, flags=apsw.SQLITE_OPEN_READONLY | apsw.SQLITE_OPEN_URI)
db.setbusyhandler(itsbusy)
db.cursor().execute('pragma journal_mode=wal;')
db.cursor().execute('pragma temp_store=memory;')
producer = get_all(db.cursor(), shard, args.clients, limit=args.blocks)
await asyncio.gather(*(consume(producer) for _ in range(min(8, args.clients))))
def __run(args, shard):
asyncio.run(run(args, shard))
def run_elastic_sync():
logging.basicConfig(level=logging.INFO)
logging.getLogger('aiohttp').setLevel(logging.WARNING)
logging.getLogger('elasticsearch').setLevel(logging.WARNING)
logging.info('lbry.server starting')
parser = argparse.ArgumentParser(prog="lbry-hub-elastic-sync")
parser.add_argument("db_path", type=str)
parser.add_argument("-c", "--clients", type=int, default=16)
parser.add_argument("-b", "--blocks", type=int, default=0)
parser.add_argument("-f", "--force", default=False, action='store_true')
args = parser.parse_args()
processes = []
if not args.force and not os.path.exists(args.db_path):
logging.info("DB path doesnt exist")
return
if not args.force and not asyncio.run(make_es_index()):
logging.info("ES is already initialized")
return
for i in range(args.clients):
processes.append(Process(target=__run, args=(args, i)))
processes[-1].start()
for process in processes:
process.join()
process.close()
-52
View File
@@ -1,52 +0,0 @@
from lbry.wallet.database import constraints_to_sql
CREATE_FULL_TEXT_SEARCH = """
create virtual table if not exists search using fts5(
claim_name, channel_name, title, description, author, tags,
content=claim, tokenize=porter
);
"""
FTS_ORDER_BY = "bm25(search, 4.0, 8.0, 1.0, 0.5, 1.0, 0.5)"
def fts_action_sql(claims=None, action='insert'):
select = {
'rowid': "claim.rowid",
'claim_name': "claim.normalized",
'channel_name': "channel.normalized",
'title': "claim.title",
'description': "claim.description",
'author': "claim.author",
'tags': "(select group_concat(tag, ' ') from tag where tag.claim_hash=claim.claim_hash)"
}
if action == 'delete':
select['search'] = '"delete"'
where, values = "", {}
if claims:
where, values = constraints_to_sql({'claim.claim_hash__in': claims})
where = 'WHERE '+where
return f"""
INSERT INTO search ({','.join(select.keys())})
SELECT {','.join(select.values())} FROM claim
LEFT JOIN claim as channel ON (claim.channel_hash=channel.claim_hash) {where}
""", values
def update_full_text_search(action, outputs, db, is_first_sync):
if is_first_sync:
return
if not outputs:
return
if action in ("before-delete", "before-update"):
db.execute(*fts_action_sql(outputs, 'delete'))
elif action in ("after-insert", "after-update"):
db.execute(*fts_action_sql(outputs, 'insert'))
else:
raise ValueError(f"Invalid action for updating full text search: '{action}'")
def first_sync_finished(db):
db.execute(*fts_action_sql())
+98 -29
View File
@@ -1,11 +1,12 @@
import os
import apsw
from typing import Union, Tuple, Set, List
from itertools import chain
from decimal import Decimal
from collections import namedtuple
from multiprocessing import Manager
from binascii import unhexlify
from binascii import unhexlify, hexlify
from lbry.wallet.server.leveldb import LevelDB
from lbry.wallet.server.util import class_logger
from lbry.wallet.database import query, constraints_to_sql
@@ -15,11 +16,10 @@ from lbry.schema.mime_types import guess_stream_type
from lbry.wallet import Ledger, RegTestLedger
from lbry.wallet.transaction import Transaction, Output
from lbry.wallet.server.db.canonical import register_canonical_functions
from lbry.wallet.server.db.full_text_search import update_full_text_search, CREATE_FULL_TEXT_SEARCH, first_sync_finished
from lbry.wallet.server.db.trending import TRENDING_ALGORITHMS
from .common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS, INDEXED_LANGUAGES
from lbry.wallet.server.db.elasticsearch import SearchIndex
ATTRIBUTE_ARRAY_MAX_LENGTH = 100
@@ -55,6 +55,7 @@ class SQLDB:
description text,
claim_type integer,
has_source bool,
reposted integer default 0,
-- streams
@@ -134,6 +135,22 @@ class SQLDB:
create index if not exists claimtrie_claim_hash_idx on claimtrie (claim_hash);
"""
CREATE_CHANGELOG_TRIGGER = """
create table if not exists changelog (
claim_hash bytes primary key
);
create index if not exists claimtrie_claim_hash_idx on claimtrie (claim_hash);
create trigger if not exists claim_changelog after update on claim
begin
insert or ignore into changelog (claim_hash) values (new.claim_hash);
end;
create trigger if not exists claimtrie_changelog after update on claimtrie
begin
insert or ignore into changelog (claim_hash) values (new.claim_hash);
insert or ignore into changelog (claim_hash) values (old.claim_hash);
end;
"""
SEARCH_INDEXES = """
-- used by any tag clouds
create index if not exists tag_tag_idx on tag (tag, claim_hash);
@@ -189,10 +206,10 @@ class SQLDB:
CREATE_TABLES_QUERY = (
CREATE_CLAIM_TABLE +
CREATE_FULL_TEXT_SEARCH +
CREATE_SUPPORT_TABLE +
CREATE_CLAIMTRIE_TABLE +
CREATE_TAG_TABLE +
CREATE_CHANGELOG_TRIGGER +
CREATE_LANGUAGE_TABLE
)
@@ -203,7 +220,6 @@ class SQLDB:
self.db = None
self.logger = class_logger(__name__, self.__class__.__name__)
self.ledger = Ledger if main.coin.NET == 'mainnet' else RegTestLedger
self._fts_synced = False
self.state_manager = None
self.blocked_streams = None
self.blocked_channels = None
@@ -216,6 +232,7 @@ class SQLDB:
unhexlify(channel_id)[::-1] for channel_id in filtering_channels if channel_id
}
self.trending = trending
self.pending_deletes = set()
def open(self):
self.db = apsw.Connection(
@@ -354,6 +371,7 @@ class SQLDB:
'author': None,
'duration': None,
'claim_type': None,
'has_source': False,
'stream_type': None,
'media_type': None,
'release_time': None,
@@ -371,6 +389,7 @@ class SQLDB:
if claim.is_stream:
claim_record['claim_type'] = CLAIM_TYPES['stream']
claim_record['has_source'] = claim.stream.has_source
claim_record['media_type'] = claim.stream.source.media_type
claim_record['stream_type'] = STREAM_TYPES[guess_stream_type(claim_record['media_type'])]
claim_record['title'] = claim.stream.title
@@ -393,6 +412,8 @@ class SQLDB:
claim_record['reposted_claim_hash'] = claim.repost.reference.claim_hash
elif claim.is_channel:
claim_record['claim_type'] = CLAIM_TYPES['channel']
elif claim.is_collection:
claim_record['claim_type'] = CLAIM_TYPES['collection']
languages[(language, claim_hash)] = (language, claim_hash, tx.height)
@@ -417,14 +438,14 @@ class SQLDB:
claims = self._upsertable_claims(txos, header)
if claims:
self.executemany("""
INSERT OR IGNORE INTO claim (
INSERT OR REPLACE INTO claim (
claim_hash, claim_id, claim_name, normalized, txo_hash, tx_position, amount,
claim_type, media_type, stream_type, timestamp, creation_timestamp,
claim_type, media_type, stream_type, timestamp, creation_timestamp, has_source,
fee_currency, fee_amount, title, description, author, duration, height, reposted_claim_hash,
creation_height, release_time, activation_height, expiration_height, short_url)
VALUES (
:claim_hash, :claim_id, :claim_name, :normalized, :txo_hash, :tx_position, :amount,
:claim_type, :media_type, :stream_type, :timestamp, :timestamp,
:claim_type, :media_type, :stream_type, :timestamp, :timestamp, :has_source,
:fee_currency, :fee_amount, :title, :description, :author, :duration, :height, :reposted_claim_hash, :height,
CASE WHEN :release_time IS NOT NULL THEN :release_time ELSE :timestamp END,
CASE WHEN :normalized NOT IN (SELECT normalized FROM claimtrie) THEN :height END,
@@ -442,7 +463,7 @@ class SQLDB:
UPDATE claim SET
txo_hash=:txo_hash, tx_position=:tx_position, amount=:amount, height=:height,
claim_type=:claim_type, media_type=:media_type, stream_type=:stream_type,
timestamp=:timestamp, fee_amount=:fee_amount, fee_currency=:fee_currency,
timestamp=:timestamp, fee_amount=:fee_amount, fee_currency=:fee_currency, has_source=:has_source,
title=:title, duration=:duration, description=:description, author=:author, reposted_claim_hash=:reposted_claim_hash,
release_time=CASE WHEN :release_time IS NOT NULL THEN :release_time ELSE release_time END
WHERE claim_hash=:claim_hash;
@@ -526,6 +547,7 @@ class SQLDB:
WHERE claim_hash = ?
""", targets
)
return {target[0] for target in targets}
def validate_channel_signatures(self, height, new_claims, updated_claims, spent_claims, affected_channels, timer):
if not new_claims and not updated_claims and not spent_claims:
@@ -692,7 +714,7 @@ class SQLDB:
claim_in_channel.channel_hash=claim.claim_hash
)
WHERE claim_hash = ?
""", [(channel_hash,) for channel_hash in all_channel_keys.keys()])
""", [(channel_hash,) for channel_hash in all_channel_keys])
sub_timer.stop()
sub_timer = timer.add_timer('update blocked claims list')
@@ -799,11 +821,56 @@ class SQLDB:
f"SELECT claim_hash, normalized FROM claim WHERE expiration_height = {height}"
)
def enqueue_changes(self):
for claim in self.execute(f"""
SELECT claimtrie.claim_hash as is_controlling,
claimtrie.last_take_over_height,
(select group_concat(tag, ',,') from tag where tag.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as tags,
(select group_concat(language, ' ') from language where language.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as languages,
(select cr.has_source from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_has_source,
claim.*
FROM claim LEFT JOIN claimtrie USING (claim_hash)
WHERE claim.claim_hash in (SELECT claim_hash FROM changelog)
"""):
claim = claim._asdict()
id_set = set(filter(None, (claim['claim_hash'], claim['channel_hash'], claim['reposted_claim_hash'])))
claim['censor_type'] = 0
claim['censoring_channel_hash'] = None
claim['has_source'] = bool(claim.pop('reposted_has_source') or claim['has_source'])
for reason_id in id_set:
if reason_id in self.blocked_streams:
claim['censor_type'] = 2
claim['censoring_channel_hash'] = self.blocked_streams.get(reason_id)
elif reason_id in self.blocked_channels:
claim['censor_type'] = 2
claim['censoring_channel_hash'] = self.blocked_channels.get(reason_id)
elif reason_id in self.filtered_streams:
claim['censor_type'] = 1
claim['censoring_channel_hash'] = self.filtered_streams.get(reason_id)
elif reason_id in self.filtered_channels:
claim['censor_type'] = 1
claim['censoring_channel_hash'] = self.filtered_channels.get(reason_id)
claim['tags'] = claim['tags'].split(',,') if claim['tags'] else []
claim['languages'] = claim['languages'].split(' ') if claim['languages'] else []
yield 'update', claim
def clear_changelog(self):
self.execute("delete from changelog;")
def claim_producer(self):
while self.pending_deletes:
claim_hash = self.pending_deletes.pop()
yield 'delete', hexlify(claim_hash[::-1]).decode()
for claim in self.enqueue_changes():
yield claim
self.clear_changelog()
def advance_txs(self, height, all_txs, header, daemon_height, timer):
insert_claims = []
update_claims = []
update_claim_hashes = set()
delete_claim_hashes = set()
delete_claim_hashes = self.pending_deletes
insert_supports = []
delete_support_txo_hashes = set()
recalculate_claim_hashes = set() # added/deleted supports, added/updated claim
@@ -872,28 +939,17 @@ class SQLDB:
expire_timer.stop()
r = timer.run
r(update_full_text_search, 'before-delete',
delete_claim_hashes, self.db.cursor(), self.main.first_sync)
affected_channels = r(self.delete_claims, delete_claim_hashes)
r(self.delete_supports, delete_support_txo_hashes)
r(self.insert_claims, insert_claims, header)
r(self.calculate_reposts, insert_claims)
r(update_full_text_search, 'after-insert',
[txo.claim_hash for txo in insert_claims], self.db.cursor(), self.main.first_sync)
r(update_full_text_search, 'before-update',
[txo.claim_hash for txo in update_claims], self.db.cursor(), self.main.first_sync)
r(self.update_claims, update_claims, header)
r(update_full_text_search, 'after-update',
[txo.claim_hash for txo in update_claims], self.db.cursor(), self.main.first_sync)
r(self.validate_channel_signatures, height, insert_claims,
update_claims, delete_claim_hashes, affected_channels, forward_timer=True)
r(self.insert_supports, insert_supports)
r(self.update_claimtrie, height, recalculate_claim_hashes, deleted_claim_names, forward_timer=True)
for algorithm in self.trending:
r(algorithm.run, self.db.cursor(), height, daemon_height, recalculate_claim_hashes)
if not self._fts_synced and self.main.first_sync and height == daemon_height:
r(first_sync_finished, self.db.cursor())
self._fts_synced = True
class LBRYLevelDB(LevelDB):
@@ -905,17 +961,30 @@ class LBRYLevelDB(LevelDB):
for algorithm_name in self.env.trending_algorithms:
if algorithm_name in TRENDING_ALGORITHMS:
trending.append(TRENDING_ALGORITHMS[algorithm_name])
self.sql = SQLDB(
self, path,
self.env.default('BLOCKING_CHANNEL_IDS', '').split(' '),
self.env.default('FILTERING_CHANNEL_IDS', '').split(' '),
trending
if self.env.es_mode == 'reader':
self.logger.info('Index mode: reader')
self.sql = None
else:
self.logger.info('Index mode: writer. Using SQLite db to sync ES')
self.sql = SQLDB(
self, path,
self.env.default('BLOCKING_CHANNEL_IDS', '').split(' '),
self.env.default('FILTERING_CHANNEL_IDS', '').split(' '),
trending
)
# Search index
self.search_index = SearchIndex(
self.env.es_index_prefix, self.env.database_query_timeout, self.env.elastic_host, self.env.elastic_port
)
def close(self):
super().close()
self.sql.close()
if self.sql:
self.sql.close()
async def _open_dbs(self, *args, **kwargs):
await self.search_index.start()
await super()._open_dbs(*args, **kwargs)
self.sql.open()
if self.sql:
self.sql.open()
+6 -1
View File
@@ -33,6 +33,8 @@ class Env:
self.allow_root = self.boolean('ALLOW_ROOT', False)
self.host = self.default('HOST', 'localhost')
self.rpc_host = self.default('RPC_HOST', 'localhost')
self.elastic_host = self.default('ELASTIC_HOST', 'localhost')
self.elastic_port = self.integer('ELASTIC_PORT', 9200)
self.loop_policy = self.set_event_loop_policy()
self.obsolete(['UTXO_MB', 'HIST_MB', 'NETWORK'])
self.db_dir = self.required('DB_DIRECTORY')
@@ -53,10 +55,13 @@ class Env:
coin_name = self.required('COIN').strip()
network = self.default('NET', 'mainnet').strip()
self.coin = Coin.lookup_coin_class(coin_name, network)
self.es_index_prefix = self.default('ES_INDEX_PREFIX', '')
self.es_mode = self.default('ES_MODE', 'writer')
self.cache_MB = self.integer('CACHE_MB', 1200)
self.reorg_limit = self.integer('REORG_LIMIT', self.coin.REORG_LIMIT)
# Server stuff
self.tcp_port = self.integer('TCP_PORT', None)
self.udp_port = self.integer('UDP_PORT', self.tcp_port)
self.ssl_port = self.integer('SSL_PORT', None)
if self.ssl_port:
self.ssl_certfile = self.required('SSL_CERTFILE')
@@ -94,7 +99,7 @@ class Env:
self.identities = [identity
for identity in (clearnet_identity, tor_identity)
if identity is not None]
self.database_query_timeout = float(self.integer('QUERY_TIMEOUT_MS', 250)) / 1000.0
self.database_query_timeout = float(self.integer('QUERY_TIMEOUT_MS', 3000)) / 1000.0
@classmethod
def default(cls, envvar, default):
+21 -4
View File
@@ -12,6 +12,7 @@
import asyncio
import array
import ast
import base64
import os
import time
import zlib
@@ -82,6 +83,7 @@ class LevelDB:
self.utxo_db = None
self.tx_counts = None
self.headers = None
self.encoded_headers = LRUCacheWithMetrics(1 << 21, metric_name='encoded_headers', namespace='wallet_server')
self.last_flush = time.time()
self.logger.info(f'using {self.env.db_engine} for DB backend')
@@ -135,9 +137,7 @@ class LevelDB:
return
def get_headers():
return [
header for header in self.headers_db.iterator(prefix=HEADER_PREFIX, include_key=False)
]
return list(self.headers_db.iterator(prefix=HEADER_PREFIX, include_key=False))
headers = await asyncio.get_event_loop().run_in_executor(self.executor, get_headers)
assert len(headers) - 1 == self.db_height, f"{len(headers)} vs {self.db_height}"
@@ -440,6 +440,16 @@ class LevelDB:
raise IndexError(f'height {height:,d} out of range')
return header
def encode_headers(self, start_height, count, headers):
key = (start_height, count)
if not self.encoded_headers.get(key):
compressobj = zlib.compressobj(wbits=-15, level=1, memLevel=9)
headers = base64.b64encode(compressobj.compress(headers) + compressobj.flush()).decode()
if start_height % 1000 != 0:
return headers
self.encoded_headers[key] = headers
return self.encoded_headers.get(key)
def read_headers(self, start_height, count) -> typing.Tuple[bytes, int]:
"""Requires start_height >= 0, count >= 0. Reads as many headers as
are available starting at start_height up to count. This
@@ -466,7 +476,14 @@ class LevelDB:
tx_height = bisect_right(self.tx_counts, tx_num)
if tx_height > self.db_height:
return None, tx_height
return self.total_transactions[tx_num], tx_height
try:
return self.total_transactions[tx_num], tx_height
except IndexError:
self.logger.exception(
"Failed to access a cached transaction, known bug #3142 "
"should be fixed in #3205"
)
return None, tx_height
def _fs_transactions(self, txids: Iterable[str]):
unpack_be_uint64 = util.unpack_be_uint64
+11 -2
View File
@@ -210,6 +210,15 @@ class MemPool:
return deferred, {prevout: utxo_map[prevout] for prevout in unspent}
async def _mempool_loop(self, synchronized_event):
try:
return await self._refresh_hashes(synchronized_event)
except asyncio.CancelledError:
raise
except Exception as e:
self.logger.exception("MEMPOOL DIED")
raise e
async def _refresh_hashes(self, synchronized_event):
"""Refresh our view of the daemon's mempool."""
while True:
@@ -315,7 +324,7 @@ class MemPool:
for prevout in tx.prevouts
if prevout[0] not in all_hashes)
utxos = await self.api.lookup_utxos(prevouts)
utxo_map = {prevout: utxo for prevout, utxo in zip(prevouts, utxos)}
utxo_map = dict(zip(prevouts, utxos))
return self._accept_transactions(tx_map, utxo_map, touched)
@@ -326,7 +335,7 @@ class MemPool:
async def keep_synchronized(self, synchronized_event):
"""Keep the mempool synchronized with the daemon."""
await asyncio.wait([
self._refresh_hashes(synchronized_event),
self._mempool_loop(synchronized_event),
# self._refresh_histogram(synchronized_event),
self._logging(synchronized_event)
])
+6 -2
View File
@@ -94,6 +94,7 @@ class Server:
self.session_mgr = env.coin.SESSION_MANAGER(
env, db, bp, daemon, mempool, self.shutdown_event
)
self._indexer_task = None
async def start(self):
env = self.env
@@ -111,8 +112,11 @@ class Server:
return _flag.wait()
await self.start_prometheus()
await self.bp.status_server.start(0, bytes.fromhex(self.bp.coin.GENESIS_HASH)[::-1]
, self.env.host, self.env.tcp_port)
if self.env.udp_port:
await self.bp.status_server.start(
0, bytes.fromhex(self.bp.coin.GENESIS_HASH)[::-1],
self.env.host, self.env.udp_port
)
await _start_cancellable(self.bp.fetch_and_process_blocks)
await self.db.populate_header_merkle_cache()
+38 -150
View File
@@ -3,7 +3,6 @@ import ssl
import math
import time
import json
import zlib
import base64
import codecs
import typing
@@ -16,8 +15,10 @@ from asyncio import Event, sleep
from collections import defaultdict
from functools import partial
from binascii import hexlify, unhexlify
from binascii import hexlify
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from elasticsearch import ConnectionTimeout
from prometheus_client import Counter, Info, Histogram, Gauge
import lbry
@@ -25,7 +26,6 @@ from lbry.utils import LRUCacheWithMetrics
from lbry.build_info import BUILD, COMMIT_HASH, DOCKER_TAG
from lbry.wallet.server.block_processor import LBRYBlockProcessor
from lbry.wallet.server.db.writer import LBRYLevelDB
from lbry.wallet.server.db import reader
from lbry.wallet.server.websocket import AdminWebSocket
from lbry.wallet.server.metrics import ServerLoadData, APICallMetrics
from lbry.wallet.rpc.framing import NewlineFramer
@@ -813,9 +813,6 @@ class LBRYSessionManager(SessionManager):
self.running = False
if self.env.websocket_host is not None and self.env.websocket_port is not None:
self.websocket = AdminWebSocket(self)
self.search_cache = self.bp.search_cache
self.search_cache['search'] = LRUCacheWithMetrics(2 ** 14, metric_name='search', namespace=NAMESPACE)
self.search_cache['resolve'] = LRUCacheWithMetrics(2 ** 16, metric_name='resolve', namespace=NAMESPACE)
async def process_metrics(self):
while self.running:
@@ -829,22 +826,11 @@ class LBRYSessionManager(SessionManager):
async def start_other(self):
self.running = True
path = os.path.join(self.env.db_dir, 'claims.db')
args = dict(
initializer=reader.initializer,
initargs=(
self.logger, path, self.env.coin.NET, self.env.database_query_timeout,
self.env.track_metrics, (
self.db.sql.blocked_streams, self.db.sql.blocked_channels,
self.db.sql.filtered_streams, self.db.sql.filtered_channels
)
)
)
if self.env.max_query_workers is not None and self.env.max_query_workers == 0:
self.query_executor = ThreadPoolExecutor(max_workers=1, **args)
self.query_executor = ThreadPoolExecutor(max_workers=1)
else:
self.query_executor = ProcessPoolExecutor(
max_workers=self.env.max_query_workers or max(os.cpu_count(), 4), **args
max_workers=self.env.max_query_workers or max(os.cpu_count(), 4)
)
if self.websocket is not None:
await self.websocket.start()
@@ -897,7 +883,6 @@ class LBRYElectrumX(SessionBase):
'blockchain.transaction.get_height': cls.transaction_get_height,
'blockchain.claimtrie.search': cls.claimtrie_search,
'blockchain.claimtrie.resolve': cls.claimtrie_resolve,
'blockchain.claimtrie.getclaimsbyids': cls.claimtrie_getclaimsbyids,
'blockchain.block.get_server_height': cls.get_server_height,
'mempool.get_fee_histogram': cls.mempool_compact_histogram,
'blockchain.block.headers': cls.block_headers,
@@ -1002,16 +987,6 @@ class LBRYElectrumX(SessionBase):
)
except asyncio.CancelledError:
raise
except reader.SQLiteInterruptedError as error:
metrics = self.get_metrics_or_placeholder_for_api(query_name)
metrics.query_interrupt(start, error.metrics)
self.session_mgr.interrupt_count_metric.inc()
raise RPCError(JSONRPC.QUERY_TIMEOUT, 'sqlite query timed out')
except reader.SQLiteOperationalError as error:
metrics = self.get_metrics_or_placeholder_for_api(query_name)
metrics.query_error(start, error.metrics)
self.session_mgr.db_operational_error_metric.inc()
raise RPCError(JSONRPC.INTERNAL_ERROR, 'query failed to execute')
except Exception:
log.exception("dear devs, please handle this exception better")
metrics = self.get_metrics_or_placeholder_for_api(query_name)
@@ -1028,40 +1003,33 @@ class LBRYElectrumX(SessionBase):
self.session_mgr.pending_query_metric.dec()
self.session_mgr.executor_time_metric.observe(time.perf_counter() - start)
async def run_and_cache_query(self, query_name, function, kwargs):
metrics = self.get_metrics_or_placeholder_for_api(query_name)
metrics.start()
cache = self.session_mgr.search_cache[query_name]
cache_key = str(kwargs)
cache_item = cache.get(cache_key)
if cache_item is None:
cache_item = cache[cache_key] = ResultCacheItem()
elif cache_item.result is not None:
metrics.cache_response()
return cache_item.result
async with cache_item.lock:
if cache_item.result is None:
cache_item.result = await self.run_in_executor(
query_name, function, kwargs
)
else:
metrics = self.get_metrics_or_placeholder_for_api(query_name)
metrics.cache_response()
return cache_item.result
async def run_and_cache_query(self, query_name, kwargs):
start = time.perf_counter()
if isinstance(kwargs, dict):
kwargs['release_time'] = format_release_time(kwargs.get('release_time'))
try:
self.session_mgr.pending_query_metric.inc()
return await self.db.search_index.session_query(query_name, kwargs)
except ConnectionTimeout:
self.session_mgr.interrupt_count_metric.inc()
raise RPCError(JSONRPC.QUERY_TIMEOUT, 'query timed out')
finally:
self.session_mgr.pending_query_metric.dec()
self.session_mgr.executor_time_metric.observe(time.perf_counter() - start)
async def mempool_compact_histogram(self):
return self.mempool.compact_fee_histogram()
async def claimtrie_search(self, **kwargs):
if kwargs:
return await self.run_and_cache_query('search', reader.search_to_bytes, kwargs)
return await self.run_and_cache_query('search', kwargs)
async def claimtrie_resolve(self, *urls):
if urls:
count = len(urls)
try:
self.session_mgr.urls_to_resolve_count_metric.inc(count)
return await self.run_and_cache_query('resolve', reader.resolve_to_bytes, urls)
return await self.run_and_cache_query('resolve', urls)
finally:
self.session_mgr.resolved_url_count_metric.inc(count)
@@ -1078,67 +1046,6 @@ class LBRYElectrumX(SessionBase):
return -1
return None
async def claimtrie_getclaimsbyids(self, *claim_ids):
claims = await self.batched_formatted_claims_from_daemon(claim_ids)
return dict(zip(claim_ids, claims))
async def batched_formatted_claims_from_daemon(self, claim_ids):
claims = await self.daemon.getclaimsbyids(claim_ids)
result = []
for claim in claims:
if claim and claim.get('value'):
result.append(self.format_claim_from_daemon(claim))
return result
def format_claim_from_daemon(self, claim, name=None):
"""Changes the returned claim data to the format expected by lbry and adds missing fields."""
if not claim:
return {}
# this ISO-8859 nonsense stems from a nasty form of encoding extended characters in lbrycrd
# it will be fixed after the lbrycrd upstream merge to v17 is done
# it originated as a fear of terminals not supporting unicode. alas, they all do
if 'name' in claim:
name = claim['name'].encode('ISO-8859-1').decode()
info = self.db.sql.get_claims(claim_id=claim['claimId'])
if not info:
# raise RPCError("Lbrycrd has {} but not lbryumx, please submit a bug report.".format(claim_id))
return {}
address = info.address.decode()
# fixme: temporary
#supports = self.format_supports_from_daemon(claim.get('supports', []))
supports = []
amount = get_from_possible_keys(claim, 'amount', 'nAmount')
height = get_from_possible_keys(claim, 'height', 'nHeight')
effective_amount = get_from_possible_keys(claim, 'effective amount', 'nEffectiveAmount')
valid_at_height = get_from_possible_keys(claim, 'valid at height', 'nValidAtHeight')
result = {
"name": name,
"claim_id": claim['claimId'],
"txid": claim['txid'],
"nout": claim['n'],
"amount": amount,
"depth": self.db.db_height - height + 1,
"height": height,
"value": hexlify(claim['value'].encode('ISO-8859-1')).decode(),
"address": address, # from index
"supports": supports,
"effective_amount": effective_amount,
"valid_at_height": valid_at_height
}
if 'claim_sequence' in claim:
# TODO: ensure that lbrycrd #209 fills in this value
result['claim_sequence'] = claim['claim_sequence']
else:
result['claim_sequence'] = -1
if 'normalized_name' in claim:
result['normalized_name'] = claim['normalized_name'].encode('ISO-8859-1').decode()
return result
def assert_tx_hash(self, value):
'''Raise an RPCError if the value is not a valid transaction
hash.'''
@@ -1149,16 +1056,6 @@ class LBRYElectrumX(SessionBase):
pass
raise RPCError(1, f'{value} should be a transaction hash')
def assert_claim_id(self, value):
'''Raise an RPCError if the value is not a valid claim id
hash.'''
try:
if len(util.hex_to_bytes(value)) == 20:
return
except Exception:
pass
raise RPCError(1, f'{value} should be a claim id hash')
async def subscribe_headers_result(self):
"""The result of a header subscription or notification."""
return self.session_mgr.hsub_results[self.subscribe_headers_raw]
@@ -1275,10 +1172,9 @@ class LBRYElectrumX(SessionBase):
address: the address to subscribe to"""
if len(addresses) > 1000:
raise RPCError(BAD_REQUEST, f'too many addresses in subscription request: {len(addresses)}')
hashXes = [
(self.address_to_hashX(address), address) for address in addresses
return [
await self.hashX_subscribe(self.address_to_hashX(address), address) for address in addresses
]
return [await self.hashX_subscribe(*args) for args in hashXes]
async def address_unsubscribe(self, address):
"""Unsubscribe an address.
@@ -1364,8 +1260,7 @@ class LBRYElectrumX(SessionBase):
headers, count = self.db.read_headers(start_height, count)
if b64:
compressobj = zlib.compressobj(wbits=-15, level=1, memLevel=9)
headers = base64.b64encode(compressobj.compress(headers) + compressobj.flush()).decode()
headers = self.db.encode_headers(start_height, count, headers)
else:
headers = headers.hex()
result = {
@@ -1553,15 +1448,14 @@ class LBRYElectrumX(SessionBase):
else:
batch_result[tx_hash] = [raw_tx, {'block_height': -1}]
def threaded_get_merkle():
if needed_merkles:
for tx_hash, (raw_tx, block_txs, pos, block_height) in needed_merkles.items():
batch_result[tx_hash] = raw_tx, {
'merkle': self._get_merkle_branch(block_txs, pos),
'pos': pos,
'block_height': block_height
}
if needed_merkles:
await asyncio.get_running_loop().run_in_executor(self.db.executor, threaded_get_merkle)
await asyncio.sleep(0) # heavy call, give other tasks a chance
self.session_mgr.tx_replied_count_metric.inc(len(tx_hashes))
return batch_result
@@ -1616,26 +1510,20 @@ class LocalRPC(SessionBase):
return 'RPC'
class ResultCacheItem:
__slots__ = '_result', 'lock', 'has_result'
def __init__(self):
self.has_result = asyncio.Event()
self.lock = asyncio.Lock()
self._result = None
@property
def result(self) -> str:
return self._result
@result.setter
def result(self, result: str):
self._result = result
if result is not None:
self.has_result.set()
def get_from_possible_keys(dictionary, *keys):
for key in keys:
if key in dictionary:
return dictionary[key]
def format_release_time(release_time):
# round release time to 1000 so it caches better
# also set a default so we dont show claims in the future
def roundup_time(number, factor=360):
return int(1 + int(number / factor)) * factor
if isinstance(release_time, str) and len(release_time) > 0:
time_digits = ''.join(filter(str.isdigit, release_time))
time_prefix = release_time[:-len(time_digits)]
return time_prefix + str(roundup_time(int(time_digits)))
elif isinstance(release_time, int):
return roundup_time(release_time)
+12 -5
View File
@@ -138,7 +138,7 @@ class StatusServer:
self._protocol: Optional[SPVServerStatusProtocol] = None
async def start(self, height: int, tip: bytes, interface: str, port: int):
if self._protocol:
if self.is_running:
return
loop = asyncio.get_event_loop()
self._protocol = SPVServerStatusProtocol(height, tip)
@@ -147,18 +147,25 @@ class StatusServer:
log.info("started udp status server on %s:%i", interface, port)
def stop(self):
if self._protocol:
if self.is_running:
self._protocol.close()
self._protocol = None
@property
def is_running(self):
return self._protocol is not None
def set_unavailable(self):
self._protocol.set_unavailable()
if self.is_running:
self._protocol.set_unavailable()
def set_available(self):
self._protocol.set_available()
if self.is_running:
self._protocol.set_available()
def set_height(self, height: int, tip: bytes):
self._protocol.set_height(height, tip)
if self.is_running:
self._protocol.set_height(height, tip)
class SPVStatusClientProtocol(asyncio.DatagramProtocol):
+1
View File
@@ -850,6 +850,7 @@ class Transaction:
return hash_type
async def sign(self, funding_accounts: Iterable['Account']):
self._reset()
ledger, wallet = self.ensure_all_have_same_ledger_and_wallet(funding_accounts)
for i, txi in enumerate(self._inputs):
assert txi.script is not None
+1 -1
View File
@@ -64,7 +64,7 @@ async def checkcontrolling(daemon: Daemon, db: SQLDB):
if __name__ == '__main__':
if not len(sys.argv) == 3:
if len(sys.argv) != 3:
print("usage: <db_file_path> <lbrycrd_url>")
sys.exit(1)
db_path, lbrycrd_url = sys.argv[1:] # pylint: disable=W0632
-177
View File
@@ -1,177 +0,0 @@
import os
import time
import textwrap
import argparse
import asyncio
import logging
from concurrent.futures.process import ProcessPoolExecutor
from lbry.wallet.server.db.reader import search_to_bytes, initializer, _get_claims, interpolate
from lbry.wallet.ledger import MainNetLedger
log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler())
log.setLevel(logging.CRITICAL)
DEFAULT_ANY_TAGS = [
'blockchain',
'news',
'learning',
'technology',
'automotive',
'economics',
'food',
'science',
'art',
'nature'
]
COMMON_AND_RARE = [
'gaming',
'ufos'
]
COMMON_AND_RARE2 = [
'city fix',
'gaming'
]
RARE_ANY_TAGS = [
'city fix',
'ufos',
]
CITY_FIX = [
'city fix'
]
MATURE_TAGS = [
'porn',
'nsfw',
'mature',
'xxx'
]
ORDER_BY = [
[
"trending_global",
"trending_mixed",
],
[
"release_time"
],
[
"effective_amount"
]
]
def get_args(limit=20):
args = []
any_tags_combinations = [DEFAULT_ANY_TAGS, COMMON_AND_RARE, RARE_ANY_TAGS, COMMON_AND_RARE2, CITY_FIX, []]
not_tags_combinations = [MATURE_TAGS, []]
for no_fee in [False, True]:
for claim_type in [None, 'stream', 'channel']:
for no_totals in [True]:
for offset in [0, 100]:
for any_tags in any_tags_combinations:
for not_tags in not_tags_combinations:
for order_by in ORDER_BY:
kw = {
'order_by': order_by,
'offset': offset,
'limit': limit,
'no_totals': no_totals
}
if not_tags:
kw['not_tags'] = not_tags
if any_tags:
kw['any_tags'] = any_tags
if claim_type:
kw['claim_type'] = claim_type
if no_fee:
kw['fee_amount'] = 0
args.append(kw)
print(f"-- Trying {len(args)} argument combinations")
return args
def _search(kwargs):
start = time.perf_counter()
error = None
try:
search_to_bytes(kwargs)
except Exception as err:
error = str(err)
return time.perf_counter() - start, kwargs, error
async def search(executor, kwargs):
return await asyncio.get_running_loop().run_in_executor(
executor, _search, kwargs
)
async def main(db_path, max_query_time):
args = dict(initializer=initializer, initargs=(log, db_path, MainNetLedger, 0.25))
workers = max(os.cpu_count(), 4)
log.info(f"using {workers} reader processes")
query_executor = ProcessPoolExecutor(workers, **args)
tasks = [search(query_executor, constraints) for constraints in get_args()]
try:
results = await asyncio.gather(*tasks)
query_times = [
{
'sql': interpolate(*_get_claims("""
claimtrie.claim_hash as is_controlling,
claimtrie.last_take_over_height,
claim.claim_hash, claim.txo_hash,
claim.claims_in_channel,
claim.height, claim.creation_height,
claim.activation_height, claim.expiration_height,
claim.effective_amount, claim.support_amount,
claim.trending_group, claim.trending_mixed,
claim.trending_local, claim.trending_global,
claim.short_url, claim.canonical_url,
claim.channel_hash, channel.txo_hash AS channel_txo_hash,
channel.height AS channel_height, claim.signature_valid
""", **constraints)),
'duration': ts,
'error': error
}
for ts, constraints, error in results
]
errored = [query_info for query_info in query_times if query_info['error']]
errors = {str(query_info['error']): [] for query_info in errored}
for error in errored:
errors[str(error['error'])].append(error['sql'])
slow = [
query_info for query_info in query_times
if not query_info['error'] and query_info['duration'] > (max_query_time / 2.0)
]
fast = [
query_info for query_info in query_times
if not query_info['error'] and query_info['duration'] <= (max_query_time / 2.0)
]
print(f"-- {len(fast)} queries were fast")
slow.sort(key=lambda query_info: query_info['duration'], reverse=True)
print(f"-- Failing queries:")
for error in errors:
print(f"-- Failure: \"{error}\"")
for failing_query in errors[error]:
print(f"{textwrap.dedent(failing_query)};\n")
print()
print(f"-- Slow queries:")
for slow_query in slow:
print(f"-- Query took {slow_query['duration']}\n{textwrap.dedent(slow_query['sql'])};\n")
finally:
query_executor.shutdown()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--db_path', dest='db_path', default=os.path.expanduser('~/claims.db'), type=str)
parser.add_argument('--max_time', dest='max_time', default=0.25, type=float)
args = parser.parse_args()
db_path = args.db_path
max_query_time = args.max_time
asyncio.run(main(db_path, max_query_time))
+20
View File
@@ -365,6 +365,26 @@ class Examples(CommandTestCase):
await self.daemon.jsonrpc_comment_abandon(reply['comment_id'])
# collections
collection = await r(
'Create a collection of one stream',
'collection', 'create',
'--name=tom', '--bid=1.0',
f'--channel_id={channel_id}',
f'--claims={stream_id}'
)
await self.on_transaction_dict(collection)
await self.generate(1)
await self.on_transaction_dict(collection)
await r(
'List collections',
'collection', 'list',
'--resolve', '--resolve_claims=1',
)
# files
file_list_result = (await r(
-62
View File
@@ -1,62 +0,0 @@
import uvloop, asyncio, time, sys, logging
from concurrent.futures import ProcessPoolExecutor
from lbry.wallet.server.db import reader
from lbry.wallet.server.metrics import calculate_avg_percentiles
db_path = '../../../lbryconf/wallet-server/claims.db'
default_query_timout = 0.25
log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler())
async def run_times(executor, iterations, show=True):
start = time.perf_counter()
timings = await asyncio.gather(*(asyncio.get_running_loop().run_in_executor(
executor, reader.search_to_bytes, {
'no_totals': True,
'offset': 0,
'limit': 20,
'any_tags': [
'ufos', 'city fix'
],
'not_tags': [
'porn', 'mature', 'xxx', 'nsfw'
],
'order_by': [
'release_time'
]
}
) for _ in range(iterations)))
timings = [r[1]['execute_query'][0]['total'] for r in timings]
total = int((time.perf_counter() - start) * 100)
if show:
avg = sum(timings)/len(timings)
print(f"{iterations:4}: {total}ms total concurrent, {len(timings)*avg*1000:.3f}s total sequential (avg*runs)")
print(f" {total/len(timings):.1f}ms/query concurrent (total/runs)")
print(f" {avg:.1f}ms/query actual average (sum(queries)/runs)")
stats = calculate_avg_percentiles(timings)
print(f" min: {stats[1]}, 5%: {stats[2]}, 25%: {stats[3]}, 50%: {stats[4]}, 75%: {stats[5]}, 95%: {stats[6]}, max: {stats[7]}")
sys.stdout.write(' sample:')
for i, t in zip(range(10), timings[::-1]):
sys.stdout.write(f' {t}ms')
print(' ...\n' if len(timings) > 10 else '\n')
async def main():
executor = ProcessPoolExecutor(
4, initializer=reader.initializer, initargs=(log, db_path, 'mainnet', 1.0, True)
)
#await run_times(executor, 4, show=False)
#await run_times(executor, 1)
await run_times(executor, 2**3)
await run_times(executor, 2**5)
await run_times(executor, 2**7)
#await run_times(executor, 2**9)
#await run_times(executor, 2**11)
#await run_times(executor, 2**13)
executor.shutdown(True)
if __name__ == '__main__':
uvloop.install()
asyncio.run(main())
+4 -2
View File
@@ -28,8 +28,9 @@ setup(
entry_points={
'console_scripts': [
'lbrynet=lbry.extras.cli:main',
'torba-server=lbry.wallet.server.cli:main',
'lbry-hub=lbry.wallet.server.cli:main',
'orchstr8=lbry.wallet.orchstr8.cli:main',
'lbry-hub-elastic-sync=lbry.wallet.server.db.elasticsearch.sync:run_elastic_sync'
],
},
install_requires=[
@@ -53,7 +54,8 @@ setup(
'coincurve==11.0.0',
'pbkdf2==1.3',
'attrs==18.2.0',
'pylru==1.1.0'
'pylru==1.1.0',
'elasticsearch==7.10.1'
] + PLYVEL,
classifiers=[
'Framework :: AsyncIO',
@@ -114,15 +114,6 @@ class BlockchainReorganizationTests(CommandTestCase):
client_reorg_block_hash = (await self.ledger.headers.hash(208)).decode()
self.assertEqual(client_reorg_block_hash, reorg_block_hash)
# verify the dropped claim is no longer returned by claim search
txos, _, _, _ = await self.ledger.claim_search([], name='hovercraft')
self.assertListEqual(txos, [])
# verify the claim published a block earlier wasn't also reverted
txos, _, _, _ = await self.ledger.claim_search([], name='still-valid')
self.assertEqual(1, len(txos))
self.assertEqual(207, txos[0].tx_ref.height)
# broadcast the claim in a different block
new_txid = await self.blockchain.sendrawtransaction(hexlify(broadcast_tx.raw).decode())
self.assertEqual(broadcast_tx.id, new_txid)
@@ -3,6 +3,7 @@ import tempfile
import logging
import asyncio
from binascii import unhexlify
from unittest import skip
from urllib.request import urlopen
from lbry.error import InsufficientFundsError
@@ -10,6 +11,7 @@ from lbry.extras.daemon.comment_client import verify
from lbry.extras.daemon.daemon import DEFAULT_PAGE_SIZE
from lbry.testcase import CommandTestCase
from lbry.wallet.orchstr8.node import SPVNode
from lbry.wallet.transaction import Transaction
from lbry.wallet.util import satoshis_to_coins as lbc
@@ -72,9 +74,22 @@ class ClaimSearchCommand(ClaimTestCase):
for claim, result in zip(claims, results):
self.assertEqual(
(claim['txid'], self.get_claim_id(claim)),
(result['txid'], result['claim_id'])
(result['txid'], result['claim_id']),
f"(expected {claim['outputs'][0]['name']}) != (got {result['name']})"
)
async def assertListsClaims(self, claims, **kwargs):
kwargs.setdefault('order_by', 'height')
results = await self.claim_list(**kwargs)
self.assertEqual(len(claims), len(results))
for claim, result in zip(claims, results):
self.assertEqual(
(claim['txid'], self.get_claim_id(claim)),
(result['txid'], result['claim_id']),
f"(expected {claim['outputs'][0]['name']}) != (got {result['name']})"
)
@skip("doesnt happen on ES...?")
async def test_disconnect_on_memory_error(self):
claim_ids = [
'0000000000000000000000000000000000000000',
@@ -94,6 +109,18 @@ class ClaimSearchCommand(ClaimTestCase):
with self.assertRaises(ConnectionResetError):
await self.claim_search(claim_ids=claim_ids)
async def test_claim_search_as_reader_server(self):
node2 = SPVNode(self.conductor.spv_module, node_number=2)
current_prefix = self.conductor.spv_node.server.bp.env.es_index_prefix
await node2.start(self.blockchain, extraconf={'ES_MODE': 'reader', 'ES_INDEX_PREFIX': current_prefix})
self.addCleanup(node2.stop)
self.ledger.network.config['default_servers'] = [(node2.hostname, node2.port)]
await self.ledger.stop()
await self.ledger.start()
channel2 = await self.channel_create('@abc', '0.1', allow_duplicate_name=True)
await asyncio.sleep(1) # fixme: find a way to block on the writer
await self.assertFindsClaims([channel2], name='@abc')
async def test_basic_claim_search(self):
await self.create_channel()
channel_txo = self.channel['outputs'][0]
@@ -134,6 +161,7 @@ class ClaimSearchCommand(ClaimTestCase):
claims = [three, two, signed]
await self.assertFindsClaims(claims, channel_ids=[self.channel_id])
await self.assertFindsClaims(claims, channel=f"@abc#{self.channel_id}")
await self.assertFindsClaims([], channel=f"@inexistent")
await self.assertFindsClaims([three, two, signed2, signed], channel_ids=[channel_id2, self.channel_id])
await self.channel_abandon(claim_id=self.channel_id)
await self.assertFindsClaims([], channel=f"@abc#{self.channel_id}", valid_channel_signature=True)
@@ -157,6 +185,23 @@ class ClaimSearchCommand(ClaimTestCase):
# abandoned stream won't show up for streams in channel search
await self.stream_abandon(txid=signed2['txid'], nout=0)
await self.assertFindsClaims([], channel_ids=[channel_id2])
# resolve by claim ids
await self.assertFindsClaims([three, two], claim_ids=[self.get_claim_id(three), self.get_claim_id(two)])
await self.assertFindsClaims([three], claim_id=self.get_claim_id(three))
await self.assertFindsClaims([three], claim_id=self.get_claim_id(three), text='*')
async def test_source_filter(self):
channel = await self.channel_create('@abc')
no_source = await self.stream_create('no-source', data=None)
normal = await self.stream_create('normal', data=b'normal')
normal_repost = await self.stream_repost(self.get_claim_id(normal), 'normal-repost')
no_source_repost = await self.stream_repost(self.get_claim_id(no_source), 'no-source-repost')
await self.assertFindsClaims([no_source_repost, no_source, channel], has_no_source=True)
await self.assertListsClaims([no_source, channel], has_no_source=True)
await self.assertFindsClaims([normal_repost, normal, channel], has_source=True)
await self.assertListsClaims([no_source_repost, normal_repost, normal], has_source=True)
await self.assertFindsClaims([no_source_repost, normal_repost, normal, no_source, channel])
await self.assertListsClaims([no_source_repost, normal_repost, normal, no_source, channel])
async def test_pagination(self):
await self.create_channel()
@@ -352,6 +397,38 @@ class ClaimSearchCommand(ClaimTestCase):
limit_claims_per_channel=3, claim_type='stream'
)
async def test_limit_claims_per_channel_across_sorted_pages(self):
await self.generate(10)
match = self.assertFindsClaims
channel_id = self.get_claim_id(await self.channel_create('@chan0'))
claims = []
first = await self.stream_create('claim0', channel_id=channel_id)
second = await self.stream_create('claim1', channel_id=channel_id)
for i in range(2, 10):
some_chan = self.get_claim_id(await self.channel_create(f'@chan{i}', bid='0.001'))
claims.append(await self.stream_create(f'claim{i}', bid='0.001', channel_id=some_chan))
last = await self.stream_create('claim10', channel_id=channel_id)
await match(
[first, second, claims[0], claims[1]], page_size=4,
limit_claims_per_channel=3, claim_type='stream', order_by=['^height']
)
# second goes out
await match(
[first, claims[0], claims[1], claims[2]], page_size=4,
limit_claims_per_channel=1, claim_type='stream', order_by=['^height']
)
# second appears, from replacement queue
await match(
[second, claims[3], claims[4], claims[5]], page_size=4, page=2,
limit_claims_per_channel=1, claim_type='stream', order_by=['^height']
)
# last is unaffected, as the limit applies per page
await match(
[claims[6], claims[7], last], page_size=4, page=3,
limit_claims_per_channel=1, claim_type='stream', order_by=['^height']
)
async def test_claim_type_and_media_type_search(self):
# create an invalid/unknown claim
address = await self.account.receiving.get_or_create_usable_address()
@@ -365,6 +442,7 @@ class ClaimSearchCommand(ClaimTestCase):
video = await self.stream_create('chrome', file_path=self.video_file_name)
image = await self.stream_create('blank-image', data=self.image_data, suffix='.png')
repost = await self.stream_repost(self.get_claim_id(image))
collection = await self.collection_create('a-collection', claims=[self.get_claim_id(video)])
channel = await self.channel_create()
unknown = self.sout(tx)
@@ -372,6 +450,7 @@ class ClaimSearchCommand(ClaimTestCase):
await self.assertFindsClaims([image, video, octet, unknown], claim_type='stream')
await self.assertFindsClaims([channel], claim_type='channel')
await self.assertFindsClaims([repost], claim_type='repost')
await self.assertFindsClaims([collection], claim_type='collection')
# stream_type
await self.assertFindsClaims([octet, unknown], stream_types=['binary'])
@@ -422,10 +501,11 @@ class ClaimSearchCommand(ClaimTestCase):
await self.assertFindsClaims([claim2], text='autobiography')
await self.assertFindsClaims([claim3], text='history')
await self.assertFindsClaims([claim4], text='conspiracy')
await self.assertFindsClaims([], text='conspiracy AND history')
await self.assertFindsClaims([claim4, claim3], text='conspiracy OR history')
await self.assertFindsClaims([claim1, claim4, claim2, claim3], text='documentary')
await self.assertFindsClaims([claim4, claim1, claim2, claim3], text='satoshi')
await self.assertFindsClaims([], text='conspiracy+history')
await self.assertFindsClaims([claim4, claim3], text='conspiracy|history')
await self.assertFindsClaims([claim1, claim4, claim2, claim3], text='documentary', order_by=[])
# todo: check why claim1 and claim2 order changed. used to be ...claim1, claim2...
await self.assertFindsClaims([claim4, claim2, claim1, claim3], text='satoshi', order_by=[])
claim2 = await self.stream_update(
self.get_claim_id(claim2), clear_tags=True, tags=['cloud'],
@@ -904,6 +984,22 @@ class ClaimCommands(ClaimTestCase):
self.assertEqual('0.0', claims[0]['received_tips'])
self.assertEqual('0.0', claims[1]['received_tips'])
async def stream_update_and_wait(self, claim_id, **kwargs):
tx = await self.daemon.jsonrpc_stream_update(claim_id, **kwargs)
await self.ledger.wait(tx)
async def test_claim_list_pending_edits_ordering(self):
stream5_id = self.get_claim_id(await self.stream_create('five'))
stream4_id = self.get_claim_id(await self.stream_create('four'))
stream3_id = self.get_claim_id(await self.stream_create('three'))
stream2_id = self.get_claim_id(await self.stream_create('two'))
stream1_id = self.get_claim_id(await self.stream_create('one'))
await self.assertClaimList([stream1_id, stream2_id, stream3_id, stream4_id, stream5_id])
await self.stream_update_and_wait(stream4_id, title='foo')
await self.assertClaimList([stream4_id, stream1_id, stream2_id, stream3_id, stream5_id])
await self.stream_update_and_wait(stream3_id, title='foo')
await self.assertClaimList([stream4_id, stream3_id, stream1_id, stream2_id, stream5_id])
class ChannelCommands(CommandTestCase):
@@ -1336,6 +1432,11 @@ class StreamCommands(ClaimTestCase):
self.assertEqual(1, blocked['channels'][0]['blocked'])
self.assertTrue(blocked['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
# same search, but details omitted by 'no_totals'
last_result = result
result = await self.out(self.daemon.jsonrpc_claim_search(name='bad_content', no_totals=True))
self.assertEqual(result['items'], last_result['items'])
# search inside channel containing filtered content
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel'))
filtered = result['blocked']
@@ -1345,6 +1446,11 @@ class StreamCommands(ClaimTestCase):
self.assertEqual(1, filtered['channels'][0]['blocked'])
self.assertTrue(filtered['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
# same search, but details omitted by 'no_totals'
last_result = result
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel', no_totals=True))
self.assertEqual(result['items'], last_result['items'])
# content was filtered by not_tag before censoring
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel', not_tags=["good", "bad"]))
self.assertEqual(0, len(result['items']))
@@ -1398,6 +1504,13 @@ class StreamCommands(ClaimTestCase):
self.assertEqual(3, filtered['channels'][0]['blocked'])
self.assertTrue(filtered['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
# same search, but details omitted by 'no_totals'
last_result = result
result = await self.out(
self.daemon.jsonrpc_claim_search(any_tags=['bad-stuff'], order_by=['height'], no_totals=True)
)
self.assertEqual(result['items'], last_result['items'])
# filtered channel should still resolve
result = await self.resolve('lbry://@bad_channel')
self.assertEqual(bad_channel_id, result['claim_id'])
@@ -1842,9 +1955,6 @@ class StreamCommands(ClaimTestCase):
with self.assertRaisesRegex(Exception, "'bid' is a required argument for new publishes."):
await self.daemon.jsonrpc_publish('foo')
with self.assertRaisesRegex(Exception, "'file_path' is a required argument for new publishes."):
await self.daemon.jsonrpc_publish('foo', bid='1.0')
# successfully create stream
with tempfile.NamedTemporaryFile() as file:
file.write(b'hi')
@@ -1887,6 +1997,41 @@ class StreamCommands(ClaimTestCase):
self.assertEqual(claim['value']['languages'], ['uk-UA'])
self.assertEqual(claim['value']['tags'], ['anime'])
# publish a stream with no source
tx5 = await self.publish(
'future-release', bid='0.1', languages='uk-UA', tags=['Anime', 'anime ']
)
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 2)
claim = await self.resolve('lbry://future-release')
self.assertEqual(claim['txid'], tx5['outputs'][0]['txid'])
self.assertNotIn('signing_channel', claim)
self.assertEqual(claim['value']['languages'], ['uk-UA'])
self.assertEqual(claim['value']['tags'], ['anime'])
self.assertNotIn('source', claim['value'])
# change metadata before the release
await self.publish(
'future-release', bid='0.1', tags=['Anime', 'anime ', 'psy-trance'], title='Psy will be over 9000!!!'
)
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 2)
claim = await self.resolve('lbry://future-release')
self.assertEqual(claim['value']['tags'], ['anime', 'psy-trance'])
self.assertEqual(claim['value']['title'], 'Psy will be over 9000!!!')
self.assertNotIn('source', claim['value'])
# update the stream to have a source
tx6 = await self.publish(
'future-release', sd_hash='beef', file_hash='beef',
file_name='blah.mp3', tags=['something-else']
)
claim = await self.resolve('lbry://future-release')
self.assertEqual(claim['txid'], tx6['outputs'][0]['txid'])
self.assertEqual(claim['value']['tags'], ['something-else'])
self.assertEqual(claim['value']['source']['sd_hash'], 'beef')
self.assertEqual(claim['value']['source']['hash'], 'beef')
self.assertEqual(claim['value']['source']['name'], 'blah.mp3')
self.assertEqual(claim['value']['source']['media_type'], 'audio/mpeg')
class SupportCommands(CommandTestCase):
@@ -1974,10 +2119,14 @@ class SupportCommands(CommandTestCase):
self.assertTrue(txs[1]['support_info'][0]['is_tip'])
self.assertTrue(txs[1]['support_info'][0]['is_spent'])
async def test_signed_supports(self):
async def test_signed_supports_with_no_change_txo_regression(self):
# reproduces a bug where transactions did not get properly signed
# if there was no change and just a single output
# lbrycrd returned 'the transaction was rejected by network rules.'
channel_id = self.get_claim_id(await self.channel_create())
stream_id = self.get_claim_id(await self.stream_create())
tx = await self.support_create(stream_id, '0.3', channel_id=channel_id)
tx = await self.support_create(stream_id, '7.967598', channel_id=channel_id)
self.assertEqual(len(tx['outputs']), 1) # must be one to reproduce bug
self.assertTrue(tx['outputs'][0]['is_channel_signature_valid'])
@@ -2023,6 +2172,10 @@ class CollectionCommands(CommandTestCase):
await self.collection_update(claim_id, clear_claims=True, claims=claim_ids[:2])
collections = await self.out(self.daemon.jsonrpc_collection_list())
self.assertEquals(len(collections['items']), 2)
self.assertNotIn('canonical_url', collections['items'][0])
resolved_collections = await self.out(self.daemon.jsonrpc_collection_list(resolve=True))
self.assertIn('canonical_url', resolved_collections['items'][0])
await self.collection_abandon(claim_id)
self.assertItemCount(await self.daemon.jsonrpc_collection_list(), 1)
+30 -1
View File
@@ -4,10 +4,12 @@ import lbry
from unittest.mock import Mock
from lbry.wallet.network import Network
from lbry.wallet.orchstr8 import Conductor
from lbry.wallet.orchstr8.node import SPVNode
from lbry.wallet.rpc import RPCSession
from lbry.wallet.server.udp import StatusServer
from lbry.testcase import IntegrationTestCase, AsyncioTestCase
from lbry.conf import Config
class NetworkTests(IntegrationTestCase):
@@ -79,7 +81,6 @@ class ReconnectTests(IntegrationTestCase):
self.assertFalse(self.ledger.network.is_connected)
await self.ledger.resolve([], ['derp'])
self.assertEqual(50002, self.ledger.network.client.server[1])
await node2.stop(True)
async def test_direct_sync(self):
await self.ledger.stop()
@@ -138,6 +139,19 @@ class ReconnectTests(IntegrationTestCase):
await self.ledger.network.on_connected.first
self.assertTrue(self.ledger.network.is_connected)
async def test_timeout_and_concurrency_propagated_from_config(self):
conf = Config()
self.assertEqual(self.ledger.network.client.timeout, 30)
self.assertEqual(self.ledger.network.client.concurrency, 32)
conf.hub_timeout = 123.0
conf.concurrent_hub_requests = 42
conf.lbryum_servers = self.ledger.config['default_servers']
conf.wallet_dir = self.ledger.config['data_path']
self.manager.config = conf
await self.manager.reset()
self.assertEqual(self.ledger.network.client.timeout, 123)
self.assertEqual(self.ledger.network.client.concurrency, 42)
# async def test_online_but_still_unavailable(self):
# # Edge case. See issue #2445 for context
# self.assertIsNotNone(self.ledger.network.session_pool.fastest_session)
@@ -146,6 +160,21 @@ class ReconnectTests(IntegrationTestCase):
# self.assertIsNone(self.ledger.network.session_pool.fastest_session)
class UDPServerFailDiscoveryTest(AsyncioTestCase):
async def test_wallet_connects_despite_lack_of_udp(self):
conductor = Conductor()
conductor.spv_node.udp_port = '0'
await conductor.start_blockchain()
self.addCleanup(conductor.stop_blockchain)
await conductor.start_spv()
self.addCleanup(conductor.stop_spv)
self.assertFalse(conductor.spv_node.server.bp.status_server.is_running)
await asyncio.wait_for(conductor.start_wallet(), timeout=5)
self.addCleanup(conductor.stop_wallet)
self.assertTrue(conductor.wallet_node.ledger.network.is_connected)
class ServerPickingTestCase(AsyncioTestCase):
async def _make_udp_server(self, port):
s = StatusServer()
@@ -12,7 +12,7 @@ class PurchaseCommandTests(CommandTestCase):
self.merchant_address = await self.blockchain.get_raw_change_address()
async def priced_stream(
self, name='stream', price: Optional[str] = '2.0', currency='LBC', mine=False
self, name='stream', price: Optional[str] = '0.2', currency='LBC', mine=False
) -> Transaction:
kwargs = {}
if price and currency:
@@ -121,6 +121,13 @@ class PurchaseCommandTests(CommandTestCase):
abc_stream = await self.priced_stream('abc')
await self.assertStreamPurchased(abc_stream, lambda: self.daemon.jsonrpc_purchase_create(url='lbry://abc'))
# purchase without valid exchange rate fails
erm = self.daemon.component_manager.get_component('exchange_rate_manager')
for feed in erm.market_feeds:
feed.last_check -= 10_000
with self.assertRaisesRegex(Exception, "Unable to convert 50 from USD to LBC"):
await self.daemon.jsonrpc_purchase_create(claim_id, allow_duplicate_purchase=True)
async def test_purchase_and_transaction_list(self):
self.assertItemCount(await self.daemon.jsonrpc_purchase_list(), 0)
self.assertItemCount(await self.daemon.jsonrpc_transaction_list(), 1)
@@ -177,7 +184,13 @@ class PurchaseCommandTests(CommandTestCase):
await self.generate(1)
await self.ledger.wait(purchase)
await self.assertBalance(self.account, '10.987893')
# confirm that available and reserved take into account purchase received
self.assertEqual(await self.account.get_detailed_balance(), {
'total': 1099789300,
'available': 1098789300,
'reserved': 1000000,
'reserved_subtotals': {'claims': 1000000, 'supports': 0, 'tips': 0}
})
self.assertItemCount(await self.daemon.jsonrpc_utxo_list(), 2)
spend = await self.daemon.jsonrpc_wallet_send('10.5', address2)
@@ -76,7 +76,7 @@ class WalletCommands(CommandTestCase):
}
self.assertIsNone(ledger._balance_cache.get(self.account.id))
query_count += 6
query_count += 2
self.assertEqual(await wallet_balance(), expected)
self.assertEqual(self.ledger.db.db.query_count, query_count)
self.assertEqual(dict_values_to_lbc(ledger._balance_cache.get(self.account.id))['total'], '10.0')
@@ -100,7 +100,7 @@ class WalletCommands(CommandTestCase):
# on_transaction event reset balance cache
query_count = self.ledger.db.db.query_count
self.assertEqual(await wallet_balance(), expected)
query_count += 3 # only one of the accounts changed
query_count += 1 # only one of the accounts changed
self.assertEqual(dict_values_to_lbc(ledger._balance_cache.get(self.account.id))['total'], '9.979893')
self.assertEqual(dict_values_to_lbc(ledger._balance_cache.get(account2.id))['total'], '10.0')
self.assertEqual(self.ledger.db.db.query_count, query_count)
@@ -221,6 +221,20 @@ class FileCommands(CommandTestCase):
file_list = (await self.daemon.jsonrpc_file_list())['items']
self.assertEqual(file_list[0].stream_claim_info.claim.stream.description, claim.stream.description)
async def test_sourceless_content(self):
# claim has no source, then it has one
tx = await self.stream_create('foo', '0.01', data=None)
claim_id = self.get_claim_id(tx)
await self.daemon.jsonrpc_file_delete(claim_name='foo')
response = await self.out(self.daemon.jsonrpc_get('lbry://foo'))
self.assertIn('error', response)
self.assertIn('nothing to download', response['error'])
# source is set (there isn't a way to clear the source field, so we stop here for now)
await self.stream_update(claim_id, data=b'surpriiiiiiiise')
response = await self.out(self.daemon.jsonrpc_get('lbry://foo'))
self.assertNotIn('error', response)
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
async def test_file_list_paginated_output(self):
await self.create_streams_in_range(0, 20)
+1 -1
View File
@@ -36,4 +36,4 @@ class CLIIntegrationTest(AsyncioTestCase):
with contextlib.redirect_stdout(actual_output):
cli.main(["--api", "localhost:5299", "status"])
actual_output = actual_output.getvalue()
self.assertIn("connection_status", actual_output)
self.assertIn("is_running", actual_output)
@@ -5,7 +5,6 @@ from lbry.extras.daemon.exchange_rate_manager import ExchangeRate, ExchangeRateM
class TestExchangeRateManager(AsyncioTestCase):
async def test_exchange_rate_manager(self):
# TODO: re-enable cryptonator.com
manager = ExchangeRateManager(FEEDS)
manager.start()
self.addCleanup(manager.stop)
@@ -16,6 +15,10 @@ class TestExchangeRateManager(AsyncioTestCase):
for feed in manager.market_feeds:
self.assertTrue(feed.is_online)
self.assertIsInstance(feed.rate, ExchangeRate)
lbc = manager.convert_currency('USD', 'LBC', Decimal('0.01'))
self.assertGreaterEqual(lbc, 0.01)
# print(f'{feed.name} - {feed.market} - {feed.rate.spot}')
lbc = manager.convert_currency('USD', 'LBC', Decimal('1.0'))
self.assertGreaterEqual(lbc, 2.0)
self.assertLessEqual(lbc, 10.0)
lbc = manager.convert_currency('BTC', 'LBC', Decimal('0.01'))
self.assertGreaterEqual(lbc, 1_000)
self.assertLessEqual(lbc, 4_000)
+1
View File
@@ -11,6 +11,7 @@ from lbry.extras.daemon.storage import SQLiteStorage
class TestNodePingQueueDiscover(AsyncioTestCase):
TIMEOUT = None # not supported as it advances time
async def test_ping_queue_discover(self):
loop = asyncio.get_event_loop()
loop.set_debug(False)
@@ -1,11 +1,19 @@
import unittest
from aiohttp import ClientSession
from aiohttp.test_utils import make_mocked_request as request
from aiohttp.web import HTTPForbidden
from lbry.testcase import AsyncioTestCase
from lbry.conf import Config
from lbry.extras.daemon.security import is_request_allowed as allowed, ensure_request_allowed as ensure
from lbry.extras.daemon.components import (
DATABASE_COMPONENT, BLOB_COMPONENT, WALLET_COMPONENT, DHT_COMPONENT,
HASH_ANNOUNCER_COMPONENT, FILE_MANAGER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT,
UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT, WALLET_SERVER_PAYMENTS_COMPONENT,
LIBTORRENT_COMPONENT
)
from lbry.extras.daemon.daemon import Daemon
class TestAllowedOrigin(unittest.TestCase):
@@ -51,3 +59,38 @@ class TestAllowedOrigin(unittest.TestCase):
ensure(request('GET', '/', headers={'Origin': 'hackers.com'}), conf)
self.assertIn("'hackers.com' are not allowed", log.output[0])
self.assertIn("'allowed_origin' limits requests to: 'localhost'", log.output[0])
class TestAccessHeaders(AsyncioTestCase):
async def asyncSetUp(self):
conf = Config(allowed_origin='localhost')
conf.data_dir = '/tmp'
conf.share_usage_data = False
conf.api = 'localhost:5299'
conf.components_to_skip = (
DATABASE_COMPONENT, BLOB_COMPONENT, WALLET_COMPONENT, DHT_COMPONENT,
HASH_ANNOUNCER_COMPONENT, FILE_MANAGER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT,
UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT, WALLET_SERVER_PAYMENTS_COMPONENT,
LIBTORRENT_COMPONENT
)
Daemon.component_attributes = {}
self.daemon = Daemon(conf)
await self.daemon.start()
self.addCleanup(self.daemon.stop)
async def test_headers(self):
async with ClientSession() as session:
# OPTIONS
async with session.options('http://localhost:5299') as resp:
self.assertEqual(resp.headers['Access-Control-Allow-Origin'], 'localhost')
self.assertEqual(resp.headers['Access-Control-Allow-Methods'], 'localhost')
self.assertEqual(resp.headers['Access-Control-Allow-Headers'], 'localhost')
# GET
status = {'method': 'status', 'params': []}
async with session.get('http://localhost:5299/lbryapi', json=status) as resp:
self.assertEqual(resp.headers['Access-Control-Allow-Origin'], 'localhost')
self.assertEqual(resp.headers['Access-Control-Allow-Methods'], 'localhost')
self.assertEqual(resp.headers['Access-Control-Allow-Headers'], 'localhost')
@@ -4,9 +4,9 @@ from time import time
from lbry.schema.claim import Claim
from lbry.extras.daemon.exchange_rate_manager import (
ExchangeRate, ExchangeRateManager, CurrencyConversionError,
LBRYFeed, LBRYBTCFeed,
CryptonatorFeed, CryptonatorBTCFeed,
BittrexFeed,
CryptonatorUSDFeed, CryptonatorBTCFeed,
BittrexUSDFeed, BittrexBTCFeed,
CoinExBTCFeed
)
from lbry.testcase import AsyncioTestCase, FakeExchangeRateManager, get_fake_exchange_rate_manager
from lbry.error import InvalidExchangeRateResponseError
@@ -26,59 +26,21 @@ class ExchangeRateTests(AsyncioTestCase):
fee.address = "bRcHraa8bYJZL7vkh5sNmGwPDERFUjGPP9"
manager = get_fake_exchange_rate_manager()
result = manager.convert_currency(fee.currency, "LBC", fee.amount)
self.assertEqual(60.0, result)
self.assertEqual(20.0, result)
def test_missing_feed(self):
fee = Claim().stream.fee
fee.usd = Decimal(1.0)
fee.address = "bRcHraa8bYJZL7vkh5sNmGwPDERFUjGPP9"
manager = FakeExchangeRateManager([LBRYFeed()], {'BTCLBC': 1.0})
manager = FakeExchangeRateManager([BittrexBTCFeed()], {'BTCLBC': 1.0})
with self.assertRaises(CurrencyConversionError):
manager.convert_currency(fee.currency, "LBC", fee.amount)
def test_lbry_feed_response(self):
feed = LBRYFeed()
out = feed.get_rate_from_response({
'data': {
'fresh': 0, 'lbc_usd': 0.05863062523378918,
'lbc_btc': 5.065289549855739e-05, 'btc_usd': 1157.498
},
'success': True,
'error': None
})
self.assertEqual(1.0 / 5.065289549855739e-05, out)
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({})
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({
"success": True,
"result": []
})
def test_lbry_btc_feed_response(self):
feed = LBRYBTCFeed()
out = feed.get_rate_from_response({
'data': {
'fresh': 0, 'lbc_usd': 0.05863062523378918,
'lbc_btc': 5.065289549855739e-05, 'btc_usd': 1157.498
},
'success': True,
'error': None
})
self.assertEqual(1.0 / 1157.498, out)
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({})
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({
"success": True,
"result": {}
})
def test_cryptonator_lbc_feed_response(self):
feed = CryptonatorFeed()
feed = CryptonatorUSDFeed()
out = feed.get_rate_from_response({
'ticker': {
'base': 'BTC', 'target': 'LBC', 'price': 23657.44026496,
'base': 'USD', 'target': 'LBC', 'price': 23657.44026496,
'volume': '', 'change': -5.59806916,
},
'timestamp': 1507470422,
@@ -115,7 +77,7 @@ class ExchangeRateTests(AsyncioTestCase):
})
def test_bittrex_feed_response(self):
feed = BittrexFeed()
feed = BittrexBTCFeed()
out = feed.get_rate_from_response({
"symbol": "LBC-BTC",
"lastTradeRate": "0.00000323",
@@ -132,7 +94,7 @@ class ExchangeRateTests(AsyncioTestCase):
})
class BadMarketFeed(LBRYFeed):
class BadMarketFeed(BittrexUSDFeed):
def get_response(self):
raise InvalidExchangeRateResponseError(self.name, 'bad stuff')
@@ -145,3 +107,15 @@ class ExchangeRateManagerTests(AsyncioTestCase):
manager.start()
await asyncio.sleep(1)
self.addCleanup(manager.stop)
async def test_median_rate_used(self):
manager = ExchangeRateManager([BittrexBTCFeed, CryptonatorBTCFeed, CoinExBTCFeed])
for feed in manager.market_feeds:
feed.last_check = time()
bittrex, cryptonator, coinex = manager.market_feeds
bittrex.rate = ExchangeRate(bittrex.market, 1.0, time())
cryptonator.rate = ExchangeRate(cryptonator.market, 2.0, time())
coinex.rate = ExchangeRate(coinex.market, 3.0, time())
self.assertEqual(14.0, manager.convert_currency("BTC", "LBC", Decimal(7.0)))
cryptonator.rate.spot = 4.0
self.assertEqual(21.0, manager.convert_currency("BTC", "LBC", Decimal(7.0)))
@@ -18,8 +18,7 @@ from lbry.schema.tags import clean_tags
from lbry.schema.result import Outputs, Censor
from lbry.wallet import Ledger, RegTestLedger
from .common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS, INDEXED_LANGUAGES
from .full_text_search import FTS_ORDER_BY
from lbry.wallet.server.db.common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS, INDEXED_LANGUAGES
class SQLiteOperationalError(apsw.Error):
@@ -53,7 +52,7 @@ SEARCH_PARAMS = {
'any_locations', 'all_locations', 'not_locations',
'any_languages', 'all_languages', 'not_languages',
'is_controlling', 'limit', 'offset', 'order_by',
'no_totals',
'no_totals', 'has_source'
} | INTEGER_PARAMS
@@ -94,10 +93,10 @@ class ReaderState:
self.db.setprogresshandler(interruptor, 100)
def get_resolve_censor(self) -> Censor:
return Censor(self.blocked_streams, self.blocked_channels)
return Censor(Censor.RESOLVE)
def get_search_censor(self, limit_claims_per_channel: int) -> Censor:
return Censor(self.filtered_streams, self.filtered_channels, limit_claims_per_channel)
return Censor(Censor.SEARCH)
ctx: ContextVar[Optional[ReaderState]] = ContextVar('ctx')
@@ -342,12 +341,7 @@ def claims_query(cols, for_count=False, **constraints) -> Tuple[str, Dict]:
_apply_constraints_for_array_attributes(constraints, 'language', lambda _: _, for_count)
_apply_constraints_for_array_attributes(constraints, 'location', lambda _: _, for_count)
if 'text' in constraints:
constraints["search"] = constraints.pop("text")
constraints["order_by"] = FTS_ORDER_BY
select = f"SELECT {cols} FROM search JOIN claim ON (search.rowid=claim.rowid)"
else:
select = f"SELECT {cols} FROM claim"
select = f"SELECT {cols} FROM claim"
if not for_count:
select += " LEFT JOIN claimtrie USING (claim_hash)"
return query(select, **constraints)
@@ -372,7 +366,7 @@ def count_claims(**constraints) -> int:
constraints.pop('offset', None)
constraints.pop('limit', None)
constraints.pop('order_by', None)
count = select_claims(Censor(), 'count(*) as row_count', for_count=True, **constraints)
count = select_claims(Censor(Censor.SEARCH), 'count(*) as row_count', for_count=True, **constraints)
return count[0]['row_count']
+7 -2
View File
@@ -8,12 +8,16 @@ from typing import List, Tuple
from lbry.wallet.constants import COIN, NULL_HASH32
from lbry.schema.claim import Claim
from lbry.schema.result import Censor
from lbry.wallet.server.db import reader, writer
from lbry.wallet.server.db import writer
from lbry.wallet.server.coin import LBCRegTest
from lbry.wallet.server.db.trending import zscore
from lbry.wallet.server.db.canonical import FindShortestID
from lbry.wallet.server.block_processor import Timer
from lbry.wallet.transaction import Transaction, Input, Output
try:
import reader
except:
from . import reader
def get_output(amount=COIN, pubkey_hash=NULL_HASH32):
@@ -31,7 +35,7 @@ def get_tx():
def search(**constraints) -> List:
return reader.search_claims(Censor(), **constraints)
return reader.search_claims(Censor(Censor.SEARCH), **constraints)
def censored_search(**constraints) -> Tuple[List, Censor]:
@@ -553,6 +557,7 @@ class TestTrending(TestSQLDB):
self.advance(zscore.TRENDING_WINDOW * 2, [self.get_support(problematic, 500000000)])
@unittest.skip("filtering/blocking is applied during ES sync, this needs to be ported to integration test")
class TestContentBlocking(TestSQLDB):
def test_blocking_and_filtering(self):
+1
View File
@@ -6,6 +6,7 @@ extras = test
changedir = {toxinidir}/tests
setenv =
HOME=/tmp
ELASTIC_HOST={env:ELASTIC_HOST:localhost}
commands =
pip install https://github.com/rogerbinns/apsw/releases/download/3.30.1-r1/apsw-3.30.1-r1.zip \
--global-option=fetch \