Compare commits

..
2 Commits
22 changed files with 522 additions and 541 deletions

No files matched your search

+111 -111
View File
@@ -37,14 +37,14 @@
"is_required": false
}
],
"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 }",
"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 }",
"examples": [
{
"title": "Get a file",
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"}}).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\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf5tbpddv\",\n \"download_path\": \"/tmp/tmpf5tbpddv/tmp41380zjn\",\n \"file_name\": \"tmp41380zjn\",\n \"height\": 214,\n \"key\": \"312cd72171ae282425adac9d1298cc0f\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"456cbb3933e75ffd57903b5ea4d51d5d4954170291841732c15a47dfdc873c40d206fd97c3d702c842e085ea3c83f2fc\",\n \"stream_name\": \"tmp41380zjn\",\n \"streaming_url\": \"http://localhost:5280/stream/398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"suggested_file_name\": \"tmp41380zjn\",\n \"timestamp\": 1557798596,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"written_bytes\": 11\n }\n}"
"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}"
}
]
},
@@ -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/tmphgl5lnpy\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmphgl5lnpy",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmphgl5lnpy\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000017b27b195a45b3df2a3596c6a6cf79f55f1354ea032300939469ff5b021ce32e7010000006a47304402201e9675252c935f7aaf46b437969d315c31c8caf56952ec0d510cbcc734d8a9fd02201bd59ea436d4a27361c06f9c9321c93cb4eae4b0a3a3f4a7138b22454038cb850121026c0e8410772593a714773d4b7ddc0bf6c5b1373d56aa8abbace5b3ad9b46c904ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7068676c356c6e7079180b22186170706c69636174696f6e2f6f637465742d73747265616d32307bc8233c25092897274f3ec179ae40384037d6fed97184c3cba4626246d89c010b9e69587553f04dfcd266af6713ff7d6d7576a914d8b5f47c1b5d0a88123e4dd5e29fa5ce24e13b9a88ace0b46217000000001976a914bd446a9c829d1f394ac4877a1501f61f5992e58888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mwSB4MnwAPq9pKThw8XyYv5gmjHECd9xjS\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798596,\n \"txid\": \"e732ce21b0f59f4639093032a04e35f1559ff76c6a6c59a3f23d5ba495b1277b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n1GpDwogqqjBKkyUM98K3vuuEPLbfC249s\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ecc6adf5d358f8de0ec76968071083bec70e670b\",\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#ecc6adf5d358f8de0ec76968071083bec70e670b\",\n \"timestamp\": null,\n \"txid\": \"5158a4d088b8dfca7d04aaa31356054aea37c71aed9ba418a9d67d5d8ee4cbec\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmphgl5lnpy\",\n \"sd_hash\": \"7bc8233c25092897274f3ec179ae40384037d6fed97184c3cba4626246d89c010b9e69587553f04dfcd266af6713ff7d\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mxmhxy7cSvDDuuFUgCMTUf3D3dUMtQ79k2\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"5158a4d088b8dfca7d04aaa31356054aea37c71aed9ba418a9d67d5d8ee4cbec\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"5158a4d088b8dfca7d04aaa31356054aea37c71aed9ba418a9d67d5d8ee4cbec\"\n }\n}"
"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}"
}
]
},
@@ -229,10 +229,10 @@
"examples": [
{
"title": "Resolve a claim",
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"]}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"]}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\": {\n \"certificate\": {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"protobuf\": \"00125a0a583056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7420b4e6577204368616e6e656c\",\n \"supports\": [],\n \"timestamp\": 1557798595,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"valid_at_height\": 210,\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"claim\": {\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n }\n },\n \"claims_in_channel\": 0\n }\n }\n}"
"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}"
}
]
},
@@ -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\": \"9nJye78X53A4UN9oSZy2RXGPYbcLQos92jBbW21D1qXBJnnUCYD2J3KBiGkFurVCBQ\",\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\": \"0416937eb1681210fd63e9099144a6ca18954acbfaeb90ba2e83ec916d6c2298\",\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\": \"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}"
}
]
},
@@ -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.0rc7\",\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.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}"
}
]
}
@@ -324,10 +324,10 @@
"examples": [
{
"title": "Add an account from seed",
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"double cash glare latin witness valid machine place pool subject strike toilet\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\", \"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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557798561.6743736,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeTCD1tZ1T9kjgw2Mi8YHRugYRob2zKzKZRwAuCZV7k5bpgkeoKpy7tfZv7WmJwQG2X4Uw3QZYJcBxgnP2kXrBGJehyQz7JZ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XvDzuYDbrZQrFxYHsTjC1DHKiKdLQbniPvBwXbP5JEhTznu46Jn6tp3U7abBYggxDedUASE9V1zkGpmvk32Q6xUNQSSCnQk\",\n \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\"\n }\n}"
"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}"
}
]
},
@@ -359,9 +359,9 @@
},
{
"title": "Get balance for specific account by id",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}).json()",
"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()",
"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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557798561.5667138,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeTCD1tZ1T9kjgw2Mi8YHRugYRob2zKzKZRwAuCZV7k5bpgkeoKpy7tfZv7WmJwQG2X4Uw3QZYJcBxgnP2kXrBGJehyQz7JZ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XvDzuYDbrZQrFxYHsTjC1DHKiKdLQbniPvBwXbP5JEhTznu46Jn6tp3U7abBYggxDedUASE9V1zkGpmvk32Q6xUNQSSCnQk\",\n \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\"\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\": \"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}"
}
]
},
@@ -473,24 +473,24 @@
"examples": [
{
"title": "Transfer 2 LBC from default account to specific account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015cfc2185d63f3d3be5bd0b891a3c702d90d64f0549f37f6ee38cc68662014992010000006a47304402202231e4ab85915684deffca56a0eac1c59871858f123700eb3d7696ad5b71373a0220606ebc2834c45d046b76fc0759da1b5ad93c962bc7ae24c36b09298e029ba40a012102c73c04fe344997186b027aafe09b64d68e1abc47557148b8f6ef19d302470531ffffffff0200c2eb0b000000001976a9147c94bff4e40db0a6ad5bc9e026e84699d24332eb88ac90d7ae2f000000001976a914b04686626b44a141236646a0378a43925715781588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmhpFDaDpRU5kPiDaB9YYaDaWwUf4TyUqE\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798594,\n \"txid\": \"9249016286c68ce36e7ff349054fd6902d703c1a890bbde53b3d3fd68521fc5c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mrsgHAFrjHr2zKFpz5RvRGk57RbhM5K2wE\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwb1hyVgX9CoMnwv27q3zZ3fQb7vSStEyC\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\"\n }\n}"
"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}"
},
{
"title": "Spread LBC between multiple addresses",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"from_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\" --from_account=\"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"from_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000019c73625ec64bb02c5fecdd8dd3539f77294d8def1ddaf0b9fa406a7674090eb7000000006b483045022100a89d171663b12b6937f1b21638651040a094772f36467c81b842ca210a01ddb402202e1cd524a614c7433b43396579c23762d0ebd050d13408b5d6db80fce69709b7012103bae292e33a09c40940e5b355badce6fc243184e2fc2ebf4c6bc3516bd725907dffffffff03c0687804000000001976a914d1708d8ff911780a6579c86998491ba73659558b88acc0687804000000001976a914d1708d8ff911780a6579c86998491ba73659558b88ac6cb9fa02000000001976a9142aa6d15fe29299c5d94e401087342c10113d2fe988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mrsgHAFrjHr2zKFpz5RvRGk57RbhM5K2wE\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557798595,\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzcNMTuA3hCUN528RTNUeZVyrgrDoeQXfJ\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mzcNMTuA3hCUN528RTNUeZVyrgrDoeQXfJ\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mjQUWpVazoAhTpgXAMb2x9qBo5zBQes2a7\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\"\n }\n}"
"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}"
},
{
"title": "Transfer all LBC to a specified account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000038f8e813c8fa5eb79927284b5d141e83bb63989bfa182092ae6eb3d80f29171a5000000006a473044022050b0ca8baa70bba462682e2e9de8970a9478fb9e81323a5f0300389217c33c4d02202e286bad96071df2cf351db8d1dbf87c043688fec35416cbee4cb97227a24e78012102b3cb75b37801c519c42c4e58cabcb6bba419cff4789960d318e1d7114fb7ad7fffffffff8f8e813c8fa5eb79927284b5d141e83bb63989bfa182092ae6eb3d80f29171a5010000006a4730440220403e69907c6508e86895ab2cf83e4b0c2b1c6e391a297e147b16d744f6eba97002204aa0531b49752e4cadb489a2d5edff03a2035872ffff6dc76bcbf4bbc8f2a0a0012102b3cb75b37801c519c42c4e58cabcb6bba419cff4789960d318e1d7114fb7ad7fffffffff8f8e813c8fa5eb79927284b5d141e83bb63989bfa182092ae6eb3d80f29171a5020000006a4730440220605f15d9834656f6172298e70cbb4af1cbde44a5b1c2afd81e28a63346362ef20220400ec46d72e4109641823dc2a74e7037dcd52b1db8960c9acfe52502a75ae8a701210244e0d25813d8817d0969608e0202fb35e53f66f31a09e60a50c6e5d51f2e4f57ffffffff015027eb0b000000001976a914496004d3d9650e07794fc75e2d1e705e2cadd99088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzcNMTuA3hCUN528RTNUeZVyrgrDoeQXfJ\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557798595,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mzcNMTuA3hCUN528RTNUeZVyrgrDoeQXfJ\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798595,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mjQUWpVazoAhTpgXAMb2x9qBo5zBQes2a7\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1557798595,\n \"txid\": \"a57191f2803debe62a0982a1bf8939b63be841d1b584729279eba58f3c818e8f\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnCveZiKh3qytL6HKGCsFya7Snh27ESbid\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"b1d0602218ae9426f38f9a401c534781ddda225db9b35efcbcc131c4f211764d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"b1d0602218ae9426f38f9a401c534781ddda225db9b35efcbcc131c4f211764d\"\n }\n}"
"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}"
}
]
},
@@ -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\": \"mocQwTExwMN4wK9gq2zu6YchWjFBNBZDcm\",\n \"is_default\": true,\n \"name\": \"Account #mocQwTExwMN4wK9gq2zu6YchWjFBNBZDcm\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YXD5pLiGvdUhuitMHjubNU5XXWffjnTe6z1dWWpVK9iM9UJeF7vex9WSTAP8QYNDB4P8wLzgWtmcVL7dMpgbtzqnrWbegGX\",\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\": \"mnNeA4p7qkBSFti1texZcMaij5XP4TTLRs\",\n \"is_default\": true,\n \"name\": \"Account #mnNeA4p7qkBSFti1texZcMaij5XP4TTLRs\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WMwJZ78QVYU65ofkdQWhLwzvEm9R8gBPAVaUqFdoje93iUzpf2oGFBntAV7hi8YsVLK4gSa2JC9JS5ZR2ZJc9qaWEswouus\",\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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}).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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557798561.5667138,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeTCD1tZ1T9kjgw2Mi8YHRugYRob2zKzKZRwAuCZV7k5bpgkeoKpy7tfZv7WmJwQG2X4Uw3QZYJcBxgnP2kXrBGJehyQz7JZ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XvDzuYDbrZQrFxYHsTjC1DHKiKdLQbniPvBwXbP5JEhTznu46Jn6tp3U7abBYggxDedUASE9V1zkGpmvk32Q6xUNQSSCnQk\",\n \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\"\n }\n}"
"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}"
}
]
},
@@ -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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\", \"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\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1557798561.7303,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeTCD1tZ1T9kjgw2Mi8YHRugYRob2zKzKZRwAuCZV7k5bpgkeoKpy7tfZv7WmJwQG2X4Uw3QZYJcBxgnP2kXrBGJehyQz7JZ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XvDzuYDbrZQrFxYHsTjC1DHKiKdLQbniPvBwXbP5JEhTznu46Jn6tp3U7abBYggxDedUASE9V1zkGpmvk32Q6xUNQSSCnQk\",\n \"seed\": \"double cash glare latin witness valid machine place pool subject strike toilet\"\n }\n}"
"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}"
}
]
},
@@ -708,9 +708,9 @@
"examples": [
{
"title": "Check if address is mine",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\"}}).json()",
"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()",
"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 \"mmhpFDaDpRU5kPiDaB9YYaDaWwUf4TyUqE\",\n \"mqKthxSXX7xY9nioX7EwccxWyYffNF7YH2\",\n \"n3657vmtNAyxb6vEvQqjSRcShzrVNwk1Jj\",\n \"mum4xondKwCYch9rKtGSbSWXi3UiuJKu3A\",\n \"n1GBSfSdFo8ZwAipwvU92xq2xnp3Ka1LJU\",\n \"mx7bLdaKB24jydS7u6p8UPDuMQSGCTp66w\",\n \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"mgiwsw6Tdj8KvjWHzYRHgsBwmXyLEYndhr\",\n \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"myNobFEgYarayp7pc4r4jd2DGA99sufnyx\",\n \"mirnhWoKos7Bu9fpZJrJDcwqawKXjNYvvG\",\n \"mshadB2vubQzopUQ2G6JxnLDrXAFqHFxSg\",\n \"mguTBqAQkHxFVTotXTSzbkWoHLqgA7qFy7\",\n \"miJNt6hHsLbgUsPmedddgT9PV2Q352rU4p\",\n \"n1GpDwogqqjBKkyUM98K3vuuEPLbfC249s\",\n \"mzD4dmmHeYGquEUQrWxxDD4e9Pn7DMPzvf\",\n \"mrmqSrxt3Z1z48fGJ1YDdixSJARMDzysJC\",\n \"mzxQZ53eRy3NAtJSJNx5PbpyAdG14uYbyT\",\n \"mtu4zVAUisznks7ekFu5W4SyYXzaCXX1uQ\",\n \"mjBM6ReaSzshXXQbzrKNNbfvmi1pjzencN\",\n \"mwXgF4NG7keBy2uV7vojYMtFiL4gMFjjN4\",\n \"mggFsf5TuajRPfeBJBb4LBdst2zMyikaLo\",\n \"mibDVv16pxdKg52x7BvR4YytxNLSDe4N42\",\n \"mwSB4MnwAPq9pKThw8XyYv5gmjHECd9xjS\",\n \"mwb1hyVgX9CoMnwv27q3zZ3fQb7vSStEyC\",\n \"miapoWLFkpSSeHCEoPTbnWv1akUZMFQPb7\",\n \"mschMpRgQfZDcStvGjxmJntXoyJehj7VEw\"\n ]\n}"
"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}"
},
{
"title": "List addresses in specified account",
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mnwfNu4zxSdDJ6yEo4ETQyDp7MzEqueaih\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mzcNMTuA3hCUN528RTNUeZVyrgrDoeQXfJ\",\n \"myuEivWHkLyrJPnLRGxz4dobniriYMfvbm\",\n \"mrsgHAFrjHr2zKFpz5RvRGk57RbhM5K2wE\",\n \"mjQUWpVazoAhTpgXAMb2x9qBo5zBQes2a7\",\n \"mnVLSCH5SRwcMgUEFnd5XkAaDta4dYHt9p\",\n \"mqjGoQwyRo7aj3PrCG1uo9EN98aE15H1U3\",\n \"muyW1bGsVLNKtsErAQ7hQiWA622fHNv9hz\",\n \"n1cf22Y6EK1tdc1oshjgZsKbq7DSy2Z6UM\",\n \"mtc7RcYQmKhE6LnLrqqiq51cUiVBf1Uh19\",\n \"mrjhppQ2nEacDTyngtdf9wRQoHP4ZUUhm1\",\n \"n263TmGvWvby4n1xUCfrzeiqgeiTJwajLd\",\n \"mhMoSVmAf4tTa9bauYJuQ8Q1XNT2VMxLtt\",\n \"mgUFN6cCkvzusuXThst28efgjvhjgGeGdK\",\n \"n2ym9Azi1FgW529ZxkGsArtnysoUXcbVEz\",\n \"mpBpe49VMn6tkCH1JLjdNuAQzFNue2aKrz\",\n \"mow8UeB7QVJAXsxfXbyBkroZQ8qz2JqsUD\",\n \"mqXMpDbpfUcRfAp23cAWZGAzTvY11eqXqu\",\n \"mut88Qcq5TFfPrdsz4wTcR2yy2b4WRrxEw\",\n \"mvJFnkbgxwU9ZgUPXtJxs5x2DhEwf5diYc\",\n \"mqR76rSyK8G2MxTicTtXxexDfLS4evLc4k\",\n \"mt1TQwjQzXMTTzDbKsTVtHYYAaQs7jtBZP\",\n \"mvYXpEsDdeixWKzwmseNGKSS1dnC8BA8hZ\",\n \"mwVH7WiKsT9hRLp636hFxAzfrypzA756Tz\",\n \"my7rHBSfLULRRb6DKeePKuUFrGQ1Crc4C5\",\n \"mj1xtfp7E2CSYXdisnbmyyF8aSRVjSMJWR\",\n \"mnFnHzrZivKTQZaiQe3Tom23Cb7qbRbq5m\"\n ]\n}"
"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}"
}
]
},
@@ -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\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\"\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mruESV2uxBZioC97PDsbuqjGKRCkviYRos\"\n}"
}
]
}
@@ -824,10 +824,10 @@
"examples": [
{
"title": "Delete a blob",
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"5a3782ce9e3d30c34a92487ed3a3ca7b43a322a3d1c208a31fda3d4d3f2c6a180b30815404a9c4fa8b3e37e95cf28b39\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete 5a3782ce9e3d30c34a92487ed3a3ca7b43a322a3d1c208a31fda3d4d3f2c6a180b30815404a9c4fa8b3e37e95cf28b39",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"5a3782ce9e3d30c34a92487ed3a3ca7b43a322a3d1c208a31fda3d4d3f2c6a180b30815404a9c4fa8b3e37e95cf28b39\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted 5a3782ce9e3d30c34a92487ed3a3ca7b43a322a3d1c208a31fda3d4d3f2c6a180b30815404a9c4fa8b3e37e95cf28b39\"\n}"
"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}"
}
]
},
@@ -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 \"5a3782ce9e3d30c34a92487ed3a3ca7b43a322a3d1c208a31fda3d4d3f2c6a180b30815404a9c4fa8b3e37e95cf28b39\",\n \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"e4d201bbe7716f7daaa4ffa94a6c99e53fc6096a9a7f37b169de32afe8902d71543a588d0418ee8a865a5115812b9a92\",\n \"3725921890987abab5cf3bd957668e58f51631b894de87457fa28f953c9a747f4f9be6dd87d4686b93d83f3eb62a0f7f\"\n ]\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"e53d7a88c1d5e8ae309ed3fe326bd71aa29f8f969c2dc657f600ac4166725ff879b081599b12e5368e1ecd292fa5e310\",\n \"135a9740f563155af8fb9b2f31c7a942e6c955aca13b86caf6e879af966e850a5efb5401ff7b6b69f9e531d31bf4f081\",\n \"564fb55561e9f6c0b2ecd932fc784573124f33e81ddd72579c48e2a27360c5f64d243330c40842617bc9a7d29963e4aa\",\n \"2217e7fc6e556852849910b734b428604fd3704cab831d71a44149622a9285067d961f7cb720bbe151139ce5a832ae25\"\n ]\n}"
}
]
},
@@ -980,10 +980,10 @@
"examples": [
{
"title": "Abandon a channel claim",
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon af506becd8dba851c8803c0f48347f16d5a92c4c",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000011e55b918c7f0126f05d68e11885238c8f5b1aaae78e432d9bcf9ce3e164b79f8000000006b4830450221008ac0dc49b5dfdb0c0571adae6bbd3d35dfdf20fc855a4e4d01762d0223776395022047ef2675161ba93c1ce6ea5e6b8b10c714cdfbcd528318aa08f81bc883f7daae0121037e59b66314ebcac4892adff6d379fccf80ff6ed7f2e3db8b93aa6aebbc22e196ffffffff0134b7f505000000001976a914ed06a0043efd7f0bb45233c266f5417cccea355988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n38ENqQYcQYhNmj2jw2Zz5d2WNApMP4oJe\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"7135a8c44191f49c4172c9374dd0cdb6d47e0dfb38c04587c450e669e8dfba94\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"7135a8c44191f49c4172c9374dd0cdb6d47e0dfb38c04587c450e669e8dfba94\"\n }\n}"
"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}"
}
]
},
@@ -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\": \"01000000019c73625ec64bb02c5fecdd8dd3539f77294d8def1ddaf0b9fa406a7674090eb7010000006b483045022100bd5e428b1ff37cca97bb4ed639542c1ded2fdf8e042c5678b523746891385f89022004cd17c2db2bef9fea6bd200228aca7f4d3e4350e57b4c9d85b84ed74ddeb2e201210299410f373b1b6ee2fb2a50c3c287a8c910ce1735aa5a09b1243e4b830ba510e6ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac76d7576a9140d79801941d440cd89bd0664b656143442974ee188acc462a029000000001976a91421a3c97a9358e6fb3e9b432a1049b6d37332950c88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mwb1hyVgX9CoMnwv27q3zZ3fQb7vSStEyC\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798595,\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": null,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"miapoWLFkpSSeHCEoPTbnWv1akUZMFQPb7\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\"\n }\n}"
"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}"
},
{
"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\": \"01000000011e55b918c7f0126f05d68e11885238c8f5b1aaae78e432d9bcf9ce3e164b79f8010000006a47304402205fb1d549b1d4e88218a672dadd165b091738ba1fd1e61919a69754827be18d1602207345ac4e5ae63edb90a073329cb50ebe2ff46f1c501d22d23f8aa269f658ebc5012103444ac2f3ba704f974a30e5a2f2e2a58a85a42d3556e7fabea52ecadb6822ae89ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a034200046fffb129eabb0a431aea6cf3ee9f1a72b94f148ae17e8c4d32b88222585853de790d7f50ef42b1c4897707a79d8ecc5e048abc713d04557dba9546d54674e744121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9140d3cc52a122c032380e38d0f9d42d2b5f20d04ea88ace221d305000000001976a914bb291830d33b4826504969779be349b1b936b22e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mfXSm7ZCWGDjLDQduY1EXFa9rbvkd5kwQN\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798595,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgiwsw6Tdj8KvjWHzYRHgsBwmXyLEYndhr\",\n \"amount\": \"1.0\",\n \"claim_id\": \"875a69e3313c9e0bb27db48c8058d4c769e9e1fd\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#875a69e3313c9e0bb27db48c8058d4c769e9e1fd\",\n \"timestamp\": null,\n \"txid\": \"64c2d6d99d52b7139e7089808daa90866376646616c4f8cb333d9b9f1b09eac5\",\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\": \"3056301006072a8648ce3d020106052b8104000a034200046fffb129eabb0a431aea6cf3ee9f1a72b94f148ae17e8c4d32b88222585853de790d7f50ef42b1c4897707a79d8ecc5e048abc713d04557dba9546d54674e744\",\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\": \"mxaZtDpf3Q2UC2rTVFZrU6ALRtAHkqKH8C\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"64c2d6d99d52b7139e7089808daa90866376646616c4f8cb333d9b9f1b09eac5\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"64c2d6d99d52b7139e7089808daa90866376646616c4f8cb333d9b9f1b09eac5\"\n }\n}"
"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}"
}
]
},
@@ -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\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
"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}"
},
{
"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\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\"\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\": \"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}"
}
]
},
@@ -1310,10 +1310,10 @@
"examples": [
{
"title": "Update a channel claim",
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"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 af506becd8dba851c8803c0f48347f16d5a92c4c --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"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\": \"01000000026b9b4102e2b539a1d6bfa60eabe6034e4af884bc9195e1b53949acfee0cf1245000000006b483045022100e7ab6ce698e331f972b4611eccfa2f3e0277f1e81f330a4f2e235c1eccc1adef0220654539c37f1522f83f2281ac515c041a78ad712e822b00547923d21d4ec6a41c0121037e59b66314ebcac4892adff6d379fccf80ff6ed7f2e3db8b93aa6aebbc22e196ffffffff4d7611f2c431c1bcfc5eb3b95d22dadd8147531c409a8ff32694ae182260d0b1000000006b483045022100c002d4a1761df43c43a2fa40e2b38eb9d0cecd72765e4d948b7309329c729b7702201e7d2a4584f72bc058abf8c865e48bf3c48c9d251219cc4526a1b14fecc23924012103502789f51ab274d404a05188307215d514908190fbaf4202aff7339ce9caa59cffffffff0200e1f50500000000a6b708406368616e6e656c144c2ca9d5167f34480f3c80c851a8dbd8ec6b50af4c6a00125a0a583056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7420b4e6577204368616e6e656c6d6d76a9140d79801941d440cd89bd0664b656143442974ee188ac6ebeea0b000000001976a9140017c33ede3e38b74fd30ccb19011598420fd5ed88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mnCveZiKh3qytL6HKGCsFya7Snh27ESbid\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1557798595,\n \"txid\": \"b1d0602218ae9426f38f9a401c534781ddda225db9b35efcbcc131c4f211764d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": null,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mfXSm7ZCWGDjLDQduY1EXFa9rbvkd5kwQN\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\"\n }\n}"
"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}"
}
]
}
@@ -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\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
"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}"
},
{
"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\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mgkCdYRXpRM4NdaUQXnKykQLSsWjYvY4NW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\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#af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"timestamp\": 1557798595,\n \"txid\": \"f8794b163ecef9bcd932e478aeaab1f5c8385288118ed6056f12f0c718b9551e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\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\": \"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}"
}
]
},
@@ -1426,17 +1426,17 @@
"examples": [
{
"title": "Search for all claims in channel",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"winning\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --channel_id=\"af506becd8dba851c8803c0f48347f16d5a92c4c\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"winning\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"absolute_channel_position\": 0,\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\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\": \"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}"
},
{
"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\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"signature_is_valid\": true,\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"supports\": [],\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"valid_at_height\": 214,\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\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\": \"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}"
}
]
}
@@ -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\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"}}).json()",
"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()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -1685,21 +1685,21 @@
"is_required": false
}
],
"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 ]",
"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 ]",
"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\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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\": \"312cd72171ae282425adac9d1298cc0f\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"456cbb3933e75ffd57903b5ea4d51d5d4954170291841732c15a47dfdc873c40d206fd97c3d702c842e085ea3c83f2fc\",\n \"stream_name\": \"tmp41380zjn\",\n \"streaming_url\": \"http://localhost:5280/stream/398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"suggested_file_name\": \"tmp41380zjn\",\n \"timestamp\": 1557798596,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"written_bytes\": null\n },\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"88ad6e29acc6b891196be7d07c242dae4645b90d\",\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\": \"3f903bb538df8c8a39e6320d1d029f96\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3657vmtNAyxb6vEvQqjSRcShzrVNwk1Jj\",\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\": \"1557798570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmp6bxst08d.png\",\n \"sd_hash\": \"3725921890987abab5cf3bd957668e58f51631b894de87457fa28f953c9a747f4f9be6dd87d4686b93d83f3eb62a0f7f\",\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\": \"e732ce21b0f59f4639093032a04e35f1559ff76c6a6c59a3f23d5ba495b1277b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afcc3f8645c7fccab539e120a46258d7509bcec1877c1dd52ac91c9ecb4571b65bb76bb64f001d160f85b577d383b834abc7f2b89cce16bfcdbe7ef7a9407aec1d0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1Line 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\": \"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
},
{
"title": "List files matching a parameter",
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"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\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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\": \"312cd72171ae282425adac9d1298cc0f\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"456cbb3933e75ffd57903b5ea4d51d5d4954170291841732c15a47dfdc873c40d206fd97c3d702c842e085ea3c83f2fc\",\n \"stream_name\": \"tmp41380zjn\",\n \"streaming_url\": \"http://localhost:5280/stream/398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"suggested_file_name\": \"tmp41380zjn\",\n \"timestamp\": 1557798596,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"written_bytes\": null\n }\n ]\n}"
"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}"
}
]
},
@@ -1812,14 +1812,14 @@
"is_required": false
}
],
"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 }",
"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 }",
"examples": [
{
"title": "Save a file to the downloads directory",
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\"}}).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\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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\": \"312cd72171ae282425adac9d1298cc0f\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"456cbb3933e75ffd57903b5ea4d51d5d4954170291841732c15a47dfdc873c40d206fd97c3d702c842e085ea3c83f2fc\",\n \"stream_name\": \"tmp41380zjn\",\n \"streaming_url\": \"http://localhost:5280/stream/398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"suggested_file_name\": \"tmp41380zjn\",\n \"timestamp\": 1557798596,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"written_bytes\": null\n }\n}"
"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}"
}
]
},
@@ -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/tmpf5tbpddv\",\n \"download_dir\": \"/tmp/tmpf5tbpddv\",\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/tmpf5tbpddv\"\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/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}"
}
]
},
@@ -1970,10 +1970,10 @@
"examples": [
{
"title": "Abandon a stream claim",
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon 5b5c494345ba9a7fa5ab0bef4b056c2823e72620",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001672b55b13c84167d0d6b3edffe0464f1eea95cccaff76a76408373381c30ed06000000006a47304402201a29f365b3e98d5ee8ae99f5c524936c57d736c52daf433ac7c99a72ab81ba320220197cf7bf0d1f7da9310474127db51639970909759249958972db490fdcc8dc3b012103d85c6081cb31797b52af9f3bbb179f686f16ba19c42d8fd9eb98eb8c59486780ffffffff0134b7f505000000001976a9147646f50f0cc8b031dabc3e8e458a4647128564aa88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mrJM2tPtGcP2HqXUroopj5b9aVLQR8xG14\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"dbf87c0a40456a4efe02462df0ca3d2d3dc04791e3e2b7d48b6ec1827e901976\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"dbf87c0a40456a4efe02462df0ca3d2d3dc04791e3e2b7d48b6ec1827e901976\"\n }\n}"
"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}"
}
]
},
@@ -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/tmp41380zjn\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmp41380zjn",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp41380zjn\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000016b9b4102e2b539a1d6bfa60eabe6034e4af884bc9195e1b53949acfee0cf1245010000006b483045022100fa51e4c4ebedc3b049607ecd153eaaa1e12d7f7719df38ea6fda4fa6f69d5244022037784b641ef5dc64a28393539335591f4f066bec74204ffa93170a14153f562a012103a2b8537954e0d6e4d61649e1b74a9e3450c2a3edd04648dce3bbc7e2b136daa8ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b051616d7576a914155c3aacc965c1d7a2b8254c48b6621181f0e11a88ac38fb9423000000001976a91468e39f0c626b188013c5b4eb826e14cee531df8a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miapoWLFkpSSeHCEoPTbnWv1akUZMFQPb7\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798595,\n \"txid\": \"4512cfe0feac4939b5e19591bc84f84a4e03e6ab0ea6bfd6a139b5e202419b6b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"timestamp\": null,\n \"txid\": \"e7df7eae837f06d09ed9b239d98a2f8a368054cfdd8f337a712a521e8c435802\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mq5ZFQe1i7gkBn6KBdjMeK7PDWtMyHWLZu\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"e7df7eae837f06d09ed9b239d98a2f8a368054cfdd8f337a712a521e8c435802\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"e7df7eae837f06d09ed9b239d98a2f8a368054cfdd8f337a712a521e8c435802\"\n }\n}"
"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}"
},
{
"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/tmp6bxst08d.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\": 1557798570, \"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmp6bxst08d.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=1557798570 --channel_id=\"af506becd8dba851c8803c0f48347f16d5a92c4c\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp6bxst08d.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\": 1557798570, \"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"channel_account_id\": [], \"preview\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000010258438c1e522a717a338fddcf5480368a2f8ad939b2d99ed0067f83ae7edfe7010000006a473044022014596c3195c9555c474291ec7de2d05defeab970277d7afe98dc82441fcb82d702205bdd59b7663c902f8e2ad121177e235eff694a815975123365c29bc4c9cbbba4012102480d1fbcfe2ff676d5f9a76da9c0b7653b3c06601af6aefe90359d8e429748c7ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db101014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afcc3f8645c7fccab539e120a46258d7509bcec1877c1dd52ac91c9ecb4571b65bb76bb64f001d160f85b577d383b834abc7f2b89cce16bfcdbe7ef7a9407aec1d0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d7036627873743038642e706e6718632209696d6167652f706e6732303725921890987abab5cf3bd957668e58f51631b894de87457fa28f953c9a747f4f9be6dd87d4686b93d83f3eb62a0f7f120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728aabde8e6053222080112196fec9e10d608b28f96cd370207ec2c31ff0473c36883d8c6bc188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914ec9e10d608b28f96cd370207ec2c31ff0473c36888acac5e7d1d000000001976a914ae9a966570fab6f589b05a7fe57790e4943ec2a388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mq5ZFQe1i7gkBn6KBdjMeK7PDWtMyHWLZu\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798596,\n \"txid\": \"e7df7eae837f06d09ed9b239d98a2f8a368054cfdd8f337a712a521e8c435802\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3657vmtNAyxb6vEvQqjSRcShzrVNwk1Jj\",\n \"amount\": \"1.0\",\n \"claim_id\": \"88ad6e29acc6b891196be7d07c242dae4645b90d\",\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#88ad6e29acc6b891196be7d07c242dae4645b90d\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"e732ce21b0f59f4639093032a04e35f1559ff76c6a6c59a3f23d5ba495b1277b\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"n3657vmtNAyxb6vEvQqjSRcShzrVNwk1Jj\",\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\": \"1557798570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmp6bxst08d.png\",\n \"sd_hash\": \"3725921890987abab5cf3bd957668e58f51631b894de87457fa28f953c9a747f4f9be6dd87d4686b93d83f3eb62a0f7f\",\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\": \"mwSB4MnwAPq9pKThw8XyYv5gmjHECd9xjS\",\n \"amount\": \"4.947555\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"e732ce21b0f59f4639093032a04e35f1559ff76c6a6c59a3f23d5ba495b1277b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"5.969662\",\n \"total_output\": \"5.947555\",\n \"txid\": \"e732ce21b0f59f4639093032a04e35f1559ff76c6a6c59Line truncated
"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
}
]
},
@@ -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\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ]\n}"
"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}"
},
{
"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\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": 1557798596,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\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\": \"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}"
}
]
},
@@ -2424,10 +2424,10 @@
"examples": [
{
"title": "Update a stream claim to add channel",
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update 5b5c494345ba9a7fa5ab0bef4b056c2823e72620 --channel_id=\"af506becd8dba851c8803c0f48347f16d5a92c4c\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000020258438c1e522a717a338fddcf5480368a2f8ad939b2d99ed0067f83ae7edfe7000000006b4830450221008b21a04effa7aec5a0e0cd0747ac077215d988e8d2b23ed7a7256fb870961e60022071e8591a59a08d08bb7395d5d3a11037f662205785ad78e5336492248d8e84ca012103d85c6081cb31797b52af9f3bbb179f686f16ba19c42d8fd9eb98eb8c59486780ffffffffc5ea091b9f9b3d33cbf8c416666476638690aa8d8089709e13b7529dd9d6c264010000006b483045022100fd0036e889ea526f4d19bb4cd5626f9c5786e9fff435fa71bd77943485c92f0202202caec13021948adcc2955e96ce417bc3dbc89ae172b879fe328913d046ff8d74012103a6139280df5f8ea8821a03913102a3fd11f32a18d92a0fba67905fcfe2589a84ffffffff0200e1f50500000000fd2301b7076173747265616d142026e723286c054bef0baba57f9aba4543495c5b4ce8014c2ca9d5167f34480f3c80c851a8dbd8ec6b50afb384b77d9ca0c2659ca145701f3df6b102a9a7868a55377f1ed0e5da758440e89c4e50c5008fe209cff1c33865725706d74ab91e28e0c142d78e613a932bc7260a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7034313338307a6a6e180b22186170706c69636174696f6e2f6f637465742d73747265616d3230398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b051616d6d76a914155c3aacc965c1d7a2b8254c48b6621181f0e11a88ac32a0d205000000001976a9140cba8b40bd0489a461989b78d98e610653c6288a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"timestamp\": 1557798596,\n \"txid\": \"e7df7eae837f06d09ed9b239d98a2f8a368054cfdd8f337a712a521e8c435802\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mxaZtDpf3Q2UC2rTVFZrU6ALRtAHkqKH8C\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1557798595,\n \"txid\": \"64c2d6d99d52b7139e7089808daa90866376646616c4f8cb333d9b9f1b09eac5\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhTtyHAfMmQizPZpCBQjvYH7u8MsYvgM1V\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\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#5b5c494345ba9a7fa5ab0bef4b056c2823e72620\",\n \"signing_channel\": {\n \"claim_id\": \"af506becd8dba851c8803c0f48347f16d5a92c4c\",\n \"name\": \"@channel\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a034200041ec95bd60c8204097e5a20250cae52db624d65fd9353e241c5a5e23bd77063a33ea806571b2976517a497fa54e51db4b7e7478102f86b822e53ece6adff6aac7\",\n \"title\": \"New Channel\"\n }\n },\n \"timestamp\": null,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp41380zjn\",\n \"sd_hash\": \"398da9577e75c4e2934747ecb58e2503d2627ed3f27f0ea541c6d88f40d7d01f66362be238613331f4b94c9c56b05161\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mggFsf5TuajRPfeBJBb4LBdst2zMyikaLo\",\n \"amount\": \"0.9768965\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"06ed301c38738340766af7afcc5ca9eef16404fedf3e6b0d7d16843cb1552b67\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000332\",\n \"total_input\": \"1.9772285\",\n \"total_output\": \"1.9768965\",\n \"txid\": \"06Line truncated
"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
}
]
}
@@ -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-13 21:49\",\n \"fee\": \"-0.000124\",\n \"support_info\": [],\n \"timestamp\": 1557798595,\n \"txid\": \"b70e0974766a40fab9f0da1def8d4d29779f53d38dddec5f2cb04bc65e62739c\",\n \"update_info\": [],\n \"value\": \"-2.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-05-13 21:49\",\n \"fee\": \"0.0\",\n \"support_info\": [],\n \"timestamp\": 1557798594,\n \"txid\": \"9249016286c68ce36e7ff349054fd6902d703c1a890bbde53b3d3fd68521fc5c\",\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-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}"
}
]
},
+1 -1
View File
@@ -1,4 +1,4 @@
__name__ = "lbrynet"
__version__ = "0.37.0"
__version__ = "0.37.0rc6"
version = tuple(__version__.split('.'))
+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))
+5 -4
View File
@@ -15,6 +15,7 @@ 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):
@@ -37,6 +38,7 @@ 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(
@@ -54,24 +56,23 @@ 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 1
self.scores[peer] = bytes_received / elapsed if bytes_received and elapsed else 0
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(30.0, (self.failures.get(peer, 0) ** self.BAN_FACTOR))
if (now - when) < min(self.BAN_CAP, (self.failures.get(peer, 0) ** self.BAN_FACTOR))
))
@cache_concurrent
-15
View File
@@ -546,21 +546,6 @@ 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()
+1 -4
View File
@@ -33,10 +33,6 @@ 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):
@@ -49,6 +45,7 @@ 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"
+97 -69
View File
@@ -2,8 +2,11 @@ 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
@@ -28,7 +31,7 @@ class Node:
self._join_task: asyncio.Task = None
self._refresh_task: asyncio.Task = None
async def refresh_node(self, force_once=False):
async def refresh_node(self):
while True:
# remove peers with expired blob announcements from the datastore
self.protocol.data_store.removed_expired_peers()
@@ -55,8 +58,6 @@ 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
@@ -66,33 +67,30 @@ 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]:
hash_value = binascii.unhexlify(blob_hash.encode())
assert len(hash_value) == constants.hash_length
peers = await self.peer_search(hash_value)
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)
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:
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])
log.info("Stored %s to %i of %i attempted peers", binascii.hexlify(hash_value).decode()[:8],
len(stored_to), len(peers))
else:
log.warning("Failed announcing %s, stored to 0 peers", blob_hash[:8])
return stored_to
len(announced_to_node_ids), len(peers))
return announced_to_node_ids
def stop(self) -> None:
if self.joined.is_set():
@@ -103,7 +101,6 @@ 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
@@ -116,7 +113,6 @@ 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)
@@ -134,31 +130,33 @@ 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, port) != (self.protocol.external_ip, self.protocol.udp_port):
if (address, port) not in known_node_addresses and address != self.protocol.external_ip:
known_node_addresses.append((address, port))
url_to_addr[address] = host
if known_node_addresses:
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)
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
log.info("Joined DHT, %i peers known in %i buckets", len(self.protocol.routing_table.get_peers()),
self.protocol.routing_table.buckets_with_contacts())
@@ -171,48 +169,78 @@ class Node:
)
)
def get_iterative_node_finder(self, key: bytes, shortlist: typing.Optional[typing.List['KademliaPeer']] = None,
def get_iterative_node_finder(self, key: bytes, shortlist: typing.Optional[typing.List] = 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['KademliaPeer']] = None,
def get_iterative_value_finder(self, key: bytes, shortlist: typing.Optional[typing.List] = 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, 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)
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)
distance = Distance(node_id)
peers.sort(key=lambda peer: distance(peer.node_id))
return peers[:count]
accumulated.sort(key=lambda peer: distance(peer.node_id))
return accumulated[:count]
async def _accumulate_search_junction(self, search_queue: asyncio.Queue,
result_queue: asyncio.Queue):
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)
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
)
])
def accumulate_peers(self, search_queue: asyncio.Queue,
peer_queue: typing.Optional[asyncio.Queue] = None) -> typing.Tuple[
asyncio.Queue, asyncio.Task]:
q = peer_queue or asyncio.Queue(loop=self.loop)
return q, self.loop.create_task(self._accumulate_search_junction(search_queue, q))
q = peer_queue or asyncio.Queue()
return q, asyncio.create_task(self._accumulate_search_junction(search_queue, q))
+6 -10
View File
@@ -31,10 +31,7 @@ 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)] = {}
def reset(self):
for statistic in (self._rpc_failures, self._last_replied, self._last_sent, self._last_requested):
statistic.clear()
self._kademlia_peers: typing.Dict[typing.Tuple[bytes, str, int], 'KademliaPeer']
def report_failure(self, address: str, udp_port: int):
now = self._loop.time()
@@ -107,12 +104,11 @@ class PeerManager:
delay = self._loop.time() - constants.check_refresh_interval
# fixme: find a way to re-enable that without breaking other parts
#if node_id not in self._node_id_reverse_mapping or (address, udp_port) not in self._node_id_mapping:
# 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
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))
@@ -0,0 +1,94 @@
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)
+52 -51
View File
@@ -66,7 +66,11 @@ def get_shortlist(routing_table: 'TreeRoutingTable', key: bytes,
"""
if len(key) != constants.hash_length:
raise ValueError("invalid key length: %i" % len(key))
return shortlist or routing_table.find_close_peers(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
class IterativeFinder:
@@ -87,11 +91,12 @@ 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['KademliaPeer'] = set()
self.contacted: typing.Set[typing.Tuple[str, int]] = set()
self.distance = Distance(key)
self.closest_peer: typing.Optional['KademliaPeer'] = None
self.closest_peer: typing.Optional['KademliaPeer'] = None if not self.shortlist else self.shortlist[0]
self.prev_closest_peer: typing.Optional['KademliaPeer'] = None
self.iteration_queue = asyncio.Queue(loop=self.loop)
@@ -102,12 +107,6 @@ 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:
"""
@@ -139,18 +138,25 @@ 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 _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):
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]):
self.prev_closest_peer = self.closest_peer
self.closest_peer = peer
self.closest_peer = self.shortlist[-1]
async def _handle_probe_result(self, peer: 'KademliaPeer', response: FindResponse):
self._add_active(peer)
if peer not in self.shortlist:
self.shortlist.append(peer)
if peer not in self.active:
self.active.add(peer)
for contact_triple in response.get_close_triples():
node_id, address, udp_port = contact_triple
self._add_active(self.peer_manager.get_kademlia_peer(node_id, address, udp_port))
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.check_result_ready(response)
async def _send_probe(self, peer: 'KademliaPeer'):
@@ -171,44 +177,40 @@ class IterativeFinder:
async def _search_round(self):
"""
Send up to constants.alpha (5) probes to closest active peers
Send up to constants.alpha (5) probes to the closest peers in the shortlist
"""
added = 0
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
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()
origin_address = (peer.address, peer.udp_port)
if origin_address in self.exclude:
if origin_address in self.exclude or self.peer_manager.peer_is_good(peer) is False:
continue
if peer.node_id == self.protocol.node_id:
continue
if origin_address == (self.protocol.external_ip, self.protocol.udp_port):
if (peer.address, peer.udp_port) == (self.protocol.external_ip, self.protocol.udp_port):
continue
self._schedule_probe(peer)
added += 1
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
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:
@@ -264,7 +266,6 @@ 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)
@@ -272,16 +273,12 @@ 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
and peer.node_id != self.protocol.node_id
and self.peer_manager.peer_is_good(peer) is not False
]
not_yet_yielded = [peer for peer in from_iter if peer not in self.yielded_peers]
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:
self.yielded_peers.update(to_yield)
for peer in to_yield:
self.yielded_peers.add(peer)
self.iteration_queue.put_nowait(to_yield)
if finish:
self.iteration_queue.put_nowait(None)
@@ -291,17 +288,21 @@ class IterativeNodeFinder(IterativeFinder):
if found:
log.debug("found")
return self.put_result(self.active, finish=True)
return self.put_result(self.shortlist, 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", len(self.active), len(self.contacted), self.bottom_out_count)
log.info("bottom out %i %i %i %i", len(self.active), len(self.contacted), len(self.shortlist),
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):
+26 -60
View File
@@ -191,14 +191,12 @@ 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: typing.Optional[float] = None):
delay = delay if delay is not None else self._default_delay
def enqueue_maybe_ping(self, *peers: 'KademliaPeer', delay: float = constants.maybe_ping_delay):
now = self._loop.time()
for peer in peers:
if peer not in self._pending_contacts or now + delay < self._pending_contacts[peer]:
@@ -209,7 +207,7 @@ class PingQueue:
try:
if self._protocol.peer_manager.peer_is_good(peer):
if peer not in self._protocol.routing_table.get_peers():
self._protocol.add_peer(peer)
await self._protocol.add_peer(peer)
return
await self._protocol.get_rpc_peer(peer).ping()
except asyncio.TimeoutError:
@@ -270,21 +268,11 @@ 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()
@@ -375,30 +363,13 @@ class KademliaProtocol(DatagramProtocol):
self.routing_table.buckets[bucket_index].remove_peer(to_replace)
return await self._add_peer(peer)
def add_peer(self, peer: 'KademliaPeer'):
async def add_peer(self, peer: 'KademliaPeer') -> bool:
if peer.node_id == self.node_id:
return False
self._to_add.add(peer)
self._wakeup_routing_task.set()
async with self._split_lock:
return await self._add_peer(peer)
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):
async 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
@@ -425,11 +396,11 @@ class KademliaProtocol(DatagramProtocol):
key, = a
result = self.node_rpc.find_value(sender_contact, key)
self.send_response(
await self.send_response(
sender_contact, ResponseDatagram(RESPONSE_TYPE, message.rpc_id, self.node_id, result),
)
def handle_request_datagram(self, address: typing.Tuple[str, int], request_datagram: RequestDatagram):
async 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:
@@ -437,7 +408,7 @@ class KademliaProtocol(DatagramProtocol):
except IndexError:
peer = self.peer_manager.get_kademlia_peer(request_datagram.node_id, address[0], address[1])
try:
self._handle_rpc(peer, request_datagram)
await 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)
@@ -445,12 +416,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:
self.add_peer(peer)
await 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))
self.send_error(
await self.send_error(
peer,
ErrorDatagram(ERROR_TYPE, request_datagram.rpc_id, self.node_id, str(type(err)).encode(),
str(err).encode())
@@ -459,13 +430,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))
self.send_error(
await self.send_error(
peer,
ErrorDatagram(ERROR_TYPE, request_datagram.rpc_id, self.node_id, str(type(err)).encode(),
str(err).encode())
)
def handle_response_datagram(self, address: typing.Tuple[str, int], response_datagram: ResponseDatagram):
async 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]
@@ -488,7 +459,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)
self.add_peer(peer)
await self.add_peer(peer)
else:
log.warning("%s:%i replied, but after we cancelled the request attempt",
peer.address, peer.udp_port)
@@ -539,15 +510,15 @@ class KademliaProtocol(DatagramProtocol):
return
if isinstance(message, RequestDatagram):
self.handle_request_datagram(address, message)
self.loop.create_task(self.handle_request_datagram(address, message))
elif isinstance(message, ErrorDatagram):
self.handle_error_datagram(address, message)
else:
assert isinstance(message, ResponseDatagram), "sanity"
self.handle_response_datagram(address, message)
self.loop.create_task(self.handle_response_datagram(address, message))
async def send_request(self, peer: 'KademliaPeer', request: RequestDatagram) -> ResponseDatagram:
self._send(peer, request)
await self._send(peer, request)
response_fut = self.sent_messages[request.rpc_id][1]
try:
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
@@ -560,16 +531,18 @@ 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:
self.remove_peer(peer)
async with self._split_lock:
self.routing_table.remove_peer(peer)
self.routing_table.join_buckets()
raise
def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
self._send(peer, response)
async def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
await self._send(peer, response)
def send_error(self, peer: 'KademliaPeer', error: ErrorDatagram):
self._send(peer, error)
async def send_error(self, peer: 'KademliaPeer', error: ErrorDatagram):
await self._send(peer, error)
def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram,
async def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram,
ErrorDatagram]):
if not self.transport or self.transport.is_closing():
raise TransportNotConnected()
@@ -629,15 +602,12 @@ class KademliaProtocol(DatagramProtocol):
return True
async def store_to_peer(self, hash_value: bytes, peer: 'KademliaPeer') -> typing.Tuple[bytes, bool]:
async def __store():
try:
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:
@@ -645,10 +615,6 @@ 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
+14 -29
View File
@@ -270,17 +270,14 @@ class Daemon(metaclass=JSONRPCServerType):
self.stop_event = asyncio.Event()
logging.getLogger('aiohttp.access').setLevel(logging.WARN)
rpc_app = web.Application()
rpc_app.router.add_get('/lbryapi', self.handle_old_jsonrpc)
rpc_app.router.add_post('/lbryapi', self.handle_old_jsonrpc)
rpc_app.router.add_post('/', self.handle_old_jsonrpc)
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)
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)
@property
def dht_node(self) -> typing.Optional['Node']:
@@ -403,20 +400,12 @@ 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.rpc_runner.setup()
await self.streaming_runner.setup()
await self.runner.setup()
try:
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])
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])
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)
@@ -452,10 +441,8 @@ class Daemon(metaclass=JSONRPCServerType):
self.component_startup_task.cancel()
log.info("stopped api components")
if shutdown_runner:
await self.rpc_runner.shutdown()
await self.streaming_runner.shutdown()
await self.rpc_runner.cleanup()
await self.streaming_runner.cleanup()
await self.runner.shutdown()
await self.runner.cleanup()
log.info("stopped api server")
if self.analytics_manager.is_started:
self.analytics_manager.stop()
@@ -484,8 +471,6 @@ class Daemon(metaclass=JSONRPCServerType):
)
async def handle_stream_get_request(self, request: web.Request):
if not self.conf.streaming_get:
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}"
@@ -67,7 +67,6 @@ 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',
+1 -6
View File
@@ -83,8 +83,6 @@ 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
@@ -106,10 +104,7 @@ 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 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
)
blob = await self.blob_downloader.download_blob(blob_info.blob_hash, blob_info.length, connection_id)
return blob
def decrypt_blob(self, blob_info: 'BlobInfo', blob: 'AbstractBlob') -> bytes:
+2 -16
View File
@@ -66,7 +66,7 @@ class ManagedStream:
'saving',
'finished_writing',
'started_writing',
'finished_write_attempt'
]
def __init__(self, loop: asyncio.BaseEventLoop, config: 'Config', blob_manager: 'BlobManager',
@@ -100,7 +100,6 @@ 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:
@@ -213,7 +212,6 @@ class ManagedStream:
download_directory = None
written_bytes = None
return {
'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 all(
self.blob_manager.is_blob_verified(b.blob_hash) for b in self.descriptor.blobs[:-1]),
'file_name': file_name,
@@ -349,7 +347,6 @@ 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:
@@ -373,22 +370,11 @@ 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)
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):
if 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):
-115
View File
@@ -1,115 +0,0 @@
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())
+3 -12
View File
@@ -35,15 +35,14 @@ 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.streaming_runner.setup()
site = aiohttp.web.TCPSite(self.daemon.streaming_runner, self.daemon.conf.streaming_host,
self.daemon.conf.streaming_port)
await self.daemon.runner.setup()
site = aiohttp.web.TCPSite(self.daemon.runner, self.daemon.conf.api_host, self.daemon.conf.api_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.streaming_host}:{self.daemon.conf.streaming_port}/get/{name}'
url = f'http://{self.daemon.conf.api_host}:{self.daemon.conf.api_port}/get/{name}'
async with aiohttp_request('get', url) as req:
self.assertEqual(req.headers.get('Content-Type'), 'application/octet-stream')
@@ -105,14 +104,6 @@ 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)
@@ -0,0 +1,102 @@
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)
-4
View File
@@ -99,7 +99,6 @@ 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):
@@ -113,7 +112,6 @@ 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)
@@ -121,7 +119,6 @@ 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)
@@ -140,7 +137,6 @@ 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()))
+3 -5
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:
self.node.protocol.add_peer(
await self.node.protocol.add_peer(
self.peer_manager.get_kademlia_peer(
n.protocol.node_id, n.protocol.external_ip, n.protocol.udp_port
)
@@ -86,8 +86,7 @@ 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
# takes 60 seconds to start, but we advance 120 to ensure it processed all batches
await self.advance(60.0 * 2)
await self.advance(61.0)
to_announce = await self.storage.get_blobs_to_announce()
self.assertEqual(0, len(to_announce))
self.blob_announcer.stop()
@@ -99,7 +98,6 @@ 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)
@@ -107,7 +105,7 @@ class TestBlobAnnouncer(AsyncioTestCase):
_, task = last.accumulate_peers(search_q, peer_q)
found_peers = await peer_q.get()
task.cancel()
await task
self.assertEqual(1, len(found_peers))
self.assertEqual(self.node.protocol.node_id, found_peers[0].node_id)
-24
View File
@@ -308,30 +308,6 @@ 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',