Compare commits

..
53 Commits
Author SHA1 Message Date
Jack Robison 246c6b6646 0.37.2rc2 2019-05-24 12:45:05 -04:00
Jack Robison b2a6c1295c improve set_build.py, add BUILD_COMMIT 2019-05-24 12:44:25 -04:00
Jack Robison 8d7ea5aae0 fix false negative with file completed field 2019-05-24 12:44:25 -04:00
Jack Robison cbef318027 start returning range request bytes at the requested offset 2019-05-24 12:44:25 -04:00
Jack Robison 80607a744e add blob_lru_cache_size config setting (default of 32) 2019-05-24 12:44:25 -04:00
Jack Robison 7d8d9d1619 require torba 0.5.3 2019-05-24 12:44:22 -04:00
Lex Berezhny bb1f42057e v0.37.1 2019-05-17 23:01:47 -04:00
Lex Berezhny 695f6658a0 v0.37.1rc2 2019-05-17 21:43:37 -04:00
Jack Robison eca677a720 Merge pull request #2148 from lbryio/lru-cache-concurrent
Fix resolve internals caching and persisting errors
2019-05-17 19:26:22 -04:00
Jack Robison 51f301785f fix test, add lru_cache_concurrent decorator 2019-05-17 18:57:07 -04:00
Jack Robison 41a6e288aa add test_resolve_lru_cache_doesnt_persist_errors 2019-05-17 18:56:28 -04:00
Jack Robison 97d8d0ef4c Merge pull request #2133 from lbryio/more-wallets
Add missing wallet server
2019-05-17 15:50:10 -04:00
Niko Storni 5baeb5f538 fix examples 2019-05-17 15:19:11 -04:00
Niko Storni cc49c8407c add missing wallet server
switch to .com domain
2019-05-17 15:19:11 -04:00
Jack Robison 3f37963f7f Merge pull request #2139 from lbryio/android-platform-name
fix system name on android
2019-05-17 14:39:20 -04:00
Jack Robison 12eb83f773 fix system name on android 2019-05-17 14:00:25 -04:00
Jack Robison ca1d135ba4 Merge pull request #2138 from lbryio/fix-file-save-doc
fix save_file doc
2019-05-17 13:44:22 -04:00
Jack Robison 107e57e3ff fix docs 2019-05-17 13:11:04 -04:00
Jack Robison 928689a10d Merge pull request #2130 from lbryio/fix-datastore
Fix updating refreshed announcements in the datastore
2019-05-17 12:58:11 -04:00
Jack Robison 6ecc22f2c7 fix refreshing peers in the datastore 2019-05-17 12:22:47 -04:00
Lex Berezhny 079c81f298 v0.37.1rc1 2019-05-17 08:59:10 -04:00
Victor Shyba 8afe178d62 remove supports from resolve 2019-05-17 08:55:39 -04:00
Jack Robison 8777dcee7c v0.37.0 2019-05-13 23:39:22 -04:00
Jack Robison 1cca4a91dd Merge pull request #2128 from lbryio/add-streaming-server-settings
add `streaming_server` and `streaming_get` settings to configure the interface/port of the media server and if it supports the `/get` endpoint
2019-05-13 22:51:53 -04:00
Jack Robison 41abfbdd9b add streaming_server and streaming_get settings
-split rpc runner from range request runner
2019-05-13 22:27:48 -04:00
Jack Robison 46ee65c8f2 Merge pull request #2127 from lbryio/add-streaming-url
add `streaming_url` field to `File` api response type
2019-05-13 21:05:52 -04:00
Jack Robison fd19daad9e add streaming_url to file api response type 2019-05-13 19:05:26 -04:00
Jack Robison 26d183cbab Merge pull request #2125 from lbryio/dht_wip
Remove search junctions, make search retry, some refactoring
2019-05-13 18:02:56 -04:00
Victor Shyba 71a4be02dd use loop to create task 2019-05-13 15:57:03 -03:00
Victor Shyba 124fdb7d31 fixes from review 2019-05-13 14:57:58 -03:00
Victor Shyba 2439743804 probe peer instead of scheduling ping for removal 2019-05-13 14:51:03 -03:00
Victor Shyba 6f79875135 fix test 2019-05-13 14:27:49 -03:00
Victor Shyba b91d2190f4 disable infinite peer search, cleanup logging, tune scores to slow connections 2019-05-13 14:24:13 -03:00
Victor Shyba d024433d1b simplify accumulate task 2019-05-13 13:34:49 -03:00
Victor Shyba 7c4eb416d6 dont clearbanned if there are working peers, dont remove node immediately during search 2019-05-13 13:14:08 -03:00
Victor Shyba fb457c820a reorganizing iterative find code 2019-05-13 04:34:39 -03:00
Victor Shyba 18af2dcd4e remove peer immediately instead of probing when its bad during search 2019-05-13 02:52:24 -03:00
Victor Shyba 0075dcc2c0 iterative find probes bad peers + test case for edge scenario Tom found 2019-05-13 02:40:04 -03:00
Victor Shyba 6e327d729b fix test 2019-05-12 04:28:58 -03:00
Victor Shyba 20022d49c1 less verbose dht tests 2019-05-12 04:13:58 -03:00
Victor Shyba 32d1563885 fix handling of invalid token 2019-05-12 04:12:12 -03:00
Victor Shyba f5cef14d8d test get token on announce 2019-05-12 03:55:07 -03:00
Victor Shyba bac7d99b8a add ability to re-join network on disconnect + tests 2019-05-12 03:39:11 -03:00
Victor Shyba 6f06026511 announcer goes idle if no peers in routing table 2019-05-12 01:10:05 -03:00
Victor Shyba f02df86709 fix announce loop when there are no peers to announce 2019-05-12 00:42:19 -03:00
Victor Shyba b7d76fd09f add integration tests, fix bug that made refresh not exclude bad peers 2019-05-11 23:30:05 -03:00
Victor Shyba e675f1387c remove peer junction and some refactoring 2019-05-11 04:58:56 -03:00
Victor Shyba 0da2827c78 fix dht deadlock 2019-05-10 19:54:59 -03:00
Jack Robison 309cfc840c v0.37.0rc7 2019-05-10 15:34:38 -04:00
Jack Robison 68ee31b62a Merge pull request #2123 from lbryio/stop-timed-out-downloads
Stop timed out downloads
2019-05-10 15:29:33 -04:00
Jack Robison ad2da24d64 improve test 2019-05-10 14:57:04 -04:00
Jack Robison 648dbcc36b add timeout to blob downloads after the head blob, stop timed out streams 2019-05-10 14:50:01 -04:00
Victor Shyba e59e96190e fix peer search using inexistent variable, fix test to cover it 2019-05-10 13:49:35 -04:00
39 changed files with 908 additions and 678 deletions

No files matched your search

+8 -5
View File
@@ -10,7 +10,7 @@ jobs:
name: "pylint lbrynet"
install:
- pip install astroid pylint
- pip install git+https://github.com/lbryio/torba.git#egg=torba
- pip install git+https://github.com/lbryio/torba.git#2626a28
- pip install -e .
script: pylint lbrynet
@@ -18,7 +18,7 @@ jobs:
name: "Unit Tests"
install:
- pip install coverage
- pip install git+https://github.com/lbryio/torba.git#egg=torba
- pip install git+https://github.com/lbryio/torba.git#2626a28
- pip install -e .
script:
- HOME=/tmp coverage run -p --source=lbrynet -m unittest discover -vv tests.unit
@@ -29,7 +29,10 @@ jobs:
- name: "Integration Tests"
install:
- pip install tox-travis coverage
- pushd .. && git clone https://github.com/lbryio/torba.git && popd
- pushd ..
- git clone https://github.com/lbryio/torba.git
- git checkout 2626a28
- popd
script: tox
after_success:
- coverage combine tests/
@@ -38,7 +41,7 @@ jobs:
- name: "Run Examples"
install:
- pip install coverage
- pip install git+https://github.com/lbryio/torba.git#egg=torba
- pip install git+https://github.com/lbryio/torba.git#2626a28
- pip install -e .
script:
- HOME=/tmp coverage run -p --source=lbrynet scripts/generate_json_api.py
@@ -79,7 +82,7 @@ jobs:
env: OS=linux
install:
- pip3 install pyinstaller
- pip3 install git+https://github.com/lbryio/torba.git
- pip3 install git+https://github.com/lbryio/torba.git#2626a28
- python3 scripts/set_build.py
- pip3 install -e .
script:
+123 -123
View File
@@ -37,14 +37,14 @@
"is_required": false
}
],
"returns": " {\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }",
"returns": " {\n \"streaming_url\": \"(str) url to stream the file using range requests\",\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }",
"examples": [
{
"title": "Get a file",
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmppe9osroo\",\n \"download_path\": \"/tmp/tmppe9osroo/tmpfmcqxqr9\",\n \"file_name\": \"tmpfmcqxqr9\",\n \"height\": 214,\n \"key\": \"de672c28f2060f41575f08bd9aab2cb8\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"65b6982a8fddae13c12390608c58a18f1368bcb73f53b31990d4be093827f3f1945eec69b84f1ca2996a1f070a3cd7f3\",\n \"stream_name\": \"tmpfmcqxqr9\",\n \"suggested_file_name\": \"tmpfmcqxqr9\",\n \"timestamp\": 1557412291,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpnk2c4f2x\",\n \"download_path\": \"/tmp/tmpnk2c4f2x/tmpip8uriwe\",\n \"file_name\": \"tmpip8uriwe\",\n \"height\": 214,\n \"key\": \"44bb79917c27efbb9014f8bbc78e3eeb\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"ef42dee59a9efc14a5611b1bb1a300b2fb5cfb92acf8e9a2034ddf341c42fc9293efef53761751fdcfec53ac74837b6a\",\n \"stream_name\": \"tmpip8uriwe\",\n \"streaming_url\": \"http://localhost:5280/stream/06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"suggested_file_name\": \"tmpip8uriwe\",\n \"timestamp\": 1558113064,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -207,10 +207,10 @@
"examples": [
{
"title": "Publish a file",
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpzyae0q0y\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpzyae0q0y",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpzyae0q0y\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001d7f8c932dde56ae69417f75de96abe606aa537e35f627bec962ef1218c6a92c8010000006b483045022100d0f33199022e2cbc91caa20aaa50779c2a70e58e345f685b7c79c5fcbe462ba50220462fc04149319ce1b36d137e52e1a8e6ca719091f859554372fee5a34a47a66d0121037ad50cdfa11808327c70f57e94b7c2462492a0b14da955eeed83ebce84494d7affffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a79616530713079180b22186170706c69636174696f6e2f6f637465742d73747265616d3230168ea3c6b9a41509af29bb6b0d2c3c000d52d0b77c3f85c327b83ceb996300e113f82f240e20e18bc253f0a800100fb86d7576a9148cd833cc0b92c8955e6a3977bb991a275444ec5e88ace0b46217000000001976a9147ce9d453a27810ecc9e2ec216b50316f3e8f220e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msv3BiuJ4RHWEbdYE665DaxxGQbmTjtPW2\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412291,\n \"txid\": \"c8926a8c21f12e96ec7b625fe337a56a60be6ae95df71794e66ae5dd32c9f8d7\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtMftuq8irZSZGMqRV4kbv558i2THU94hW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"f1d4b94f0a1a6cbda837d67a2714bba180ea8e9c\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#f1d4b94f0a1a6cbda837d67a2714bba180ea8e9c\",\n \"timestamp\": null,\n \"txid\": \"70c642a80f01d3cc1e77e6a8961fbfbdc40461ad017f0a58eccd192b7a404636\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpzyae0q0y\",\n \"sd_hash\": \"168ea3c6b9a41509af29bb6b0d2c3c000d52d0b77c3f85c327b83ceb996300e113f82f240e20e18bc253f0a800100fb8\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mruSCbKo6azmjoYfnd1Br48qyQa4FTVUE8\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"70c642a80f01d3cc1e77e6a8961fbfbdc40461ad017f0a58eccd192b7a404636\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"70c642a80f01d3cc1e77e6a8961fbfbdc40461ad017f0a58eccd192b7a404636\"\n }\n}"
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp_ddtpmtn\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmp_ddtpmtn",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp_ddtpmtn\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000111a6b763ecad0030f105b7122e1588d7766b7c447d6e76144d7b88b2e486266a010000006a473044022066605f1c9e25a8a838adb5a53106f0ee2c03de7f0f4eac8016f33cc189ee359a0220202177781095f151f3b6a7bee91b21dc1039b9e3bde1a23dbe67cbd5315dc9e8012102b4376442c145e1283d561a5be188ed37faa10f5d052279e026d165e4098452a1ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d705f646474706d746e180b22186170706c69636174696f6e2f6f637465742d73747265616d323064eea681e0895a5ed6d4856424c0658f0dccfc385ecdb7168b0a82006d58b8aaa3b08e683bd7bf6e47201d3704c23a106d7576a914e77e5be57e932140e2ae68632263fc60f82c0ae988ace0b46217000000001976a914d075e70713e8bf2abacacaf9b434c62011b8060188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n3vDyZVf6EuxN2r6BqLpMgS67f4epzdqZT\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113064,\n \"txid\": \"6a2686e4b2887b4d14766e7d447c6b76d788152e12b705f13000adec63b7a611\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n2cykwbGgwagYFnVFgAL95H8Sa2ciygBeB\",\n \"amount\": \"1.0\",\n \"claim_id\": \"55b9b81794fb07f18f3a29d7ae42f1c421935913\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#55b9b81794fb07f18f3a29d7ae42f1c421935913\",\n \"timestamp\": null,\n \"txid\": \"f1c8710adb72349cbb472af93a4d1e73d5896a7e114b551accb641f896725785\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp_ddtpmtn\",\n \"sd_hash\": \"64eea681e0895a5ed6d4856424c0658f0dccfc385ecdb7168b0a82006d58b8aaa3b08e683bd7bf6e47201d3704c23a10\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mzXC5xg5xjmCMzxP7K3gsvHjPstYHvXExH\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f1c8710adb72349cbb472af93a4d1e73d5896a7e114b551accb641f896725785\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"f1c8710adb72349cbb472af93a4d1e73d5896a7e114b551accb641f896725785\"\n }\n}"
}
]
},
@@ -229,10 +229,10 @@
"examples": [
{
"title": "Resolve a claim",
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"]}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"]}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\": {\n \"certificate\": {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_sequence\": -1,\n \"confirmations\": 7,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": false,\n \"height\": 210,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"protobuf\": \"00125a0a583056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46420b4e6577204368616e6e656c\",\n \"supports\": [],\n \"timestamp\": 1557412290,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"valid_at_height\": 210,\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"claim\": {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_sequence\": -1,\n \"confirmations\": 3,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n }\n },\n \"claims_in_channel\": 0\n }\n }\n}"
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"]}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"]}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\": {\n \"certificate\": {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_sequence\": -1,\n \"confirmations\": 7,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": false,\n \"height\": 210,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"protobuf\": \"00125a0a583056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5420b4e6577204368616e6e656c\",\n \"supports\": [],\n \"timestamp\": 1558113063,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"valid_at_height\": 210,\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"claim\": {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_sequence\": -1,\n \"confirmations\": 3,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n }\n },\n \"claims_in_channel\": 0\n }\n }\n}"
}
]
},
@@ -254,7 +254,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 \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"installation_id\": \"2Aw32Z949cPi5dj1K8LfW3AnAyy2MnsUYFMHDbBj97fWWA9oP4YLviNc17x953kwoV\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"blockchain_headers\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"best_blockhash\": \"e9bf8976351ca1f215a0c26463b371aedff0752d0a046090da58f0d50f76d710\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"is_encrypted\": false,\n \"is_locked\": false\n }\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"installation_id\": \"vGHKEdD9oDTsGZQrpSKthuhu37QoTVDeyKWRmqRVoiLdXttQUk2Hcvj94KWaskRkp\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"blockchain_headers\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"best_blockhash\": \"2239cabf318b8ddd48d0373c54962651646d5cc1fb70fd2b41e545316a2f69cc\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"is_encrypted\": false,\n \"is_locked\": false\n }\n }\n}"
}
]
},
@@ -276,7 +276,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\": \"ubuntu:GNOME\",\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.37.0rc5\",\n \"os_release\": \"4.15.15-041515-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.15.15-041515-generic-x86_64-with-debian-buster-sid\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.0\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"ubuntu:GNOME\",\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.37.1rc1\",\n \"os_release\": \"4.15.15-041515-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.15.15-041515-generic-x86_64-with-debian-buster-sid\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.0\"\n }\n}"
}
]
}
@@ -324,10 +324,10 @@
"examples": [
{
"title": "Add an account from seed",
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"concert caution silent security delay egg bus category bean double bargain lunch\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\", \"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\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557412257.1639874,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeSga9d4YgRVnsaZW25naWk1zDAaHRntf4zT3dQJKttbge4SfANdGPPkqYGUL8TAwqVnXYiSUAS3HqU4V31K27obgU8JtsRQ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XuiN3Gj95q9uSc5SBQyV63cmVgcar4h3uUhpFo7v5PDYpBGmnjWU6AvPJGsDfhFGhQeZreu9Yj73qRHgUbTPvoeGp5zqWwL\",\n \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"crunch tonight gown dish tell power aspect banana eager blade senior predict\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\", \"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\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1558113030.2059674,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdaKbS6ZPteaurN1YPsbVoY1dZGvi962chqdJZgh8sNXsJkZ3EcK8cSPYcPU2MopK88k2ezxK4Ny2tM8P4adR3hoZhixidcM\",\n \"public_key\": \"tpubD6NzVbkrYhZ4X3MPKkDzJ4F2RPXUZCnQNqcQqny1ZMq1YKt5C5Wj3s9jUsYj24LWx9uZi6MHH7g4GcSsCJ7qhxp3J7kWN6Hf2VNQynfDn63\",\n \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\"\n }\n}"
}
]
},
@@ -359,9 +359,9 @@
},
{
"title": "Get balance for specific account by id",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}).json()",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"2.0\"\n}"
}
]
@@ -390,7 +390,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\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557412257.0474465,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeSga9d4YgRVnsaZW25naWk1zDAaHRntf4zT3dQJKttbge4SfANdGPPkqYGUL8TAwqVnXYiSUAS3HqU4V31K27obgU8JtsRQ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XuiN3Gj95q9uSc5SBQyV63cmVgcar4h3uUhpFo7v5PDYpBGmnjWU6AvPJGsDfhFGhQeZreu9Yj73qRHgUbTPvoeGp5zqWwL\",\n \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\"\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\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1558113030.1062362,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdaKbS6ZPteaurN1YPsbVoY1dZGvi962chqdJZgh8sNXsJkZ3EcK8cSPYcPU2MopK88k2ezxK4Ny2tM8P4adR3hoZhixidcM\",\n \"public_key\": \"tpubD6NzVbkrYhZ4X3MPKkDzJ4F2RPXUZCnQNqcQqny1ZMq1YKt5C5Wj3s9jUsYj24LWx9uZi6MHH7g4GcSsCJ7qhxp3J7kWN6Hf2VNQynfDn63\",\n \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\"\n }\n}"
}
]
},
@@ -473,24 +473,24 @@
"examples": [
{
"title": "Transfer 2 LBC from default account to specific account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001b06f630c6b29be941ceb4f1fb4357e1b804ed618943bd9d4e77cbf16e3393195000000006a47304402201df99b64f2287a581f910988d875053424a2a6703f0e94edf1c347af283ad41502207e5d24ca551492df3f2026bbdd8ef9b67d1fb942fff5bcb4e03eb5a2bc74567c012103a9394113d9e2fccb7d4a81031a667c676ebd35014fdf2cede3b8034a8b68668bffffffff0200c2eb0b000000001976a91424076ae8e5d1812aed9085683d93090e8cbfee9e88ac90d7ae2f000000001976a914a9889d05d4a60dd24d61f475baa6a02d238b7ffd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mjJRfy3fpDc1QqpSKfExmdhcTXyossEqTp\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557412289,\n \"txid\": \"953139e316bf7ce7d4d93b9418d64e801b7e35b41f4feb1c94be296b0c636fb0\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mvyN9Y5pUWo4XTok2fAJYHmrhiKMUPqivB\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015f436044c45069272085b4f45103fc58403718a21cb656946fa9e151c9678346010000006a47304402200f5336f7333239b1eb370872f710abd7f0c14874de970c34b6bae24f01877c46022044c41caa2a09ae19d6356f310ec7bcfd7bac3d22a0bddbec5c69a014ef77a4530121030b7ef076179d0a33577a6060401bb3f6e611d6656248e072a3d1bde6e575f7aeffffffff0200c2eb0b000000001976a9149f28eb048487fc797c203b70c722e2624d301b6e88ac90d7ae2f000000001976a914b2d879d3dd87f999a456ba4487515f9fc828601588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n3hzACYXp2epupNQSa5QFDDUcgprVt5rV1\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113062,\n \"txid\": \"468367c951e1a96f9456b61ca218374058fc0351f4b48520276950c44460435f\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mv2WkbBYY24ezE3Tj78eJ9NA7TTZNaFSoD\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwpbuD2xLqHN352Ag1ntMRDpu6bV9PxyLb\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\"\n }\n}"
},
{
"title": "Spread LBC between multiple addresses",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"from_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\" --from_account=\"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"from_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ea490e9b788fe3d86e39f1ddd26017a4a46a07815280bff285990901958bf096000000006a473044022001401269e53f0fe7c03ffc8cfcaf45a24857ae794c4608e4addbf4bab6a57907022061ae8c55a3c913159abecf3038dd52fe5def995cc9eeca1b05f3ea5d7e60b411012102503f19a6af2d83f0f6e0a0d1208245ada4829b69e3540ce46b3b42e1a2854f6dffffffff03c0687804000000001976a91424076ae8e5d1812aed9085683d93090e8cbfee9e88acc0687804000000001976a91424076ae8e5d1812aed9085683d93090e8cbfee9e88ac6cb9fa02000000001976a91424076ae8e5d1812aed9085683d93090e8cbfee9e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557412290,\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"from_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\" --from_account=\"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"from_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001db75946a6e5c3ae4fba9643571cb397b944abe0f5447896d8fa4eb211203da5f000000006b48304502210096115913c0bd4ec19033357d8503774773a5a4043d2a39c4d3673de621f78679022061a4e89ec0ed28b9d249fffdbe338c702f38c0e29cc7a9b694bd132cae599da701210235a4b0e8a6ac2f816eba77fb31fbb92056799bb91f7d840cd756ff6b8a4b8f6effffffff03c0687804000000001976a914e4b32f7f86b87098278de13fe8d0e759f9d8f5d588acc0687804000000001976a914e4b32f7f86b87098278de13fe8d0e759f9d8f5d588ac6cb9fa02000000001976a9144c2ffba88e18787b9caea7fb9212f5a3dc08e6e588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mv2WkbBYY24ezE3Tj78eJ9NA7TTZNaFSoD\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1558113063,\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n2ND1pZp2bzYiwYhq1niiGrAHwykFFR1ar\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n2ND1pZp2bzYiwYhq1niiGrAHwykFFR1ar\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnTo8Z3NzRayC33pkpfsNbcH2Z1x2ZffBt\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\"\n }\n}"
},
{
"title": "Transfer all LBC to a specified account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000003715b2ad2a2e81604c90899369460b5d0805c4d93318fbfd89cb3a832ae8c42d4000000006b4830450221009eac41c57796e11bef3fb42dca572e421927c38beffffcc1ecdb8a33c940b09e0220072dde889627cbe1a8d2199d9958a1f9bf2070f9a1e72bc82466a720ee5fab58012102503f19a6af2d83f0f6e0a0d1208245ada4829b69e3540ce46b3b42e1a2854f6dffffffff715b2ad2a2e81604c90899369460b5d0805c4d93318fbfd89cb3a832ae8c42d4010000006b483045022100a6d6075c3e0cca3fff08cfdac4655fb849e101fbc47ec74aa995a51eb6023b6d022062206ae3641f2c0e60d783eec1429299866da1c38f25b9174a67095ed8da726f012102503f19a6af2d83f0f6e0a0d1208245ada4829b69e3540ce46b3b42e1a2854f6dffffffff715b2ad2a2e81604c90899369460b5d0805c4d93318fbfd89cb3a832ae8c42d4020000006b483045022100eaf594ddab83fd806147c9a9f0cb729c1b3c91f2a8cb425a9c92affb744a490602206adf92a18f5b46ef0b7af7e5acd0655011259066278b11e7405ef729878a5feb012102503f19a6af2d83f0f6e0a0d1208245ada4829b69e3540ce46b3b42e1a2854f6dffffffff015027eb0b000000001976a914f6e8134b423b2b5052396954d35477fb9f0637b988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557412290,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412290,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1557412290,\n \"txid\": \"d4428cae32a8b39cd8bf8f31934d5c80d0b56094369908c90416e8a2d22a5b71\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n42UY87hnpSR9fbacE6WCJDc8cyfHVa4a1\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a3378429d2d818d2ed85196ef9c8224e120c76f5674f3a577079242abd7fa7b7\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"a3378429d2d818d2ed85196ef9c8224e120c76f5674f3a577079242abd7fa7b7\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000036aee2c057f3d28b2a7ea4f529e84a0af7c2a2fdf81ac12f46361ee97167786b8000000006a473044022042ac78b8f37cb24fa1da07fb9f713fc0ae93582f9717a05c134e71c53fafda090220359a7f557bfababfaf107cb9985ac0f11596552a7187339633aa0b54a443544e0121034d281614d23f1f45df8cbecbd254968d01607e47d67551f8dd3f20ba131fbb7effffffff6aee2c057f3d28b2a7ea4f529e84a0af7c2a2fdf81ac12f46361ee97167786b8010000006a47304402200dd583a35370f98534d99448719d4d4f78b8d318cf231ddeeaf14633e6442012022023875b8309d3a1572313d9bd4fbd161b946e421a326e48d99ad49fb9be636d8d0121034d281614d23f1f45df8cbecbd254968d01607e47d67551f8dd3f20ba131fbb7effffffff6aee2c057f3d28b2a7ea4f529e84a0af7c2a2fdf81ac12f46361ee97167786b8020000006b483045022100c492cdc27f3e14ea67b54f77339d299c28b6cddb241051b34cbdfbd1f5a005990220615fe4efc3f7e5ce2e8bc01cbeacb54c0b7eeaf9a15d9d5bfeda69176742844b012103760597d5bbbc065f268318b3e1497c6599bc72554e6119c7114e4b92f4e35560ffffffff015027eb0b000000001976a914b0ff6e050d9e8087a65dbbf3fe9c7808e496f0d888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2ND1pZp2bzYiwYhq1niiGrAHwykFFR1ar\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1558113063,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n2ND1pZp2bzYiwYhq1niiGrAHwykFFR1ar\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113063,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mnTo8Z3NzRayC33pkpfsNbcH2Z1x2ZffBt\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1558113063,\n \"txid\": \"b886771697ee6163f412ac81df2f2a7cafa0849e524feaa7b2283d7f052cee6a\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mweqDPRKNNkSLpGP2Kr651TEtQijM4NEVm\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"1f82bbd70eb481abd74d1c6d820378a6b7d258f03843cc9d986c48c130773fc0\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"1f82bbd70eb481abd74d1c6d820378a6b7d258f03843cc9d986c48c130773fc0\"\n }\n}"
}
]
},
@@ -530,7 +530,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 \"lbc_regtest\": [\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\": \"mnNeA4p7qkBSFti1texZcMaij5XP4TTLRs\",\n \"is_default\": true,\n \"name\": \"Account #mnNeA4p7qkBSFti1texZcMaij5XP4TTLRs\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WMwJZ78QVYU65ofkdQWhLwzvEm9R8gBPAVaUqFdoje93iUzpf2oGFBntAV7hi8YsVLK4gSa2JC9JS5ZR2ZJc9qaWEswouus\",\n \"satoshis\": 1000000000\n }\n ]\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"lbc_regtest\": [\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\": \"n3bUWqq67266Y6T8k7TJPwn5Ybqf9K6BM7\",\n \"is_default\": true,\n \"name\": \"Account #n3bUWqq67266Y6T8k7TJPwn5Ybqf9K6BM7\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WeoW66qCtgFYq9giThLdtyLcTkoEKStUAReh46oGjwe8eNNrG57WSUCfruLNodAih54vbpz5dhnJHnhDDwPK4nmpKFur8PY\",\n \"satoshis\": 1000000000\n }\n ]\n }\n}"
}
]
},
@@ -577,10 +577,10 @@
"examples": [
{
"title": "Remove an account",
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}).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\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557412257.0474465,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeSga9d4YgRVnsaZW25naWk1zDAaHRntf4zT3dQJKttbge4SfANdGPPkqYGUL8TAwqVnXYiSUAS3HqU4V31K27obgU8JtsRQ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XuiN3Gj95q9uSc5SBQyV63cmVgcar4h3uUhpFo7v5PDYpBGmnjWU6AvPJGsDfhFGhQeZreu9Yj73qRHgUbTPvoeGp5zqWwL\",\n \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}).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\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1558113030.1062362,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdaKbS6ZPteaurN1YPsbVoY1dZGvi962chqdJZgh8sNXsJkZ3EcK8cSPYcPU2MopK88k2ezxK4Ny2tM8P4adR3hoZhixidcM\",\n \"public_key\": \"tpubD6NzVbkrYhZ4X3MPKkDzJ4F2RPXUZCnQNqcQqny1ZMq1YKt5C5Wj3s9jUsYj24LWx9uZi6MHH7g4GcSsCJ7qhxp3J7kWN6Hf2VNQynfDn63\",\n \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\"\n }\n}"
}
]
},
@@ -655,10 +655,10 @@
"examples": [
{
"title": "Modify maximum number of times a change address can be reused",
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\", \"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\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557412257.2121701,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeSga9d4YgRVnsaZW25naWk1zDAaHRntf4zT3dQJKttbge4SfANdGPPkqYGUL8TAwqVnXYiSUAS3HqU4V31K27obgU8JtsRQ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XuiN3Gj95q9uSc5SBQyV63cmVgcar4h3uUhpFo7v5PDYpBGmnjWU6AvPJGsDfhFGhQeZreu9Yj73qRHgUbTPvoeGp5zqWwL\",\n \"seed\": \"concert caution silent security delay egg bus category bean double bargain lunch\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\", \"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\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1558113030.2514572,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdaKbS6ZPteaurN1YPsbVoY1dZGvi962chqdJZgh8sNXsJkZ3EcK8cSPYcPU2MopK88k2ezxK4Ny2tM8P4adR3hoZhixidcM\",\n \"public_key\": \"tpubD6NzVbkrYhZ4X3MPKkDzJ4F2RPXUZCnQNqcQqny1ZMq1YKt5C5Wj3s9jUsYj24LWx9uZi6MHH7g4GcSsCJ7qhxp3J7kWN6Hf2VNQynfDn63\",\n \"seed\": \"crunch tonight gown dish tell power aspect banana eager blade senior predict\"\n }\n}"
}
]
},
@@ -708,9 +708,9 @@
"examples": [
{
"title": "Check if address is mine",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mruESV2uxBZioC97PDsbuqjGKRCkviYRos\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mruESV2uxBZioC97PDsbuqjGKRCkviYRos",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mruESV2uxBZioC97PDsbuqjGKRCkviYRos\"}}).json()",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mzsUgb5dCMh2iFp14dvqZWkLKwt4sfCcmU\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mzsUgb5dCMh2iFp14dvqZWkLKwt4sfCcmU",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mzsUgb5dCMh2iFp14dvqZWkLKwt4sfCcmU\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -745,14 +745,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 \"mjJRfy3fpDc1QqpSKfExmdhcTXyossEqTp\",\n \"n3fKziJ6gTJXNMFD5uTT2SzsCm35BUqBMC\",\n \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"myA5CAex5LcxzWfsLytgzyMxSJcNQqsKHt\",\n \"mpcGVMt4WM16pUaEbQz77wNuwajDCG75EN\",\n \"miGb9wRahD39Hs4ZaQ9CFQuBkttwmLwTZs\",\n \"mybA14ZrM1TF8sxDcHLiY31bMztURhxxY3\",\n \"myhdrdTx5ZmfKaVcg4QgYiub2EBYPnkywQ\",\n \"mruESV2uxBZioC97PDsbuqjGKRCkviYRos\",\n \"mjbUc8iTY9yqsTsNNhKH9iehJrNvEoGZwq\",\n \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"mtMftuq8irZSZGMqRV4kbv558i2THU94hW\",\n \"mxwcZA9JejJ4qdLreAMcurk1LyFVYxB8MF\",\n \"moZXCin3xSUiUhDUtbMMg3pvcXWmpXJ8Ah\",\n \"mwVdTBKHwRVY1EDGTnrPDx6EVvsKMTRTg7\",\n \"mref6paiwNMQzTCgxM7BokGNqtFbUrTqdd\",\n \"mpgHxbSf9AMGqtg7tKFW9urQ2DdBxjtGAN\",\n \"mpoDuuAwpWSQFjmdfVD8DDo8bfJQhcvHVF\",\n \"mnENyzt7Lg7RbS9h8VX9GHWXrGcCKtg3U5\",\n \"mohQDtnEwVVqFJ155RDUtDYFvCmpzMAMSv\",\n \"miZ926v6sAnfowtQ52L42Sy9JDe7xPKN7P\",\n \"mqL999ZnSc6rAWKYzekqgAHRM2JYQwPWAW\",\n \"mvyN9Y5pUWo4XTok2fAJYHmrhiKMUPqivB\",\n \"msv3BiuJ4RHWEbdYE665DaxxGQbmTjtPW2\",\n \"miSnDhW4U5DDhjvUpZkGqeVXWYbe37yaRS\",\n \"mmd1DmjigWXF11iiqTT2MgVrh86i2USVMf\",\n \"micK9zMw8jAoyeL7csPp2aB2sYW4fHXH4J\"\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mwpbuD2xLqHN352Ag1ntMRDpu6bV9PxyLb\",\n \"mrWGKtehqRNHX1qo9DiQbTu8vUVmTx3AJE\",\n \"mmPUWDor4sLvbGctcUjFjRsj7o94YQmVkC\",\n \"n3vDyZVf6EuxN2r6BqLpMgS67f4epzdqZT\",\n \"n1SHWyZqJiWMNrdCxmQx9V3xQ83hWJnJUM\",\n \"mweqDPRKNNkSLpGP2Kr651TEtQijM4NEVm\",\n \"n3hzACYXp2epupNQSa5QFDDUcgprVt5rV1\",\n \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"n3dnMbCeTpMMqzuJxbJB32qoa1CC5CMfRA\",\n \"miuZSzrr2MH8qvf3rwoRnkaNH5enZfSH1q\",\n \"mq6YGvAQ9Edj2mManWjbufSvPBqUrrzjgJ\",\n \"mzsUgb5dCMh2iFp14dvqZWkLKwt4sfCcmU\",\n \"ms5gJaXcsiHP64SHxRspxU6ZdxaCn7kS9E\",\n \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"mioLjPKzYbc12oQN5T7wNtpPRqgPe8Mgnd\",\n \"n2cykwbGgwagYFnVFgAL95H8Sa2ciygBeB\",\n \"n3yrPmbxnkTHpvJENs6YWfGnJo6ZxBtdrd\",\n \"mgCTRnGJU922PVkiQLtDbAv7ZTZKfnTRGj\",\n \"mh3A5mCcB1BWRk2qP3dwzEToC58fNymxQq\",\n \"n1EbYvEqsT264RpNwxJErxNZSr73YLK5Gi\",\n \"miquu4BM3HbL4TdkZYvbLjxPum75xA8rS5\",\n \"miXywcRRg3vVT5wst6pwxXhagJ6UKvG1Uz\",\n \"mstsodJ1hWJd1So6fFnCNwXnD2ovm6SscX\",\n \"mfcRDTDcY638nZYaejiRLozZLTdaYHktvo\",\n \"mvqVYgqco4W6n5nYmiGMRZHmc6MiGhwZUp\",\n \"mt37V8PpEqfQwg9AYDMVxD1VbHatnYSuyd\",\n \"n2rpLpSwWHuz61oDkHJ7samRaX2CrShddX\"\n ]\n}"
},
{
"title": "List addresses in specified account",
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mfeYAtr97JTR3wPYQMafz4sqxVw9sKxnnF\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mnAJ3Uit18ZLhzeDNxtZFSPW8pyAZ1s3b1\",\n \"mioTWLxbBBkwBxzGVtfAhgJcfyXqfAVkVF\",\n \"mwA5FJ3C8dgzEzkdaLsTuvVTNSkSRVV9Hz\",\n \"mh6BL728vsFYzMD5coxFXmLpKxgYKWJsxk\",\n \"n2jHfxeNm8W4EbdhD3jFBiAmbHdgnQppAY\",\n \"mx5D2R8x54kXyKkPZRmed57fDFrLGTs16M\",\n \"mnTUtc4N5G8ktZaQEasckeLtnYvHY2zfps\",\n \"mnKJyfbHmY7tPqdaCfuxZAzRt7zMh3zvo1\",\n \"myGFZQj1XzsjEpyFV5qcecNs6eHRDbd9e9\",\n \"mpoFsBE3p85BS6NLhZyU7fYgK8FFFNiRo2\",\n \"mrKDmuenR5D8L8FuSu5gBn6QGxk2Y91dF2\",\n \"mxrTiTua6oPYjH9CoW9FvP6kMj2HA2qPNf\",\n \"mtnMjFABczz6WAuGHTf8gmCE6A4ZMey1jz\",\n \"mgCMxT5m14Y5buhQN5KTGp7u1fFgLzbmU5\",\n \"mvQKoAUe89VWi7yHWdn8yhFmKk7Q2dC7Pk\",\n \"mjJLJmpb5AvjubuQxooaqxRwRwfWhCrXvC\",\n \"n1sAHnV9Jn7ummJhPrwMaBiYDURx8fFFRi\",\n \"mtonAnGVr5HEv17UGcstLmXC5whqJv8UuM\",\n \"mqUgc6Xp2qFyGQgxytRYMDXGmaUderJ4iU\",\n \"mpaGuh2UMrvM8ehcvSdHdEPpKzSmmAoez4\",\n \"mnoTc3oBdzUa42UuDLm9MQzCgmfko8EV9U\",\n \"msP6swJtRWxSk5gv5bwXa1tQSm8VpaMyta\",\n \"n1JAGuN5UxbuW5SbWsGVC5jTURWtSSSdde\",\n \"mk58t3DXcPepvpo7c8QvoW35L6vJMq3EYS\",\n \"mj4QmYHJKFgDq65H4J26CcmTryBtmKYGnW\",\n \"n1fnnx3YFazDuz2hd5AUAvenkGnZXk9syN\"\n ]\n}"
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mrgGy6tfn3BBLrR56aJrdRCayqwxofDfXH\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mvWcQmp1Z9ryTe9KXuEFCbpKTdnDs3aXFV\",\n \"mzyVviBL61iCAJGgj4UGV89FD29sDCFSPH\",\n \"mok13BFBoydmH5jgW72GcCmsBFdj6FHvuM\",\n \"n27LP5ChLA1dggFVSVvZUoQSzuzjU4qGaz\",\n \"mv2WkbBYY24ezE3Tj78eJ9NA7TTZNaFSoD\",\n \"n4rGHx8SE1HXD7TjLjTavN7Qxzu2s6PHFL\",\n \"mqmdBcPHgipgLERdWnnrVkAaDuKTG8vn7r\",\n \"mhCLZXu3nxv6UG1BQ2dEXjsWoNwEQWboDo\",\n \"mjotbnaJ5hEuC4njSAyULMPUgL6aiVtund\",\n \"n1mjsaUdjkfEvvv5XwgwKuXVHboWk6krtv\",\n \"mjxa6Ab4fzfFUezniWtiMcudRRXKUXBkhX\",\n \"n2CD7uc8oWKkckThQ6vMK8PWnSRTwnZNW9\",\n \"miP2ZuLcrXVzpQdS7D8eFyBwoMREPY5d85\",\n \"n36VqScWuYZq2RQDXgsmaBzrUWBizVssia\",\n \"ms29KPAjP3YgyHaYgH8swJntmRzZEEfUF1\",\n \"morJAncdHuypAa9Z8XKHcncuUxRHuGucFM\",\n \"moD6rKnqi8z241dTr5af7VgzNKzfzPbawT\",\n \"mgJB5ij3PLNgNRCvfvyup1CsZSxSmvkNns\",\n \"n2WPRvMr2jAsh8JVafa6W5gdM6v56tRkYg\",\n \"mqU13a6mhhv6ij8GT2PmpBRJqSrJiZunY8\",\n \"mjgjVMFcHsav4eWqUJZXFpyNAn4VPjxGZh\",\n \"n1L2tmc6CEq6gBvxUW4ukg5URyD2eWdqfV\",\n \"mskTkRhwhWepPcnEcmqKreADoG5ZVXniPP\",\n \"myDoCnTUAeYhjV5eSXy6CYhwoSj5NpisWe\",\n \"n1UqhucGjj97H4FL87JnFL8Aatk1bAmGHV\",\n \"mjZ8HCbb1sgYm7bvc18y8xz8h89FLuoe6T\"\n ]\n}"
}
]
},
@@ -774,7 +774,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\": \"mruESV2uxBZioC97PDsbuqjGKRCkviYRos\"\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mzsUgb5dCMh2iFp14dvqZWkLKwt4sfCcmU\"\n}"
}
]
}
@@ -824,10 +824,10 @@
"examples": [
{
"title": "Delete a blob",
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310\"\n}"
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\"\n}"
}
]
},
@@ -905,7 +905,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 \"e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310\",\n \"135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f081\",\n \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"2217e7fc6e556852849910b734b428604fd3704cab831d71a44149622a9285067d961f7cb720bbe151139ce5a832ae25\"\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\",\n \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"2bd76e60458f62cfd36bc2f8304dcc96359f388476ad79ca220b302a5dd7345da6037c027f823e17b2f251203192afb3\",\n \"98dfa858507f8c3b68aad063a88a6424b1989db4b55fdab9195ae3ba80866ac98700cbea771cc0ea0065fc4fcdac1cbe\"\n ]\n}"
}
]
},
@@ -980,10 +980,10 @@
"examples": [
{
"title": "Abandon a channel claim",
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 3f6710c07d83e45e0434983d62b6b29530794121",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012e623434c3ef9e6c0305fade6e8b1028fde34963746f25025771d28bb2cf9b47000000006b483045022100a8587da6a1f1ac023e83fe02babd02452f0d82877ac1e998dbd7f1c94bc181b1022058eaf1c53497bb85cce8fc4d221ba11b932ef4bda80ac9a758470546ad5ab9e701210356872df7d60c6022803123324524702308a57d453cd77de9a57185fc67d045aaffffffff0134b7f505000000001976a91422edc806fbf7009d40a85f930333927485ffb45688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mihe7uzo2CeWPAdCpPPwh7MkLwH53NoYHs\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"6a0a4765ae298fb8ce5fd45f56e5d0d823cf551a65d53766fc71cb89646c3a02\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"6a0a4765ae298fb8ce5fd45f56e5d0d823cf551a65d53766fc71cb89646c3a02\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 67193e65e8c0363f26aff251435cf1795e47e2f8",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000187fc493ce9081f842874b079131513508679e7f01d6058dfb1dbad7fce2ab8be000000006b483045022100b03e72becb27277ac183222249b3fb694b3f435ef21f7e4dcfe677e9129f13bf0220699a4e65156bbbafd967df6340732fbd51d8e1a20b71f3501f4548de6b3840810121031e8fea600c38afe3fa4d56a76c5a14da1c63735e97a0f4897f0148c0448c01cdffffffff0134b7f505000000001976a914ae6714999a339aef99dd18b56d49e87d1b5084a388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mwR7Mb7ofen5fzCnowjDC2GG8wwQ5Mic9P\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"f2557c72be663ec6d8e01cabb4d599957b17ed34b0844daf3c2a7493fee2cd2a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"f2557c72be663ec6d8e01cabb4d599957b17ed34b0844daf3c2a7493fee2cd2a\"\n }\n}"
}
]
},
@@ -1095,14 +1095,14 @@
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"preview\": 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\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ea490e9b788fe3d86e39f1ddd26017a4a46a07815280bff285990901958bf096010000006a47304402201ddaf5c437e4d4de5de8d95da2eb46bddd3b3534cf6a4eb13f60a6abd6a2dfd5022026ae5018f82db4ca984f598f9afd571eb9a6ad7344c6fdb207a45665f7ac9501012102365c65f8694b4fb51051c8646320b6eedb1f75b08e59710315665668133f80deffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d466d7576a91491bb608a97377923f480cb50987ec466f97ae2e088acc462a029000000001976a914f6e8134b423b2b5052396954d35477fb9f0637b988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvyN9Y5pUWo4XTok2fAJYHmrhiKMUPqivB\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412290,\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": null,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n42UY87hnpSR9fbacE6WCJDc8cyfHVa4a1\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001db75946a6e5c3ae4fba9643571cb397b944abe0f5447896d8fa4eb211203da5f010000006a473044022060f5f4558bf31494b793af0c0edfebe5d3325538ecababe967caed5b62f78f9e02205801be9412b4bada94fb1ed038bf53830c6b8dc9804ddf4ad71b5c0c431f0f350121024d0d34f9a054ed1888b0138c9169ae91085393aa874b52066d6dc1bc3cfe1857ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c56d7576a914a16b1616689b84e9c75e8859854d20052afb93bf88acc462a029000000001976a9147888050e199716fc5ac0fafa910af696715e411488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mwpbuD2xLqHN352Ag1ntMRDpu6bV9PxyLb\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113063,\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": null,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mrWGKtehqRNHX1qo9DiQbTu8vUVmTx3AJE\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\"\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\", \"preview\": 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\", \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012e623434c3ef9e6c0305fade6e8b1028fde34963746f25025771d28bb2cf9b47010000006a47304402207cc90fd6f98c1cf0d1ec4e306d34d91a772deee7df74512ce74e80e55d0761ab0220040c3b4c5205a19579f81a80b00fae3a3aa5210b12bd9ce093014ff614b3cf7b0121024e7978a5afa717e117ce4ce7c2a746872fdf51f5000a1929aab16b0dbadd09cfffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000427e280bc4603d321e21866526bd8356241a60bb685f80e8850999c09cb4fd02d4682610a1db0b490fca59053ccae1405b0e56fd537129d1674afe5b1ad19f518121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9142cbb784d8075dc6da01c74007d125b6d577a515788ace221d305000000001976a914a0011029dbc52632024beb82ce65e35e618c8ddd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miZ926v6sAnfowtQ52L42Sy9JDe7xPKN7P\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412290,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjbUc8iTY9yqsTsNNhKH9iehJrNvEoGZwq\",\n \"amount\": \"1.0\",\n \"claim_id\": \"d5b2bf1bdb558fb989addf7404cc1459a78bcf8e\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#d5b2bf1bdb558fb989addf7404cc1459a78bcf8e\",\n \"timestamp\": null,\n \"txid\": \"6add0aeef9de275b1fde43517fc7bdac32bb92c1f52783ad155e585f79b90a72\",\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\": \"3056301006072a8648ce3d020106052b8104000a0342000427e280bc4603d321e21866526bd8356241a60bb685f80e8850999c09cb4fd02d4682610a1db0b490fca59053ccae1405b0e56fd537129d1674afe5b1ad19f518\",\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\": \"mv6ygcdKPPGwnT1QvJWdE8SUjuaGUH2G4n\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"6add0aeef9de275b1fde43517fc7bdac32bb92c1f52783ad155e585f79b90a72\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"6add0aeef9de275b1fde43517fc7bdac32bb92c1f52783ad155e585f79b90a72\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000187fc493ce9081f842874b079131513508679e7f01d6058dfb1dbad7fce2ab8be010000006b483045022100b3425a6d7f4fb1d7118799116c5166fdc53eb67ce7c73c4d93c53b9948a92a54022000acb4e1b812594405997ed1d67a66cbe7d7d8887d706ee77a7c6e36d21e95f7012102aafc9b133d073a6f6cc73be0bfc7ceb60ecae2cb5776d57843b9a8370f6772fdffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a034200049825bd3b56048f750b9691a0bb78f1f643f64cb45b93f69450eab0e19aa36b0215bec62b8207f2b3f9de91112a35ee142f50bf3ce86d3a4e2176d4037e0a1999121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914f29d61de0783dcf020ec617e8b2a4e86428206ab88ace221d305000000001976a914da807b748e40ea127ad78d2613cb638a997b160b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmPUWDor4sLvbGctcUjFjRsj7o94YQmVkC\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113063,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3dnMbCeTpMMqzuJxbJB32qoa1CC5CMfRA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"7b6b7fa23d531a3a220c864d494883314800b54d\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#7b6b7fa23d531a3a220c864d494883314800b54d\",\n \"timestamp\": null,\n \"txid\": \"cc4167a5c14d4a19410a6dff9c1814869f7ac310cc792433e61cc355552d2c8c\",\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\": \"3056301006072a8648ce3d020106052b8104000a034200049825bd3b56048f750b9691a0bb78f1f643f64cb45b93f69450eab0e19aa36b0215bec62b8207f2b3f9de91112a35ee142f50bf3ce86d3a4e2176d4037e0a1999\",\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\": \"n1SHWyZqJiWMNrdCxmQx9V3xQ83hWJnJUM\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"cc4167a5c14d4a19410a6dff9c1814869f7ac310cc792433e61cc355552d2c8c\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"cc4167a5c14d4a19410a6dff9c1814869f7ac310cc792433e61cc355552d2c8c\"\n }\n}"
}
]
},
@@ -1164,14 +1164,14 @@
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
},
{
"title": "Paginate your channel claims",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1310,10 +1310,10 @@
"examples": [
{
"title": "Update a channel claim",
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 3f6710c07d83e45e0434983d62b6b29530794121 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002be13d83c27342eba2dd5f7ec09b9b4fc86fa1885a3a269c26b174699e53185f8000000006b483045022100960ca95f03525474e75d2648171edf82471a91b687d6573953dd2f65af7d341502201ec36a31b49127f83d311bec01330cac8688db14e04395f36da6b651c149ccda01210356872df7d60c6022803123324524702308a57d453cd77de9a57185fc67d045aaffffffffb7a77fbd2a247970573a4f67f5760c124e22c8f96e1985edd218d8d2298437a3000000006b48304502210085d8e789ecc0533f12399c12eb22cf7e611090d3aa08d03b55ee9e965597740c022053492e3c5fd1812d35c6c1ddf99a7fed5c27d8bcb463e1175d161555391f74e40121034f42fe5f87754a38a9e4ff74c92641e5b7cce0cb1fac01f7b42ea3209ef5443cffffffff0200e1f50500000000a6b708406368616e6e656c142141793095b2b6623d9834045ee4837dc010673f4c6a00125a0a583056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46420b4e6577204368616e6e656c6d6d76a91491bb608a97377923f480cb50987ec466f97ae2e088ac6ebeea0b000000001976a9142152297b3b1a61303c5958bc1640c9c382e85d6688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n42UY87hnpSR9fbacE6WCJDc8cyfHVa4a1\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557412290,\n \"txid\": \"a3378429d2d818d2ed85196ef9c8224e120c76f5674f3a577079242abd7fa7b7\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": null,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"miZ926v6sAnfowtQ52L42Sy9JDe7xPKN7P\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 67193e65e8c0363f26aff251435cf1795e47e2f8 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000250d1ca558876aef02a4dab31491d6ef9f87181df871eb62483d32fd97cff40e9000000006b48304502210097ca8f97bd9236114aa4e0beff7d7c75c2f3ce9bf65390c0bc2d2478f5c09a6b0220039ca9d75e3147f08d4637b7c97b896bec7fa9bdc40329194b92ef0aaac58d600121031e8fea600c38afe3fa4d56a76c5a14da1c63735e97a0f4897f0148c0448c01cdffffffffc03f7730c1486c989dcc4338f058d2b7a67803826d1c4dd7ab81b40ed7bb821f000000006b483045022100bd72d137340083d0609627957de2243784d30f614922c1d56c3ffea89f6388a702206a8913c05984d97eab6e429d46e236361d5b3ca3ce017b27d481d28b23936c30012103ce2d7ffce7a840465e470da09b80334f7d145a0d3812d51e73c05c37ed639895ffffffff0200e1f50500000000a6b708406368616e6e656c14f8e2475e79f15c4351f2af263f36c0e8653e19674c6a00125a0a583056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5420b4e6577204368616e6e656c6d6d76a914a16b1616689b84e9c75e8859854d20052afb93bf88ac6ebeea0b000000001976a9144066a516149b5efc22d609eff65d107b4672a83588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mweqDPRKNNkSLpGP2Kr651TEtQijM4NEVm\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1558113063,\n \"txid\": \"1f82bbd70eb481abd74d1c6d820378a6b7d258f03843cc9d986c48c130773fc0\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": null,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mmPUWDor4sLvbGctcUjFjRsj7o94YQmVkC\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\"\n }\n}"
}
]
}
@@ -1352,14 +1352,14 @@
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
},
{
"title": "Paginate your claims",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtoWk4QmGYMGsw89PJ8QKQuHQmaTTDPrUA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3f6710c07d83e45e0434983d62b6b29530794121\",\n \"timestamp\": 1557412290,\n \"txid\": \"479bcfb28bd2715702256f746349e3fd28108b6edefa05036c9eefc33434622e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mvETNRY6cV97UJLKq9oD1YFQMzRi7ws3x3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"timestamp\": 1558113063,\n \"txid\": \"beb82ace7faddbb1df58601df0e779865013151379b07428841f08e93c49fc87\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1426,17 +1426,17 @@
"examples": [
{
"title": "Search for all claims in channel",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"winning\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --channel_id=\"3f6710c07d83e45e0434983d62b6b29530794121\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"winning\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"absolute_channel_position\": 0,\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_sequence\": -1,\n \"confirmations\": 1,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n }\n }\n ],\n \"page\": 1,\n \"page_size\": 10,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"winning\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --channel_id=\"67193e65e8c0363f26aff251435cf1795e47e2f8\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"winning\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"absolute_channel_position\": 0,\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_sequence\": -1,\n \"confirmations\": 1,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n }\n }\n ],\n \"page\": 1,\n \"page_size\": 10,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Search for claims matching a name",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"winning\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --name=\"astream\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"winning\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_sequence\": -1,\n \"confirmations\": 1,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n }\n }\n ],\n \"page\": 1,\n \"page_size\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_sequence\": -1,\n \"confirmations\": 1,\n \"decoded_claim\": true,\n \"effective_amount\": \"1.0\",\n \"has_signature\": true,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n }\n }\n ],\n \"page\": 1,\n \"page_size\": 1,\n \"total_pages\": 1\n }\n}"
}
]
}
@@ -1583,9 +1583,9 @@
"examples": [
{
"title": "Delete a file",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"}}).json()",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -1685,21 +1685,21 @@
"is_required": false
}
],
"returns": " [\n {\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }\n ]",
"returns": " [\n {\n \"streaming_url\": \"(str) url to stream the file using range requests\",\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }\n ]",
"examples": [
{
"title": "List local files",
"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 {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"de672c28f2060f41575f08bd9aab2cb8\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"65b6982a8fddae13c12390608c58a18f1368bcb73f53b31990d4be093827f3f1945eec69b84f1ca2996a1f070a3cd7f3\",\n \"stream_name\": \"tmpfmcqxqr9\",\n \"suggested_file_name\": \"tmpfmcqxqr9\",\n \"timestamp\": 1557412291,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"written_bytes\": null\n },\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"cce9db7375721826197b998d2425809892bbdc93\",\n \"claim_name\": \"blank-image\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"532aced13a8b5f9c63d7e95879f3d251\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3fKziJ6gTJXNMFD5uTT2SzsCm35BUqBMC\",\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\": \"1557412265\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmp61vr1_8a.png\",\n \"sd_hash\": \"135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f081\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"c8926a8c21f12e96ec7b625fe337a56a60be6ae95df71794e66ae5dd32c9f8d7:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673fe1cd9b2bb7577c6eec2b6b13aa37b7723c785934ba1598e25e4274d2d03dde331b6915f66ef5da0d8a288c4e5de567284a6ef557617f49467f83f77a33e4791a0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d7036317672315f38612e706e6718632209696d6167652f706e673230135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f0Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"44bb79917c27efbb9014f8bbc78e3eeb\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"ef42dee59a9efc14a5611b1bb1a300b2fb5cfb92acf8e9a2034ddf341c42fc9293efef53761751fdcfec53ac74837b6a\",\n \"stream_name\": \"tmpip8uriwe\",\n \"streaming_url\": \"http://localhost:5280/stream/06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"suggested_file_name\": \"tmpip8uriwe\",\n \"timestamp\": 1558113064,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"written_bytes\": null\n },\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"20edd2806f871fd5137173e2c8500d3e40bbb28f\",\n \"claim_name\": \"blank-image\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"7d9e3e8063f9aefd46cfb9047130855a\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mh3A5mCcB1BWRk2qP3dwzEToC58fNymxQq\",\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\": \"1558113038\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmph7izwd1p.png\",\n \"sd_hash\": \"fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"6a2686e4b2887b4d14766e7d447c6b76d788152e12b705f13000adec63b7a611:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967e9c30300f2db8da744b33f3c1beb0f0d1f8b09607a591fd6eefdb99e487b303454a5b77b6a7d45afd612902f615de4084a65e6a104e7d0b938a94cf075aa9ce40ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1Line truncated
},
{
"title": "List files matching a parameter",
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"de672c28f2060f41575f08bd9aab2cb8\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"65b6982a8fddae13c12390608c58a18f1368bcb73f53b31990d4be093827f3f1945eec69b84f1ca2996a1f070a3cd7f3\",\n \"stream_name\": \"tmpfmcqxqr9\",\n \"suggested_file_name\": \"tmpfmcqxqr9\",\n \"timestamp\": 1557412291,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"written_bytes\": null\n }\n ]\n}"
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"44bb79917c27efbb9014f8bbc78e3eeb\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"ef42dee59a9efc14a5611b1bb1a300b2fb5cfb92acf8e9a2034ddf341c42fc9293efef53761751fdcfec53ac74837b6a\",\n \"stream_name\": \"tmpip8uriwe\",\n \"streaming_url\": \"http://localhost:5280/stream/06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"suggested_file_name\": \"tmpip8uriwe\",\n \"timestamp\": 1558113064,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"written_bytes\": null\n }\n ]\n}"
}
]
},
@@ -1743,83 +1743,83 @@
},
{
"name": "file_save",
"description": "Output a download to a file",
"description": "Start saving a file to disk.",
"arguments": [
{
"name": "file_name",
"type": "str",
"description": "delete by file name in downloads folder",
"description": "file name to save to",
"is_required": false
},
{
"name": "download_directory",
"type": "str",
"description": "delete by file name in downloads folder",
"description": "directory to save into",
"is_required": false
},
{
"name": "sd_hash",
"type": "str",
"description": "delete by file sd hash",
"description": "save file with matching sd hash",
"is_required": false
},
{
"name": "stream_hash",
"type": "str",
"description": "delete by file stream hash",
"description": "save file with matching stream hash",
"is_required": false
},
{
"name": "rowid",
"type": "int",
"description": "delete by file row id",
"description": "save file with matching row id",
"is_required": false
},
{
"name": "claim_id",
"type": "str",
"description": "delete by file claim id",
"description": "save file with matching claim id",
"is_required": false
},
{
"name": "txid",
"type": "str",
"description": "delete by file claim txid",
"description": "save file with matching claim txid",
"is_required": false
},
{
"name": "nout",
"type": "int",
"description": "delete by file claim nout",
"description": "save file with matching claim nout",
"is_required": false
},
{
"name": "claim_name",
"type": "str",
"description": "delete by file claim name",
"description": "save file with matching claim name",
"is_required": false
},
{
"name": "channel_claim_id",
"type": "str",
"description": "delete by file channel claim id",
"description": "save file with matching channel claim id",
"is_required": false
},
{
"name": "channel_name",
"type": "str",
"description": "delete by file channel claim name",
"description": "save file with matching channel claim name",
"is_required": false
}
],
"returns": " {\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }",
"returns": " {\n \"streaming_url\": \"(str) url to stream the file using range requests\",\n \"completed\": \"(bool) true if download is completed\",\n \"file_name\": \"(str) name of file\",\n \"download_directory\": \"(str) download directory\",\n \"points_paid\": \"(float) credit paid to download file\",\n \"stopped\": \"(bool) true if download is stopped\",\n \"stream_hash\": \"(str) stream hash of file\",\n \"stream_name\": \"(str) stream name\",\n \"suggested_file_name\": \"(str) suggested file name\",\n \"sd_hash\": \"(str) sd hash of file\",\n \"download_path\": \"(str) download path of file\",\n \"mime_type\": \"(str) mime type of file\",\n \"key\": \"(str) key attached to file\",\n \"total_bytes_lower_bound\": \"(int) lower bound file size in bytes\",\n \"total_bytes\": \"(int) file upper bound size in bytes\",\n \"written_bytes\": \"(int) written size in bytes\",\n \"blobs_completed\": \"(int) number of fully downloaded blobs\",\n \"blobs_in_stream\": \"(int) total blobs on stream\",\n \"blobs_remaining\": \"(int) total blobs remaining to download\",\n \"status\": \"(str) downloader status\",\n \"claim_id\": \"(str) None if claim is not found else the claim id\",\n \"txid\": \"(str) None if claim is not found else the transaction id\",\n \"nout\": \"(int) None if claim is not found else the transaction output index\",\n \"outpoint\": \"(str) None if claim is not found else the tx and output\",\n \"metadata\": \"(dict) None if claim is not found else the claim metadata\",\n \"channel_claim_id\": \"(str) None if claim is not found or not signed\",\n \"channel_name\": \"(str) None if claim is not found or not signed\",\n \"claim_name\": \"(str) None if claim is not found else the claim name\"\n }",
"examples": [
{
"title": "Save a file to the downloads directory",
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"de672c28f2060f41575f08bd9aab2cb8\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"65b6982a8fddae13c12390608c58a18f1368bcb73f53b31990d4be093827f3f1945eec69b84f1ca2996a1f070a3cd7f3\",\n \"stream_name\": \"tmpfmcqxqr9\",\n \"suggested_file_name\": \"tmpfmcqxqr9\",\n \"timestamp\": 1557412291,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"written_bytes\": null\n }\n}"
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"44bb79917c27efbb9014f8bbc78e3eeb\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"ef42dee59a9efc14a5611b1bb1a300b2fb5cfb92acf8e9a2034ddf341c42fc9293efef53761751fdcfec53ac74837b6a\",\n \"stream_name\": \"tmpip8uriwe\",\n \"streaming_url\": \"http://localhost:5280/stream/06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"suggested_file_name\": \"tmpip8uriwe\",\n \"timestamp\": 1558113064,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"written_bytes\": null\n }\n}"
}
]
},
@@ -1909,7 +1909,7 @@
"curl": "curl -d'{\"method\": \"settings_get\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet settings get",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"settings_get\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"blob_download_timeout\": 30.0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"comment_server\": \"http://comments.lbry.com:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/jack/.lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmppe9osroo\",\n \"download_dir\": \"/tmp/tmppe9osroo\",\n \"download_timeout\": 30.0,\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 8,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 2.0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"tcp_port\": 3333,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"wallet_dir\": \"/tmp/tmppe9osroo\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"blob_download_timeout\": 30.0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"comment_server\": \"http://comments.lbry.com:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/jack/.lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpnk2c4f2x\",\n \"download_dir\": \"/tmp/tmpnk2c4f2x\",\n \"download_timeout\": 30.0,\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"wallet_dir\": \"/tmp/tmpnk2c4f2x\"\n }\n}"
}
]
},
@@ -1970,10 +1970,10 @@
"examples": [
{
"title": "Abandon a stream claim",
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon ed10be11aef6501957c61077a1a8d0ae2ee69a9a",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000016bfeb1c5a9f6ba9993982efcf6b3d263af20959caa96ca2f3e119cdb2a9bb5a9000000006b483045022100ce0d0e3c393ca028471d656bc8f0cf98128d6c4ac191b72d1729a8ad1d29fc6402201803d1e5f6b571786abc3ed99f69b44d7002d3fffb91ef188f4462511adf94da012103ee840c67b3bf07f9be296c33298dc25fa4cc10759079fe0b490030f5c0ed243bffffffff0134b7f505000000001976a914201e4da198f796d551193a574289f1a57b8ef8ef88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miSnDhW4U5DDhjvUpZkGqeVXWYbe37yaRS\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"f6baccc6e166ffc59cb21ac6e6f3de44d817095c485881ece50e6bd7b0ca4180\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"f6baccc6e166ffc59cb21ac6e6f3de44d817095c485881ece50e6bd7b0ca4180\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon 2606a71cd812c77bc3dc76ecc3727e0368b1af6d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001b7b5e2967c3e050f0af9a3e7641aaa52da33325226e6f8738ff4b53c27496cb6000000006b483045022100d560713a5a8d9369754bbe3c861331642f0095a7e9c34560b2efe17c9adc1f07022076d2a9e52de7062a27e36c38c6da5239b31fa3531f0b04411fb22b6b6d8623fd01210248599b7ed9d22dc6e1569332c54749b5f9c02402a49a98da5c92ef3df448f113ffffffff0134b7f505000000001976a914ce70166483a78ef6018c6766c68c0b0442fc9e6e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzLVmYa3EbjZcnZJQ9g3LrEJ7Kj4HL1Wmi\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"b55ff6c7813dbc1759b701f6273811d9a386ce40b10ff5571aec661a7b880682\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"b55ff6c7813dbc1759b701f6273811d9a386ce40b10ff5571aec661a7b880682\"\n }\n}"
}
]
},
@@ -2156,17 +2156,17 @@
"examples": [
{
"title": "Create a stream claim without metadata",
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpfmcqxqr9\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmpfmcqxqr9",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpfmcqxqr9\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001be13d83c27342eba2dd5f7ec09b9b4fc86fa1885a3a269c26b174699e53185f8010000006b4830450221009276471c41cb424518112603ca931b5555c48378966363a73425c746475c7b8b02207f1267c3b65260369b86a8a428764006888ca3b9e1f5be94d141697f5ac144070121034f42fe5f87754a38a9e4ff74c92641e5b7cce0cb1fac01f7b42ea3209ef5443cffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa6d7576a9143c2e372b4add56043ac276a706e1bb2750339e0188ac38fb9423000000001976a914799309e5d6680b2cc6cad9de3ff681c77ac5145b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n42UY87hnpSR9fbacE6WCJDc8cyfHVa4a1\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412290,\n \"txid\": \"f88531e59946176bc269a2a38518fa86fcb4b909ecf7d52dba2e34273cd813be\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"timestamp\": null,\n \"txid\": \"ad78dfa585175ec1a1f97f051f809eecd47d18f7bc8bd6986146f5077cae3f8e\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mrbnCh2Z3Tqo3JqW8YZefRLk8zv7P7fVvA\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"ad78dfa585175ec1a1f97f051f809eecd47d18f7bc8bd6986146f5077cae3f8e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"ad78dfa585175ec1a1f97f051f809eecd47d18f7bc8bd6986146f5077cae3f8e\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpip8uriwe\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmpip8uriwe",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpip8uriwe\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000150d1ca558876aef02a4dab31491d6ef9f87181df871eb62483d32fd97cff40e9010000006b483045022100ade1d56753cee6dd79ea183dd7389ecc051265361d6066b146406da91588cf9702204a57095efa8618089d8e3d1e8f3806df2e221a62c23e489c540747c12d4a4a1d012102e4f371b1ecf18107102c17cd564b9649f6c45ccb605691c5a80c7c94c54acd64ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a0424626d7576a914d03b84e073b9094b455ff6b00d33fa88d2810f2188ac38fb9423000000001976a9144205724c6bbfdfd050bf1d0866338b7d11207a8488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mrWGKtehqRNHX1qo9DiQbTu8vUVmTx3AJE\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113063,\n \"txid\": \"e940ff7cd92fd38324b61e87df8171f8f96e1d4931ab4d2af0ae768855cad150\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"timestamp\": null,\n \"txid\": \"5d885f1883b8119fe5ff86463198d275833fbd59fceda1d2c2a3e3a42e4554de\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmY3R9EcmdQTb5p8hxGHSpD9rou8ki41yN\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"5d885f1883b8119fe5ff86463198d275833fbd59fceda1d2c2a3e3a42e4554de\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"5d885f1883b8119fe5ff86463198d275833fbd59fceda1d2c2a3e3a42e4554de\"\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/tmp61vr1_8a.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1557412265, \"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmp61vr1_8a.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=1557412265 --channel_id=\"3f6710c07d83e45e0434983d62b6b29530794121\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp61vr1_8a.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1557412265, \"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000018e3fae7c07f5466198d68bbcf7187dd4ec9e801f057ff9a1c15e1785a5df78ad010000006b483045022100a4c76abe1d8d8108612e41c4aa16adb14cca338c5a9d9aaa05ae54a8ed5c72bb0220308cf38219d9f7e893a418a3b857c8c541e2178e74be666938cee245fe27e5640121024992dc4c1592aed07c4bf9f0a29df780e1c804d1a7e8b4d4532940bfd3a60721ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db101012141793095b2b6623d9834045ee4837dc010673fe1cd9b2bb7577c6eec2b6b13aa37b7723c785934ba1598e25e4274d2d03dde331b6915f66ef5da0d8a288c4e5de567284a6ef557617f49467f83f77a33e4791a0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d7036317672315f38612e706e6718632209696d6167652f706e673230135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f081120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728a9f3d0e6053222080112196ff2e835c499324eba9344a2525e0ff67b8696acd823cc406b188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914f2e835c499324eba9344a2525e0ff67b8696acd888acac5e7d1d000000001976a91487ff28c16efc769df297e43ab5d6f7a51833e2ab88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mrbnCh2Z3Tqo3JqW8YZefRLk8zv7P7fVvA\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412291,\n \"txid\": \"ad78dfa585175ec1a1f97f051f809eecd47d18f7bc8bd6986146f5077cae3f8e\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3fKziJ6gTJXNMFD5uTT2SzsCm35BUqBMC\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cce9db7375721826197b998d2425809892bbdc93\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#cce9db7375721826197b998d2425809892bbdc93\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"c8926a8c21f12e96ec7b625fe337a56a60be6ae95df71794e66ae5dd32c9f8d7\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3fKziJ6gTJXNMFD5uTT2SzsCm35BUqBMC\",\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\": \"1557412265\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmp61vr1_8a.png\",\n \"sd_hash\": \"135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f081\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"msv3BiuJ4RHWEbdYE665DaxxGQbmTjtPW2\",\n \"amount\": \"4.947555\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"c8926a8c21f12e96ec7b625fe337a56a60be6ae95df71794e66ae5dd32c9f8d7\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"5.969662\",\n \"total_output\": \"5.947555\",\n \"txid\": \"c8926a8c21f12e96ec7b625fe337a56a60be6ae95df71794Line truncated
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmph7izwd1p.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1558113038, \"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmph7izwd1p.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=1558113038 --channel_id=\"67193e65e8c0363f26aff251435cf1795e47e2f8\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmph7izwd1p.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1558113038, \"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001de54452ea4e3a3c2d2a1edfc59bd3f8375d298314686ffe59f11b883185f885d010000006a4730440220415a6ce0db25a258338a055f68e6cc8e7bde6a19856f8e0d7de66d4e405f87e102206ac0121d9e1de2c45a8b452abd3c9577fa49903cc295cb2993f2f21e48ecc2a80121020bfcf9627405a59302cff34631349d05c4e0932539b49e9c3c1f42716c9fa93bffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101f8e2475e79f15c4351f2af263f36c0e8653e1967e9c30300f2db8da744b33f3c1beb0f0d1f8b09607a591fd6eefdb99e487b303454a5b77b6a7d45afd612902f615de4084a65e6a104e7d0b938a94cf075aa9ce40ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706837697a776431702e706e6718632209696d6167652f706e673230fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f7267288ed6fbe6053222080112196f10ae71e0a9fd99f62361922757769d7613456d247a60a9a2188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a91410ae71e0a9fd99f62361922757769d7613456d2488acac5e7d1d000000001976a914f5b96ca126423359a466456e164dc1edfcf9914288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmY3R9EcmdQTb5p8hxGHSpD9rou8ki41yN\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113064,\n \"txid\": \"5d885f1883b8119fe5ff86463198d275833fbd59fceda1d2c2a3e3a42e4554de\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mh3A5mCcB1BWRk2qP3dwzEToC58fNymxQq\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20edd2806f871fd5137173e2c8500d3e40bbb28f\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#20edd2806f871fd5137173e2c8500d3e40bbb28f\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"6a2686e4b2887b4d14766e7d447c6b76d788152e12b705f13000adec63b7a611\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mh3A5mCcB1BWRk2qP3dwzEToC58fNymxQq\",\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\": \"1558113038\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmph7izwd1p.png\",\n \"sd_hash\": \"fb5be9ad617fd756b29c835efb11e6fa44a301b7a506bb72d58108a0f276a6bf86591e0bce04525d098440fb9f5b286a\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n3vDyZVf6EuxN2r6BqLpMgS67f4epzdqZT\",\n \"amount\": \"4.947555\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"6a2686e4b2887b4d14766e7d447c6b76d788152e12b705f13000adec63b7a611\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"5.969662\",\n \"total_output\": \"5.947555\",\n \"txid\": \"6a2686e4b2887b4d14766e7d447c6b76d788152e12b705Line truncated
}
]
},
@@ -2200,14 +2200,14 @@
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ]\n}"
},
{
"title": "Paginate your stream claims",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557412291,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1558113064,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -2424,10 +2424,10 @@
"examples": [
{
"title": "Update a stream claim to add channel",
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update ed10be11aef6501957c61077a1a8d0ae2ee69a9a --channel_id=\"3f6710c07d83e45e0434983d62b6b29530794121\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000028e3fae7c07f5466198d68bbcf7187dd4ec9e801f057ff9a1c15e1785a5df78ad000000006a47304402202023c676b2bd9e303bf9857f94c45beb55b68ed42409b3fd257d94f6f25d2ec00220452a9064f2908deec9e8060babf128dff66188a78e92ae6237f9fee0e2f431ac012103ee840c67b3bf07f9be296c33298dc25fa4cc10759079fe0b490030f5c0ed243bffffffff720ab9795f585e15ad8327f5c192bb32acbdc77f5143de1f5b27def9ee0add6a010000006a473044022073e4f0819fa1338bc63f19810741500734fcf4f8b527b907963adaae769a4f7d02204e34e00e71c83c9a46a67ca340512ec41ec90266c0383af5c1dbd9896b7b87ab012103d581ddc113506f32d8b215d97316f3df4559ff4b161fdfbecf29ebcc689a3827ffffffff0200e1f50500000000fd2301b7076173747265616d149a9ae62eaed0a8a17710c6571950f6ae11be10ed4ce8012141793095b2b6623d9834045ee4837dc010673f69741f82a15c92d092bc923e9d31c39d8367e5b29c9159efa878c5a4556fc742cde21b4046ca582e62c72b134fbb4fc78ec968cf172bf646f0da28f9ea5778a80a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70666d637178717239180b22186170706c69636174696f6e2f6f637465742d73747265616d3230564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa6d6d76a9143c2e372b4add56043ac276a706e1bb2750339e0188ac32a0d205000000001976a91460dbfd055c18945c66046497c015fb7d9f95b98788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"timestamp\": 1557412291,\n \"txid\": \"ad78dfa585175ec1a1f97f051f809eecd47d18f7bc8bd6986146f5077cae3f8e\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv6ygcdKPPGwnT1QvJWdE8SUjuaGUH2G4n\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557412290,\n \"txid\": \"6add0aeef9de275b1fde43517fc7bdac32bb92c1f52783ad155e585f79b90a72\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mm1ACg1WdL9cunAY9q9kuDSokVPMWEMTB3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ed10be11aef6501957c61077a1a8d0ae2ee69a9a\",\n \"signing_channel\": {\n \"claim_id\": \"3f6710c07d83e45e0434983d62b6b29530794121\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000445e2d150380e5ac43f5bd01da23ab1f2900bee84671d223a8d30065d80d1ddba9d1d6424d171d34328d34135ba1eadc7d7dbfe603d6f15d0d484b45958361d46\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpfmcqxqr9\",\n \"sd_hash\": \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mpM6hXeP4zjRPrLeHh26dxdngnvS7AfceT\",\n \"amount\": \"0.9768965\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a9b59b2adb9c113e2fca96aa9c9520af63d2b3f6fc2e989399baf6a9c5b1fe6b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000332\",\n \"total_input\": \"1.9772285\",\n \"total_output\": \"1.9768965\",\n \"txid\": \"a9b59bLine truncated
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update 2606a71cd812c77bc3dc76ecc3727e0368b1af6d --channel_id=\"67193e65e8c0363f26aff251435cf1795e47e2f8\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002de54452ea4e3a3c2d2a1edfc59bd3f8375d298314686ffe59f11b883185f885d000000006b4830450221009bf40501fd5dcff6a5712dbe3a4169c6704e20d51f7c9a1c709584ff7703c311022060127b652e57b1722ca32a1fabd1a57770524bce439b92c2c7898316d7842c5501210248599b7ed9d22dc6e1569332c54749b5f9c02402a49a98da5c92ef3df448f113ffffffff8c2c2d5555c31ce6332479cc10c37a9f8614189cff6d0a41194a4dc1a56741cc010000006a47304402207827109f24fae8c5198f46ce44ae0ce5751efc1613e4c02414a5ad0dc77cdb2f022024c29dbabbbb317980c8ea4f090ff68becd762dbf56f89d1a0be1aae5bc65a8d0121038cb31d7471b5442c0df144d16733fbe51334f1b5348ba0267d67309aefe3489bffffffff0200e1f50500000000fd2301b7076173747265616d146dafb168037e72c3ec76dcc37bc712d81ca706264ce801f8e2475e79f15c4351f2af263f36c0e8653e1967128556beabb3c0f3216a15825a50d9f22326fff3c4f8b53089ced7fed5b66aaf3eb00db47aba375985ea1440e0ddee48e5ef9e695688f8d31284f25ab37ebc5b0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706970387572697765180b22186170706c69636174696f6e2f6f637465742d73747265616d323006310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a0424626d6d76a914d03b84e073b9094b455ff6b00d33fa88d2810f2188ac32a0d205000000001976a91450ac4be0af83010408c157824719217c048bdac488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"timestamp\": 1558113064,\n \"txid\": \"5d885f1883b8119fe5ff86463198d275833fbd59fceda1d2c2a3e3a42e4554de\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n1SHWyZqJiWMNrdCxmQx9V3xQ83hWJnJUM\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1558113063,\n \"txid\": \"cc4167a5c14d4a19410a6dff9c1814869f7ac310cc792433e61cc355552d2c8c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzVz9QnHzyJ15wCFAYRt7bzLoeoBK83N8J\",\n \"amount\": \"1.0\",\n \"claim_id\": \"2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#2606a71cd812c77bc3dc76ecc3727e0368b1af6d\",\n \"signing_channel\": {\n \"claim_id\": \"67193e65e8c0363f26aff251435cf1795e47e2f8\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000487b10920b14642f4e0bca8d5225def746ae52ad02277aacd22fd770d1c5fcf82979fc8b9047dfe901bb973c71511ce4bc09b92c6d2f2377f1673ff5a899e35c5\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpip8uriwe\",\n \"sd_hash\": \"06310334c23b0473ff2464d94717052a61da6ceeb7be591779ef68b3b1633db273586a22f6d29fcf95e1c1ed6a042462\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnsWkmGMmaPRXEfwAcM2Fwy8ULUXNxYeCd\",\n \"amount\": \"0.9768965\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b66c49273cb5f48f73f8e626523233da52aa1a64e7a3f90a0f053e7c96e2b5b7\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000332\",\n \"total_input\": \"1.9772285\",\n \"total_output\": \"1.9768965\",\n \"txid\": \"b66cLine truncated
}
]
}
@@ -2623,7 +2623,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 {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2019-05-09 10:31\",\n \"fee\": \"-0.000124\",\n \"support_info\": [],\n \"timestamp\": 1557412290,\n \"txid\": \"96f08b9501099985f2bf805281076aa4a41760d2ddf1396ed8e38f789b0e49ea\",\n \"update_info\": [],\n \"value\": \"-2.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-05-09 10:31\",\n \"fee\": \"0.0\",\n \"support_info\": [],\n \"timestamp\": 1557412289,\n \"txid\": \"953139e316bf7ce7d4d93b9418d64e801b7e35b41f4feb1c94be296b0c636fb0\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2019-05-17 13:11\",\n \"fee\": \"-0.000124\",\n \"support_info\": [],\n \"timestamp\": 1558113063,\n \"txid\": \"5fda031221eba48f6d8947540fbe4a947b39cb713564a9fbe43a5c6e6a9475db\",\n \"update_info\": [],\n \"value\": \"-2.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-05-17 13:11\",\n \"fee\": \"0.0\",\n \"support_info\": [],\n \"timestamp\": 1558113062,\n \"txid\": \"468367c951e1a96f9456b61ca218374058fc0351f4b48520276950c44460435f\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ]\n}"
}
]
},
+3 -2
View File
@@ -4,8 +4,9 @@
share_usage_data: True
lbryum_servers:
- lbryumx1.lbry.io:50001
- lbryumx2.lbry.io:50001
- lbryumx1.lbry.com:50001
- lbryumx2.lbry.com:50001
- lbryumx4.lbry.com:50001
blockchain_name: lbrycrd_main
+1 -1
View File
@@ -1,4 +1,4 @@
__name__ = "lbrynet"
__version__ = "0.37.0rc6"
__version__ = "0.37.2rc2"
version = tuple(__version__.split('.'))
+3
View File
@@ -2,6 +2,7 @@ import os
import typing
import asyncio
import logging
from lbrynet.utils import LRUCache
from lbrynet.blob.blob_file import is_valid_blobhash, BlobFile, BlobBuffer, AbstractBlob
from lbrynet.stream.descriptor import StreamDescriptor
@@ -30,6 +31,8 @@ class BlobManager:
else self._node_data_store.completed_blobs
self.blobs: typing.Dict[str, AbstractBlob] = {}
self.config = config
self.decrypted_blob_lru_cache = None if not self.config.blob_lru_cache_size else LRUCache(
self.config.blob_lru_cache_size)
def _get_blob(self, blob_hash: str, length: typing.Optional[int] = None):
if self.config.save_blobs:
+2 -2
View File
@@ -31,8 +31,8 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
self.closed = asyncio.Event(loop=self.loop)
def data_received(self, data: bytes):
log.debug("%s:%d -- got %s bytes -- %s bytes on buffer -- %s blob bytes received",
self.peer_address, self.peer_port, len(data), len(self.buf), self._blob_bytes_received)
#log.debug("%s:%d -- got %s bytes -- %s bytes on buffer -- %s blob bytes received",
# self.peer_address, self.peer_port, len(data), len(self.buf), self._blob_bytes_received)
if not self.transport or self.transport.is_closing():
log.warning("transport closing, but got more bytes from %s:%i\n%s", self.peer_address, self.peer_port,
binascii.hexlify(data))
+4 -5
View File
@@ -15,7 +15,6 @@ log = logging.getLogger(__name__)
class BlobDownloader:
BAN_FACTOR = 2.0 # fixme: when connection manager gets implemented, move it out from here
BAN_CAP = 30.0*60.0 # maximum time a node remains banned before being retried
def __init__(self, loop: asyncio.BaseEventLoop, config: 'Config', blob_manager: 'BlobManager',
peer_queue: asyncio.Queue):
@@ -38,7 +37,6 @@ class BlobDownloader:
async def request_blob_from_peer(self, blob: 'AbstractBlob', peer: 'KademliaPeer', connection_id: int = 0):
if blob.get_is_verified():
return
self.scores[peer] = self.scores.get(peer, 0) - 1 # starts losing score, to account for cancelled ones
transport = self.connections.get(peer)
start = self.loop.time()
bytes_received, transport = await request_blob(
@@ -56,23 +54,24 @@ class BlobDownloader:
self.failures[peer] = 0
self.connections[peer] = transport
elapsed = self.loop.time() - start
self.scores[peer] = bytes_received / elapsed if bytes_received and elapsed else 0
self.scores[peer] = bytes_received / elapsed if bytes_received and elapsed else 1
async def new_peer_or_finished(self):
active_tasks = list(self.active_connections.values()) + [asyncio.sleep(1)]
await asyncio.wait(active_tasks, loop=self.loop, return_when='FIRST_COMPLETED')
def cleanup_active(self):
if not self.active_connections and not self.connections:
self.clearbanned()
to_remove = [peer for (peer, task) in self.active_connections.items() if task.done()]
for peer in to_remove:
del self.active_connections[peer]
self.clearbanned()
def clearbanned(self):
now = self.loop.time()
self.ignored = dict((
(peer, when) for (peer, when) in self.ignored.items()
if (now - when) < min(self.BAN_CAP, (self.failures.get(peer, 0) ** self.BAN_FACTOR))
if (now - when) < min(30.0, (self.failures.get(peer, 0) ** self.BAN_FACTOR))
))
@cache_concurrent
+1
View File
@@ -1,2 +1,3 @@
# don't touch this. CI server changes this during build/deployment
BUILD = "dev"
BUILD_COMMIT = "source installation"
+26 -7
View File
@@ -485,7 +485,10 @@ class Config(CLIConfig):
# blob announcement and download
save_blobs = Toggle("Save encrypted blob files for hosting, otherwise download blobs to memory only.", True)
blob_lru_cache_size = Integer(
"LRU cache size for decrypted downloaded blobs used to minimize re-downloading the same blobs when "
"replying to a range request. Set to 0 to disable.", 32
)
announce_head_and_sd_only = Toggle(
"Announce only the descriptor and first (rather than all) data blob for a stream to the DHT", True,
previous_names=['announce_head_blobs_only']
@@ -520,14 +523,15 @@ class Config(CLIConfig):
('reflector.lbry.io', 5566)
])
lbryum_servers = Servers("SPV wallet servers", [
('lbryumx1.lbry.io', 50001),
('lbryumx2.lbry.io', 50001)
('lbryumx1.lbry.com', 50001), # US EAST
('lbryumx2.lbry.com', 50001), # US EAST
('lbryumx4.lbry.com', 50001) #EU
])
known_dht_nodes = Servers("Known nodes for bootstrapping connection to the DHT", [
('lbrynet1.lbry.io', 4444), # US EAST
('lbrynet2.lbry.io', 4444), # US WEST
('lbrynet3.lbry.io', 4444), # EU
('lbrynet4.lbry.io', 4444) # ASIA
('lbrynet1.lbry.com', 4444), # US EAST
('lbrynet2.lbry.com', 4444), # US WEST
('lbrynet3.lbry.com', 4444), # EU
('lbrynet4.lbry.com', 4444) # ASIA
])
# comment server uses a single string because requests are made to the /api resource
@@ -546,6 +550,21 @@ class Config(CLIConfig):
previous_names=['upload_log', 'upload_log', 'share_debug_info']
)
# media server
streaming_server = String('Host name and port to serve streaming media over range requests',
'localhost:5280', metavar='HOST:PORT')
streaming_get = Toggle("Enable the /get endpoint for the streaming media server. "
"Disable to prevent new streams from being added.", True)
@property
def streaming_host(self):
return self.streaming_server.split(':')[0]
@property
def streaming_port(self):
return int(self.streaming_server.split(':')[1])
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.set_default_paths()
+4 -1
View File
@@ -33,6 +33,10 @@ class BlobAnnouncer:
while batch_size:
if not self.node.joined.is_set():
await self.node.joined.wait()
await asyncio.sleep(60, loop=self.loop)
if not self.node.protocol.routing_table.get_peers():
log.warning("No peers in DHT, announce round skipped")
continue
self.announce_queue.extend(await self.storage.get_blobs_to_announce())
log.debug("announcer task wake up, %d blobs to announce", len(self.announce_queue))
while len(self.announce_queue):
@@ -45,7 +49,6 @@ class BlobAnnouncer:
if announced:
await self.storage.update_last_announced_blobs(announced)
log.info("announced %i blobs", len(announced))
await asyncio.sleep(60)
def start(self, batch_size: typing.Optional[int] = 10):
assert not self.announce_task or self.announce_task.done(), "already running"
+69 -97
View File
@@ -2,11 +2,8 @@ import logging
import asyncio
import typing
import binascii
import contextlib
from lbrynet.utils import resolve_host
from lbrynet.dht import constants
from lbrynet.dht.error import RemoteException
from lbrynet.dht.protocol.async_generator_junction import AsyncGeneratorJunction
from lbrynet.dht.protocol.distance import Distance
from lbrynet.dht.protocol.iterative_find import IterativeNodeFinder, IterativeValueFinder
from lbrynet.dht.protocol.protocol import KademliaProtocol
@@ -31,7 +28,7 @@ class Node:
self._join_task: asyncio.Task = None
self._refresh_task: asyncio.Task = None
async def refresh_node(self):
async def refresh_node(self, force_once=False):
while True:
# remove peers with expired blob announcements from the datastore
self.protocol.data_store.removed_expired_peers()
@@ -58,6 +55,8 @@ class Node:
peers = await self.peer_search(node_ids.pop())
total_peers.extend(peers)
else:
if force_once:
break
fut = asyncio.Future(loop=self.loop)
self.loop.call_later(constants.refresh_interval // 4, fut.set_result, None)
await fut
@@ -67,30 +66,33 @@ class Node:
to_ping = [peer for peer in set(total_peers) if self.protocol.peer_manager.peer_is_good(peer) is not True]
if to_ping:
self.protocol.ping_queue.enqueue_maybe_ping(*to_ping, delay=0)
if force_once:
break
fut = asyncio.Future(loop=self.loop)
self.loop.call_later(constants.refresh_interval, fut.set_result, None)
await fut
async def announce_blob(self, blob_hash: str) -> typing.List[bytes]:
announced_to_node_ids = []
while not announced_to_node_ids:
hash_value = binascii.unhexlify(blob_hash.encode())
assert len(hash_value) == constants.hash_length
peers = await self.peer_search(hash_value)
hash_value = binascii.unhexlify(blob_hash.encode())
assert len(hash_value) == constants.hash_length
peers = await self.peer_search(hash_value)
if not self.protocol.external_ip:
raise Exception("Cannot determine external IP")
log.debug("Store to %i peers", len(peers))
for peer in peers:
log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port)
stored_to_tup = await asyncio.gather(
*(self.protocol.store_to_peer(hash_value, peer) for peer in peers), loop=self.loop
)
announced_to_node_ids.extend([node_id for node_id, contacted in stored_to_tup if contacted])
if not self.protocol.external_ip:
raise Exception("Cannot determine external IP")
log.debug("Store to %i peers", len(peers))
for peer in peers:
log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port)
stored_to_tup = await asyncio.gather(
*(self.protocol.store_to_peer(hash_value, peer) for peer in peers), loop=self.loop
)
stored_to = [node_id for node_id, contacted in stored_to_tup if contacted]
if stored_to:
log.info("Stored %s to %i of %i attempted peers", binascii.hexlify(hash_value).decode()[:8],
len(announced_to_node_ids), len(peers))
return announced_to_node_ids
len(stored_to), len(peers))
else:
log.warning("Failed announcing %s, stored to 0 peers", blob_hash[:8])
return stored_to
def stop(self) -> None:
if self.joined.is_set():
@@ -101,6 +103,7 @@ class Node:
self._refresh_task.cancel()
if self.protocol and self.protocol.ping_queue.running:
self.protocol.ping_queue.stop()
self.protocol.stop()
if self.listening_port is not None:
self.listening_port.close()
self._join_task = None
@@ -113,6 +116,7 @@ class Node:
lambda: self.protocol, (interface, self.internal_udp_port)
)
log.info("DHT node listening on UDP %s:%i", interface, self.internal_udp_port)
self.protocol.start()
else:
log.warning("Already bound to port %s", self.listening_port)
@@ -130,33 +134,31 @@ class Node:
if known_node_urls:
for host, port in known_node_urls:
address = await resolve_host(host, port, proto='udp')
if (address, port) not in known_node_addresses and address != self.protocol.external_ip:
if (address, port) not in known_node_addresses and\
(address, port) != (self.protocol.external_ip, self.protocol.udp_port):
known_node_addresses.append((address, port))
url_to_addr[address] = host
if known_node_addresses:
while not self.protocol.routing_table.get_peers():
success = False
# ping the seed nodes, this will set their node ids (since we don't know them ahead of time)
for address, port in known_node_addresses:
peer = self.protocol.get_rpc_peer(KademliaPeer(self.loop, address, udp_port=port))
try:
await peer.ping()
success = True
except asyncio.TimeoutError:
log.warning("seed node (%s:%i) timed out in %s", url_to_addr.get(address, address), port,
round(self.protocol.rpc_timeout, 2))
if success:
break
# now that we have the seed nodes in routing, to an iterative lookup of our own id to populate the buckets
# in the routing table with good peers who are near us
async with self.peer_search_junction(self.protocol.node_id, max_results=16) as junction:
async for peers in junction:
for peer in peers:
try:
await self.protocol.get_rpc_peer(peer).ping()
except (asyncio.TimeoutError, RemoteException):
pass
peers = [
KademliaPeer(self.loop, address, udp_port=port)
for (address, port) in known_node_addresses
]
while True:
if not self.protocol.routing_table.get_peers():
if self.joined.is_set():
self.joined.clear()
self.protocol.peer_manager.reset()
self.protocol.ping_queue.enqueue_maybe_ping(*peers, delay=0.0)
peers.extend(await self.peer_search(self.protocol.node_id, shortlist=peers, count=32))
if self.protocol.routing_table.get_peers():
self.joined.set()
log.info(
"Joined DHT, %i peers known in %i buckets", len(self.protocol.routing_table.get_peers()),
self.protocol.routing_table.buckets_with_contacts())
else:
continue
await asyncio.sleep(1, loop=self.loop)
log.info("Joined DHT, %i peers known in %i buckets", len(self.protocol.routing_table.get_peers()),
self.protocol.routing_table.buckets_with_contacts())
@@ -169,78 +171,48 @@ class Node:
)
)
def get_iterative_node_finder(self, key: bytes, shortlist: typing.Optional[typing.List] = None,
def get_iterative_node_finder(self, key: bytes, shortlist: typing.Optional[typing.List['KademliaPeer']] = None,
bottom_out_limit: int = constants.bottom_out_limit,
max_results: int = constants.k) -> IterativeNodeFinder:
return IterativeNodeFinder(self.loop, self.protocol.peer_manager, self.protocol.routing_table, self.protocol,
key, bottom_out_limit, max_results, None, shortlist)
def get_iterative_value_finder(self, key: bytes, shortlist: typing.Optional[typing.List] = None,
def get_iterative_value_finder(self, key: bytes, shortlist: typing.Optional[typing.List['KademliaPeer']] = None,
bottom_out_limit: int = 40,
max_results: int = -1) -> IterativeValueFinder:
return IterativeValueFinder(self.loop, self.protocol.peer_manager, self.protocol.routing_table, self.protocol,
key, bottom_out_limit, max_results, None, shortlist)
@contextlib.asynccontextmanager
async def stream_peer_search_junction(self, hash_queue: asyncio.Queue, bottom_out_limit=20,
max_results=-1) -> AsyncGeneratorJunction:
peer_generator = AsyncGeneratorJunction(self.loop)
async def _add_hashes_from_queue():
while True:
blob_hash = await hash_queue.get()
peer_generator.add_generator(
self.get_iterative_value_finder(
binascii.unhexlify(blob_hash.encode()), bottom_out_limit=bottom_out_limit,
max_results=max_results
)
)
add_hashes_task = self.loop.create_task(_add_hashes_from_queue())
try:
async with peer_generator as junction:
yield junction
finally:
if add_hashes_task and not (add_hashes_task.done() or add_hashes_task.cancelled()):
add_hashes_task.cancel()
def peer_search_junction(self, node_id: bytes, max_results=constants.k*2,
bottom_out_limit=20) -> AsyncGeneratorJunction:
peer_generator = AsyncGeneratorJunction(self.loop)
peer_generator.add_generator(
self.get_iterative_node_finder(
node_id, bottom_out_limit=bottom_out_limit, max_results=max_results
)
)
return peer_generator
async def peer_search(self, node_id: bytes, count=constants.k, max_results=constants.k*2,
bottom_out_limit=20) -> typing.List['KademliaPeer']:
accumulated: typing.List['KademliaPeer'] = []
async with self.peer_search_junction(node_id, max_results=max_results,
bottom_out_limit=bottom_out_limit) as junction:
async for peers in junction:
accumulated.extend(peers)
bottom_out_limit=20, shortlist: typing.Optional[typing.List['KademliaPeer']] = None
) -> typing.List['KademliaPeer']:
peers = []
async for iteration_peers in self.get_iterative_node_finder(
node_id, shortlist=shortlist, bottom_out_limit=bottom_out_limit, max_results=max_results):
peers.extend(iteration_peers)
distance = Distance(node_id)
accumulated.sort(key=lambda peer: distance(peer.node_id))
return accumulated[:count]
peers.sort(key=lambda peer: distance(peer.node_id))
return peers[:count]
async def _accumulate_search_junction(self, search_queue: asyncio.Queue,
result_queue: asyncio.Queue):
async with self.stream_peer_search_junction(search_queue) as search_junction: # pylint: disable=E1701
async for peers in search_junction:
if peers:
result_queue.put_nowait([
peer for peer in peers
if not (
peer.address == self.protocol.external_ip
and peer.tcp_port == self.protocol.peer_port
)
])
tasks = []
try:
while True:
blob_hash = await search_queue.get()
tasks.append(self.loop.create_task(self._value_producer(blob_hash, result_queue)))
finally:
for task in tasks:
task.cancel()
async def _value_producer(self, blob_hash: str, result_queue: asyncio.Queue):
async for results in self.get_iterative_value_finder(binascii.unhexlify(blob_hash.encode())):
result_queue.put_nowait(results)
def accumulate_peers(self, search_queue: asyncio.Queue,
peer_queue: typing.Optional[asyncio.Queue] = None) -> typing.Tuple[
asyncio.Queue, asyncio.Task]:
q = peer_queue or asyncio.Queue()
return q, asyncio.create_task(self._accumulate_search_junction(search_queue, q))
q = peer_queue or asyncio.Queue(loop=self.loop)
return q, self.loop.create_task(self._accumulate_search_junction(search_queue, q))
+10 -6
View File
@@ -31,7 +31,10 @@ class PeerManager:
self._node_id_mapping: typing.Dict[typing.Tuple[str, int], bytes] = {}
self._node_id_reverse_mapping: typing.Dict[bytes, typing.Tuple[str, int]] = {}
self._node_tokens: typing.Dict[bytes, (float, bytes)] = {}
self._kademlia_peers: typing.Dict[typing.Tuple[bytes, str, int], 'KademliaPeer']
def reset(self):
for statistic in (self._rpc_failures, self._last_replied, self._last_sent, self._last_requested):
statistic.clear()
def report_failure(self, address: str, udp_port: int):
now = self._loop.time()
@@ -104,11 +107,12 @@ class PeerManager:
delay = self._loop.time() - constants.check_refresh_interval
if node_id not in self._node_id_reverse_mapping or (address, udp_port) not in self._node_id_mapping:
return
addr_tup = (address, udp_port)
if self._node_id_reverse_mapping[node_id] != addr_tup or self._node_id_mapping[addr_tup] != node_id:
return
# fixme: find a way to re-enable that without breaking other parts
#if node_id not in self._node_id_reverse_mapping or (address, udp_port) not in self._node_id_mapping:
# return
#addr_tup = (address, udp_port)
#if self._node_id_reverse_mapping[node_id] != addr_tup or self._node_id_mapping[addr_tup] != node_id:
# return
previous_failure, most_recent_failure = self._rpc_failures.get((address, udp_port), (None, None))
last_requested = self._last_requested.get((address, udp_port))
last_replied = self._last_replied.get((address, udp_port))
@@ -1,94 +0,0 @@
import asyncio
import typing
import logging
import traceback
if typing.TYPE_CHECKING:
from types import AsyncGeneratorType
log = logging.getLogger(__name__)
def cancel_task(task: typing.Optional[asyncio.Task]):
if task and not (task.done() or task.cancelled()):
task.cancel()
def drain_tasks(tasks: typing.List[typing.Optional[asyncio.Task]]):
while tasks:
cancel_task(tasks.pop())
class AsyncGeneratorJunction:
"""
A helper to interleave the results from multiple async generators into one
async generator.
"""
def __init__(self, loop: asyncio.BaseEventLoop, queue: typing.Optional[asyncio.Queue] = None):
self.loop = loop
self.__iterator_queue = asyncio.Queue(loop=loop)
self.result_queue = queue or asyncio.Queue(loop=loop)
self.tasks: typing.List[asyncio.Task] = []
self.running_iterators: typing.Dict[typing.AsyncGenerator, bool] = {}
self.generator_queue: asyncio.Queue = asyncio.Queue(loop=self.loop)
@property
def running(self):
return any(self.running_iterators.values())
async def wait_for_generators(self):
async def iterate(iterator: typing.AsyncGenerator):
try:
async for item in iterator:
self.result_queue.put_nowait(item)
self.__iterator_queue.put_nowait(item)
finally:
self.running_iterators[iterator] = False
if not self.running:
self.__iterator_queue.put_nowait(StopAsyncIteration)
while True:
async_gen: typing.Union[typing.AsyncGenerator, 'AsyncGeneratorType'] = await self.generator_queue.get()
self.running_iterators[async_gen] = True
self.tasks.append(self.loop.create_task(iterate(async_gen)))
def add_generator(self, async_gen: typing.Union[typing.AsyncGenerator, 'AsyncGeneratorType']):
"""
Add an async generator. This can be called during an iteration of the generator junction.
"""
self.generator_queue.put_nowait(async_gen)
def __aiter__(self):
return self
async def __anext__(self):
result = await self.__iterator_queue.get()
if result is StopAsyncIteration:
raise result
return result
def aclose(self):
async def _aclose():
for iterator in list(self.running_iterators.keys()):
result = iterator.aclose()
if asyncio.iscoroutine(result):
await result
self.running_iterators[iterator] = False
drain_tasks(self.tasks)
raise StopAsyncIteration()
return self.loop.create_task(_aclose())
async def __aenter__(self):
self.tasks.append(self.loop.create_task(self.wait_for_generators()))
return self
async def __aexit__(self, exc_type, exc, tb):
try:
await self.aclose()
except StopAsyncIteration:
pass
finally:
if exc_type:
if exc_type not in (asyncio.CancelledError, asyncio.TimeoutError, StopAsyncIteration, GeneratorExit):
err = traceback.format_exception(exc_type, exc, tb)
log.error(err)
+37 -43
View File
@@ -9,68 +9,62 @@ if typing.TYPE_CHECKING:
class DictDataStore:
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager'):
# Dictionary format:
# { <key>: [<contact>, <value>, <lastPublished>, <originallyPublished> <original_publisher_id>] }
self._data_store: typing.Dict[bytes,
typing.List[typing.Tuple['KademliaPeer', bytes, float, float, bytes]]] = {}
self._get_time = loop.time
# { <key>: [(<contact>, <age>), ...] }
self._data_store: typing.Dict[bytes, typing.List[typing.Tuple['KademliaPeer', float]]] = {}
self.loop = loop
self._peer_manager = peer_manager
self.completed_blobs: typing.Set[str] = set()
def filter_bad_and_expired_peers(self, key: bytes) -> typing.List['KademliaPeer']:
def removed_expired_peers(self):
now = self.loop.time()
keys = list(self._data_store.keys())
for key in keys:
to_remove = []
for (peer, ts) in self._data_store[key]:
if ts + constants.data_expiration < now or self._peer_manager.peer_is_good(peer) is False:
to_remove.append((peer, ts))
for item in to_remove:
self._data_store[key].remove(item)
if not self._data_store[key]:
del self._data_store[key]
def filter_bad_and_expired_peers(self, key: bytes) -> typing.Iterator['KademliaPeer']:
"""
Returns only non-expired and unknown/good peers
"""
peers = []
for peer in map(lambda p: p[0],
filter(lambda peer: self._get_time() - peer[3] < constants.data_expiration,
self._data_store[key])):
for peer in self.filter_expired_peers(key):
if self._peer_manager.peer_is_good(peer) is not False:
peers.append(peer)
return peers
yield peer
def filter_expired_peers(self, key: bytes) -> typing.List['KademliaPeer']:
def filter_expired_peers(self, key: bytes) -> typing.Iterator['KademliaPeer']:
"""
Returns only non-expired peers
"""
return list(
map(
lambda p: p[0],
filter(lambda peer: self._get_time() - peer[3] < constants.data_expiration, self._data_store[key])
)
)
def removed_expired_peers(self):
expired_keys = []
for key in self._data_store.keys():
unexpired_peers = self.filter_expired_peers(key)
if not unexpired_peers:
expired_keys.append(key)
else:
self._data_store[key] = [x for x in self._data_store[key] if x[0] in unexpired_peers]
for key in expired_keys:
del self._data_store[key]
now = self.loop.time()
for (peer, ts) in self._data_store.get(key, []):
if ts + constants.data_expiration > now:
yield peer
def has_peers_for_blob(self, key: bytes) -> bool:
return key in self._data_store and len(self.filter_bad_and_expired_peers(key)) > 0
return key in self._data_store
def add_peer_to_blob(self, contact: 'KademliaPeer', key: bytes, compact_address: bytes, last_published: int,
originally_published: int, original_publisher_id: bytes) -> None:
def add_peer_to_blob(self, contact: 'KademliaPeer', key: bytes) -> None:
now = self.loop.time()
if key in self._data_store:
if compact_address not in map(lambda store_tuple: store_tuple[1], self._data_store[key]):
self._data_store[key].append(
(contact, compact_address, last_published, originally_published, original_publisher_id)
)
current = list(filter(lambda x: x[0] == contact, self._data_store[key]))
if len(current):
self._data_store[key][self._data_store[key].index(current[0])] = contact, now
else:
self._data_store[key].append((contact, now))
else:
self._data_store[key] = [(contact, compact_address, last_published, originally_published,
original_publisher_id)]
self._data_store[key] = [(contact, now)]
def get_peers_for_blob(self, key: bytes) -> typing.List['KademliaPeer']:
return [] if key not in self._data_store else [peer for peer in self.filter_bad_and_expired_peers(key)]
return list(self.filter_bad_and_expired_peers(key))
def get_storing_contacts(self) -> typing.List['KademliaPeer']:
peers = set()
for key in self._data_store:
for values in self._data_store[key]:
if values[0] not in peers:
peers.add(values[0])
for key, stored in self._data_store.items():
peers.update(set(map(lambda tup: tup[0], stored)))
return list(peers)
+51 -52
View File
@@ -66,11 +66,7 @@ def get_shortlist(routing_table: 'TreeRoutingTable', key: bytes,
"""
if len(key) != constants.hash_length:
raise ValueError("invalid key length: %i" % len(key))
if not shortlist:
shortlist = routing_table.find_close_peers(key)
distance = Distance(key)
shortlist.sort(key=lambda peer: distance(peer.node_id), reverse=True)
return shortlist
return shortlist or routing_table.find_close_peers(key)
class IterativeFinder:
@@ -91,12 +87,11 @@ class IterativeFinder:
self.max_results = max_results
self.exclude = exclude or []
self.shortlist: typing.List['KademliaPeer'] = get_shortlist(routing_table, key, shortlist)
self.active: typing.Set['KademliaPeer'] = set()
self.contacted: typing.Set[typing.Tuple[str, int]] = set()
self.contacted: typing.Set['KademliaPeer'] = set()
self.distance = Distance(key)
self.closest_peer: typing.Optional['KademliaPeer'] = None if not self.shortlist else self.shortlist[0]
self.closest_peer: typing.Optional['KademliaPeer'] = None
self.prev_closest_peer: typing.Optional['KademliaPeer'] = None
self.iteration_queue = asyncio.Queue(loop=self.loop)
@@ -107,6 +102,12 @@ class IterativeFinder:
self.running = False
self.tasks: typing.List[asyncio.Task] = []
self.delayed_calls: typing.List[asyncio.Handle] = []
for peer in get_shortlist(routing_table, key, shortlist):
if peer.node_id:
self._add_active(peer)
else:
# seed nodes
self._schedule_probe(peer)
async def send_probe(self, peer: 'KademliaPeer') -> FindResponse:
"""
@@ -138,25 +139,18 @@ class IterativeFinder:
def _is_closer(self, peer: 'KademliaPeer') -> bool:
return not self.closest_peer or self.distance.is_closer(peer.node_id, self.closest_peer.node_id)
def _update_closest(self):
self.shortlist.sort(key=lambda peer: self.distance(peer.node_id), reverse=True)
if self.closest_peer and self.closest_peer is not self.shortlist[-1]:
if self._is_closer(self.shortlist[-1]):
def _add_active(self, peer):
if peer not in self.active and peer.node_id and peer.node_id != self.protocol.node_id:
self.active.add(peer)
if self._is_closer(peer):
self.prev_closest_peer = self.closest_peer
self.closest_peer = self.shortlist[-1]
self.closest_peer = peer
async def _handle_probe_result(self, peer: 'KademliaPeer', response: FindResponse):
if peer not in self.shortlist:
self.shortlist.append(peer)
if peer not in self.active:
self.active.add(peer)
self._add_active(peer)
for contact_triple in response.get_close_triples():
node_id, address, udp_port = contact_triple
if (address, udp_port) not in self.contacted: # and not self.peer_manager.is_ignored(addr_tuple)
found_peer = self.peer_manager.get_kademlia_peer(node_id, address, udp_port)
if found_peer not in self.shortlist and self.peer_manager.peer_is_good(peer) is not False:
self.shortlist.append(found_peer)
self._update_closest()
self._add_active(self.peer_manager.get_kademlia_peer(node_id, address, udp_port))
self.check_result_ready(response)
async def _send_probe(self, peer: 'KademliaPeer'):
@@ -177,40 +171,44 @@ class IterativeFinder:
async def _search_round(self):
"""
Send up to constants.alpha (5) probes to the closest peers in the shortlist
Send up to constants.alpha (5) probes to closest active peers
"""
added = 0
self.shortlist.sort(key=lambda p: self.distance(p.node_id), reverse=True)
while self.running and len(self.shortlist) and added < constants.alpha:
peer = self.shortlist.pop()
to_probe = list(self.active - self.contacted)
to_probe.sort(key=lambda peer: self.distance(self.key))
for peer in to_probe:
if added >= constants.alpha:
break
origin_address = (peer.address, peer.udp_port)
if origin_address in self.exclude or self.peer_manager.peer_is_good(peer) is False:
if origin_address in self.exclude:
continue
if peer.node_id == self.protocol.node_id:
continue
if (peer.address, peer.udp_port) == (self.protocol.external_ip, self.protocol.udp_port):
if origin_address == (self.protocol.external_ip, self.protocol.udp_port):
continue
if (peer.address, peer.udp_port) not in self.contacted:
self.contacted.add((peer.address, peer.udp_port))
t = self.loop.create_task(self._send_probe(peer))
def callback(_):
self.running_probes.difference_update({
probe for probe in self.running_probes if probe.done() or probe == t
})
if not self.running_probes and self.shortlist:
self.tasks.append(self.loop.create_task(self._search_task(0.0)))
t.add_done_callback(callback)
self.running_probes.add(t)
added += 1
self._schedule_probe(peer)
added += 1
log.debug("running %d probes", len(self.running_probes))
if not added and not self.running_probes:
log.debug("search for %s exhausted", hexlify(self.key)[:8])
self.search_exhausted()
def _schedule_probe(self, peer: 'KademliaPeer'):
self.contacted.add(peer)
t = self.loop.create_task(self._send_probe(peer))
def callback(_):
self.running_probes.difference_update({
probe for probe in self.running_probes if probe.done() or probe == t
})
if not self.running_probes:
self.tasks.append(self.loop.create_task(self._search_task(0.0)))
t.add_done_callback(callback)
self.running_probes.add(t)
async def _search_task(self, delay: typing.Optional[float] = constants.iterative_lookup_delay):
try:
if self.running:
@@ -266,6 +264,7 @@ class IterativeNodeFinder(IterativeFinder):
self.yielded_peers: typing.Set['KademliaPeer'] = set()
async def send_probe(self, peer: 'KademliaPeer') -> FindNodeResponse:
log.debug("probing %s:%d %s", peer.address, peer.udp_port, hexlify(peer.node_id)[:8] if peer.node_id else '')
response = await self.protocol.get_rpc_peer(peer).find_node(self.key)
return FindNodeResponse(self.key, response)
@@ -273,12 +272,16 @@ class IterativeNodeFinder(IterativeFinder):
self.put_result(self.active, finish=True)
def put_result(self, from_iter: typing.Iterable['KademliaPeer'], finish=False):
not_yet_yielded = [peer for peer in from_iter if peer not in self.yielded_peers]
not_yet_yielded = [
peer for peer in from_iter
if peer not in self.yielded_peers
and peer.node_id != self.protocol.node_id
and self.peer_manager.peer_is_good(peer) is not False
]
not_yet_yielded.sort(key=lambda peer: self.distance(peer.node_id))
to_yield = not_yet_yielded[:min(constants.k, len(not_yet_yielded))]
if to_yield:
for peer in to_yield:
self.yielded_peers.add(peer)
self.yielded_peers.update(to_yield)
self.iteration_queue.put_nowait(to_yield)
if finish:
self.iteration_queue.put_nowait(None)
@@ -288,21 +291,17 @@ class IterativeNodeFinder(IterativeFinder):
if found:
log.debug("found")
return self.put_result(self.shortlist, finish=True)
return self.put_result(self.active, finish=True)
if self.prev_closest_peer and self.closest_peer and not self._is_closer(self.prev_closest_peer):
# log.info("improving, %i %i %i %i %i", len(self.shortlist), len(self.active), len(self.contacted),
# self.bottom_out_count, self.iteration_count)
self.bottom_out_count = 0
elif self.prev_closest_peer and self.closest_peer:
self.bottom_out_count += 1
log.info("bottom out %i %i %i %i", len(self.active), len(self.contacted), len(self.shortlist),
self.bottom_out_count)
log.info("bottom out %i %i %i", len(self.active), len(self.contacted), self.bottom_out_count)
if self.bottom_out_count >= self.bottom_out_limit or self.iteration_count >= self.bottom_out_limit:
log.info("limit hit")
self.put_result(self.active, True)
elif self.max_results and len(self.active) - len(self.yielded_peers) >= self.max_results:
log.debug("max results")
self.put_result(self.active, True)
class IterativeValueFinder(IterativeFinder):
+72 -38
View File
@@ -45,19 +45,19 @@ class KademliaRPC:
def ping():
return b'pong'
def store(self, rpc_contact: 'KademliaPeer', blob_hash: bytes, token: bytes, port: int,
original_publisher_id: bytes, age: int) -> bytes:
if original_publisher_id is None:
original_publisher_id = rpc_contact.node_id
def store(self, rpc_contact: 'KademliaPeer', blob_hash: bytes, token: bytes, port: int) -> bytes:
if len(blob_hash) != constants.hash_bits // 8:
raise ValueError(f"invalid length of blob hash: {len(blob_hash)}")
if not 0 < port < 65535:
raise ValueError(f"invalid tcp port: {port}")
rpc_contact.update_tcp_port(port)
if self.loop.time() - self.protocol.started_listening_time < constants.token_secret_refresh_interval:
pass
elif not self.verify_token(token, rpc_contact.compact_ip()):
raise ValueError("Invalid token")
now = int(self.loop.time())
originally_published = now - age
if not self.verify_token(token, rpc_contact.compact_ip()):
if self.loop.time() - self.protocol.started_listening_time < constants.token_secret_refresh_interval:
pass
else:
raise ValueError("Invalid token")
self.protocol.data_store.add_peer_to_blob(
rpc_contact, blob_hash, rpc_contact.compact_address_tcp(), now, originally_published, original_publisher_id
rpc_contact, blob_hash
)
return b'OK'
@@ -191,12 +191,14 @@ class PingQueue:
self._process_task: asyncio.Task = None
self._running = False
self._running_pings: typing.Set[asyncio.Task] = set()
self._default_delay = constants.maybe_ping_delay
@property
def running(self):
return self._running
def enqueue_maybe_ping(self, *peers: 'KademliaPeer', delay: float = constants.maybe_ping_delay):
def enqueue_maybe_ping(self, *peers: 'KademliaPeer', delay: typing.Optional[float] = None):
delay = delay if delay is not None else self._default_delay
now = self._loop.time()
for peer in peers:
if peer not in self._pending_contacts or now + delay < self._pending_contacts[peer]:
@@ -207,7 +209,7 @@ class PingQueue:
try:
if self._protocol.peer_manager.peer_is_good(peer):
if peer not in self._protocol.routing_table.get_peers():
await self._protocol.add_peer(peer)
self._protocol.add_peer(peer)
return
await self._protocol.get_rpc_peer(peer).ping()
except asyncio.TimeoutError:
@@ -268,11 +270,21 @@ class KademliaProtocol(DatagramProtocol):
self.node_rpc = KademliaRPC(self, self.loop, self.peer_port)
self.rpc_timeout = rpc_timeout
self._split_lock = asyncio.Lock(loop=self.loop)
self._to_remove: typing.Set['KademliaPeer'] = set()
self._to_add: typing.Set['KademliaPeer'] = set()
self._wakeup_routing_task = asyncio.Event(loop=self.loop)
self.maintaing_routing_task: typing.Optional[asyncio.Task] = None
@functools.lru_cache(128)
def get_rpc_peer(self, peer: 'KademliaPeer') -> RemoteKademliaRPC:
return RemoteKademliaRPC(self.loop, self.peer_manager, self, peer)
def start(self):
self.maintaing_routing_task = self.loop.create_task(self.routing_table_task())
def stop(self):
if self.maintaing_routing_task:
self.maintaing_routing_task.cancel()
if self.transport:
self.disconnect()
@@ -363,13 +375,30 @@ class KademliaProtocol(DatagramProtocol):
self.routing_table.buckets[bucket_index].remove_peer(to_replace)
return await self._add_peer(peer)
async def add_peer(self, peer: 'KademliaPeer') -> bool:
def add_peer(self, peer: 'KademliaPeer'):
if peer.node_id == self.node_id:
return False
async with self._split_lock:
return await self._add_peer(peer)
self._to_add.add(peer)
self._wakeup_routing_task.set()
async def _handle_rpc(self, sender_contact: 'KademliaPeer', message: RequestDatagram):
def remove_peer(self, peer: 'KademliaPeer'):
self._to_remove.add(peer)
self._wakeup_routing_task.set()
async def routing_table_task(self):
while True:
while self._to_remove:
async with self._split_lock:
peer = self._to_remove.pop()
self.routing_table.remove_peer(peer)
self.routing_table.join_buckets()
while self._to_add:
async with self._split_lock:
await self._add_peer(self._to_add.pop())
await asyncio.gather(self._wakeup_routing_task.wait(), asyncio.sleep(.1, loop=self.loop), loop=self.loop)
self._wakeup_routing_task.clear()
def _handle_rpc(self, sender_contact: 'KademliaPeer', message: RequestDatagram):
assert sender_contact.node_id != self.node_id, (binascii.hexlify(sender_contact.node_id)[:8].decode(),
binascii.hexlify(self.node_id)[:8].decode())
method = message.method
@@ -387,7 +416,7 @@ class KademliaProtocol(DatagramProtocol):
result = self.node_rpc.ping()
elif method == b'store':
blob_hash, token, port, original_publisher_id, age = a
result = self.node_rpc.store(sender_contact, blob_hash, token, port, original_publisher_id, age)
result = self.node_rpc.store(sender_contact, blob_hash, token, port)
elif method == b'findNode':
key, = a
result = self.node_rpc.find_node(sender_contact, key)
@@ -396,11 +425,11 @@ class KademliaProtocol(DatagramProtocol):
key, = a
result = self.node_rpc.find_value(sender_contact, key)
await self.send_response(
self.send_response(
sender_contact, ResponseDatagram(RESPONSE_TYPE, message.rpc_id, self.node_id, result),
)
async def handle_request_datagram(self, address: typing.Tuple[str, int], request_datagram: RequestDatagram):
def handle_request_datagram(self, address: typing.Tuple[str, int], request_datagram: RequestDatagram):
# This is an RPC method request
self.peer_manager.report_last_requested(address[0], address[1])
try:
@@ -408,7 +437,7 @@ class KademliaProtocol(DatagramProtocol):
except IndexError:
peer = self.peer_manager.get_kademlia_peer(request_datagram.node_id, address[0], address[1])
try:
await self._handle_rpc(peer, request_datagram)
self._handle_rpc(peer, request_datagram)
# if the contact is not known to be bad (yet) and we haven't yet queried it, send it a ping so that it
# will be added to our routing table if successful
is_good = self.peer_manager.peer_is_good(peer)
@@ -416,12 +445,12 @@ class KademliaProtocol(DatagramProtocol):
self.ping_queue.enqueue_maybe_ping(peer)
# only add a requesting contact to the routing table if it has replied to one of our requests
elif is_good is True:
await self.add_peer(peer)
self.add_peer(peer)
except ValueError as err:
log.debug("error raised handling %s request from %s:%i - %s(%s)",
request_datagram.method, peer.address, peer.udp_port, str(type(err)),
str(err))
await self.send_error(
self.send_error(
peer,
ErrorDatagram(ERROR_TYPE, request_datagram.rpc_id, self.node_id, str(type(err)).encode(),
str(err).encode())
@@ -430,13 +459,13 @@ class KademliaProtocol(DatagramProtocol):
log.warning("error raised handling %s request from %s:%i - %s(%s)",
request_datagram.method, peer.address, peer.udp_port, str(type(err)),
str(err))
await self.send_error(
self.send_error(
peer,
ErrorDatagram(ERROR_TYPE, request_datagram.rpc_id, self.node_id, str(type(err)).encode(),
str(err).encode())
)
async def handle_response_datagram(self, address: typing.Tuple[str, int], response_datagram: ResponseDatagram):
def handle_response_datagram(self, address: typing.Tuple[str, int], response_datagram: ResponseDatagram):
# Find the message that triggered this response
if response_datagram.rpc_id in self.sent_messages:
peer, df, request = self.sent_messages[response_datagram.rpc_id]
@@ -459,7 +488,7 @@ class KademliaProtocol(DatagramProtocol):
self.peer_manager.update_contact_triple(peer.node_id, address[0], address[1])
if not df.cancelled():
df.set_result(response_datagram)
await self.add_peer(peer)
self.add_peer(peer)
else:
log.warning("%s:%i replied, but after we cancelled the request attempt",
peer.address, peer.udp_port)
@@ -510,15 +539,15 @@ class KademliaProtocol(DatagramProtocol):
return
if isinstance(message, RequestDatagram):
self.loop.create_task(self.handle_request_datagram(address, message))
self.handle_request_datagram(address, message)
elif isinstance(message, ErrorDatagram):
self.handle_error_datagram(address, message)
else:
assert isinstance(message, ResponseDatagram), "sanity"
self.loop.create_task(self.handle_response_datagram(address, message))
self.handle_response_datagram(address, message)
async def send_request(self, peer: 'KademliaPeer', request: RequestDatagram) -> ResponseDatagram:
await self._send(peer, request)
self._send(peer, request)
response_fut = self.sent_messages[request.rpc_id][1]
try:
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
@@ -531,18 +560,16 @@ class KademliaProtocol(DatagramProtocol):
except (asyncio.TimeoutError, RemoteException):
self.peer_manager.report_failure(peer.address, peer.udp_port)
if self.peer_manager.peer_is_good(peer) is False:
async with self._split_lock:
self.routing_table.remove_peer(peer)
self.routing_table.join_buckets()
self.remove_peer(peer)
raise
async def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
await self._send(peer, response)
def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
self._send(peer, response)
async def send_error(self, peer: 'KademliaPeer', error: ErrorDatagram):
await self._send(peer, error)
def send_error(self, peer: 'KademliaPeer', error: ErrorDatagram):
self._send(peer, error)
async def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram,
def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram,
ErrorDatagram]):
if not self.transport or self.transport.is_closing():
raise TransportNotConnected()
@@ -602,12 +629,15 @@ class KademliaProtocol(DatagramProtocol):
return True
async def store_to_peer(self, hash_value: bytes, peer: 'KademliaPeer') -> typing.Tuple[bytes, bool]:
try:
async def __store():
res = await self.get_rpc_peer(peer).store(hash_value)
if res != b"OK":
raise ValueError(res)
log.debug("Stored %s to %s", binascii.hexlify(hash_value).decode()[:8], peer)
return peer.node_id, True
try:
return await __store()
except asyncio.TimeoutError:
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)
except ValueError as err:
@@ -615,6 +645,10 @@ class KademliaProtocol(DatagramProtocol):
except Exception as err:
if 'Invalid token' in str(err):
self.peer_manager.clear_token(peer.node_id)
try:
return await __store()
except:
return peer.node_id, False
else:
log.exception("Unexpected error while storing blob_hash")
return peer.node_id, False
+56 -26
View File
@@ -270,14 +270,17 @@ class Daemon(metaclass=JSONRPCServerType):
self.stop_event = asyncio.Event()
logging.getLogger('aiohttp.access').setLevel(logging.WARN)
app = web.Application()
app.router.add_get('/lbryapi', self.handle_old_jsonrpc)
app.router.add_post('/lbryapi', self.handle_old_jsonrpc)
app.router.add_get('/get/{claim_name}', self.handle_stream_get_request)
app.router.add_get('/get/{claim_name}/{claim_id}', self.handle_stream_get_request)
app.router.add_get('/stream/{sd_hash}', self.handle_stream_range_request)
app.router.add_post('/', self.handle_old_jsonrpc)
self.runner = web.AppRunner(app)
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)
self.rpc_runner = web.AppRunner(rpc_app)
streaming_app = web.Application()
streaming_app.router.add_get('/get/{claim_name}', self.handle_stream_get_request)
streaming_app.router.add_get('/get/{claim_name}/{claim_id}', self.handle_stream_get_request)
streaming_app.router.add_get('/stream/{sd_hash}', self.handle_stream_range_request)
self.streaming_runner = web.AppRunner(streaming_app)
@property
def dht_node(self) -> typing.Optional['Node']:
@@ -400,12 +403,20 @@ class Daemon(metaclass=JSONRPCServerType):
log.debug("Settings: %s", json.dumps(self.conf.settings_dict, indent=2))
log.info("Platform: %s", json.dumps(system_info.get_platform(), indent=2))
await self.analytics_manager.send_server_startup()
await self.runner.setup()
await self.rpc_runner.setup()
await self.streaming_runner.setup()
try:
site = web.TCPSite(self.runner, self.conf.api_host, self.conf.api_port, shutdown_timeout=.5)
await site.start()
log.info('lbrynet API listening on TCP %s:%i', *site._server.sockets[0].getsockname()[:2])
rpc_site = web.TCPSite(self.rpc_runner, self.conf.api_host, self.conf.api_port, shutdown_timeout=.5)
await rpc_site.start()
log.info('lbrynet API listening on TCP %s:%i', *rpc_site._server.sockets[0].getsockname()[:2])
streaming_site = web.TCPSite(self.streaming_runner, self.conf.streaming_host, self.conf.streaming_port,
shutdown_timeout=.5)
await streaming_site.start()
log.info('lbrynet media server listening on TCP %s:%i',
*streaming_site._server.sockets[0].getsockname()[:2])
except OSError as e:
log.error('lbrynet API failed to bind TCP %s for listening. Daemon is already running or this port is '
'already in use by another application.', self.conf.api)
@@ -441,8 +452,10 @@ class Daemon(metaclass=JSONRPCServerType):
self.component_startup_task.cancel()
log.info("stopped api components")
if shutdown_runner:
await self.runner.shutdown()
await self.runner.cleanup()
await self.rpc_runner.shutdown()
await self.streaming_runner.shutdown()
await self.rpc_runner.cleanup()
await self.streaming_runner.cleanup()
log.info("stopped api server")
if self.analytics_manager.is_started:
self.analytics_manager.stop()
@@ -471,6 +484,9 @@ class Daemon(metaclass=JSONRPCServerType):
)
async def handle_stream_get_request(self, request: web.Request):
if not self.conf.streaming_get:
log.warning("streaming_get is disabled, rejecting request")
raise web.HTTPForbidden()
name_and_claim_id = request.path.split("/get/")[1]
if "/" not in name_and_claim_id:
uri = f"lbry://{name_and_claim_id}"
@@ -485,6 +501,20 @@ class Daemon(metaclass=JSONRPCServerType):
raise web.HTTPFound(f"/stream/{stream.sd_hash}")
async def handle_stream_range_request(self, request: web.Request):
try:
return await self._handle_stream_range_request(request)
except web.HTTPException as err:
log.warning("http code during /stream range request: %s", err)
raise err
except asyncio.CancelledError:
log.debug("/stream range request cancelled")
except Exception:
log.exception("error handling /stream range request")
raise
finally:
log.debug("finished handling /stream range request")
async def _handle_stream_range_request(self, request: web.Request):
sd_hash = request.path.split("/stream/")[1]
if not self.stream_manager.started.is_set():
await self.stream_manager.started.wait()
@@ -1584,7 +1614,7 @@ class Daemon(metaclass=JSONRPCServerType):
@requires(STREAM_MANAGER_COMPONENT)
async def jsonrpc_file_save(self, file_name=None, download_directory=None, **kwargs):
"""
Output a download to a file
Start saving a file to disk.
Usage:
file_save [--file_name=<file_name>] [--download_directory=<download_directory>] [--sd_hash=<sd_hash>]
@@ -1593,17 +1623,17 @@ class Daemon(metaclass=JSONRPCServerType):
[--channel_name=<channel_name>]
Options:
--file_name=<file_name> : (str) delete by file name in downloads folder
--download_directory=<download_directory> : (str) delete by file name in downloads folder
--sd_hash=<sd_hash> : (str) delete by file sd hash
--stream_hash=<stream_hash> : (str) delete by file stream hash
--rowid=<rowid> : (int) delete by file row id
--claim_id=<claim_id> : (str) delete by file claim id
--txid=<txid> : (str) delete by file claim txid
--nout=<nout> : (int) delete by file claim nout
--claim_name=<claim_name> : (str) delete by file claim name
--channel_claim_id=<channel_claim_id> : (str) delete by file channel claim id
--channel_name=<channel_name> : (str) delete by file channel claim name
--file_name=<file_name> : (str) file name to save to
--download_directory=<download_directory> : (str) directory to save into
--sd_hash=<sd_hash> : (str) save file with matching sd hash
--stream_hash=<stream_hash> : (str) save file with matching stream hash
--rowid=<rowid> : (int) save file with matching row id
--claim_id=<claim_id> : (str) save file with matching claim id
--txid=<txid> : (str) save file with matching claim txid
--nout=<nout> : (int) save file with matching claim nout
--claim_name=<claim_name> : (str) save file with matching claim name
--channel_claim_id=<channel_claim_id> : (str) save file with matching channel claim id
--channel_name=<channel_name> : (str) save file with matching channel claim name
Returns: {File}
"""
@@ -67,6 +67,7 @@ def encode_account_doc():
def encode_file_doc():
return {
'streaming_url': '(str) url to stream the file using range requests',
'completed': '(bool) true if download is completed',
'file_name': '(str) name of file',
'download_directory': '(str) download directory',
+4 -1
View File
@@ -8,12 +8,15 @@ log = logging.getLogger(__name__)
def get_platform() -> dict:
os_system = platform.system()
if os.environ and 'ANDROID_ARGUMENT' in os.environ:
os_system = 'android'
p = {
"processor": platform.processor(),
"python_version": platform.python_version(),
"platform": platform.platform(),
"os_release": platform.release(),
"os_system": platform.system(),
"os_system": os_system,
"lbrynet_version": lbrynet_version,
"build": build_type.BUILD, # CI server sets this during build step
}
+17 -2
View File
@@ -3,7 +3,7 @@ import typing
import logging
import binascii
from lbrynet.error import DownloadSDTimeout
from lbrynet.utils import resolve_host
from lbrynet.utils import resolve_host, lru_cache_concurrent
from lbrynet.stream.descriptor import StreamDescriptor
from lbrynet.blob_exchange.downloader import BlobDownloader
from lbrynet.dht.peer import KademliaPeer
@@ -36,6 +36,16 @@ class StreamDownloader:
self.time_to_descriptor: typing.Optional[float] = None
self.time_to_first_bytes: typing.Optional[float] = None
async def cached_read_blob(blob_info: 'BlobInfo') -> bytes:
return await self.read_blob(blob_info, 2)
if self.blob_manager.decrypted_blob_lru_cache:
cached_read_blob = lru_cache_concurrent(override_lru_cache=self.blob_manager.decrypted_blob_lru_cache)(
cached_read_blob
)
self.cached_read_blob = cached_read_blob
async def add_fixed_peers(self):
def _delayed_add_fixed_peers():
self.added_fixed_peers = True
@@ -83,6 +93,8 @@ class StreamDownloader:
# set up peer accumulation
if node:
self.node = node
if self.accumulate_task and not self.accumulate_task.done():
self.accumulate_task.cancel()
_, self.accumulate_task = self.node.accumulate_peers(self.search_queue, self.peer_queue)
await self.add_fixed_peers()
# start searching for peers for the sd hash
@@ -104,7 +116,10 @@ class StreamDownloader:
async def download_stream_blob(self, blob_info: 'BlobInfo', connection_id: int = 0) -> 'AbstractBlob':
if not filter(lambda blob: blob.blob_hash == blob_info.blob_hash, self.descriptor.blobs[:-1]):
raise ValueError(f"blob {blob_info.blob_hash} is not part of stream with sd hash {self.sd_hash}")
blob = await self.blob_downloader.download_blob(blob_info.blob_hash, blob_info.length, connection_id)
blob = await asyncio.wait_for(
self.blob_downloader.download_blob(blob_info.blob_hash, blob_info.length, connection_id),
self.config.blob_download_timeout * 10, loop=self.loop
)
return blob
def decrypt_blob(self, blob_info: 'BlobInfo', blob: 'AbstractBlob') -> bytes:
+44 -12
View File
@@ -3,7 +3,7 @@ import asyncio
import typing
import logging
import binascii
from aiohttp.web import Request, StreamResponse
from aiohttp.web import Request, StreamResponse, HTTPRequestRangeNotSatisfiable
from lbrynet.utils import generate_id
from lbrynet.error import DownloadSDTimeout
from lbrynet.schema.mime_types import guess_media_type
@@ -42,6 +42,9 @@ class ManagedStream:
STATUS_STOPPED = "stopped"
STATUS_FINISHED = "finished"
SAVING_ID = 1
STREAMING_ID = 2
__slots__ = [
'loop',
'config',
@@ -66,7 +69,7 @@ class ManagedStream:
'saving',
'finished_writing',
'started_writing',
'finished_write_attempt'
]
def __init__(self, loop: asyncio.BaseEventLoop, config: 'Config', blob_manager: 'BlobManager',
@@ -100,6 +103,7 @@ class ManagedStream:
self.saving = asyncio.Event(loop=self.loop)
self.finished_writing = asyncio.Event(loop=self.loop)
self.started_writing = asyncio.Event(loop=self.loop)
self.finished_write_attempt = asyncio.Event(loop=self.loop)
@property
def descriptor(self) -> StreamDescriptor:
@@ -212,7 +216,9 @@ class ManagedStream:
download_directory = None
written_bytes = None
return {
'completed': (self.output_file_exists and self.status in ('stopped', 'finished')) or all(
'streaming_url': f"http://{self.config.streaming_host}:{self.config.streaming_port}/stream/{self.sd_hash}",
'completed': (self.output_file_exists and (self.status in ('stopped', 'finished'))
or not self.saving.is_set()) or all(
self.blob_manager.is_blob_verified(b.blob_hash) for b in self.descriptor.blobs[:-1]),
'file_name': file_name,
'download_directory': download_directory,
@@ -302,14 +308,19 @@ class ManagedStream:
raise IndexError(start_blob_num)
for i, blob_info in enumerate(self.descriptor.blobs[start_blob_num:-1]):
assert i + start_blob_num == blob_info.blob_num
decrypted = await self.downloader.read_blob(blob_info, connection_id)
if connection_id == self.STREAMING_ID:
decrypted = await self.downloader.cached_read_blob(blob_info)
else:
decrypted = await self.downloader.read_blob(blob_info, connection_id)
yield (blob_info, decrypted)
async def stream_file(self, request: Request, node: typing.Optional['Node'] = None) -> StreamResponse:
log.info("stream file to browser for lbry://%s#%s (sd hash %s...)", self.claim_name, self.claim_id,
self.sd_hash[:6])
headers, size, skip_blobs, first_blob_start_offset = self._prepare_range_response_headers(
request.headers.get('range', 'bytes=0-')
)
await self.start(node)
headers, size, skip_blobs = self._prepare_range_response_headers(request.headers.get('range', 'bytes=0-'))
response = StreamResponse(
status=206,
headers=headers
@@ -319,11 +330,16 @@ class ManagedStream:
self.streaming.set()
try:
wrote = 0
async for blob_info, decrypted in self._aiter_read_stream(skip_blobs, connection_id=2):
async for blob_info, decrypted in self._aiter_read_stream(skip_blobs, connection_id=self.STREAMING_ID):
if not wrote:
decrypted = decrypted[first_blob_start_offset:]
if (blob_info.blob_num == len(self.descriptor.blobs) - 2) or (len(decrypted) + wrote >= size):
decrypted += (b'\x00' * (size - len(decrypted) - wrote - (skip_blobs * 2097151)))
log.debug("sending browser final blob (%i/%i)", blob_info.blob_num + 1,
len(self.descriptor.blobs) - 1)
await response.write_eof(decrypted)
else:
log.debug("sending browser blob (%i/%i)", blob_info.blob_num + 1, len(self.descriptor.blobs) - 1)
await response.write(decrypted)
wrote += len(decrypted)
log.info("sent browser %sblob %i/%i", "(final) " if response._eof_sent else "",
@@ -347,11 +363,12 @@ class ManagedStream:
log.info("save file for lbry://%s#%s (sd hash %s...) -> %s", self.claim_name, self.claim_id, self.sd_hash[:6],
output_path)
self.saving.set()
self.finished_write_attempt.clear()
self.finished_writing.clear()
self.started_writing.clear()
try:
with open(output_path, 'wb') as file_write_handle:
async for blob_info, decrypted in self._aiter_read_stream(connection_id=1):
async for blob_info, decrypted in self._aiter_read_stream(connection_id=self.SAVING_ID):
log.info("write blob %i/%i", blob_info.blob_num + 1, len(self.descriptor.blobs) - 1)
await self.loop.run_in_executor(None, self._write_decrypted_blob, file_write_handle, decrypted)
self.written_bytes += len(decrypted)
@@ -370,11 +387,22 @@ class ManagedStream:
if os.path.isfile(output_path):
log.warning("removing incomplete download %s for %s", output_path, self.sd_hash)
os.remove(output_path)
if not isinstance(err, asyncio.CancelledError):
self.written_bytes = 0
if isinstance(err, asyncio.TimeoutError):
self.downloader.stop()
await self.blob_manager.storage.change_file_download_dir_and_file_name(
self.stream_hash, None, None
)
self._file_name, self.download_directory = None, None
await self.blob_manager.storage.clear_saved_file(self.stream_hash)
await self.update_status(self.STATUS_STOPPED)
return
elif not isinstance(err, asyncio.CancelledError):
log.exception("unexpected error encountered writing file for stream %s", self.sd_hash)
raise err
finally:
self.saving.clear()
self.finished_write_attempt.set()
async def save_file(self, file_name: typing.Optional[str] = None, download_directory: typing.Optional[str] = None,
node: typing.Optional['Node'] = None):
@@ -471,7 +499,7 @@ class ManagedStream:
return
await asyncio.sleep(1, loop=self.loop)
def _prepare_range_response_headers(self, get_range: str) -> typing.Tuple[typing.Dict[str, str], int, int]:
def _prepare_range_response_headers(self, get_range: str) -> typing.Tuple[typing.Dict[str, str], int, int, int]:
if '=' in get_range:
get_range = get_range.split('=')[1]
start, end = get_range.split('-')
@@ -489,16 +517,20 @@ class ManagedStream:
log.debug("estimating stream size")
start = int(start)
original_start = start
if start >= size:
raise HTTPRequestRangeNotSatisfiable()
end = int(end) if end else size - 1
skip_blobs = start // 2097150
skip = skip_blobs * 2097151
start = skip
skip_last_blob = original_start - skip
start = skip + skip_last_blob
final_size = end - start + 1
headers = {
'Accept-Ranges': 'bytes',
'Content-Range': f'bytes {start}-{end}/{size}',
'Content-Length': str(final_size),
'Content-Type': self.mime_type
}
return headers, size, skip_blobs
return headers, size, skip_blobs, skip_last_blob
+2
View File
@@ -62,6 +62,7 @@ class CommandTestCase(IntegrationTestCase):
LEDGER = lbrynet.wallet
MANAGER = LbryWalletManager
VERBOSITY = logging.WARN
blob_lru_cache_size = 0
async def asyncSetUp(self):
await super().asyncSetUp()
@@ -81,6 +82,7 @@ class CommandTestCase(IntegrationTestCase):
conf.lbryum_servers = [('127.0.0.1', 50001)]
conf.reflector_servers = [('127.0.0.1', 5566)]
conf.known_dht_nodes = []
conf.blob_lru_cache_size = self.blob_lru_cache_size
await self.account.ensure_address_gap()
address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0]
+55
View File
@@ -15,6 +15,7 @@ import contextlib
import certifi
import aiohttp
import functools
import collections
from lbrynet.schema.claim import Claim
from lbrynet.cryptoutils import get_lbry_hash_obj
@@ -201,6 +202,60 @@ async def resolve_host(url: str, port: int, proto: str) -> str:
))[0][4][0]
class LRUCache:
__slots__ = [
'capacity',
'cache'
]
def __init__(self, capacity):
self.capacity = capacity
self.cache = collections.OrderedDict()
def get(self, key):
value = self.cache.pop(key)
self.cache[key] = value
return value
def set(self, key, value):
try:
self.cache.pop(key)
except KeyError:
if len(self.cache) >= self.capacity:
self.cache.popitem(last=False)
self.cache[key] = value
def __contains__(self, item) -> bool:
return item in self.cache
def lru_cache_concurrent(cache_size: typing.Optional[int] = None,
override_lru_cache: typing.Optional[LRUCache] = None):
if not cache_size and override_lru_cache is None:
raise ValueError("invalid cache size")
concurrent_cache = {}
lru_cache = override_lru_cache or LRUCache(cache_size)
def wrapper(async_fn):
@functools.wraps(async_fn)
async def _inner(*args, **kwargs):
key = tuple([args, tuple([tuple([k, kwargs[k]]) for k in kwargs])])
if key in lru_cache:
return lru_cache.get(key)
concurrent_cache[key] = concurrent_cache.get(key) or asyncio.create_task(async_fn(*args, **kwargs))
try:
result = await concurrent_cache[key]
lru_cache.set(key, result)
return result
finally:
concurrent_cache.pop(key, None)
return _inner
return wrapper
def get_ssl_context() -> ssl.SSLContext:
return ssl.create_default_context(
purpose=ssl.Purpose.CLIENT_AUTH, capath=certifi.where()
+4 -7
View File
@@ -1,11 +1,10 @@
import logging
import asyncio
from functools import lru_cache
from cryptography.exceptions import InvalidSignature
from binascii import unhexlify, hexlify
from lbrynet.utils import lru_cache_concurrent
from lbrynet.wallet.account import validate_claim_id
from lbrynet.wallet.dewies import dewies_to_lbc
from lbrynet.error import UnknownNameError, UnknownClaimID, UnknownURI, UnknownOutpoint
@@ -51,11 +50,9 @@ class Resolver:
results = await asyncio.gather(*futs)
return dict(list(map(lambda result: list(result.items())[0], results)))
@lru_cache(256)
def _fetch_tx(self, txid):
async def __fetch_parse(txid):
return self.transaction_class(unhexlify(await self.network.get_transaction(txid)))
return asyncio.ensure_future(__fetch_parse(txid))
@lru_cache_concurrent(256)
async def _fetch_tx(self, txid):
return self.transaction_class(unhexlify(await self.network.get_transaction(txid)))
async def _handle_resolutions(self, resolutions, requested_uris, page, page_size, claim_trie_root):
results = {}
+4 -2
View File
@@ -190,7 +190,7 @@ class LBRYElectrumX(ElectrumX):
claims = await self.daemon.getclaimsforname(name)
if claims:
claims['claims'] = [self.format_claim_from_daemon(claim, name) for claim in claims['claims']]
claims['supports_without_claims'] = claims['supports without claims']
claims['supports_without_claims'] = [] # fixme temporary
del claims['supports without claims']
claims['last_takeover_height'] = claims['nLastTakeoverHeight']
del claims['nLastTakeoverHeight']
@@ -224,7 +224,9 @@ class LBRYElectrumX(ElectrumX):
# raise RPCError("Lbrycrd has {} but not lbryumx, please submit a bug report.".format(claim_id))
return {}
address = info.address.decode()
supports = self.format_supports_from_daemon(claim.get('supports', []))
# 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')
+18 -23
View File
@@ -1,33 +1,28 @@
"""Set the build version to be 'qa', 'rc', 'release'"""
"""Set the build version to be 'dev', 'qa', 'rc', 'release'"""
import os.path
import re
import subprocess
import sys
import os
import re
def get_build_type(travis_tag=None):
if not travis_tag:
return "qa"
print("getting build type for tag: \"%s\"" % travis_tag)
if re.match('v\d+\.\d+\.\d+rc\d+$', travis_tag):
return 'rc'
elif re.match('v\d+\.\d+\.\d+$', travis_tag):
return 'release'
return 'qa'
def main():
build = get_build()
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
travis_commit = os.environ['TRAVIS_COMMIT'][:6]
build_type = get_build_type(os.environ.get('TRAVIS_TAG', None))
print("setting build type=%s, build commit=%s", build_type, travis_commit)
with open(os.path.join(root_dir, 'lbrynet', 'build_type.py'), 'w') as f:
f.write("BUILD = '{}'\n".format(build))
def get_build():
try:
tag = subprocess.check_output(['git', 'describe', '--exact-match', '--all']).strip()
if re.match('tags\/v\d+\.\d+\.\d+rc\d+$', tag.decode()):
print('Build: rc')
return 'rc'
elif re.match('tags\/v\d+\.\d+\.\d+$', tag.decode()):
print('Build: release')
return 'release'
print('Build: qa')
return 'qa'
except subprocess.CalledProcessError:
print("Couldn't determine build type, defaulting to qa.")
return 'qa'
f.write("BUILD = \"{}\"\nBUILD_COMMIT = \"{}\"\n".format(build_type, travis_commit))
if __name__ == '__main__':
+4 -2
View File
@@ -6,8 +6,10 @@ apt-get -qq update
apt-get -qq install -y git
pip install setuptools_scm
git clone https://github.com/lbryio/torba.git --depth 1
cd torba && pip install -e . && cd ..
git clone https://github.com/lbryio/torba.git --depth 20
cd torba
git checkout 2626a28e6
pip install -e . && cd ..
cd lbry
+1 -1
View File
@@ -23,7 +23,7 @@ setup(
'console_scripts': 'lbrynet=lbrynet.extras.cli:main'
},
install_requires=[
'torba',
'torba==0.5.3',
'aiohttp==3.5.4',
'aioupnp',
'appdirs==1.4.3',
+2 -6
View File
@@ -138,8 +138,6 @@ class EpicAdventuresOfChris45(CommandTestCase):
# It obviously did! Because, blockchain baby \O/
self.assertEqual(resolve_result[uri]['claim']['amount'], '1.0')
self.assertEqual(resolve_result[uri]['claim']['effective_amount'], '1.2')
self.assertEqual(resolve_result[uri]['claim']['supports'][0]['amount'], '0.2')
self.assertEqual(resolve_result[uri]['claim']['supports'][0]['txid'], tx['txid'])
await self.generate(5)
# Now he also wanted to support the original creator of the Award Winning Novel
@@ -152,8 +150,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
# And again checks if it went to the just right place
resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri))
# Which it obviously did. Because....?????
self.assertEqual(resolve_result[uri]['claim']['supports'][1]['amount'], '0.3')
self.assertEqual(resolve_result[uri]['claim']['supports'][1]['txid'], tx['txid'])
self.assertEqual(resolve_result[uri]['claim']['effective_amount'], '1.5')
await self.generate(5)
# Seeing the ravishing success of his novel Chris adds support to his claim too
@@ -163,8 +160,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
# And check if his support showed up
resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri))
# It did!
self.assertEqual(resolve_result[uri]['claim']['supports'][2]['amount'], '0.4')
self.assertEqual(resolve_result[uri]['claim']['supports'][2]['txid'], tx['txid'])
self.assertEqual(resolve_result[uri]['claim']['effective_amount'], '1.9')
await self.generate(5)
# Now Ramsey who is a singer by profession, is preparing for his new "gig". He has everything in place for that
+115
View File
@@ -0,0 +1,115 @@
import asyncio
from binascii import hexlify
from lbrynet.dht import constants
from lbrynet.dht.node import Node
from lbrynet.dht.peer import PeerManager, KademliaPeer
from torba.testcase import AsyncioTestCase
class DHTIntegrationTest(AsyncioTestCase):
async def asyncSetUp(self):
import logging
logging.getLogger('asyncio').setLevel(logging.ERROR)
logging.getLogger('lbrynet.dht').setLevel(logging.WARN)
self.nodes = []
self.known_node_addresses = []
async def setup_network(self, size: int, start_port=40000, seed_nodes=1):
for i in range(size):
node_port = start_port + i
node = Node(self.loop, PeerManager(self.loop), node_id=constants.generate_id(i),
udp_port=node_port, internal_udp_port=node_port,
peer_port=3333, external_ip='127.0.0.1')
self.nodes.append(node)
self.known_node_addresses.append(('127.0.0.1', node_port))
await node.start_listening('127.0.0.1')
self.addCleanup(node.stop)
for node in self.nodes:
node.protocol.rpc_timeout = .5
node.protocol.ping_queue._default_delay = .5
node.start('127.0.0.1', self.known_node_addresses[:seed_nodes])
await asyncio.gather(*[node.joined.wait() for node in self.nodes])
async def test_replace_bad_nodes(self):
await self.setup_network(20)
self.assertEquals(len(self.nodes), 20)
node = self.nodes[0]
bad_peers = []
for candidate in self.nodes[1:10]:
address, port, node_id = candidate.protocol.external_ip, candidate.protocol.udp_port, candidate.protocol.node_id
peer = KademliaPeer(self.loop, address, node_id, port)
bad_peers.append(peer)
node.protocol.add_peer(peer)
candidate.stop()
await asyncio.sleep(.3) # let pending events settle
for bad_peer in bad_peers:
self.assertIn(bad_peer, node.protocol.routing_table.get_peers())
await node.refresh_node(True)
await asyncio.sleep(.3) # let pending events settle
good_nodes = {good_node.protocol.node_id for good_node in self.nodes[10:]}
for peer in node.protocol.routing_table.get_peers():
self.assertIn(peer.node_id, good_nodes)
async def test_re_join(self):
await self.setup_network(20, seed_nodes=10)
node = self.nodes[-1]
self.assertTrue(node.joined.is_set())
self.assertTrue(node.protocol.routing_table.get_peers())
for network_node in self.nodes[:-1]:
network_node.stop()
await node.refresh_node(True)
await asyncio.sleep(.3) # let pending events settle
self.assertFalse(node.protocol.routing_table.get_peers())
for network_node in self.nodes[:-1]:
network_node.start('127.0.0.1', self.known_node_addresses)
self.assertFalse(node.protocol.routing_table.get_peers())
timeout = 20
while not node.protocol.routing_table.get_peers():
await asyncio.sleep(.1)
timeout -= 1
if not timeout:
self.fail("node didnt join back after 2 seconds")
async def test_announce_no_peers(self):
await self.setup_network(1)
node = self.nodes[0]
blob_hash = hexlify(constants.generate_id(1337)).decode()
peers = await node.announce_blob(blob_hash)
self.assertEqual(len(peers), 0)
async def test_get_token_on_announce(self):
await self.setup_network(2, seed_nodes=2)
node1, node2 = self.nodes
node1.protocol.peer_manager.clear_token(node2.protocol.node_id)
blob_hash = hexlify(constants.generate_id(1337)).decode()
node_ids = await node1.announce_blob(blob_hash)
self.assertIn(node2.protocol.node_id, node_ids)
node2.protocol.node_rpc.refresh_token()
node_ids = await node1.announce_blob(blob_hash)
self.assertIn(node2.protocol.node_id, node_ids)
node2.protocol.node_rpc.refresh_token()
node_ids = await node1.announce_blob(blob_hash)
self.assertIn(node2.protocol.node_id, node_ids)
async def test_peer_search_removes_bad_peers(self):
# that's an edge case discovered by Tom, but an important one
# imagine that you only got bad peers and refresh will happen in one hour
# instead of failing for one hour we should be able to recover by scheduling pings to bad peers we find
await self.setup_network(2, seed_nodes=2)
node1, node2 = self.nodes
node2.stop()
# forcefully make it a bad peer but dont remove it from routing table
address, port, node_id = node2.protocol.external_ip, node2.protocol.udp_port, node2.protocol.node_id
peer = KademliaPeer(self.loop, address, node_id, port)
self.assertTrue(node1.protocol.peer_manager.peer_is_good(peer))
node1.protocol.peer_manager.report_failure(node2.protocol.external_ip, node2.protocol.udp_port)
node1.protocol.peer_manager.report_failure(node2.protocol.external_ip, node2.protocol.udp_port)
self.assertFalse(node1.protocol.peer_manager.peer_is_good(peer))
# now a search happens, which removes bad peers while contacting them
self.assertTrue(node1.protocol.routing_table.get_peers())
await node1.peer_search(node2.protocol.node_id)
await asyncio.sleep(.3) # let pending events settle
self.assertFalse(node1.protocol.routing_table.get_peers())
+54
View File
@@ -1,3 +1,4 @@
import asyncio
import json
from binascii import hexlify
from lbrynet.testcase import CommandTestCase
@@ -88,3 +89,56 @@ class ResolveCommand(CommandTestCase):
self.assertFalse(claim['decoded_claim'])
self.assertEqual(claim['txid'], txid)
self.assertEqual(claim['effective_amount'], "0.1")
async def _test_resolve_abc_foo(self):
response = await self.resolve('lbry://@abc/foo')
claim = response['lbry://@abc/foo']
self.assertIn('certificate', claim)
self.assertIn('claim', claim)
self.assertEqual(claim['claim']['name'], 'foo')
self.assertEqual(claim['claim']['channel_name'], '@abc')
self.assertEqual(claim['certificate']['name'], '@abc')
self.assertEqual(claim['claims_in_channel'], 0)
self.assertEqual(
claim['claim']['timestamp'],
self.ledger.headers[claim['claim']['height']]['timestamp']
)
self.assertEqual(
claim['certificate']['timestamp'],
self.ledger.headers[claim['certificate']['height']]['timestamp']
)
async def test_resolve_lru_cache_doesnt_persist_errors(self):
original_get_transaction = self.daemon.wallet_manager.ledger.network.get_transaction
async def timeout_get_transaction(txid):
fut = self.loop.create_future()
def delayed_raise_cancelled_error():
fut.set_exception(asyncio.CancelledError())
self.loop.call_soon(delayed_raise_cancelled_error)
return await fut
tx = await self.channel_create('@abc', '0.01')
channel_id = tx['outputs'][0]['claim_id']
await self.stream_create('foo', '0.01', channel_id=channel_id)
# raise a cancelled error from get_transaction
self.daemon.wallet_manager.ledger.network.get_transaction = timeout_get_transaction
with self.assertRaises(KeyError):
await self._test_resolve_abc_foo()
# restore the real get_transaction that doesn't cancel, it should be called and the result cached
self.daemon.wallet_manager.ledger.network.get_transaction = original_get_transaction
await self._test_resolve_abc_foo()
called_again = asyncio.Event(loop=self.loop)
def check_result_cached(txid):
called_again.set()
return original_get_transaction(txid)
# check that the result was cached
self.daemon.wallet_manager.ledger.network.get_transaction = check_result_cached
await self._test_resolve_abc_foo()
self.assertFalse(called_again.is_set())
+56 -3
View File
@@ -2,6 +2,7 @@ import os
import hashlib
import aiohttp
import aiohttp.web
import asyncio
from lbrynet.utils import aiohttp_request
from lbrynet.blob.blob_file import MAX_BLOB_SIZE
@@ -35,14 +36,15 @@ class RangeRequests(CommandTestCase):
await self.daemon.jsonrpc_file_delete(delete_from_download_dir=True, claim_name='foo')
self.assertEqual(0, len(os.listdir(self.daemon.blob_manager.blob_dir)))
# await self._restart_stream_manager()
await self.daemon.runner.setup()
site = aiohttp.web.TCPSite(self.daemon.runner, self.daemon.conf.api_host, self.daemon.conf.api_port)
await self.daemon.streaming_runner.setup()
site = aiohttp.web.TCPSite(self.daemon.streaming_runner, self.daemon.conf.streaming_host,
self.daemon.conf.streaming_port)
await site.start()
self.assertListEqual(self.daemon.jsonrpc_file_list(), [])
async def _test_range_requests(self):
name = 'foo'
url = f'http://{self.daemon.conf.api_host}:{self.daemon.conf.api_port}/get/{name}'
url = f'http://{self.daemon.conf.streaming_host}:{self.daemon.conf.streaming_port}/get/{name}'
async with aiohttp_request('get', url) as req:
self.assertEqual(req.headers.get('Content-Type'), 'application/octet-stream')
@@ -104,6 +106,14 @@ class RangeRequests(CommandTestCase):
((MAX_BLOB_SIZE - 1) * 4) - 15, padding=b'\x00' * 15
)
async def test_forbidden(self):
self.data = get_random_bytes(1000)
await self._setup_stream(self.data, file_size=1000)
url = f'http://{self.daemon.conf.streaming_host}:{self.daemon.conf.streaming_port}/get/foo'
self.daemon.conf.streaming_get = False
async with aiohttp_request('get', url) as req:
self.assertEqual(403, req.status)
async def test_range_requests_last_block_of_last_blob_padding(self):
self.data = get_random_bytes(((MAX_BLOB_SIZE - 1) * 4) - 16)
await self._setup_stream(self.data)
@@ -364,3 +374,46 @@ class RangeRequests(CommandTestCase):
await stream.finished_writing.wait()
with open(stream.full_path, 'rb') as f:
self.assertEqual(self.data, f.read())
class RangeRequestsLRUCache(CommandTestCase):
blob_lru_cache_size = 32
async def _request_stream(self):
name = 'foo'
url = f'http://{self.daemon.conf.streaming_host}:{self.daemon.conf.streaming_port}/get/{name}'
async with aiohttp_request('get', url) as req:
self.assertEqual(req.headers.get('Content-Type'), 'application/octet-stream')
content_range = req.headers.get('Content-Range')
content_length = int(req.headers.get('Content-Length'))
streamed_bytes = await req.content.read()
self.assertEqual(content_length, len(streamed_bytes))
self.assertEqual(15, content_length)
self.assertEqual(b'hi\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', streamed_bytes)
self.assertEqual('bytes 0-14/15', content_range)
async def test_range_requests_with_blob_lru_cache(self):
self.data = b'hi'
self.daemon.conf.save_blobs = False
self.daemon.conf.save_files = False
await self.stream_create('foo', '0.01', data=self.data, file_size=0)
await self.daemon.jsonrpc_file_list()[0].fully_reflected.wait()
await self.daemon.jsonrpc_file_delete(delete_from_download_dir=True, claim_name='foo')
self.assertEqual(0, len(os.listdir(self.daemon.blob_manager.blob_dir)))
await self.daemon.streaming_runner.setup()
site = aiohttp.web.TCPSite(self.daemon.streaming_runner, self.daemon.conf.streaming_host,
self.daemon.conf.streaming_port)
await site.start()
self.assertListEqual(self.daemon.jsonrpc_file_list(), [])
await self._request_stream()
self.assertEqual(1, len(self.daemon.jsonrpc_file_list()))
self.server.stop_server()
# running with cache size 0 gets through without errors without
# this since the server doesnt stop immediately
await asyncio.sleep(1, loop=self.loop)
await self._request_stream()
@@ -1,102 +0,0 @@
import unittest
import asyncio
from torba.testcase import AsyncioTestCase
from lbrynet.dht.protocol.async_generator_junction import AsyncGeneratorJunction
class MockAsyncGen:
def __init__(self, loop, result, delay, stop_cnt=10):
self.loop = loop
self.result = result
self.delay = delay
self.count = 0
self.stop_cnt = stop_cnt
self.called_close = False
def __aiter__(self):
return self
async def __anext__(self):
await asyncio.sleep(self.delay, loop=self.loop)
if self.count > self.stop_cnt - 1:
raise StopAsyncIteration()
self.count += 1
return self.result
async def aclose(self):
self.called_close = True
class TestAsyncGeneratorJunction(AsyncioTestCase):
def setUp(self):
self.loop = asyncio.get_event_loop()
async def _test_junction(self, expected, *generators):
order = []
async with AsyncGeneratorJunction(self.loop) as junction:
for generator in generators:
junction.add_generator(generator)
async for item in junction:
order.append(item)
self.assertListEqual(order, expected)
async def test_yield_order(self):
expected_order = [1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 2, 2]
fast_gen = MockAsyncGen(self.loop, 1, 0.2)
slow_gen = MockAsyncGen(self.loop, 2, 0.4)
await self._test_junction(expected_order, fast_gen, slow_gen)
self.assertEqual(fast_gen.called_close, True)
self.assertEqual(slow_gen.called_close, True)
async def test_nothing_to_yield(self):
async def __nothing():
for _ in []:
yield self.fail("nada")
await self._test_junction([], __nothing())
async def test_fast_iteratiors(self):
async def __gotta_go_fast():
for _ in range(10):
yield 0
await self._test_junction([0]*40, __gotta_go_fast(), __gotta_go_fast(), __gotta_go_fast(), __gotta_go_fast())
@unittest.SkipTest
async def test_one_stopped_first(self):
expected_order = [1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2]
fast_gen = MockAsyncGen(self.loop, 1, 0.2, 5)
slow_gen = MockAsyncGen(self.loop, 2, 0.4)
await self._test_junction(expected_order, fast_gen, slow_gen)
self.assertEqual(fast_gen.called_close, True)
self.assertEqual(slow_gen.called_close, True)
async def test_with_non_async_gen_class(self):
expected_order = [1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2]
async def fast_gen():
for i in range(10):
if i == 5:
return
await asyncio.sleep(0.2)
yield 1
slow_gen = MockAsyncGen(self.loop, 2, 0.4)
await self._test_junction(expected_order, fast_gen(), slow_gen)
self.assertEqual(slow_gen.called_close, True)
async def test_stop_when_encapsulating_task_cancelled(self):
fast_gen = MockAsyncGen(self.loop, 1, 0.2)
slow_gen = MockAsyncGen(self.loop, 2, 0.4)
async def _task():
async with AsyncGeneratorJunction(self.loop) as junction:
junction.add_generator(fast_gen)
junction.add_generator(slow_gen)
async for _ in junction:
pass
task = self.loop.create_task(_task())
self.loop.call_later(1.0, task.cancel)
with self.assertRaises(asyncio.CancelledError):
await task
self.assertEqual(fast_gen.called_close, True)
self.assertEqual(slow_gen.called_close, True)
+21 -9
View File
@@ -16,10 +16,22 @@ class DataStoreTests(TestCase):
peer = self.peer_manager.get_kademlia_peer(node_id, address, udp_port)
peer.update_tcp_port(tcp_port)
before = self.data_store.get_peers_for_blob(blob)
self.data_store.add_peer_to_blob(peer, blob, peer.compact_address_tcp(), 0, 0, peer.node_id)
self.data_store.add_peer_to_blob(peer, blob)
self.assertListEqual(before + [peer], self.data_store.get_peers_for_blob(blob))
return peer
def test_refresh_peer_to_blob(self):
blob = b'f' * 48
self.assertListEqual([], self.data_store.get_peers_for_blob(blob))
peer = self._test_add_peer_to_blob(blob=blob, node_id=b'a' * 48, address='1.2.3.4')
self.assertTrue(self.data_store.has_peers_for_blob(blob))
self.assertEqual(len(self.data_store.get_peers_for_blob(blob)), 1)
self.assertEqual(self.data_store._data_store[blob][0][1], 0)
self.loop.time = lambda: 100.0
self.assertEqual(self.data_store._data_store[blob][0][1], 0)
self.data_store.add_peer_to_blob(peer, blob)
self.assertEqual(self.data_store._data_store[blob][0][1], 100)
def test_add_peer_to_blob(self, blob=b'f' * 48, peers=None):
peers = peers or [
(b'a' * 48, '1.2.3.4'),
@@ -67,8 +79,8 @@ class DataStoreTests(TestCase):
self.assertEqual(len(self.data_store.get_storing_contacts()), len(peers))
# expire the first peer from blob1
first = self.data_store._data_store[blob1][0]
self.data_store._data_store[blob1][0] = (first[0], first[1], first[2], -86401, first[4])
first = self.data_store._data_store[blob1][0][0]
self.data_store._data_store[blob1][0] = (first, -86401)
self.assertEqual(len(self.data_store.get_storing_contacts()), len(peers))
self.data_store.removed_expired_peers()
self.assertEqual(len(self.data_store.get_peers_for_blob(blob1)), len(peers) - 1)
@@ -76,18 +88,18 @@ class DataStoreTests(TestCase):
self.assertEqual(len(self.data_store.get_storing_contacts()), len(peers))
# expire the first peer from blob2
first = self.data_store._data_store[blob2][0]
self.data_store._data_store[blob2][0] = (first[0], first[1], first[2], -86401, first[4])
first = self.data_store._data_store[blob2][0][0]
self.data_store._data_store[blob2][0] = (first, -86401)
self.data_store.removed_expired_peers()
self.assertEqual(len(self.data_store.get_peers_for_blob(blob1)), len(peers) - 1)
self.assertEqual(len(self.data_store.get_peers_for_blob(blob2)), len(peers) - 1)
self.assertEqual(len(self.data_store.get_storing_contacts()), len(peers) - 1)
# expire the second and third peers from blob1
first = self.data_store._data_store[blob2][0]
self.data_store._data_store[blob1][0] = (first[0], first[1], first[2], -86401, first[4])
second = self.data_store._data_store[blob2][1]
self.data_store._data_store[blob1][1] = (second[0], second[1], second[2], -86401, second[4])
first = self.data_store._data_store[blob2][0][0]
self.data_store._data_store[blob1][0] = (first, -86401)
second = self.data_store._data_store[blob2][1][0]
self.data_store._data_store[blob1][1] = (second, -86401)
self.data_store.removed_expired_peers()
self.assertEqual(len(self.data_store.get_peers_for_blob(blob1)), 0)
self.assertEqual(len(self.data_store.get_peers_for_blob(blob2)), len(peers) - 1)
+4
View File
@@ -99,6 +99,7 @@ class TestProtocol(AsyncioTestCase):
self.loop, PeerManager(self.loop), node_id, address, udp_port, tcp_port
)
await self.loop.create_datagram_endpoint(lambda: proto, (address, 4444))
proto.start()
return proto, other_peer.peer_manager.get_kademlia_peer(node_id, address, udp_port=udp_port)
async def test_add_peer_after_handle_request(self):
@@ -112,6 +113,7 @@ class TestProtocol(AsyncioTestCase):
self.loop, PeerManager(self.loop), node_id1, '1.2.3.4', 4444, 3333
)
await self.loop.create_datagram_endpoint(lambda: peer1, ('1.2.3.4', 4444))
peer1.start()
peer2, peer_2_from_peer_1 = await self._make_protocol(peer1, node_id2, '1.2.3.5', 4444, 3333)
peer3, peer_3_from_peer_1 = await self._make_protocol(peer1, node_id3, '1.2.3.6', 4444, 3333)
@@ -119,6 +121,7 @@ class TestProtocol(AsyncioTestCase):
# peers who reply should be added
await peer1.get_rpc_peer(peer_2_from_peer_1).ping()
await asyncio.sleep(0.5)
self.assertListEqual([peer_2_from_peer_1], peer1.routing_table.get_peers())
peer1.routing_table.remove_peer(peer_2_from_peer_1)
@@ -137,6 +140,7 @@ class TestProtocol(AsyncioTestCase):
self.assertEqual(0, len(peer1.ping_queue._pending_contacts))
pong = await peer1_from_peer4.ping()
self.assertEqual(b'pong', pong)
await asyncio.sleep(0.5)
self.assertEqual(1, len(peer1.routing_table.get_peers()))
self.assertEqual(0, len(peer1.ping_queue._pending_contacts))
peer1.routing_table.buckets[0].peers.clear()
@@ -57,7 +57,7 @@ class TestRouting(AsyncioTestCase):
node.protocol.node_id, node.protocol.external_ip,
udp_port=node.protocol.udp_port
)
added = await node_1.protocol.add_peer(peer)
added = await node_1.protocol._add_peer(peer)
self.assertEqual(True, added)
contact_cnt += 1
@@ -88,7 +88,7 @@ class TestRouting(AsyncioTestCase):
# set all of the peers to good (as to not attempt pinging stale ones during split)
node_1.protocol.peer_manager.report_last_replied(peer.address, peer.udp_port)
node_1.protocol.peer_manager.report_last_replied(peer.address, peer.udp_port)
await node_1.protocol.add_peer(peer)
await node_1.protocol._add_peer(peer)
# check that bucket 0 is always the one covering the local node id
self.assertEqual(True, node_1.protocol.routing_table.buckets[0].key_in_range(node_1.protocol.node_id))
self.assertEqual(40, len(node_1.protocol.routing_table.get_peers()))
+5 -3
View File
@@ -32,7 +32,7 @@ class TestBlobAnnouncer(AsyncioTestCase):
await n.start_listening(address)
self.nodes.update({len(self.nodes): n})
if add_to_routing_table:
await self.node.protocol.add_peer(
self.node.protocol.add_peer(
self.peer_manager.get_kademlia_peer(
n.protocol.node_id, n.protocol.external_ip, n.protocol.udp_port
)
@@ -86,7 +86,8 @@ class TestBlobAnnouncer(AsyncioTestCase):
to_announce = await self.storage.get_blobs_to_announce()
self.assertEqual(2, len(to_announce))
self.blob_announcer.start(batch_size=1) # so it covers batching logic
await self.advance(61.0)
# takes 60 seconds to start, but we advance 120 to ensure it processed all batches
await self.advance(60.0 * 2)
to_announce = await self.storage.get_blobs_to_announce()
self.assertEqual(0, len(to_announce))
self.blob_announcer.stop()
@@ -98,6 +99,7 @@ class TestBlobAnnouncer(AsyncioTestCase):
await self.chain_peer(constants.generate_id(12), '1.2.3.12')
await self.chain_peer(constants.generate_id(13), '1.2.3.13')
await self.chain_peer(constants.generate_id(14), '1.2.3.14')
await self.advance(61.0)
last = self.nodes[len(self.nodes) - 1]
search_q, peer_q = asyncio.Queue(loop=self.loop), asyncio.Queue(loop=self.loop)
@@ -105,7 +107,7 @@ class TestBlobAnnouncer(AsyncioTestCase):
_, task = last.accumulate_peers(search_q, peer_q)
found_peers = await peer_q.get()
await task
task.cancel()
self.assertEqual(1, len(found_peers))
self.assertEqual(self.node.protocol.node_id, found_peers[0].node_id)
+1 -1
View File
@@ -72,7 +72,7 @@ class TestManagedStream(BlobExchangeTestBase):
self.assertTrue(self.stream._running.is_set())
await asyncio.sleep(0.5, loop=self.loop)
self.assertTrue(self.stream._running.is_set())
await asyncio.sleep(0.6, loop=self.loop)
await asyncio.sleep(2, loop=self.loop)
self.assertEqual(self.stream.status, "finished")
self.assertFalse(self.stream._running.is_set())
+24
View File
@@ -308,6 +308,30 @@ class TestStreamManager(BlobExchangeTestBase):
self.server_blob_manager.delete_blob(head_blob_hash)
await self._test_download_error_analytics_on_start(DownloadDataTimeout, timeout=1)
async def test_non_head_data_timeout(self):
await self.setup_stream_manager()
with open(os.path.join(self.server_dir, self.sd_hash), 'r') as sdf:
last_blob_hash = json.loads(sdf.read())['blobs'][-2]['blob_hash']
self.server_blob_manager.delete_blob(last_blob_hash)
self.client_config.blob_download_timeout = 0.1
stream = await self.stream_manager.download_stream_from_uri(self.uri, self.exchange_rate_manager)
await stream.started_writing.wait()
self.assertEqual('running', stream.status)
self.assertIsNotNone(stream.full_path)
self.assertGreater(stream.written_bytes, 0)
await stream.finished_write_attempt.wait()
self.assertEqual('stopped', stream.status)
self.assertIsNone(stream.full_path)
self.assertEqual(0, stream.written_bytes)
self.stream_manager.stop()
await self.stream_manager.start()
self.assertEqual(1, len(self.stream_manager.streams))
stream = list(self.stream_manager.streams.values())[0]
self.assertEqual('stopped', stream.status)
self.assertIsNone(stream.full_path)
self.assertEqual(0, stream.written_bytes)
async def test_download_then_recover_stream_on_startup(self, old_sort=False):
expected_analytics_events = [
'Time To First Bytes',