Compare commits

..
Author SHA1 Message Date
Victor Shyba ac06b782a8 remove external ip from analytics 2021-06-28 00:25:33 -03:00
Victor Shyba 6495694ac8 add analytics_id, remove session_id and stop sending installation id 2021-06-28 00:21:51 -03:00
Alex Grin 115034fccb Merge pull request #3232 from lbryio/timeout 2021-06-25 11:05:25 -04:00
Victor Shyba 309e957a85 add concurrent_hub_requests conf 2021-06-24 21:21:19 -03:00
Victor Shyba d7007e402e move request semaphore to session and apply to all requests 2021-06-24 21:02:41 -03:00
Victor Shyba 91323a21cf add hub_timeout and propagate it to network code 2021-06-24 21:02:41 -03:00
Lex Berezhny fea893d76c v0.100.0 2021-06-22 13:33:03 -04:00
Lex Berezhny 761bc6ba4c revert release and fix test 2021-06-22 13:32:41 -04:00
Lex Berezhny 75172feb4e v0.100.0 2021-06-22 12:53:23 -04:00
Lex Berezhny 3285fb1608 revert release 2021-06-22 12:52:48 -04:00
Lex Berezhny 03a4c6910d v0.100.0 2021-06-22 12:51:36 -04:00
Lex Berezhny 485b958599 revert release 2021-06-22 12:50:11 -04:00
Lex Berezhny da47ba2f67 v0.100.0 2021-06-22 11:11:02 -04:00
Lex Berezhny c39195488a bug fix 2021-06-22 11:07:58 -04:00
Lex Berezhny 227fb0ae9b network integration test fix 2021-06-22 11:07:58 -04:00
Lex Berezhny b12ff5b503 test fixes 2021-06-22 11:07:58 -04:00
Lex Berezhny 0946c72b88 lint 2021-06-22 11:07:58 -04:00
Lex Berezhny 7d49b046d4 added support to config for determining if value is set and implemented hub selection logic 2021-06-22 11:07:58 -04:00
Lex Berezhny 5f0426c840 country jurisdiction added to hub UDP protocol 2021-06-22 11:07:58 -04:00
Lex Berezhny 73e239cc5f client side hub discovery pub/sub and hub metadata stored, removed old peers implementation 2021-06-22 11:07:58 -04:00
Lex Berezhny ad670f721a working client peer hub 2021-06-22 11:07:58 -04:00
Lex Berezhny 028a4a70cf wallet server federation, client portion 2021-06-22 11:07:58 -04:00
Lex Berezhny 77d7960347 increase lbc exchange rate threshold 2021-06-18 11:26:30 -04:00
Lex Berezhny 39821146bd increase lbc threshold in exchange rate integration tests even more 2021-06-17 10:23:33 -04:00
Lex Berezhny 7d505a41ac drop sqlite indexes from test 2021-06-15 18:22:42 -04:00
Lex Berezhny e457b2f0d6 fix trending to use built-in sqlite instead of apsw 2021-06-15 18:22:42 -04:00
Lex Berezhny c9cf7fd4d4 drop apsw in wallet.server.db.elasticsearch.sync 2021-06-15 18:22:42 -04:00
Lex Berezhny b0371dd33d update test reader to use plain sqlite 2021-06-15 18:22:42 -04:00
Lex Berezhny 25e16c3565 dropping apsw 2021-06-15 18:22:42 -04:00
Lex Berezhny 7b39527863 update exchange rate threshold in integration tests due to significant drop in LBC price 2021-06-15 15:58:59 -04:00
Alex Grin d861b08866 Merge pull request #3323 from lbryio/dht_leak 2021-06-07 16:15:59 -04:00
Victor Shyba fb438dc108 remove the unregister call 2021-06-04 12:47:16 -03:00
Victor Shyba 4e6b4f179b add items() to LRUCache 2021-06-04 12:20:44 -03:00
Victor Shyba 00d038c8f3 add default parameter to pop on LRUCache 2021-06-04 12:15:47 -03:00
Victor Shyba a9f6a68952 use LRU caches for DHT metrics 2021-06-04 11:54:37 -03:00
Alex Grin b9142bbc5a Merge pull request #3319 from lbryio/support_value_type
drop `value_type` for supports
2021-06-04 08:39:40 -04:00
Victor Shyba 6c812f663e drop value_type for support 2021-06-02 18:01:54 -03:00
Alex Grin a93ec9783a Update README.md 2021-06-02 14:10:19 -04:00
Lex Berezhny 2d184d77b6 v0.99.0 2021-06-02 12:07:37 -04:00
Victor Shyba bce299ccc7 fix docopt typo 2021-06-02 12:05:36 -04:00
Victor Shyba 235cebd14a fix test value 2021-06-02 12:05:36 -04:00
Victor Shyba a638aa9d53 add and test support for support_create anonymous --comment 2021-06-02 12:05:36 -04:00
Victor Shyba 67cce0ef7e test+implement --comment for support_create 2021-06-02 12:05:36 -04:00
Victor Shyba 82f4267bf6 add comment property/setter to the signable support class 2021-06-02 12:05:36 -04:00
Victor Shyba 45a9ca29c4 update generated support protobuf with field 2021-06-02 12:05:36 -04:00
Victor Shyba 7f4e813277 document schema update process 2021-06-02 12:05:36 -04:00
Lex Berezhny 3805ff4a0c fix purchase test 2021-06-02 11:34:21 -04:00
Lex Berezhny 464cfd475e properly format scripthash address on output 2021-06-02 11:34:21 -04:00
Lex Berezhny fe469ae57f create appropriate script for scripthash address 2021-06-02 11:34:21 -04:00
Lex Berezhny 550ef9a1c4 allows script addresses (beginning with r) to be used 2021-06-02 11:34:21 -04:00
Alex Grin 935adfb51a Merge pull request #3301 from lbryio/no_repeat_claim_id
add `--remove_duplicates` to the search api
2021-05-28 11:01:15 -04:00
Victor Shyba 3974df4a62 fix interaction between two modes 2021-05-27 20:14:12 -03:00
Victor Shyba 4870974161 update json api 2021-05-27 20:14:12 -03:00
Victor Shyba 8c4b0037f5 API: add --remove_duplicates to claim_search 2021-05-27 20:14:12 -03:00
Victor Shyba 2c6f763ef2 test picking oldest when originals doesnt match 2021-05-27 20:14:12 -03:00
Victor Shyba ca28de02d8 test and implementation for remove_duplicates on post-search filtering 2021-05-27 20:14:12 -03:00
Victor Shyba bfc15ea029 handle limit being 0 and skip reordering if 0/none 2021-05-27 20:14:12 -03:00
Victor Shyba 6e8b8a5920 always call search_ahead 2021-05-27 20:14:12 -03:00
Jack Robison 099f3b6a62 Merge pull request #3308 from lbryio/reflect_more
Don't set stream as reflected until reflector says it doesn't need any blob
2021-05-27 19:13:23 -04:00
Victor Shyba 142d182bc1 if progress was made, retry without a delay 2021-05-27 18:24:58 -03:00
Victor Shyba 1437871d88 fix reflector client: only set completed when server says so 2021-05-27 18:24:58 -03:00
Victor Shyba 352bf69409 improve test 2021-05-27 18:24:58 -03:00
Victor Shyba 9bdf3d23e1 test bug 3296, failing 2021-05-27 18:24:58 -03:00
Victor Shyba be8ecfa707 sort keys so helper scripts can send blobs using send_request 2021-05-27 18:24:58 -03:00
Lex Berezhny 51da0d0259 v0.98.0 2021-05-26 09:23:19 -04:00
Alex Grin f55b78a994 Merge pull request #3306 from lbryio/fix-collectionUpdateWithReplace 2021-05-18 15:25:53 -04:00
Alex Grin e1a44c93f8 Merge branch 'master' into fix-collectionUpdateWithReplace 2021-05-18 15:25:40 -04:00
Alex Grin 07e7087a09 Merge pull request #3303 from keikari/patch-1
Minor fix suggestion for issue #3240
2021-05-18 15:23:56 -04:00
Alex Grin 2c79c7e2f6 Merge branch 'master' into patch-1 2021-05-18 15:23:08 -04:00
Victor Shyba 09f6637fe0 remove unused multiprocessin.Manager 2021-05-17 15:07:32 -03:00
Victor Shyba 3784db3308 test collections update with --replace 2021-05-15 03:27:33 -03:00
zeppi 2b950ff5dd fix bug in collection_update --replace 2021-05-15 03:27:33 -03:00
Alex Grin 09339c9cfb Merge pull request #3305 from lbryio/fix_migrator_tool
fix hub Elasticsearch sync/migrations tool for when the db exists already
2021-05-14 11:06:07 -04:00
Victor Shyba ccadd88af5 fix cache call 2021-05-13 22:40:21 -03:00
Victor Shyba cc02a0efc2 fix es migration bug, expand test case 2021-05-13 19:00:53 -03:00
Victor Shyba 43a1385b79 test sync helper 2021-05-13 19:00:53 -03:00
Victor Shyba 5101464e3b add integration tests command on install.md 2021-05-13 19:00:36 -03:00
Victor Shyba 3d71478d38 update install.md with ES instructions 2021-05-13 19:00:36 -03:00
Victor Shyba 4989ed445e add ES to makefile 2021-05-13 19:00:36 -03:00
keikari d9413039ec Fix suggestion for issue #3240
L135: If `getattr()` returns `None`, use `""` instead to avoid error in issue #3240
2021-05-12 18:30:38 +03:00
Jack Robison eba0c9be34 fix typo 2021-05-07 16:51:19 -04:00
Jack Robison 48c9e9f3cc Merge pull request #3294 from lbryio/versioned-es-search-index
add versioning to ES search index and automate resync on version bumps
2021-05-07 15:38:21 -04:00
Jack Robison 81ebde88db resync ES search index on version bumps
-bump ES search index to version 1
2021-05-07 14:36:53 -04:00
Jack Robison 79ced9d0f8 Merge pull request #3262 from lbryio/channel_repost_has_source
Fix bug for `has_source=True` hiding channel reposts
2021-05-07 14:36:04 -04:00
Victor Shyba a4058b84ce clean out unused sharding 2021-05-07 15:03:37 -03:00
Victor Shyba 7bf211a52b apply reposted_claim_type on es sync 2021-05-07 15:03:37 -03:00
Victor Shyba d5f722792f fix and test has_source for channel reposts 2021-05-07 15:03:37 -03:00
Victor Shyba 0f02906c9b fix has_source for reposted channels 2021-05-07 15:03:37 -03:00
Victor Shyba 9582e228b1 assert instead of sleep 2021-05-07 15:02:31 -03:00
Victor Shyba 45f20431f9 update tests from the removed feed 2021-05-07 15:02:31 -03:00
Victor Shyba 7554e6d7f9 remove dead code 2021-05-07 15:02:31 -03:00
Victor Shyba cb8f26f177 remove broken feed 2021-05-07 15:02:31 -03:00
Jack Robison b5dfce7861 Revert "finished switch from using hash # in URLs to colon :"
This reverts commit 888aa558
2021-05-07 11:31:28 -04:00
Jack Robison 2ca5a65544 Revert "FindShortestID updated"
This reverts commit 8f04a50c
2021-05-07 11:30:31 -04:00
Jack Robison 17deb136db Revert "StreamCommands"
This reverts commit 2a8ccb06
2021-05-07 11:29:45 -04:00
Jack Robison 8c9710c76c Merge pull request #3293 from lbryio/fix-block-processor-crash-invalid-fee
fix invalid claim fees breaking the block processor
2021-05-07 10:03:40 -04:00
Jack Robison 32f7ecb261 fix invalid claim fees breaking the block processor 2021-05-06 11:18:58 -04:00
Victor Shyba fb77fde710 for debug, it is always whole page 2021-05-04 22:22:07 -03:00
Victor Shyba 3c67bb90d7 don't fail when a single one go on maintenance and set completion event regardless of failures 2021-05-04 22:22:07 -03:00
Victor Shyba dabb168853 dont log full exceptions on simple connection errors 2021-05-04 22:22:07 -03:00
Victor Shyba 45e5b3b219 dont log full pages 2021-05-04 22:22:07 -03:00
Alex Grin a6b7469923 Update README.md 2021-05-03 18:04:29 -04:00
Jack Robison cb5dab3033 Merge pull request #3285 from lbryio/restrict-udp-source
Restrict udp sources, add `ALLOW_LAN_UDP` hub setting
2021-04-29 10:19:32 -04:00
Jack Robison 21d0038ff2 add timestamps to hub log 2021-04-28 16:47:00 -04:00
Jack Robison c094d8f2e8 add ALLOW_LAN_UDP hub setting 2021-04-28 16:47:00 -04:00
Jack Robison c465d6a6c2 ignore udp packets with low source ports 2021-04-28 16:47:00 -04:00
Lex Berezhny 73d35bc985 v0.97.0 2021-04-28 16:23:46 -04:00
Lex Berezhny 2a8ccb065b StreamCommands 2021-04-28 16:21:01 -04:00
Lex Berezhny 8f04a50ce1 FindShortestID updated 2021-04-28 16:21:01 -04:00
Lex Berezhny 888aa5586b finished switch from using hash # in URLs to colon : 2021-04-28 16:21:01 -04:00
62 changed files with 1130 additions and 1391 deletions

No files matched your search

+13 -1
View File
@@ -92,11 +92,23 @@ To install on Windows:
```
## Run the tests
### Elasticsearch
To run the unit tests from the repo directory:
For running integration tests, Elasticsearch is required to be available at localhost:9200/
The easiest way to start it is using docker with:
```bash
make elastic-docker
```
Alternative installation methods are available [at Elasticsearch website](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html).
To run the unit and integration tests from the repo directory:
```
python -m unittest discover tests.unit
python -m unittest discover tests.integration
```
## Usage
+4 -5
View File
@@ -1,11 +1,7 @@
.PHONY: install tools lint test test-unit test-unit-coverage test-integration idea
install:
pip install https://s3.amazonaws.com/files.lbry.io/python_libtorrent-1.2.4-py3-none-any.whl
CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=2500000" pip install -U https://github.com/rogerbinns/apsw/releases/download/3.30.1-r1/apsw-3.30.1-r1.zip \
--global-option=fetch \
--global-option=--version --global-option=3.30.1 --global-option=--all \
--global-option=build --global-option=--enable --global-option=fts5
pip install lbry-libtorrent
pip install -e .
tools:
@@ -30,3 +26,6 @@ test-integration:
idea:
mkdir -p .idea
cp -r scripts/idea/* .idea
elastic-docker:
docker run -d -v lbryhub:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e"ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
+2 -2
View File
@@ -4,7 +4,7 @@ LBRY is a decentralized peer-to-peer protocol for publishing and accessing digit
LBRY SDK for Python is currently the most fully featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components include:
* Built on Python 3.7+ and `asyncio`.
* Built on Python 3.7 and `asyncio`.
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/dht)).
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/blob_exchange)).
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/schema)).
@@ -41,7 +41,7 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our GPG key is here](https://lbry.com/faq/gpg-key) if you need it.
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our PGP key is here](https://lbry.com/faq/pgp-key) if you need it.
## Contact
+144 -138
View File
@@ -54,10 +54,10 @@
"examples": [
{
"title": "Get a file",
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1619186574,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp3yjc8ttn\",\n \"download_path\": \"/tmp/tmp3yjc8ttn/tmp12xihy6s\",\n \"file_name\": \"tmp12xihy6s\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#ea41b9f807c6982cf97a1178838dfef64feaa014\"}}' http://localhost:5279/",
"lbrynet": "lbrynet get astream#ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#ea41b9f807c6982cf97a1178838dfef64feaa014\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1621405335,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp5s0wcgsl\",\n \"download_path\": \"/tmp/tmp5s0wcgsl/tmpvccpjv29\",\n \"file_name\": \"tmpvccpjv29\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"1331d793facb0a628aa3416c5f1b2c59\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c23f90d26738136a2d4fd7016f9c3f6009c6cc2097c286c8bea94843a4f2796781afd1797a19737f2ae770022e06b623fedaea0a9654fc9e098271a9c186889d14e0bab2cc75cd36b1e67efe284d06467438d0ed0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"aacc5131b8a53b4254185d476dc6fcd254ab08945416c68bdfd09571c660e58862e813b90fe4f6cf1f6d85633268b385\",\n \"stream_name\": \"tmpvccpjv29\",\n \"streaming_url\": \"http://localhost:5280/stream/54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"suggested_file_name\": \"tmpvccpjv29\",\n \"timestamp\": 1621405356,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -268,10 +268,10 @@
"examples": [
{
"title": "Publish a file",
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpqedr4hf_\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpqedr4hf_",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpqedr4hf_\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012bb08a103ff362cdf211bf509a3a315369d42e8dd89fdbe043e3b3a17fb63145010000006a473044022076b7b102c80e4063523944b71575ad015f69ab44758b49e9674d112aa7d8e65e02203179a6488f9ccd64d640ff14c49d80ccb5ccf10cbda4b01173ac3a01ab4e387e01210214d28c7227f0b3eef47cb2b5704bde364b40747f97b9d7edf806da068aaaabd2ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70716564723468665f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d4d0e089925b0a7f5ab287cf39ff511ef380b0fb7e04b62d72964bb416baf4211e713dab967e600aa2a39f4b5c9f88da6d7576a9141b195fe77318659029c07b32b2de8df7820e5c9e88ac54826311000000001976a9143c14aa564481f9d0f771e740377fc0ed17791e7788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mztSRbjwzK9k7BUDXWybL8ZJs2KYQAq6hP\",\n \"amount\": \"3.941448\",\n \"confirmations\": 3,\n \"height\": 217,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhzEwHxzVtn29ZSiSGWrCvNkS8tvxULAPx\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3750860c465d9b7b30f197e01b1d767bf2f6427c\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"a-new-stream\",\n \"normalized_name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#3750860c465d9b7b30f197e01b1d767bf2f6427c\",\n \"timestamp\": null,\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpqedr4hf_\",\n \"sd_hash\": \"d4d0e089925b0a7f5ab287cf39ff511ef380b0fb7e04b62d72964bb416baf4211e713dab967e600aa2a39f4b5c9f88da\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mkzdbRHazFEn4s2w2MVvGqSQoMuprZPxDo\",\n \"amount\": \"2.917341\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"3.941448\",\n \"total_output\": \"3.917341\",\n \"txid\": \"0819ba64123cf83ea748a21ee6e5f72a133766fe1745598796d86c268e2c33c8\"\n }\n}"
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp71cpkkpk\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmp71cpkkpk",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp71cpkkpk\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015f41ebc2b2af4adaafc3fe8631d6f56f9c2cd1d67c384fa8c10559354183f3ab010000006b483045022100c00b31d02741ecce403cce42c8ffb89a977ba9a769b11947b19727e1253670b302203ee3d3e40b7b81e4ae3b9d1260014089231309a6873ae8de061efd9e1dbc6514012103654434c522fa0681cb1131a62328a3c3c99f43242edf2d055dbefa69b3c9b5d3ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70373163706b6b706b180b22186170706c69636174696f6e2f6f637465742d73747265616d32303ba910e14fbcd8314f7de8e5e39b7442a2d257c3b975d0780131e7fe5978e17b5f59708abb7279597e71646d0970bf4e6d7576a9145199d244266b2168acfccfcf3c12f6b7b2f37fa088ac54826311000000001976a914b940ff67df6bd84a70a08f88ec01a4bfba20db5e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgyaP4FvA3DLPfatc7bfJS8a62c2AHQZH1\",\n \"amount\": \"3.941448\",\n \"confirmations\": 3,\n \"height\": 217,\n \"nout\": 1,\n \"timestamp\": 1621405356,\n \"txid\": \"abf38341355905c1a84f387cd6d12c9c6ff5d63186fec3afda4aafb2c2eb415f\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnxRJHcT6tEndwbT2fS3bTjcyknA8x1MV3\",\n \"amount\": \"1.0\",\n \"claim_id\": \"26ed324fb68e5f0093d8bb16ee4b2f371004f456\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"a-new-stream\",\n \"normalized_name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#26ed324fb68e5f0093d8bb16ee4b2f371004f456\",\n \"timestamp\": null,\n \"txid\": \"f5a1b7441bcb30df43696f135975e16c303c1ed8ab443353390de8bac25c3cad\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp71cpkkpk\",\n \"sd_hash\": \"3ba910e14fbcd8314f7de8e5e39b7442a2d257c3b975d0780131e7fe5978e17b5f59708abb7279597e71646d0970bf4e\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mxQVAfGJmsfYiH6JrM3uTxzHjNpBesAWFe\",\n \"amount\": \"2.917341\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f5a1b7441bcb30df43696f135975e16c303c1ed8ab443353390de8bac25c3cad\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"3.941448\",\n \"total_output\": \"3.917341\",\n \"txid\": \"f5a1b7441bcb30df43696f135975e16c303c1ed8ab443353390de8bac25c3cad\"\n }\n}"
}
]
},
@@ -332,10 +332,10 @@
"examples": [
{
"title": "Resolve a claim",
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\": {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ea41b9f807c6982cf97a1178838dfef64feaa014\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet resolve astream#ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ea41b9f807c6982cf97a1178838dfef64feaa014\"], \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"include_sent_supports\": false, \"include_sent_tips\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#ea41b9f807c6982cf97a1178838dfef64feaa014\": {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2/astream#e\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1621405356,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"short_url\": \"lbry://astream#e\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1621405355,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"short_url\": \"lbry://@channel#2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
}
]
},
@@ -357,7 +357,7 @@
"curl": "curl -d'{\"method\": \"status\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet status",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"status\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"file_manager\": {\n \"managed_files\": 0\n },\n \"installation_id\": \"4PfwRLRLRYVBzAH9BztZYLG9kWdaBF3rd9248ACo1ft7L7TMa4ohEijLmXDXn2bnBs\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"file_manager\": true,\n \"wallet\": true,\n \"wallet_server_payments\": true\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"dc9c04cc674a7123a0ac3dfbf2b03838664490c0fa9845fc2a5bfb5eb7a25a19\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"localhost:50002\",\n \"connected_features\": {\n \"daily_fee\": \"0\",\n \"description\": \"\",\n \"donation_address\": \"\",\n \"genesis_hash\": \"6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556\",\n \"hash_function\": \"sha256\",\n \"hosts\": {},\n \"payment_address\": \"\",\n \"protocol_max\": \"0.99.0\",\n \"protocol_min\": \"0.54.0\",\n \"pruning\": null,\n \"server_version\": \"0.94.1\",\n \"trending_algorithm\": \"zscore\"\n },\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.0034657910000532866,\n \"port\": 50002\n }\n ]\n },\n \"wallet_server_payments\": {\n \"max_fee\": \"0.0\",\n \"running\": false\n }\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"file_manager\": {\n \"managed_files\": 0\n },\n \"installation_id\": \"5b3thUHqWPtw7tsqms7k6EhytxX6kg99EtrTSLjrZpPohJfgdtDFw9v3vHQkTLHjkJ\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"file_manager\": true,\n \"wallet\": true,\n \"wallet_server_payments\": true\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"ec817b4f72ffdc8f2e1fef1eec569b4a96ab1b9a7a5421d6dea82c12ae817753\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"localhost:50002\",\n \"connected_features\": {\n \"daily_fee\": \"0\",\n \"description\": \"\",\n \"donation_address\": \"\",\n \"genesis_hash\": \"6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556\",\n \"hash_function\": \"sha256\",\n \"hosts\": {},\n \"payment_address\": \"\",\n \"protocol_max\": \"0.99.0\",\n \"protocol_min\": \"0.54.0\",\n \"pruning\": null,\n \"server_version\": \"0.97.0\",\n \"trending_algorithm\": \"zscore\"\n },\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.004196007997961715,\n \"port\": 50002\n }\n ]\n },\n \"wallet_server_payments\": {\n \"max_fee\": \"0.0\",\n \"running\": false\n }\n }\n}"
}
]
},
@@ -379,7 +379,7 @@
"curl": "curl -d'{\"method\": \"version\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet version",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"version\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"GNOME\",\n \"distro\": {\n \"codename\": \"xenial\",\n \"id\": \"ubuntu\",\n \"like\": \"debian\",\n \"version\": \"16.04\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"16\",\n \"minor\": \"04\"\n }\n },\n \"lbrynet_version\": \"0.94.1\",\n \"os_release\": \"4.4.0-116-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.9\",\n \"version\": \"0.94.1\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"Unknown\",\n \"distro\": {\n \"codename\": \"buster\",\n \"id\": \"debian\",\n \"like\": \"\",\n \"version\": \"10\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"10\",\n \"minor\": \"\"\n }\n },\n \"lbrynet_version\": \"0.97.0\",\n \"os_release\": \"5.4.107-1.fc25.qubes.x86_64\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-5.4.107-1.fc25.qubes.x86_64-x86_64-with-debian-10.9\",\n \"processor\": \"\",\n \"python_version\": \"3.7.3\",\n \"version\": \"0.97.0\"\n }\n}"
}
]
}
@@ -433,10 +433,10 @@
"examples": [
{
"title": "Add an account from seed",
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"alley cattle pig switch demise guide use thing monkey club setup post\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\", \"single_key\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account add \"new account\" --seed=\"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\", \"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\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1621405324,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeotZxjhxcL98N5eitgmSNgPrxekYztXJ7brMFd9ARZVC43QpNgvrY2exF1KxJQ4A69X5WaaADjcScHdoGKfU2dACXhaBdE7\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YGvMrPNZ1joEw7Af41xLwyzeFAnrRAKgx677t1xkc474E9dTquq7uzegJexpLhtvkyDDy8z63CEwyVr7jPix8DB3mq2Emey\",\n \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\"\n }\n}"
}
]
},
@@ -474,9 +474,9 @@
},
{
"title": "Get balance for specific account by id",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).json()",
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account balance \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"available\": \"2.0\",\n \"reserved\": \"0.0\",\n \"reserved_subtotals\": {\n \"claims\": \"0.0\",\n \"supports\": \"0.0\",\n \"tips\": \"0.0\"\n },\n \"total\": \"2.0\"\n }\n}"
}
]
@@ -511,7 +511,7 @@
"curl": "curl -d'{\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account create \"generated account\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
"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\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1621405324,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeotZxjhxcL98N5eitgmSNgPrxekYztXJ7brMFd9ARZVC43QpNgvrY2exF1KxJQ4A69X5WaaADjcScHdoGKfU2dACXhaBdE7\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YGvMrPNZ1joEw7Af41xLwyzeFAnrRAKgx677t1xkc474E9dTquq7uzegJexpLhtvkyDDy8z63CEwyVr7jPix8DB3mq2Emey\",\n \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\"\n }\n}"
}
]
},
@@ -566,24 +566,24 @@
"examples": [
{
"title": "Transfer 2 LBC from default account to specific account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000140b6a1a9e9d645fdc13d610f5ea726f6f3632d573d710fd9fd653b7bf26e7b7c000000006b483045022100d98c7aee6bf787a8baab3ad7dda342cbb3a40f97b0e3f7acb8d5ec6d8cdf46330220500ffb8e927c309f8c27eb16a2a63990f393501b54f7993198efb8fe5b8b03560121030b674794d96c8f25504064a3fa083612eeaa9725611c65882f6c09124b9fd90effffffff0200c2eb0b000000001976a9141d34f625de59642aee534ce63fbeff7c629ecc3888ac90d7ae2f000000001976a914d2ba6ed7df0d95eccf902d5e4057e5e49e32343488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"moncvibtkcp8X8EEAaA5Qx5vNGcBJPsZbM\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"nout\": 0,\n \"timestamp\": 1619186593,\n \"txid\": \"7c7b6ef27b3b65fdd90f713d572d63f3f626a75e0f613dc1fd45d6e9a9a1b640\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mzjBXvqaeQQUHpxocqhqtdRStrmpW4Ho45\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\" --amount=2.0 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000158b9aacf16272c014b4ea68547f99b83aac802ec1649da83922ecdc9273b727a010000006b483045022100daca5565f0ad55024830d3ea012285bfa572abda34d585b086899ae9959025db022025b134dcb5ce9d9eee109c649b5aaa1efb82bd782ec0bc7fc8982c563cb61470012103f2ee97726d5454ae20354313092052968f819e77b792e6fc52458fa4ddfe34e7ffffffff0200c2eb0b000000001976a914cdfc5605a8e5ea0e13e4be23811bba94622e161b88ac90d7ae2f000000001976a9142ad7e4109f922f32e09cb95ccd0d94150cc9e6fc88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mffPeSmHrFE3tg5J4zCQGP4muR6CcUV5wu\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"nout\": 1,\n \"timestamp\": 1621405354,\n \"txid\": \"7a723b27c9cd2e9283da4916ec02c8aa839bf94785a64e4b012c2716cfaab958\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzJ76zabb25ur5UEzCcPqDNcdnANJJktk1\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mjRVJULUCxB7s3guxUriGqN5C7RFj6Fsxh\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\"\n }\n}"
},
{
"title": "Spread LBC between multiple addresses",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --from_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ca8922cd1c37b7d77e41a53a11b7cb791defa2a4eecfc6ba3cfef78d7d2f6c03000000006b483045022100c90c3a19f2df1bf1804182b956ac026c49a3ae5c5b4683e752d0b0f790a2ffcc02201585e4a89be8d9a8a89390955f52652981b5334d773dddf4b532b1c0cf5c10ef012102cd0bfe93207b243de0c9e94c14acb266d2c0e8cbd9cd8e5bc392b9ea854a7525ffffffff03c0687804000000001976a914dcd3b9091b6c5476b0c3ca5e2a1ce803d9690f1688acc0687804000000001976a914dcd3b9091b6c5476b0c3ca5e2a1ce803d9690f1688ac6cb9fa02000000001976a914ab9a29a2d32193a63d1bdae31881e80dce7c72b388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwAJXGL1Aw4U5BRnTYjKiZKHHUkLbxJwTs\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"from_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --to_account=\"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\" --from_account=\"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\" --amount=1.5 --outputs=2 --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"from_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001a2a08aed2135620a6c05793822961a98dc9cccb41eb629d6865dc29b2dccf0d0000000006a47304402205f3edef7ce0ca0c525806eeb3d6cbbc4435cd0e99af6b255b3adf850053597c4022007356877e70c4db839f3fe7c3895143482a84db7691f2efb7fbc1b15def1e2c501210374fa170082b9b46254f2887e0f938be9e9b2e2753f5966d03eca0b3c238ecc6affffffff03c0687804000000001976a914b49ada82e78a48e693c1cfe3c4472a0b994c4bce88acc0687804000000001976a914b49ada82e78a48e693c1cfe3c4472a0b994c4bce88ac6cb9fa02000000001976a91420f5af908fbb3a2dff2ad9c136cfc60c9b48170c88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzJ76zabb25ur5UEzCcPqDNcdnANJJktk1\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"nout\": 0,\n \"timestamp\": 1621405355,\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mwyuRzojNR4AcQ3Dzk8tTVsdYZnoMJYD6B\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwyuRzojNR4AcQ3Dzk8tTVsdYZnoMJYD6B\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"miXEEjwhrMsbL91dccqwTJeTkRmgDGSYoP\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\"\n }\n}"
},
{
"title": "Transfer all LBC to a specified account",
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000037626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784000000006b483045022100cc8ab1133f9aa023984758dc6028daabbe9898fab43db8e7a7f03cd98b7a52a102207679d5b8825642dbf7e04e8cc7adab6c16859470815cf9e7b8546e294c0a248d0121031a0a1bb2d064d4b10274f214f972b78e12d7f024568e0cb478a1e6738bbe826dffffffff7626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784010000006b48304502210085c8b09788fdf20a1d7662d6281f2d3a13a16bafda968bb5aaa090329f2524af02205a18a3ffcd85d0887b88a01b41c9e530b7f5c1d4644b37adc764cda8cb66747a0121031a0a1bb2d064d4b10274f214f972b78e12d7f024568e0cb478a1e6738bbe826dffffffff7626c7a04392685e0a99b46986e68d64ba8b58bef538caaed3f5cb18afa84784020000006a47304402203ac347806d77cba6bb1cdc3f79638a4f254f9e2bdbc42d348d52de859487c5e502204af387abc826923a9033b674ecef4a712cbe7f7b29fa531188600543271a98eb0121037a661ea7428fcd9c1ad331f049646bfbf17f210ba0ce9c27e16b17ddef5c72d0ffffffff015027eb0b000000001976a9140953009b4f066787a0aa01eb98f8fbf233feacb788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n1eab1nmWNhEa1MYfpgGdNVm89VZFz3ohV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwAJXGL1Aw4U5BRnTYjKiZKHHUkLbxJwTs\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 2,\n \"timestamp\": 1619186594,\n \"txid\": \"8447a8af18cbf5d3aeca38f5be588bba648de68669b4990a5e689243a0c72676\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgNFotMcVkNSmVwGpZHi6dACpVsMKBgFZB\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet account fund --from_account=\"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\" --everything --broadcast",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"everything\": true, \"broadcast\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000037745ebd964dff03ad2cd3989d956476eda614cbe95bdf8aaef54ed6f76fa2eff000000006b4830450221008f287b89057f784e197e2318f2be9f5ad53c3e19300ea61bbc6bc030cbb013c90220425cdeb4b5dd8207ec4c755a63cfdda9788a27598c24c0ada41fa7901cfbd82b012103c0330685b2f4734821f4f6b8116c9de7c5faa9d518da7275c823e1440864631bffffffff7745ebd964dff03ad2cd3989d956476eda614cbe95bdf8aaef54ed6f76fa2eff010000006a4730440220493dbb56e0750528e33a6313f1b5577e46b584cfbee44088717c1de513ffa50002207385d2a245325be823ffbc0a2445a02212d75c04a13140c4d885e05588021465012103c0330685b2f4734821f4f6b8116c9de7c5faa9d518da7275c823e1440864631bffffffff7745ebd964dff03ad2cd3989d956476eda614cbe95bdf8aaef54ed6f76fa2eff020000006b483045022100f1344b664449676fdd4b99e4c21e22e361ecd223fae1b05108d0d5e919350d9902203fef98f15717541f256841fb5964f1c22c2bd9281a32420aaf112cc9e79974850121025780217a60380b1410bd46a3c261ac0ae3d86b1dc4b8c45addb0525217ddd31dffffffff015027eb0b000000001976a9147ef48a8cc47e6fbce1d7bb3d909d5e5aa557bd3488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mwyuRzojNR4AcQ3Dzk8tTVsdYZnoMJYD6B\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 0,\n \"timestamp\": 1621405355,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mwyuRzojNR4AcQ3Dzk8tTVsdYZnoMJYD6B\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 1,\n \"timestamp\": 1621405355,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"miXEEjwhrMsbL91dccqwTJeTkRmgDGSYoP\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"nout\": 2,\n \"timestamp\": 1621405355,\n \"txid\": \"ff2efa766fed54efaaf8bd95be4c61da6e4756d98939cdd23af0df64d9eb4577\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"ms6EPFDDfSb3gVMgyBZ5drGuYH9uqvvmPq\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"ac0d083d10fabb4abcd15d2a8c94868fd4a64de15f0d94d10eecc547155fb8f5\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"ac0d083d10fabb4abcd15d2a8c94868fd4a64de15f0d94d10eecc547155fb8f5\"\n }\n}"
}
]
},
@@ -641,7 +641,7 @@
"curl": "curl -d'{\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet account list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mkPwiscpsmDM8ECQrLYS3vnq16MaXsTZVD\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mkPwiscpsmDM8ECQrLYS3vnq16MaXsTZVD\",\n \"public_key\": \"tpubD6NzVbkrYhZ4We9GS84h1j7L9Xs5T2QcCqABCJqEAMAXeBXqsR1FUwZXjLpMuGUtr3VLB95No1ax4HevXK2MwUZ39FSKkGMDWs4PL7kiSp1\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"n34d7tsf9D7HjzWr2LnE7c9x9rwtvGNNwG\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #n34d7tsf9D7HjzWr2LnE7c9x9rwtvGNNwG\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Y47gVC3GHm5nxPbxoWF7fxq3L59VBTkw5X3iiyHrka3AD5M7YWvC8NvUngQwrm6wacpWxEeJMXNH3YvJBYAbtp2TVmsSyw4\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -686,10 +686,10 @@
"examples": [
{
"title": "Remove an account",
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}' http://localhost:5279/",
"lbrynet": "lbrynet account remove mue613K8x5kLXpsePncrd5xqSoRi7NXmYx",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}).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\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1621405324,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeotZxjhxcL98N5eitgmSNgPrxekYztXJ7brMFd9ARZVC43QpNgvrY2exF1KxJQ4A69X5WaaADjcScHdoGKfU2dACXhaBdE7\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YGvMrPNZ1joEw7Af41xLwyzeFAnrRAKgx677t1xkc474E9dTquq7uzegJexpLhtvkyDDy8z63CEwyVr7jPix8DB3mq2Emey\",\n \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\"\n }\n}"
}
]
},
@@ -782,10 +782,10 @@
"examples": [
{
"title": "Modify maximum number of times a change address can be reused",
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\", \"default\": false, \"change_max_uses\": 10}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 10\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1619186562,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeDp4m3ZSg72s4LFLVLxoStasxmbm5egbdCpMk1YANTw52EhZiTZ831vgdcuuwD6EhfPhvEHn1t9BtpBR74sJCQ2TEhaXMK6\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XgqrehE35WgydMmGeg9i2CBfFHe4VvUzTh58NQMkYxYwCPvo6CEy8b8qo8cq2rdfPk42qNYLk7cWLpDkiXJnvr9zHZ9KqGD\",\n \"seed\": \"alley cattle pig switch demise guide use thing monkey club setup post\"\n }\n}"
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
"lbrynet": "lbrynet account set mue613K8x5kLXpsePncrd5xqSoRi7NXmYx --change_max_uses=10",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\", \"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\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1621405324,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPeotZxjhxcL98N5eitgmSNgPrxekYztXJ7brMFd9ARZVC43QpNgvrY2exF1KxJQ4A69X5WaaADjcScHdoGKfU2dACXhaBdE7\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YGvMrPNZ1joEw7Af41xLwyzeFAnrRAKgx677t1xkc474E9dTquq7uzegJexpLhtvkyDDy8z63CEwyVr7jPix8DB3mq2Emey\",\n \"seed\": \"remember bamboo bacon absurd copper easy hill wish soccer office lawn limb\"\n }\n}"
}
]
}
@@ -821,9 +821,9 @@
"examples": [
{
"title": "Check if address is mine",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"}}).json()",
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mwzRFUu7mKpzqPvh1uaAQivEKd1wDUp41X\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address is_mine mwzRFUu7mKpzqPvh1uaAQivEKd1wDUp41X",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mwzRFUu7mKpzqPvh1uaAQivEKd1wDUp41X\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -870,14 +870,14 @@
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet address list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mfmhc92HaRe3va3ebMqfkjACWE7Efg7WQo\",\n \"pubkey\": \"tpubDA9GDAntyJu4osD8fGNsDznW1DxdJz31FNzUUgq4F5Aamjn2PRv3CFKWHwg8pLTprfRkNZaZDeUDgDsBfiY7Q8ZjgjEApjnenkZyJ2KideH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mgbap1vfAiBNVKqUUT7W5xnxmrjsbU3fQk\",\n \"pubkey\": \"tpubDA9GDAntyJu4JHowiMKECSVPkkntXycNgaLidDnum3oF5pgvEq7PaRoyqK7Ls9xtPHfyVLVuQu9YGJ4Gd1CrtZaSispuLPgjpvDzDA41wy3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"pubkey\": \"tpubDA9GDAntyJu4R9T8QWqc7PvQs7AU9wKyG6xyct6WN1huKHPZjmvVh1wbFKuCc2yLjXP1qQ188rLS87tvqXPutEz71stE6E14Ux3F3DpsVVH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mjebtHKV24PApa9fR5mQ8gSCAits93Ecb4\",\n \"pubkey\": \"tpubDA9GDAntyJu4KfYLGfo16i1S39nfrDVVe3tAbNuXfzftkSRbASzo9UT1X9j8oGLRfTjnUQF1rGP3FnSQUDfEweRqiZUXhv6WDVDRUHRGoWu\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mm3VT4W1vwPRrPQqCTZytyeVnzbUkmWyTA\",\n \"pubkey\": \"tpubDA9GDAntyJu4N1hoLeYF6TuJuAnv9aZE6k4pAhwgm6hDaFzzMxSSTYMLed637xt7QAMhmB7iVpjn9d55kgmp3z4KKuEooYQeAaqVwJVSqLz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mmKWdxNhFhFAXNsGTy2tVRwhbpkijgK2bm\",\n \"pubkey\": \"tpubDA9GDAntyJu4PsNjmu5LaSbS7DtcdGC7mjF9NH3Jyu2UrR8FxZK8PErhJHg3cskG7D6GUgLmLJ6LaEnVFFS3WCdnU2gT54YXW9BBtGQQHb6\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mnDP2uk38XSLorT95aqq9N5gy8bf3Wjt9y\",\n \"pubkey\": \"tpubDA9GDAntyJu4dQDNMhay8bq1f5QyCXzL8SQLj11i1pbg1pbrgUUFoJcAbCS56eqe6Xqs3CPKW4DTkir1HJ64uriFBT4xw9FA1unJKFKpGSx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"moSi1CqRyZzfkLgT1kkrtHS6oYChRvJxqd\",\n \"pubkey\": \"tpubDA9GDAntyJu4mDpFcwkSwF4Hyvn5VSWp2bskbKd9iNqDwdNLbwkzxLwQGF1JArVWEEwk2xV76BXa1hk1nQMQmPd1Ab6tcJPpfKhY8pFZXMX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mr2s4EoTgVBE4r9JLkwAHDnFX3uGvgufW6\",\n \"pubkey\": \"tpubDA9GDAntyJu4FQqtS3XjPowNGLHcBXgaFZVwwVZa8uK1cFk2mhG4ZbSWQszY7REB1wiauhsbFNU5e8TfpQWChL1uwmoxkW35ytVmWFXfSMG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msJmZvJqs2e8C23hovmZKeVdCkitGxbrru\",\n \"pubkey\": \"tpubDA9GDAntyJu4hBpsMFjvMc9AawthJSRgKTRjX5aJ96VS81xaha6fURbWbaJ1d9sTpBk43JQB6oxcaRRBdSkz83s3YVVx6Rxs4B3xp4fpXQV\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msMFJbadB5dzHvz5oWscZUKvQYEYPk7Ncd\",\n \"pubkey\": \"tpubDA9GDAntyJu4ENuarHFHHvkPf1MQKFyXtS18GUuqFeAmqgmYkWvboJpbm9dZnTFUu1WN3YeyyNMRDVmpU81ad9j18SjGFVXq9rvDyktKDDb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mt6JggawxBTj1GrZ5DcDHFgmvkDtmBtw8P\",\n \"pubkey\": \"tpubDA9GDAntyJu4rGaqwnidtFkzNjDdbeZxtaVhXWXSkzAgsf5fmcXuFuMAtSHApnmpnawbcjQpLzJzoY9BBJmhXHV8ZTv7iUQTVmQHKzspkZr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtESjA4yH9XhMV1TTRPDahQcswXGokjJEQ\",\n \"pubkey\": \"tpubDA9GDAntyJu4kGNiwQwsfXo9MQiNv4zvppZMZG5rJsRuU9yuy5hdbkkyNTYEAPdDfW27WfC1yWd2mtMiUsWkhKk6xGouuZzFwQSepqdFj4m\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtSMa8yjkyumAEpuu27w5mBKDvtV8WuwUS\",\n \"pubkey\": \"tpubDA9GDAntyJu4bDz5PUjqeS6vDQGgFZ67ttpxoeAh8FMsHmgYXe5MEUHDLmVtSmdjxqzpLsCkLc9efBvVn1qqzuSFV5gffcEHjWD3QmjoAMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mu3Fgd4fLSMmPdBG8M7pMDM9mVgqBsNa2P\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZYzCJS7DcSKHDiEwRLUSG5VkfS5fubFz3fQnrZ32LMAK1fVG6xucP5GLdEtaPtFXmbVd7kzLp5j2viUfWJ8n7HHX9e3rFMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"muTdW8b65cWxqTbCnrGyxEMwfNXX1ZYuoa\",\n \"pubkey\": \"tpubDA9GDAntyJu54zEFL428ce3vX5ehsYh4AEaXi3GRtwyLftHLfwJisf7Q1JyQehhw77Q1xvgy4qrc7CSNxn8aBM8xikmNpUwFNSzdUEQyUQ8\",\n \"Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mfeQWMvmtnuZnSpGwjNDy33jQvgy2nu4vR\",\n \"pubkey\": \"tpubDA9GDAntyJu4Ytag2HiGb2Hrmgtjga1oSRTdWNZz6Vh6mW2yWyMkhKtJS9rH3ctZzPFvFhenoTfoArgceQgaLSXXQATSa9r5iVjAWHHxpBc\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mhgyiqzXraHQvoYN4oRsnmZGeB5e27v7X6\",\n \"pubkey\": \"tpubDA9GDAntyJu56nZDL32W3uoYzpZQ3HuE5zDDzVnCzNzgH3fAaHx2p8PgX9oETY13FKHdiiN8zZEgZHxGks6B12exJigtntT9FQTPrYpwuKH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"miXEEjwhrMsbL91dccqwTJeTkRmgDGSYoP\",\n \"pubkey\": \"tpubDA9GDAntyJu4NUN7zjtAZaH7SwJJGrNw3GGXpLXus5dTmGEcHUsuAC9M7tH5oeirCACaY4kWWwo6zEFFYt8xK6JgUSSR24ZwmcHsbPaCxNr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mjhaqbLhpch3DebPyWr21ppDGLukn1YSeh\",\n \"pubkey\": \"tpubDA9GDAntyJu4cZWdAgJTwKrWNEXdbNPrydUPVLiURVv6DmDYRTAAAMMW4y7RXJkPYNofLKohDGNPmbV6yNwnxVijRhxkVNYY4Ei6amXvrVA\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mk6aLnMyWNce5z7pkAFjT7VKvgddRfpuPZ\",\n \"pubkey\": \"tpubDA9GDAntyJu4V1BUGVmutJZCuz1TtuzwidW2b7masz8qtFuZmpJ7HZvVy95TL1MQpszsmuK5KgmEXXRzAfg2xRRituyqqaKtQHjxxHnyXtz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mkygHEMa1gckjft4HdnXdBCA2qNn8ocEnd\",\n \"pubkey\": \"tpubDA9GDAntyJu4juqLBa7brBP1W1x3G7XvPCTRqUsunQh7u2Ly3jmevsLu3BDmsFJUuwdLx38BTHa5ip6wVoFVqUinnp6EahBfd9uSDXZZrkM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mmGWzcEtP4BYh2rxf82c9L7cdVyvbkxhfB\",\n \"pubkey\": \"tpubDA9GDAntyJu4XQhL61tDESr7XG7YnKJRzRM6hCvRxv4x3tMTqK2yv17k8qXWiVziW2jdFwbGpeVLkcdxonchVPj4beHsv8hRy1dfmipdrm3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mn8SVfBD3117apKuXMVjVeefpeHVfni2xW\",\n \"pubkey\": \"tpubDA9GDAntyJu4QuRUc8EBJvTo74ZbvQiN1StbbZnFX6qBBCoVocV3VsFFC6SUteRFj2rJp2LGxUDXmQHcHqZa3LhFpKeCtguhimnxgKaYtYJ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mnwPnyB24JZfXUqd7vn8MsMhmNTRkj4Amr\",\n \"pubkey\": \"tpubDA9GDAntyJu4LW5QvSz76VzXmRsAUoQ4otyRRnKz3yrANK2G39avPvQigzzVj1wVyYZxVqot7C6LjzdyFE5prYR49tcWJUYfFvqdnvy2FbG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mo2ydnUzgxFX1YsZPuECeQxeRwiuR9haHK\",\n \"pubkey\": \"tpubDA9GDAntyJu4gTKzy4MShkNiFnhQxEZQ5S7y7nKtvhWFsxqQ8mGuSWCQJUGL4jdNcFFRU9neXyJaDjMZP3RuKTDXi5BFz6Ao7GFfc9cFmsn\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"moEwuQhAkg3hT7qhTjHXiFuf7KBcUhGzCt\",\n \"pubkey\": \"tpubDA9GDAntyJu52jXcb9gAsJXM1CVAabeFAktL9nw3yBoFWpE3m5mocdwDANmosEhdna2tUb2uuR6wBnFXR3RmQ3fsuHsEVucP3BcHquzKmXm\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"morR7jG1kXb7AbvQRXRYH554jpCnQkfXYg\",\n \"pubkey\": \"tpubDA9GDAntyJu4G59VFEdQaAoKs3LeNRP9rKTZ8a1rK5ocUPV8i8i9hbZiGbCgEFZiH3dGvf8Gstw7nbfxA5R5gum7Mf9GRa9vCi6xhXn7rPs\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mouye7ULsS8mZ6GDZ6t4LyNDKt1NR9YYxS\",\n \"pubkey\": \"tpubDA9GDAntyJu4wQF2sSaUSY4RpHuypUbKKbuVJz3Dyv4VZsnuMetXPVnx1RuGBgLAj8ARSqNe5xF9j6Y4JuBHca98YDS2DQxbzVbqsdDcAVw\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mpZtKoHsPTyPoUPdmhG6sDpj6AJeKWeB5g\",\n \"pubkey\": \"tpubDA9GDAntyJu4fHj1PXGSc2DLHTxwphZRVAg4qo8p56iUaigrzzgo3qSaeCEEMkKjUgBxy6oq8Y9Rfm6epyF7DTzcbMuYBRt8acTf4SAZpaT\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mqKfz8h1dEwid46RueaL1RSZ6KAACn4iPw\",\n \"pubkey\": \"tpubDA9GDAntyJu4JPiW5aSsNcqLb49zqbKNLVZcMhDKF5vWyv5XRzHFtbwKXPfNUW9mX7ahKiC9qUMxtGVtJP9oBVupKZFifEGXDEwZvWvXWMP\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"msSrvvj7mbVxFE65GQcGyTqfgjCqHGjRWS\",\n \"pubkey\": \"tpubDA9GDAntyJu4RA2NaDmVC8192ZULDVGbbsBFNv87jbjqfX6mtNHWVarfxJR9dEbxFivrJAfnggyg1ysVGWWa746mp4pXq9kKKG56HWnQDpJ\",\n \"Line truncated
},
{
"title": "List addresses in specified account",
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mfmhc92HaRe3va3ebMqfkjACWE7Efg7WQo\",\n \"pubkey\": \"tpubDA9GDAntyJu4osD8fGNsDznW1DxdJz31FNzUUgq4F5Aamjn2PRv3CFKWHwg8pLTprfRkNZaZDeUDgDsBfiY7Q8ZjgjEApjnenkZyJ2KideH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mgbap1vfAiBNVKqUUT7W5xnxmrjsbU3fQk\",\n \"pubkey\": \"tpubDA9GDAntyJu4JHowiMKECSVPkkntXycNgaLidDnum3oF5pgvEq7PaRoyqK7Ls9xtPHfyVLVuQu9YGJ4Gd1CrtZaSispuLPgjpvDzDA41wy3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"miBPLSvKJAiYtorvP4R3Z9bCBmbyVzCpZV\",\n \"pubkey\": \"tpubDA9GDAntyJu4R9T8QWqc7PvQs7AU9wKyG6xyct6WN1huKHPZjmvVh1wbFKuCc2yLjXP1qQ188rLS87tvqXPutEz71stE6E14Ux3F3DpsVVH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mjebtHKV24PApa9fR5mQ8gSCAits93Ecb4\",\n \"pubkey\": \"tpubDA9GDAntyJu4KfYLGfo16i1S39nfrDVVe3tAbNuXfzftkSRbASzo9UT1X9j8oGLRfTjnUQF1rGP3FnSQUDfEweRqiZUXhv6WDVDRUHRGoWu\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mm3VT4W1vwPRrPQqCTZytyeVnzbUkmWyTA\",\n \"pubkey\": \"tpubDA9GDAntyJu4N1hoLeYF6TuJuAnv9aZE6k4pAhwgm6hDaFzzMxSSTYMLed637xt7QAMhmB7iVpjn9d55kgmp3z4KKuEooYQeAaqVwJVSqLz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mmKWdxNhFhFAXNsGTy2tVRwhbpkijgK2bm\",\n \"pubkey\": \"tpubDA9GDAntyJu4PsNjmu5LaSbS7DtcdGC7mjF9NH3Jyu2UrR8FxZK8PErhJHg3cskG7D6GUgLmLJ6LaEnVFFS3WCdnU2gT54YXW9BBtGQQHb6\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mnDP2uk38XSLorT95aqq9N5gy8bf3Wjt9y\",\n \"pubkey\": \"tpubDA9GDAntyJu4dQDNMhay8bq1f5QyCXzL8SQLj11i1pbg1pbrgUUFoJcAbCS56eqe6Xqs3CPKW4DTkir1HJ64uriFBT4xw9FA1unJKFKpGSx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"moSi1CqRyZzfkLgT1kkrtHS6oYChRvJxqd\",\n \"pubkey\": \"tpubDA9GDAntyJu4mDpFcwkSwF4Hyvn5VSWp2bskbKd9iNqDwdNLbwkzxLwQGF1JArVWEEwk2xV76BXa1hk1nQMQmPd1Ab6tcJPpfKhY8pFZXMX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mr2s4EoTgVBE4r9JLkwAHDnFX3uGvgufW6\",\n \"pubkey\": \"tpubDA9GDAntyJu4FQqtS3XjPowNGLHcBXgaFZVwwVZa8uK1cFk2mhG4ZbSWQszY7REB1wiauhsbFNU5e8TfpQWChL1uwmoxkW35ytVmWFXfSMG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msJmZvJqs2e8C23hovmZKeVdCkitGxbrru\",\n \"pubkey\": \"tpubDA9GDAntyJu4hBpsMFjvMc9AawthJSRgKTRjX5aJ96VS81xaha6fURbWbaJ1d9sTpBk43JQB6oxcaRRBdSkz83s3YVVx6Rxs4B3xp4fpXQV\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"msMFJbadB5dzHvz5oWscZUKvQYEYPk7Ncd\",\n \"pubkey\": \"tpubDA9GDAntyJu4ENuarHFHHvkPf1MQKFyXtS18GUuqFeAmqgmYkWvboJpbm9dZnTFUu1WN3YeyyNMRDVmpU81ad9j18SjGFVXq9rvDyktKDDb\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mt6JggawxBTj1GrZ5DcDHFgmvkDtmBtw8P\",\n \"pubkey\": \"tpubDA9GDAntyJu4rGaqwnidtFkzNjDdbeZxtaVhXWXSkzAgsf5fmcXuFuMAtSHApnmpnawbcjQpLzJzoY9BBJmhXHV8ZTv7iUQTVmQHKzspkZr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtESjA4yH9XhMV1TTRPDahQcswXGokjJEQ\",\n \"pubkey\": \"tpubDA9GDAntyJu4kGNiwQwsfXo9MQiNv4zvppZMZG5rJsRuU9yuy5hdbkkyNTYEAPdDfW27WfC1yWd2mtMiUsWkhKk6xGouuZzFwQSepqdFj4m\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mtSMa8yjkyumAEpuu27w5mBKDvtV8WuwUS\",\n \"pubkey\": \"tpubDA9GDAntyJu4bDz5PUjqeS6vDQGgFZ67ttpxoeAh8FMsHmgYXe5MEUHDLmVtSmdjxqzpLsCkLc9efBvVn1qqzuSFV5gffcEHjWD3QmjoAMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"mu3Fgd4fLSMmPdBG8M7pMDM9mVgqBsNa2P\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZYzCJS7DcSKHDiEwRLUSG5VkfS5fubFz3fQnrZ32LMAK1fVG6xucP5GLdEtaPtFXmbVd7kzLp5j2viUfWJ8n7HHX9e3rFMS\",\n \"used_times\": 0\n },\n {\n \"account\": \"mhiYjatt6yjzN75xTigQa2hkN69FLRZnNs\",\n \"address\": \"muTdW8b65cWxqTbCnrGyxEMwfNXX1ZYuoa\",\n \"pubkey\": \"tpubDA9GDAntyJu54zEFL428ce3vX5ehsYh4AEaXi3GRtwyLftHLfwJisf7Q1JyQehhw77Q1xvgy4qrc7CSNxn8aBM8xikmNpUwFNSzdUEQyUQ8\",\n \"Line truncated
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}' http://localhost:5279/",
"lbrynet": "lbrynet address list --account_id=\"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mfeQWMvmtnuZnSpGwjNDy33jQvgy2nu4vR\",\n \"pubkey\": \"tpubDA9GDAntyJu4Ytag2HiGb2Hrmgtjga1oSRTdWNZz6Vh6mW2yWyMkhKtJS9rH3ctZzPFvFhenoTfoArgceQgaLSXXQATSa9r5iVjAWHHxpBc\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mhgyiqzXraHQvoYN4oRsnmZGeB5e27v7X6\",\n \"pubkey\": \"tpubDA9GDAntyJu56nZDL32W3uoYzpZQ3HuE5zDDzVnCzNzgH3fAaHx2p8PgX9oETY13FKHdiiN8zZEgZHxGks6B12exJigtntT9FQTPrYpwuKH\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"miXEEjwhrMsbL91dccqwTJeTkRmgDGSYoP\",\n \"pubkey\": \"tpubDA9GDAntyJu4NUN7zjtAZaH7SwJJGrNw3GGXpLXus5dTmGEcHUsuAC9M7tH5oeirCACaY4kWWwo6zEFFYt8xK6JgUSSR24ZwmcHsbPaCxNr\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mjhaqbLhpch3DebPyWr21ppDGLukn1YSeh\",\n \"pubkey\": \"tpubDA9GDAntyJu4cZWdAgJTwKrWNEXdbNPrydUPVLiURVv6DmDYRTAAAMMW4y7RXJkPYNofLKohDGNPmbV6yNwnxVijRhxkVNYY4Ei6amXvrVA\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mk6aLnMyWNce5z7pkAFjT7VKvgddRfpuPZ\",\n \"pubkey\": \"tpubDA9GDAntyJu4V1BUGVmutJZCuz1TtuzwidW2b7masz8qtFuZmpJ7HZvVy95TL1MQpszsmuK5KgmEXXRzAfg2xRRituyqqaKtQHjxxHnyXtz\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mkygHEMa1gckjft4HdnXdBCA2qNn8ocEnd\",\n \"pubkey\": \"tpubDA9GDAntyJu4juqLBa7brBP1W1x3G7XvPCTRqUsunQh7u2Ly3jmevsLu3BDmsFJUuwdLx38BTHa5ip6wVoFVqUinnp6EahBfd9uSDXZZrkM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mmGWzcEtP4BYh2rxf82c9L7cdVyvbkxhfB\",\n \"pubkey\": \"tpubDA9GDAntyJu4XQhL61tDESr7XG7YnKJRzRM6hCvRxv4x3tMTqK2yv17k8qXWiVziW2jdFwbGpeVLkcdxonchVPj4beHsv8hRy1dfmipdrm3\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mn8SVfBD3117apKuXMVjVeefpeHVfni2xW\",\n \"pubkey\": \"tpubDA9GDAntyJu4QuRUc8EBJvTo74ZbvQiN1StbbZnFX6qBBCoVocV3VsFFC6SUteRFj2rJp2LGxUDXmQHcHqZa3LhFpKeCtguhimnxgKaYtYJ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mnwPnyB24JZfXUqd7vn8MsMhmNTRkj4Amr\",\n \"pubkey\": \"tpubDA9GDAntyJu4LW5QvSz76VzXmRsAUoQ4otyRRnKz3yrANK2G39avPvQigzzVj1wVyYZxVqot7C6LjzdyFE5prYR49tcWJUYfFvqdnvy2FbG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mo2ydnUzgxFX1YsZPuECeQxeRwiuR9haHK\",\n \"pubkey\": \"tpubDA9GDAntyJu4gTKzy4MShkNiFnhQxEZQ5S7y7nKtvhWFsxqQ8mGuSWCQJUGL4jdNcFFRU9neXyJaDjMZP3RuKTDXi5BFz6Ao7GFfc9cFmsn\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"moEwuQhAkg3hT7qhTjHXiFuf7KBcUhGzCt\",\n \"pubkey\": \"tpubDA9GDAntyJu52jXcb9gAsJXM1CVAabeFAktL9nw3yBoFWpE3m5mocdwDANmosEhdna2tUb2uuR6wBnFXR3RmQ3fsuHsEVucP3BcHquzKmXm\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"morR7jG1kXb7AbvQRXRYH554jpCnQkfXYg\",\n \"pubkey\": \"tpubDA9GDAntyJu4G59VFEdQaAoKs3LeNRP9rKTZ8a1rK5ocUPV8i8i9hbZiGbCgEFZiH3dGvf8Gstw7nbfxA5R5gum7Mf9GRa9vCi6xhXn7rPs\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mouye7ULsS8mZ6GDZ6t4LyNDKt1NR9YYxS\",\n \"pubkey\": \"tpubDA9GDAntyJu4wQF2sSaUSY4RpHuypUbKKbuVJz3Dyv4VZsnuMetXPVnx1RuGBgLAj8ARSqNe5xF9j6Y4JuBHca98YDS2DQxbzVbqsdDcAVw\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mpZtKoHsPTyPoUPdmhG6sDpj6AJeKWeB5g\",\n \"pubkey\": \"tpubDA9GDAntyJu4fHj1PXGSc2DLHTxwphZRVAg4qo8p56iUaigrzzgo3qSaeCEEMkKjUgBxy6oq8Y9Rfm6epyF7DTzcbMuYBRt8acTf4SAZpaT\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"mqKfz8h1dEwid46RueaL1RSZ6KAACn4iPw\",\n \"pubkey\": \"tpubDA9GDAntyJu4JPiW5aSsNcqLb49zqbKNLVZcMhDKF5vWyv5XRzHFtbwKXPfNUW9mX7ahKiC9qUMxtGVtJP9oBVupKZFifEGXDEwZvWvXWMP\",\n \"used_times\": 0\n },\n {\n \"account\": \"mue613K8x5kLXpsePncrd5xqSoRi7NXmYx\",\n \"address\": \"msSrvvj7mbVxFE65GQcGyTqfgjCqHGjRWS\",\n \"pubkey\": \"tpubDA9GDAntyJu4RA2NaDmVC8192ZULDVGbbsBFNv87jbjqfX6mtNHWVarfxJR9dEbxFivrJAfnggyg1ysVGWWa746mp4pXq9kKKG56HWnQDpJ\",\n \"Line truncated
}
]
},
@@ -905,7 +905,7 @@
"curl": "curl -d'{\"method\": \"address_unused\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet address unused",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_unused\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\"\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mwzRFUu7mKpzqPvh1uaAQivEKd1wDUp41X\"\n}"
}
]
}
@@ -955,10 +955,10 @@
"examples": [
{
"title": "Delete a blob",
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"\n}"
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\"}}' http://localhost:5279/",
"lbrynet": "lbrynet blob delete c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\"\n}"
}
]
},
@@ -1036,7 +1036,7 @@
"curl": "curl -d'{\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet blob list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"3e9c701f71aa9df9dc13e18a1a2d96a0c8f834a4218a3c2cddea815e6bccd3ddf3b96ae3aa0e338cd797b781596a1584\",\n \"8433ac4f1eef3d06976ab7ed852be501ecbbee9c4901e72469183e17a08a1f70d2e994d226bf7c9f570c93fffb42ddb4\",\n \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\",\n \"a6f0d442c48c63004f85151f3424da59c9e358680c60174202a174e1a9d2152e909cfca24ef182c0fcf44e91978a9121\",\n \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"9656965659aa2e1e3e4b07e2ad6047c13341769af4742ff1bca364682dbff614e3761cfb0a4fece29155331110611a10\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1117,10 +1117,10 @@
"examples": [
{
"title": "Abandon a channel claim",
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 5c15c266bf34c683523ce06cfb7fe5c984221375",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000123097a98778ac14275b0c3b444748a09911c5c44ea2d11c4b507c36f74a7cb7d000000006b4830450221008cdfde561c68c5bc509bf87206794b930c8e51ad147e1dc40025cf929d04d32d02206923e395f867551cf8273aa98497cd8339da18e1b81e04b07e4fefa89f932a730121032c31a47c0f8bc4a0c8565f56f796f3cca09b86524b74dea8c16715240134ab1fffffffff0134b7f505000000001976a91425783ce606316d3bac10802a371e229c1363246888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 9,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miw5LRgpz1FvHDgCLQT3hMoKD5bwSRSK9M\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"17c121e283ad21ec0c0bd05b59007ff9abd789cc736377336327aa73d34b4a62\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"17c121e283ad21ec0c0bd05b59007ff9abd789cc736377336327aa73d34b4a62\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel abandon 20ccc609603f9c6f01d74f2d6a133867d2903fc2",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001942c37d36793290feb0e2ab637e6da02b1eea67d85a872dff83c8b0c19a322ff000000006b48304502210097bf5a07e8051956c2f9291207c7cd5acb4becbb4057ceeff56f55cd00d34b2902200b99e51cb96ea088fd76a914348d8487e6e22c74edff84e4573f54572d9d426c01210353931cc595ec3293186c7f9d63a8e1b8aecc5cc4fd0e010092d2b40483213902ffffffff0134b7f505000000001976a9140bc6abe6b62ea58b85132979e66092310a33ab5588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 9,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgbDj6pkqZoTouwLRaAfCTueUTyZRHMCbB\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"5a1104a6f7094b070fe9b286204903e05c0982124436d9d68d8f3de26993033d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"5a1104a6f7094b070fe9b286204903e05c0982124436d9d68d8f3de26993033d\"\n }\n}"
}
]
},
@@ -1250,14 +1250,14 @@
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel create @channel 1.0",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ca8922cd1c37b7d77e41a53a11b7cb791defa2a4eecfc6ba3cfef78d7d2f6c03010000006b48304502210094ac6bbd1833b430dadb4f835843e8895d7420cb0c8146ac3037f55b0b668ebc02202a178a2c108fef944f28b71fc71c1f8f76403bcfec8a208a41361a809be333b5012103335f36c7b695d71f35a4345aa590f2b3f1efaec93eda106a6fcf083a89877a85ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d6d7576a9149fcb81549737993f898614438f3dcddefe43ba5388acc462a029000000001976a914cc111fc1cabd8cda886b054333a7239bf339ab5188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzjBXvqaeQQUHpxocqhqtdRStrmpW4Ho45\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": null,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mz7xezDeGSCCwsT1RAV6VSnZvx1Y48GWBz\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001a2a08aed2135620a6c05793822961a98dc9cccb41eb629d6865dc29b2dccf0d0010000006b483045022100c5400dc6883d3a4bbc7856ce2398ce65cb1f3c78c7656898c5dc50a1e2becf2702206d1544c74b380cb5b5e2bbdabe19c15e9115f2cea5566eb9defba3a6b0f196fd012103755009dd0af23759ad72b338313e1f9635070afebd056af92a62a4f6cb5b0353ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b866d7576a91433ad5a86909d2aeb60f6bb427cfaf9acfd51078e88acc462a029000000001976a9143941a8e680e7196066423b400ac8edd4549c35de88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mjRVJULUCxB7s3guxUriGqN5C7RFj6Fsxh\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"nout\": 1,\n \"timestamp\": 1621405355,\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": null,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mkjhU7Go11ZuCbGEp6edSr4At5CBDW23xH\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\"\n }\n}"
},
{
"title": "Create a channel claim with all metadata",
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel create @bigchannel 1.0 --title=\"Big Channel\" --description=\"A channel with lots of videos.\" --email=\"creator@smallmedia.com\" --tags=music --tags=art --languages=pt-BR --languages=uk --locations=BR --locations=UA::Kiyv --website_url=\"http://smallmedia.com\" --thumbnail_url=\"http://smallmedia.com/logo.jpg\" --cover_url=\"http://smallmedia.com/logo.jpg\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000123097a98778ac14275b0c3b444748a09911c5c44ea2d11c4b507c36f74a7cb7d010000006b483045022100c4562df8bef779b2f494ef275f2dff0e6b5034e1b1b354fa4aadd0999c50633c0220671886610ed3b99c1e78836b1696ae39150a8a680e7ecbc2e6b72cce95ad25790121025a25bd09226e9bfd30e70205841bbe4588502ced799970bcfc5c32b19f10710affffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000403a4c9063ae880abb9e7a4f2b0f31b33aa0f2eb00432d0fc3dc6263a0cc4f03f4e8762f2b0549d6e433e28754ff9b9aa86f66fc4779d8ad4392430ea18e86e23121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914755f01af82d2a8dd32fc3dfde402e9ecb6b8107588ace221d305000000001976a9148f28c757d1d8d84faa35f1af1c1c3c52bc1efba288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mh5rVtpeDVSih7YixfMP6SQoQ8re4iy8gX\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mrDZAfto9XzQP3SjvshVZL4vcsTfSXvLje\",\n \"amount\": \"1.0\",\n \"claim_id\": \"87d1232c6284d36467b41ebe8c8b3d2dfdce01ce\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#87d1232c6284d36467b41ebe8c8b3d2dfdce01ce\",\n \"timestamp\": null,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\n \"type\": \"claim\",\n \"value\": {\n \"cover\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"description\": \"A channel with lots of videos.\",\n \"email\": \"creator@smallmedia.com\",\n \"languages\": [\n \"pt-BR\",\n \"uk\"\n ],\n \"locations\": [\n {\n \"country\": \"BR\"\n },\n {\n \"city\": \"Kiyv\",\n \"country\": \"UA\"\n }\n ],\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000403a4c9063ae880abb9e7a4f2b0f31b33aa0f2eb00432d0fc3dc6263a0cc4f03f4e8762f2b0549d6e433e28754ff9b9aa86f66fc4779d8ad4392430ea18e86e23\",\n \"public_key_id\": \"mizH8bDDSiitsoUdZc4wycocXccrY3j4Vi\",\n \"tags\": [\n \"music\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"title\": \"Big Channel\",\n \"website_url\": \"http://smallmedia.com\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mtZumqabuzJQ9UMvtN5a58XCcrBBCPL1BD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\"\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001942c37d36793290feb0e2ab637e6da02b1eea67d85a872dff83c8b0c19a322ff010000006b483045022100f3ffa25ac1f85a5401eab38c796a4bce7af42d230142617634731f22256662f102207373f746f06fefe1b8998dae433b8aa01816c388d1ffb2c03ba0cab67cc9cbe8012103f10e8cfbe3f83dfa4ac39c22d5bf47b3bbfa96c7a43ab951c0480b9956bf86dcffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004cd1aec7a333657cd8e881fd07817e7ddf71edee513a954bc118608348a94945066d352a9397937944db8ae9f30c87d937a200ad5e9c549a306fe542d618def4d121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9144db8fdeee2015a424c5ba86fa68b7261bd8c33d088ace221d305000000001976a914a03ab95f4d7565fff8a76ff10859fb5fc0572f7f88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mxfwopyUuJxZQZXA7HvmGQXk9jVMLC97gr\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"nout\": 1,\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnbuwHjbMJRqWHMhqzo2Co8QvMLfA7RPzL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"d877c978e04ff30ccbd8133ca07116064430f4eb\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#d877c978e04ff30ccbd8133ca07116064430f4eb\",\n \"timestamp\": null,\n \"txid\": \"2441d3f16fd54914ff30dc89c1ec086eb30d05f7252df041d4f2fb09a5f1a453\",\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\": \"3056301006072a8648ce3d020106052b8104000a03420004cd1aec7a333657cd8e881fd07817e7ddf71edee513a954bc118608348a94945066d352a9397937944db8ae9f30c87d937a200ad5e9c549a306fe542d618def4d\",\n \"public_key_id\": \"mwHUnTRHRMZRvQUK8h15HihHQ5Ujz3mybi\",\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\": \"mv8AkyC2tGywD9ARYqEkznnjM7gs8LG17A\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"2441d3f16fd54914ff30dc89c1ec086eb30d05f7252df041d4f2fb09a5f1a453\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"2441d3f16fd54914ff30dc89c1ec086eb30d05f7252df041d4f2fb09a5f1a453\"\n }\n}"
}
]
},
@@ -1379,14 +1379,14 @@
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your channel claims",
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -1581,10 +1581,10 @@
"examples": [
{
"title": "Update a channel claim",
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 5c15c266bf34c683523ce06cfb7fe5c984221375 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000020d9532306586cdcb59cc30c6bcc8ed810faf1d38e2b01e06a720ce34b203f93d000000006a473044022025740699e7c92648b58019fd6b1d7a78285195bfafeb115f4b5a5e485d1df4de02203f8fc26159454b07e5580ff0b9be8ba8f9aecfd5b1573c00b707b41193b8e1980121032c31a47c0f8bc4a0c8565f56f796f3cca09b86524b74dea8c16715240134ab1fffffffffeed7f31a5c0b04a61481a56e0cc1c71c1fa5f898cabd52efef6ac1445b26057f000000006b483045022100d26d8fa7ff5e1be2f486278c059a6e6c3fb9a002ff14059cd0aa96d3a34e48880220108d5900346d266eae1a6091e0d6e34de4a9f18bdbdced164450a98c5fc975920121035e9a676a6c96274e2da7647804cf7f567df88f4db16aea223caf0d201526df65ffffffff0200e1f50500000000a6b708406368616e6e656c1475132284c9e57ffb6ce03c5283c634bf66c2155c4c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d420b4e6577204368616e6e656c6d6d76a9149fcb81549737993f898614438f3dcddefe43ba5388ac6ebeea0b000000001976a914113103aeb6cd62f58efa54a0d0b51dba991e49c888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mgNFotMcVkNSmVwGpZHi6dACpVsMKBgFZB\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"nout\": 0,\n \"timestamp\": 1619186594,\n \"txid\": \"7f05265b44c16aefef52bdca98f8a51f1cc7c10c6ea58114a6040b5c1af3d7ee\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": null,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mh5rVtpeDVSih7YixfMP6SQoQ8re4iy8gX\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\"\n }\n}"
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet channel update 20ccc609603f9c6f01d74f2d6a133867d2903fc2 --title=\"New Channel\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002bb384e08ba07d2a2881a4b7bbaca52623e4e9b4802750411a0e0eba84d960aeb000000006b483045022100f86030e4a9e901fcfd8ac8b89d7341ae03f9ef73a7019c282ffedcc6f4c24e0502206e6f7ad8b6eff9b6ea13f6ac1866af80d5ab132a4bad19a9afd8ad407c268ef001210353931cc595ec3293186c7f9d63a8e1b8aecc5cc4fd0e010092d2b40483213902fffffffff5b85f1547c5ec0ed1940d5fe14da6d48f86948c2a5dd1bc4abbfa103d080dac000000006b483045022100816dd9784eb76b97ed127984f5d42b19a8368de3d5a7ef79733500662cb28c39022025f20e6d5820987af30253bd8002940e54e177b1ee188e0422cb939e6fc90af701210211196ea4ea6217ea95455ee10e84bb9d5fc615e7b7e852a1a34e04acb50b108dffffffff0200e1f50500000000a6b708406368616e6e656c14c23f90d26738136a2d4fd7016f9c3f6009c6cc204c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86420b4e6577204368616e6e656c6d6d76a91433ad5a86909d2aeb60f6bb427cfaf9acfd51078e88ac6ebeea0b000000001976a914bc2d79ca1969aceba4290c8f8f04677062d2376b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"ms6EPFDDfSb3gVMgyBZ5drGuYH9uqvvmPq\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"nout\": 0,\n \"timestamp\": 1621405355,\n \"txid\": \"ac0d083d10fabb4abcd15d2a8c94868fd4a64de15f0d94d10eecc547155fb8f5\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": null,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mxfwopyUuJxZQZXA7HvmGQXk9jVMLC97gr\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\"\n }\n}"
}
]
}
@@ -1695,14 +1695,14 @@
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your claims",
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"claim_type\": [], \"claim_id\": [], \"name\": [], \"is_spent\": false, \"channel_id\": [], \"has_source\": false, \"has_no_source\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false, \"include_received_tips\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -2028,6 +2028,12 @@
"description": "lookup and include a boolean indicating if claim being resolved is yours",
"is_required": false
},
{
"name": "remove_duplicates",
"type": "bool",
"description": "removes duplicated content from search by picking either the original claim or the oldest matching repost",
"is_required": false
},
{
"name": "has_source",
"type": "bool",
@@ -2051,17 +2057,17 @@
"examples": [
{
"title": "Search for all claims in channel",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"remove_duplicates\": false, \"has_source\": false, \"has_no_source\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --channel=@channel",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"remove_duplicates\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2/astream#e\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1621405356,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"short_url\": \"lbry://astream#e\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1621405355,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"short_url\": \"lbry://@channel#2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Search for claims matching a name",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}' http://localhost:5279/",
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"remove_duplicates\": false, \"has_source\": false, \"has_no_source\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet claim search --name=\"astream\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": [], \"no_totals\": false, \"include_purchase_receipt\": false, \"include_is_my_output\": false, \"remove_duplicates\": false, \"has_source\": false, \"has_no_source\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": [],\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2/astream#e\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1621405356,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"short_url\": \"lbry://astream#e\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1621405355,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"short_url\": \"lbry://@channel#2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
}
@@ -2249,10 +2255,10 @@
"examples": [
{
"title": "Create a collection of one stream",
"curl": "curl -d'{\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet collection create --name=tom --bid=1.0 --channel_id=5c15c266bf34c683523ce06cfb7fe5c984221375 --claims=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001daef8df5dd59c4ef2e5b64332013dabc2ef12ba695cbe481e6cf15211fdd1bfd010000006a47304402204aa8d205ac5000d87b6c4040cb20efb23a97d6f7d590ab4f96c2b32c4214f3f8022074f7e20dc877e683fce13b8fddb84dd3083093b014b8ad0b02aa6a4557f57c2c012102bbf7a3d450aede8d5f60a6889a8e1b66e5f22d7079944623d779d19e2b270973ffffffff0200e1f5050000000091b503746f6d4c6f0175132284c9e57ffb6ce03c5283c634bf66c2155c256e3b7258258dac89ac426b7e6634a8ce11544475ef77194abd183a9de6bb75539bfa416b69f85e5191fca61dfabaac8766ba96f47718d7ab581e06344b26ef1a1812160a149d4935f781af62d81034a194560fabc96b3ad0bc6d7576a91442d128bf839fcc82c9596282d0cdd3bcd5170ee588ac202c7e17000000001976a914d47a9b5eb4d22ce83b0717df98b9022ecd15f36488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mqsLA2uT7pBfhzPBEQPrXiHtXpMtys7jRb\",\n \"amount\": \"4.947555\",\n \"confirmations\": 2,\n \"height\": 215,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"fd1bdd1f2115cfe681e4cb95a62bf12ebcda132033645b2eefc459ddf58defda\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmcFTMBvn5a1YdH1hWZaQzYbXY8n1ULESS\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"tom\",\n \"normalized_name\": \"tom\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://tom#1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"claim\",\n \"value\": {\n \"claims\": [\n \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"\n ]\n },\n \"value_type\": \"collection\"\n },\n {\n \"address\": \"mztSRbjwzK9k7BUDXWybL8ZJs2KYQAq6hP\",\n \"amount\": \"3.941448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.006107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.941448\",\n \"txid\": \"4531b67fa1b3e343e0db9fd88d2ed46953313a9a50bf11f2cd62f33f108ab02b\"\n }\n}"
"curl": "curl -d'{\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"ea41b9f807c6982cf97a1178838dfef64feaa014\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet collection create --name=tom --bid=1.0 --channel_id=20ccc609603f9c6f01d74f2d6a133867d2903fc2 --claims=ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"collection_create\", \"params\": {\"name\": \"tom\", \"bid\": \"1.0\", \"claims\": [\"ea41b9f807c6982cf97a1178838dfef64feaa014\"], \"allow_duplicate_name\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000011552a7efeb31dafb72d77acd8dff177d3ab93525ed1b9abde9997412348ae34f010000006b483045022100ec009f539259e608e0a876beb86bfc7cc5439b8d0fe09188ec5711cda2f49e5902207a58d4af049513c5ccd6f1bdd24bc0d7e16f823027e436523f8bb939a69fc530012102b9174bcb2bb1f01a1c17be57386fdb7922f5cabfdeccb0318611ecbc554337cbffffffff0200e1f5050000000091b503746f6d4c6f01c23f90d26738136a2d4fd7016f9c3f6009c6cc20ab977ae13013c5115619502f2a730af6fd385eb74fd78cd7d3df1c0d01d32002e25f9bdfbd15db7a8bd557ffdcdacf475204b1f6df7de65ef174c1a0a43232b01a1812160a1414a0ea4ff6fe8d8378117af92c98c607f8b941ea6d7576a914f27bcbde9870d0d372378d0e2f33bbb92ce0194588ac202c7e17000000001976a91410011067a2603a2f53b941403aec639db140561488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1V4V9jbac2vgqPKghf7uCw9AJ51unJhfd\",\n \"amount\": \"4.947555\",\n \"confirmations\": 2,\n \"height\": 215,\n \"nout\": 1,\n \"timestamp\": 1621405356,\n \"txid\": \"4fe38a34127499e9bd9a1bed2535b93a7d17ff8dcd7ad772fbda31ebefa75215\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3d67zugu7tXuuBLhAajnSt56j9Yv2yQ2w\",\n \"amount\": \"1.0\",\n \"claim_id\": \"e60f8f8c2252950c925a4bbb0efa4165aa7a0055\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"tom\",\n \"normalized_name\": \"tom\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://tom#e60f8f8c2252950c925a4bbb0efa4165aa7a0055\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"abf38341355905c1a84f387cd6d12c9c6ff5d63186fec3afda4aafb2c2eb415f\",\n \"type\": \"claim\",\n \"value\": {\n \"claims\": [\n \"ea41b9f807c6982cf97a1178838dfef64feaa014\"\n ]\n },\n \"value_type\": \"collection\"\n },\n {\n \"address\": \"mgyaP4FvA3DLPfatc7bfJS8a62c2AHQZH1\",\n \"amount\": \"3.941448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"abf38341355905c1a84f387cd6d12c9c6ff5d63186fec3afda4aafb2c2eb415f\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.006107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.941448\",\n \"txid\": \"abf38341355905c1a84f387cd6d12c9c6ff5d63186fec3afda4aafb2c2eb415f\"\n }\n}"
}
]
},
@@ -2304,7 +2310,7 @@
"curl": "curl -d'{\"method\": \"collection_list\", \"params\": {\"resolve_claims\": 1, \"resolve\": true}}' http://localhost:5279/",
"lbrynet": "lbrynet collection list --resolve --resolve_claims=1",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"collection_list\", \"params\": {\"resolve_claims\": 1, \"resolve\": true}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmcFTMBvn5a1YdH1hWZaQzYbXY8n1ULESS\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/tom#1\",\n \"claim_id\": \"1ce582bac00e1fc80e05e2f2357adf2f2b4673c6\",\n \"claim_op\": \"create\",\n \"claims\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5/astream#b\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#5\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1619186594,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"short_url\": \"lbry://@channel#5\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"confirmations\": 1,\n \"height\": 217,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 217,\n \"creation_height\": 217,\n \"creation_timestamp\": 1619186595,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263191,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 217,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\"Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"n3d67zugu7tXuuBLhAajnSt56j9Yv2yQ2w\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2/tom#e\",\n \"claim_id\": \"e60f8f8c2252950c925a4bbb0efa4165aa7a0055\",\n \"claim_op\": \"create\",\n \"claims\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2/astream#e\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1621405356,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"short_url\": \"lbry://astream#e\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#2\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1621405355,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"short_url\": \"lbry://@channel#2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"confirmations\": 1,\n \"height\": 217,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 217,\n \"creation_height\": 217,\n \"creation_timestamp\": 1621405356,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263191,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 217,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\"Line truncated
}
]
},
@@ -2500,10 +2506,10 @@
"examples": [
{
"title": "Abandon a comment",
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment abandon 5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\": {\n \"abandoned\": true\n }\n }\n}"
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment abandon 137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\": {\n \"abandoned\": true\n }\n }\n}"
}
]
},
@@ -2558,17 +2564,17 @@
"examples": [
{
"title": "Posting a comment as your channel",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"371cc84d6d2d487592d1483a4d915b793ced4d6ed843402f958e1aeb22325b977b88a41ac0b1d87094634ade2e68a305bda7a3521139f4c5c6ea7b9167afa1d9\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n }\n}"
},
{
"title": "Use the parent_id param to make replies",
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"I have photographic evidence confirming Sasquatch exists\" --channel_name=@channel --parent_id=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030 --claim_id=bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
"lbrynet": "lbrynet comment create --comment=\"I have photographic evidence confirming Sasquatch exists\" --channel_name=@channel --parent_id=137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d --claim_id=ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"168b09f4067231cd5fd065f2ac466a12af98a44477a9a7d68513ef0a26856c6e26fea4bceb6c8c4b182c4bec7d6a316a0d1ed19455123c701806816c317ee417\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"signature\": \"df5b9417c995e7d1e5864074d7f759b7b0053847cc2a4d741e130d67f029a8fa729e2ef188babc4dfb604474657afceb3a5c4be2de50063cc1a9c71472f76240\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n }\n}"
}
]
},
@@ -2655,17 +2661,17 @@
"examples": [
{
"title": "List all comments on a claim",
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list bcd03a6bc9ab0f5694a13410d862af81f735499d --include_replies",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n },\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list ea41b9f807c6982cf97a1178838dfef64feaa014 --include_replies",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"include_replies\": true, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"168b09f4067231cd5fd065f2ac466a12af98a44477a9a7d68513ef0a26856c6e26fea4bceb6c8c4b182c4bec7d6a316a0d1ed19455123c701806816c317ee417\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"signature\": \"df5b9417c995e7d1e5864074d7f759b7b0053847cc2a4d741e130d67f029a8fa729e2ef188babc4dfb604474657afceb3a5c4be2de50063cc1a9c71472f76240\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n },\n {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"371cc84d6d2d487592d1483a4d915b793ced4d6ed843402f958e1aeb22325b977b88a41ac0b1d87094634ade2e68a305bda7a3521139f4c5c6ea7b9167afa1d9\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "List a comment thread replying to a top level comment",
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list bcd03a6bc9ab0f5694a13410d862af81f735499d --parent_id=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"44906b7921edca7d32b3dbfd092adc9a33cd14ab0e87ba5b8be0ccc45dd3a89bd6c294118ca81278bc20269d9c0aca27f6c7b9126e6ad0d97eb64df89ecc91cf\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"signature\": \"775f999681b9b20f7eb9f60a72ce64e63b2cb552fb25c2eabdfafd35d7bef13ae2d51ab35debfe84411b110bd09a4a8104bd191fb2bfa1eedb6e882fa484af4a\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n },\n {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"cb6d31df7a9e7bb181cc3fec3843eb90e7e7ccd8d7afd8a718ef9be602135d574ff3e39246b84663c057b7146035df7efe54fbbe3b3d18be2b6e8c3317d98de4\",\n \"signing_ts\": \"1619186572\",\n \"timestamp\": \"1619186572\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet comment list ea41b9f807c6982cf97a1178838dfef64feaa014 --parent_id=137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\", \"include_replies\": false, \"skip_validation\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"168b09f4067231cd5fd065f2ac466a12af98a44477a9a7d68513ef0a26856c6e26fea4bceb6c8c4b182c4bec7d6a316a0d1ed19455123c701806816c317ee417\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"signature\": \"df5b9417c995e7d1e5864074d7f759b7b0053847cc2a4d741e130d67f029a8fa729e2ef188babc4dfb604474657afceb3a5c4be2de50063cc1a9c71472f76240\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n },\n {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"signature\": \"371cc84d6d2d487592d1483a4d915b793ced4d6ed843402f958e1aeb22325b977b88a41ac0b1d87094634ade2e68a305bda7a3521139f4c5c6ea7b9167afa1d9\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -2834,10 +2840,10 @@
"examples": [
{
"title": "Edit the contents of a comment",
"curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"comment\": \"Where there was once sasquatch, there is not\",\n \"comment_id\": \"5fc8a6d6a65cf68be2bab52f65762eb3c7855570d01754ffb4543eff988d97c6230740cf2e541ca07f31bb6b79e5d01b32d077ec63a6b193d16b8bbf05423030\",\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": null,\n \"signature\": \"b37359c9301ab871acf14a0327b6151b89f639c2490134006687bcee4bd4c627b25ce2a520973a769cd32fa3cbbe43323ce23a9a1141dc768c992d146c5ca1d1\",\n \"signing_ts\": \"1619186573\",\n \"timestamp\": \"1619186572\"\n }\n}"
"curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"comment\": \"Where there was once sasquatch, there is not\",\n \"comment_id\": \"137a4cd974dcc1f2c733e77391557208c46c53645147898f2bda5e96b42729d5201f421a588682e93cb976407280830cef5ec79860a1508391437095cbb3963d\",\n \"is_hidden\": false,\n \"is_pinned\": false,\n \"parent_id\": null,\n \"signature\": \"56408942b909552d7636cee888f3b964cb3aafd5fed90bca5a24a87e821dd9d808e37c57d4b25a956661b6e91472e8ae7d937ae4ab1c64b88162185fd755e536\",\n \"signing_ts\": \"1621405333\",\n \"timestamp\": \"1621405333\"\n }\n}"
}
]
}
@@ -2927,9 +2933,9 @@
"examples": [
{
"title": "Delete a file",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\"}}).json()",
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file delete --claim_id=\"ea41b9f807c6982cf97a1178838dfef64feaa014\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
}
]
@@ -3090,14 +3096,14 @@
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"is_fully_reflected\": true,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 0\n },\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"30a49013449a01baf6c5a15adca029bbd3cb8487\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"is_fully_reflected\": true,\n \"key\": \"0ac74e9ad025a7b43c7088801dbcad53\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1619186570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpie38oo39.png\",\n \"sd_hash\": \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Line truncated
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"is_fully_reflected\": true,\n \"key\": \"1331d793facb0a628aa3416c5f1b2c59\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c23f90d26738136a2d4fd7016f9c3f6009c6cc2097c286c8bea94843a4f2796781afd1797a19737f2ae770022e06b623fedaea0a9654fc9e098271a9c186889d14e0bab2cc75cd36b1e67efe284d06467438d0ed0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"aacc5131b8a53b4254185d476dc6fcd254ab08945416c68bdfd09571c660e58862e813b90fe4f6cf1f6d85633268b385\",\n \"stream_name\": \"tmpvccpjv29\",\n \"streaming_url\": \"http://localhost:5280/stream/54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"suggested_file_name\": \"tmpvccpjv29\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 0\n },\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"6cd66398c40603947d6e34122d82b782dac24424\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"is_fully_reflected\": true,\n \"key\": \"f6a644c1b23e5f9eccc1c1aa7a348a79\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mmqinVr6k9tg4Ndah8rU8euHavqDgPiBi4\",\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\": \"1621405331\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpeu6brs_o.png\",\n \"sd_hash\": \"c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Line truncated
},
{
"title": "List files matching a parameter",
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"bcd03a6bc9ab0f5694a13410d862af81f735499d\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"is_fully_reflected\": true,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"reverse\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet file list --claim_id=\"ea41b9f807c6982cf97a1178838dfef64feaa014\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"reverse\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"is_fully_reflected\": true,\n \"key\": \"1331d793facb0a628aa3416c5f1b2c59\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c23f90d26738136a2d4fd7016f9c3f6009c6cc2097c286c8bea94843a4f2796781afd1797a19737f2ae770022e06b623fedaea0a9654fc9e098271a9c186889d14e0bab2cc75cd36b1e67efe284d06467438d0ed0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 100,\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"aacc5131b8a53b4254185d476dc6fcd254ab08945416c68bdfd09571c660e58862e813b90fe4f6cf1f6d85633268b385\",\n \"stream_name\": \"tmpvccpjv29\",\n \"streaming_url\": \"http://localhost:5280/stream/54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"suggested_file_name\": \"tmpvccpjv29\",\n \"timestamp\": 1621405356,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -3214,10 +3220,10 @@
"examples": [
{
"title": "Save a file to the downloads directory",
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1619186574,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp3yjc8ttn\",\n \"download_path\": \"/tmp/tmp3yjc8ttn/tmp12xihy6s_1\",\n \"file_name\": \"tmp12xihy6s_1\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"6153d7a516ff43d69f858f7353fc9a39\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"5811a98af0070bbe1d55e78b9eccf809c0b3e334b0f4daf8b5832b0f2361e6940547f97da8768a8663a35607460d814a\",\n \"stream_name\": \"tmp12xihy6s\",\n \"streaming_url\": \"http://localhost:5280/stream/f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"suggested_file_name\": \"tmp12xihy6s\",\n \"timestamp\": 1619186595,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\"}}' http://localhost:5279/",
"lbrynet": "lbrynet file save --sd_hash=\"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\"}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1621405335,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 4,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp5s0wcgsl\",\n \"download_path\": \"/tmp/tmp5s0wcgsl/tmpvccpjv29_1\",\n \"file_name\": \"tmpvccpjv29_1\",\n \"height\": 214,\n \"is_fully_reflected\": false,\n \"key\": \"1331d793facb0a628aa3416c5f1b2c59\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c23f90d26738136a2d4fd7016f9c3f6009c6cc2097c286c8bea94843a4f2796781afd1797a19737f2ae770022e06b623fedaea0a9654fc9e098271a9c186889d14e0bab2cc75cd36b1e67efe284d06467438d0ed0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"purchase_receipt\": null,\n \"reflector_progress\": 0,\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"aacc5131b8a53b4254185d476dc6fcd254ab08945416c68bdfd09571c660e58862e813b90fe4f6cf1f6d85633268b385\",\n \"stream_name\": \"tmpvccpjv29\",\n \"streaming_url\": \"http://localhost:5280/stream/54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"suggested_file_name\": \"tmpvccpjv29\",\n \"timestamp\": 1621405356,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"uploading_to_reflector\": false,\n \"written_bytes\": 11\n }\n}"
}
]
},
@@ -3498,7 +3504,7 @@
"curl": "curl -d'{\"method\": \"settings_get\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet settings get",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"settings_get\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"allowed_origin\": \"\",\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 160k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"http://localhost:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmp3yjc8ttn\",\n \"download_dir\": \"/tmp/tmp3yjc8ttn\",\n \"download_timeout\": 30.0,\n \"ffmpeg_path\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"fixed_peers\": [\n [\n \"127.0.0.1\",\n 5567\n ]\n ],\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"max_wallet_server_fee\": \"0.0\",\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"prometheus_port\": 0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"save_blobs\": true,\n \"save_files\": true,\n \"save_resolved_claims\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"transaction_cache_size\": 10000,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_bitrate_maximum\": 5000000,\n \"video_encoder\": \"libx264 -crf 24 -preset faster -pix_fmt yuv420p\",\n \"video_scaler\": \"-vf \\\"scale=if(gte(iw\\\\,ih)\\\\,min(1920\\\\,iw)\\\\,-2):if(lt(iw\\\\,ih)\\\\,min(1920\\\\,ih)\\\\,-2)\\\" -maxrate 5500K -bufsize 5000K\",\n \"volume_analysis_time\": 240,\n \"volume_filter\": \"\",\n \"wallet_dir\": \"/tmp/tmp3yjc8ttn\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"allowed_origin\": \"\",\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 160k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"http://localhost:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\",\n \"libtorrent_component\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/user/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmp5s0wcgsl\",\n \"download_dir\": \"/tmp/tmp5s0wcgsl\",\n \"download_timeout\": 30.0,\n \"ffmpeg_path\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"fixed_peers\": [\n [\n \"127.0.0.1\",\n 5567\n ]\n ],\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"max_wallet_server_fee\": \"0.0\",\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"prometheus_port\": 0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"save_blobs\": true,\n \"save_files\": true,\n \"save_resolved_claims\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"transaction_cache_size\": 10000,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_bitrate_maximum\": 5000000,\n \"video_encoder\": \"libx264 -crf 24 -preset faster -pix_fmt yuv420p\",\n \"video_scaler\": \"-vf \\\"scale=if(gte(iw\\\\,ih)\\\\,min(1920\\\\,iw)\\\\,-2):if(lt(iw\\\\,ih)\\\\,min(1920\\\\,ih)\\\\,-2)\\\" -maxrate 5500K -bufsize 5000K\",\n \"volume_analysis_time\": 240,\n \"volume_filter\": \"\",\n \"wallet_dir\": \"/tmp/tmp5s0wcgsl\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
}
]
},
@@ -3573,10 +3579,10 @@
"examples": [
{
"title": "Abandon a stream claim",
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon bcd03a6bc9ab0f5694a13410d862af81f735499d",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000137bea49efcbfa290749f4df97b298fde15e94a91f7074db0c5824ee871d29a7b000000006a47304402203412da1fa2b96cc1191e36deab1bad5e822ec9cb4f88e9267632e87dd5dd4bf7022031daa32521dcf4f69d0ba71261dd33f7e97fbfe0f3dfa29eb9704f0c8e94bab6012103a0f9331ba7bb5ec620354ccaf4579e1195929316a8a03269f0389e6aa40e103dffffffff0134b7f505000000001976a9148ce9b7e1af3519b3ac3d6fc6dd79e8b2fb82f2a688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtN2swZj3Wynoe9L6R82xxk7xaTWs5N6kb\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"6021f8bfa24e637732164e17f2272ced687f4b1256a9cc6ff5715bda6a71e42c\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"6021f8bfa24e637732164e17f2272ced687f4b1256a9cc6ff5715bda6a71e42c\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream abandon ea41b9f807c6982cf97a1178838dfef64feaa014",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012b02e035e15a2d7b0ad580c13855b399916881dfb62f7739f34773cd4e07eb08000000006a47304402201f154b1ed0e658ed7cecd5eacde667fa53e6da238599c9e617676f78964c0b24022061a30c3d58ce2bab5ec15be078a1a01786d00e9b8fd08a9ae02c57b7b2266f4c0121030bb5d283d077a4d93a13dd43f6ab8886f8f2d39b3e4936fdb1f79baa95bbf19effffffff0134b7f505000000001976a9144eb00af05527118271650a5c534844db57da987e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"height\": 214,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnh1tgQ4wJwbPpNLh2iCSTpBm1Hp1xDTsT\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"cc04061078010a27c416a485b97fb61db50e49703b91a353fa03464a2ac7e264\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"cc04061078010a27c416a485b97fb61db50e49703b91a353fa03464a2ac7e264\"\n }\n}"
}
]
},
@@ -3807,17 +3813,17 @@
"examples": [
{
"title": "Create a stream claim without metadata",
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp12xihy6s\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmp12xihy6s",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp12xihy6s\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000010d9532306586cdcb59cc30c6bcc8ed810faf1d38e2b01e06a720ce34b203f93d010000006b483045022100b3aec529900a8019a269482d77b7da0cd65170365839702814db3e724b93f0b50220298b277f4c06ca9f1192523284880f73e4ef67b30b3a266efa7dc94e538a1fb5012103784172862f04b1e6c2c6973ad24461b7f1a5afb65814b7d3eefb434c7dad0792ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea6d7576a91445207a9e9642daffd510f3394e2275ffecb3dfa288ac38fb9423000000001976a914e17fa7172490e99ae32889b75416ab97a7934c9b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mz7xezDeGSCCwsT1RAV6VSnZvx1Y48GWBz\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"3df903b234ce20a7061eb0e2381daf0f81edc8bcc630cc59cbcd86653032950d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": null,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n25HFgSFcDw1unkj8wTi2tVq6LB3hpd3DX\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\"\n }\n}"
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpvccpjv29\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmpvccpjv29",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpvccpjv29\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001bb384e08ba07d2a2881a4b7bbaca52623e4e9b4802750411a0e0eba84d960aeb010000006b483045022100ee034d690c385f87e52db7a7c5ecec41c0f5d8eda08332778d9a674046583d7a02207ec24358481bf0c81d2a32fc9e1716e145eda810553d1d814b7c93a968468a49012102c21142e983b9c10d17cd922818fefd1a34f34a708849811a41c25ad13835320fffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb76d7576a9141fcba83c5371c31a24cb491e9d74db9e397784af88ac38fb9423000000001976a914ebc5945ded112d0f109cfdc3d985668de7b27ada88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkjhU7Go11ZuCbGEp6edSr4At5CBDW23xH\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"nout\": 1,\n \"timestamp\": 1621405355,\n \"txid\": \"eb0a964da8ebe0a011047502489b4e3e6252caba7b4b1a88a2d207ba084e38bb\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"timestamp\": null,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n31bnChc7o13i4LjY3GMtdhEJoAqdsMb7w\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\"\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/tmpie38oo39.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1619186570, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpie38oo39.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title=\"Blank Image\" --description=\"A blank PNG that is 5x7.\" --author=Picaso --license=\"Public Domain\" --license_url=http://public-domain.org --thumbnail_url=\"http://smallmedia.com/thumbnail.jpg\" --release_time=1619186570 --channel_id=\"5c15c266bf34c683523ce06cfb7fe5c984221375\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpie38oo39.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1619186570, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001badbf685df67ec9d66f01be500d92b417ea1871625ed0c3fbd4353530a829ff7010000006b4830450221009e4c32407bee4da0c778760a72b2bf7886304a7353791b46f1c988c2b1af1b8b0220135bb6146bf859fa673047c369ed69b0ea8afda19bbf966e4f3bc6e634eada4d0121030e089bbbe50c6d7ccd1fed871a8a122110790d52807de6ca8c62c62a1132160cffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db1010175132284c9e57ffb6ce03c5283c634bf66c2155c6a58b698a1aa43f0e8a6c902011194d0f2e3f1ac4fe0cab54c3d690845f73bfcaeff030384ab3ba2372a57e58daf5579d0a39eb55964fae5a823c3e5e69b357b0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d70696533386f6f33392e706e6718632209696d6167652f706e67323066615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f7267288aa78b84063222080112196f1ccf2a77c401281744e1ee1b91bb59fde2b1982051d1686f188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9141ccf2a77c401281744e1ee1b91bb59fde2b1982088acac5e7d1d000000001976a914718bd3897a6f10f3e7ef8dd0521654677826a57b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n25HFgSFcDw1unkj8wTi2tVq6LB3hpd3DX\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"nout\": 1,\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\n \"amount\": \"1.0\",\n \"claim_id\": \"30a49013449a01baf6c5a15adca029bbd3cb8487\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"blank-image\",\n \"normalized_name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#30a49013449a01baf6c5a15adca029bbd3cb8487\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"fd1bdd1f2115cfe681e4cb95a62bf12ebcda132033645b2eefc459ddf58defda\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mi9HPZePTMpu83NpAQwTqJkfPbSgLZhFPU\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1619186570\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpie38oo39.png\",\n \"sd_hash\": \"66615b1c95f4f88df25f1f1a243ec7129d283a6df60a21640a3022f686d2d89f0a5b0757aaeb885d7ac06febe8d07a04\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thuLine truncated
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpeu6brs_o.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1621405331, \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpeu6brs_o.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=1621405331 --channel_id=\"20ccc609603f9c6f01d74f2d6a133867d2903fc2\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpeu6brs_o.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1621405331, \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015983dbfa63b6de2131f250c8aa08c81fa1c2b75c8614bbc8ed7efcd09f4a37e4010000006b4830450221008fec0f41696f6bdc859e471a60f9f2598c721a197ab106ae24596d999a554542022045a2176cb13e5417bff7299505e382c66a9754d2540915f317b9d1c1a0a73545012102dab800fee684fddb84ce0ae74c3455b38fcb855ae038c60d272a07dbe40dac62ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101c23f90d26738136a2d4fd7016f9c3f6009c6cc20bc86cfc6d27ece4853069056b8995fc7369b9cad50c37d389390d868d7fa8f475b261f7dee284dcd39e29e3c9806cd02b68fd18869ad3c91d16889ef3ab4fdc30ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706575366272735f6f2e706e6718632209696d6167652f706e673230c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f72672893dd9285063222080112196f455d617873267c515540aeb9dc52903fafa112917f28c9dd188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914455d617873267c515540aeb9dc52903fafa1129188acac5e7d1d000000001976a914db06da1dd2cf5d45e1870016719db223fb230e5988ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n31bnChc7o13i4LjY3GMtdhEJoAqdsMb7w\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"nout\": 1,\n \"timestamp\": 1621405356,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmqinVr6k9tg4Ndah8rU8euHavqDgPiBi4\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6cd66398c40603947d6e34122d82b782dac24424\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"blank-image\",\n \"normalized_name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#6cd66398c40603947d6e34122d82b782dac24424\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"4fe38a34127499e9bd9a1bed2535b93a7d17ff8dcd7ad772fbda31ebefa75215\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mmqinVr6k9tg4Ndah8rU8euHavqDgPiBi4\",\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\": \"1621405331\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpeu6brs_o.png\",\n \"sd_hash\": \"c279adc5346f64aaa7135c83b6170ff7f2efdbbb76efc6ef6a346a07b505fe1860b6ad82b837c161b92bfe1e01907ee7\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thuLine truncated
}
]
},
@@ -3887,14 +3893,14 @@
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"timestamp\": 1621405356,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
},
{
"title": "Paginate your stream claims",
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"name\": [], \"claim_id\": [], \"is_spent\": false, \"page\": 1, \"page_size\": 20, \"resolve\": false, \"no_totals\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1619186595,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": false,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1621405356,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"create\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_internal_transfer\": false,\n \"is_my_input\": true,\n \"is_my_output\": true,\n \"is_spent\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"timestamp\": 1621405356,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
@@ -4233,10 +4239,10 @@
"examples": [
{
"title": "Update a stream claim to add channel",
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update bcd03a6bc9ab0f5694a13410d862af81f735499d --channel_id=\"5c15c266bf34c683523ce06cfb7fe5c984221375\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002badbf685df67ec9d66f01be500d92b417ea1871625ed0c3fbd4353530a829ff7000000006a47304402202f8600123db5731f4702cddf0f8f56aba57555b124ce30c6282475c3fdfb0a150220286c133895326dcc9a0f3ea1cda7bbaa2c5ab24d802e1a28ecfea296408ddb4f012103a0f9331ba7bb5ec620354ccaf4579e1195929316a8a03269f0389e6aa40e103dffffffff2b20bfe244cdca1f5be113c9c0fc43f187632ca5ed391207233909bc20619bb2010000006a47304402206828757a2a417405079bd345bdd495e6b2a4937cb7f20d5c1b22626bc28d8475022004ee827093b6c2a091aeda2493d0ab47283dcd78d765bbfcb4b8b454e88e711e0121038564fc7ee856388d69c509f057b6aa7d7d9b341ebccb7d6452bc0adb0c6d50e7ffffffff0200e1f50500000000fd2301b7076173747265616d149d4935f781af62d81034a194560fabc96b3ad0bc4ce80175132284c9e57ffb6ce03c5283c634bf66c2155c29355d45feccaadb918ace380beac35a09dc3df2c22c5a5ee688d37af34904d5354ddeefe50206e3467c9559895cbf61b6e319a44256bf87b52a2ad7720244cf0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703132786968793673180b22186170706c69636174696f6e2f6f637465742d73747265616d3230f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea6d6d76a91445207a9e9642daffd510f3394e2275ffecb3dfa288ac32a0d205000000001976a914eb1c5433f3da0f37cd32430383e5614e02e412ca88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"timestamp\": 1619186595,\n \"txid\": \"f79f820a535343bd3f0ced251687a17e412bd900e51bf0669dec67df85f6dbba\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp12xihy6s\",\n \"sd_hash\": \"f4f9e85899fd81833288ae98c314521b6a19336063c981bb8aec8ef948e2fbc787aed892943bfa5ca48e066e5a7b26ea\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtZumqabuzJQ9UMvtN5a58XCcrBBCPL1BD\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"nout\": 1,\n \"timestamp\": 1619186594,\n \"txid\": \"b29b6120bc093923071239eda52c6387f143fcc0c913e15b1fcacd44e2bf202b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmpTpyBuV9vuZ56V3fj2yGXG76JEN8SDBm\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bcd03a6bc9ab0f5694a13410d862af81f735499d\",\n \"signing_channel\": {\n \"address\": \"mv5sXLuaYTqALHhPNerS1KCR9DBnhLV2HR\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#5c15c266bf34c683523ce06cfb7fe5c984221375\",\n \"timestamp\": 1619186594,\n \"txid\": \"7dcba7746fc307b5c4112dea445c1c91098a7444b4c3b07542c18a77987a0923\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004b1f16e5b66fbb724cd8967de626e1113083a5d2f391b52fe9896d30aeb374155c8c660dc268195bc2feb2925ce3f4dc2d547bacc43955465ddf94adce214f50d\",\n \"public_key_id\": \"mpgQaTWRWYphbxv94VZsSgW91YK55FZEov\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"7b9ad271e84e82c5b04d07f7914ae915de8f297bf94d9f7490a2bffc9ea4be37\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n Line truncated
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
"lbrynet": "lbrynet stream update ea41b9f807c6982cf97a1178838dfef64feaa014 --channel_id=\"20ccc609603f9c6f01d74f2d6a133867d2903fc2\"",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\", \"validate_file\": false, \"optimize_file\": false, \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000025983dbfa63b6de2131f250c8aa08c81fa1c2b75c8614bbc8ed7efcd09f4a37e4000000006a473044022035dd8c46b38449f8e9dd343553e3c7c8980a8463ea586fb618ab307faf29b8ed02204cd801cea4125a0b38f0ff8505bfc500251c0991fe9b5ac06f944094f3db5a290121030bb5d283d077a4d93a13dd43f6ab8886f8f2d39b3e4936fdb1f79baa95bbf19effffffff53a4f1a509fbf2d441f02d25f7050db36e08ecc189dc30ff1449d56ff1d34124010000006b4830450221008bc1812dd520343aac1eb8fd949f143c43fa2d5922c71fb628422988d40ef6bf0220628378190c53883fe6a22ac8a0717aceeaa4a96896f789a9c16fc1891835b9490121037071cf357b535f0733476fc860a2d531c2186b84ad9d57af093118a0fdddca98ffffffff0200e1f50500000000fd2301b7076173747265616d1414a0ea4ff6fe8d8378117af92c98c607f8b941ea4ce801c23f90d26738136a2d4fd7016f9c3f6009c6cc2097c286c8bea94843a4f2796781afd1797a19737f2ae770022e06b623fedaea0a9654fc9e098271a9c186889d14e0bab2cc75cd36b1e67efe284d06467438d0ed0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70766363706a763239180b22186170706c69636174696f6e2f6f637465742d73747265616d323054ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb76d6d76a9141fcba83c5371c31a24cb491e9d74db9e397784af88ac32a0d205000000001976a9146ff324c17cf183bd5df4fe6b6b1ec33d83320de388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"timestamp\": 1621405356,\n \"txid\": \"e4374a9fd0fc7eedc8bb14865cb7c2a11fc808aac850f23121deb663fadb8359\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpvccpjv29\",\n \"sd_hash\": \"54ec72886f465bc3df47375713693c8d42e36e8837634207fd18de0e32115add3f705d7fa651adf6cd97ea89bc171eb7\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mv8AkyC2tGywD9ARYqEkznnjM7gs8LG17A\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"nout\": 1,\n \"timestamp\": 1621405355,\n \"txid\": \"2441d3f16fd54914ff30dc89c1ec086eb30d05f7252df041d4f2fb09a5f1a453\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miR5DMCS5nUcdcKdQ3Gsuffa9ZQQtDLFhd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ea41b9f807c6982cf97a1178838dfef64feaa014\",\n \"signing_channel\": {\n \"address\": \"mkECRf6x88VNeN1E7wgh3hVL1DvLRdNEUL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#20ccc609603f9c6f01d74f2d6a133867d2903fc2\",\n \"timestamp\": 1621405355,\n \"txid\": \"ff22a3190c8b3cf8df72a8857da6eeb102dae637b62a0eeb0f299367d3372c94\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004e93250829b529ec976a8663c8ed643e851c44028626020d3ebf3ca6cfd9d0dd1e10cda67469571e0044b82a22aa4cb78abf7d67c32604c5b0f318c9fd73b6b86\",\n \"public_key_id\": \"muK9uonhinC3s8fFAFNKxzxWu8ZHB1VbC5\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"08eb074ecd7347f339772fb6df81689199b35538c180d50a7b2d5ae135e0022b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n Line truncated
}
]
}
@@ -4612,7 +4618,7 @@
"curl": "curl -d'{\"method\": \"transaction_list\", \"params\": {}}' http://localhost:5279/",
"lbrynet": "lbrynet transaction list",
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"transaction_list\", \"params\": {}}).json()",
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2021-04-23 10:03\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1619186594,\n \"txid\": \"036c2f7d8df7fe3cbac6cfeea4a2ef1d79cbb7113aa5417ed7b7371ccd2289ca\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2021-04-23 10:03\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1619186593,\n \"txid\": \"7c7b6ef27b3b65fdd90f713d572d63f3f626a75e0f613dc1fd45d6e9a9a1b640\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2021-05-19 03:22\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1621405355,\n \"txid\": \"d0f0cc2d9bc25d86d629b61eb4cc9cdc981a96223879056c0a623521ed8aa0a2\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2021-05-19 03:22\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1621405354,\n \"txid\": \"7a723b27c9cd2e9283da4916ec02c8aa839bf94785a64e4b012c2716cfaab958\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
}
]
},
+1 -1
View File
@@ -1,2 +1,2 @@
__version__ = "0.96.0"
__version__ = "0.100.0"
version = tuple(map(int, __version__.split('.'))) # pylint: disable=invalid-name
+99 -14
View File
@@ -1,8 +1,8 @@
import os
import re
import sys
import typing
import logging
from typing import List, Dict, Tuple, Union, TypeVar, Generic, Optional
from argparse import ArgumentParser
from contextlib import contextmanager
from appdirs import user_data_dir, user_config_dir
@@ -15,7 +15,7 @@ log = logging.getLogger(__name__)
NOT_SET = type('NOT_SET', (object,), {}) # pylint: disable=invalid-name
T = typing.TypeVar('T')
T = TypeVar('T')
CURRENCIES = {
'BTC': {'type': 'crypto'},
@@ -24,11 +24,11 @@ CURRENCIES = {
}
class Setting(typing.Generic[T]):
class Setting(Generic[T]):
def __init__(self, doc: str, default: typing.Optional[T] = None,
previous_names: typing.Optional[typing.List[str]] = None,
metavar: typing.Optional[str] = None):
def __init__(self, doc: str, default: Optional[T] = None,
previous_names: Optional[List[str]] = None,
metavar: Optional[str] = None):
self.doc = doc
self.default = default
self.previous_names = previous_names or []
@@ -45,7 +45,7 @@ class Setting(typing.Generic[T]):
def no_cli_name(self):
return f"--no-{self.name.replace('_', '-')}"
def __get__(self, obj: typing.Optional['BaseConfig'], owner) -> T:
def __get__(self, obj: Optional['BaseConfig'], owner) -> T:
if obj is None:
return self
for location in obj.search_order:
@@ -53,7 +53,7 @@ class Setting(typing.Generic[T]):
return location[self.name]
return self.default
def __set__(self, obj: 'BaseConfig', val: typing.Union[T, NOT_SET]):
def __set__(self, obj: 'BaseConfig', val: Union[T, NOT_SET]):
if val == NOT_SET:
for location in obj.modify_order:
if self.name in location:
@@ -63,6 +63,18 @@ class Setting(typing.Generic[T]):
for location in obj.modify_order:
location[self.name] = val
def is_set(self, obj: 'BaseConfig') -> bool:
for location in obj.search_order:
if self.name in location:
return True
return False
def is_set_to_default(self, obj: 'BaseConfig') -> bool:
for location in obj.search_order:
if self.name in location:
return location[self.name] == self.default
return False
def validate(self, value):
raise NotImplementedError()
@@ -87,7 +99,7 @@ class String(Setting[str]):
f"Setting '{self.name}' must be a string."
# TODO: removes this after pylint starts to understand generics
def __get__(self, obj: typing.Optional['BaseConfig'], owner) -> str: # pylint: disable=useless-super-delegation
def __get__(self, obj: Optional['BaseConfig'], owner) -> str: # pylint: disable=useless-super-delegation
return super().__get__(obj, owner)
@@ -200,7 +212,7 @@ class MaxKeyFee(Setting[dict]):
class StringChoice(String):
def __init__(self, doc: str, valid_values: typing.List[str], default: str, *args, **kwargs):
def __init__(self, doc: str, valid_values: List[str], default: str, *args, **kwargs):
super().__init__(doc, default, *args, **kwargs)
if not valid_values:
raise ValueError("No valid values provided")
@@ -273,6 +285,75 @@ class Strings(ListSetting):
f"'{self.name}' must be a string."
class KnownHubsList:
def __init__(self, config: 'Config' = None, file_name: str = 'known_hubs.yml'):
self.file_name = file_name
self.path = os.path.join(config.wallet_dir, self.file_name) if config else None
self.hubs: Dict[Tuple[str, int], Dict] = {}
if self.exists:
self.load()
@property
def exists(self):
return self.path and os.path.exists(self.path)
@property
def serialized(self) -> Dict[str, Dict]:
return {f"{host}:{port}": details for (host, port), details in self.hubs.items()}
def filter(self, match_none=False, **kwargs):
if not kwargs:
return self.hubs
result = {}
for hub, details in self.hubs.items():
for key, constraint in kwargs.items():
value = details.get(key)
if value == constraint or (match_none and value is None):
result[hub] = details
break
return result
def load(self):
if self.path:
with open(self.path, 'r') as known_hubs_file:
raw = known_hubs_file.read()
for hub, details in yaml.safe_load(raw).items():
self.set(hub, details)
def save(self):
if self.path:
with open(self.path, 'w') as known_hubs_file:
known_hubs_file.write(yaml.safe_dump(self.serialized, default_flow_style=False))
def set(self, hub: str, details: Dict):
if hub and hub.count(':') == 1:
host, port = hub.split(':')
hub_parts = (host, int(port))
if hub_parts not in self.hubs:
self.hubs[hub_parts] = details
return hub
def add_hubs(self, hubs: List[str]):
added = False
for hub in hubs:
if self.set(hub, {}) is not None:
added = True
return added
def items(self):
return self.hubs.items()
def __bool__(self):
return len(self) > 0
def __len__(self):
return self.hubs.__len__()
def __iter__(self):
return iter(self.hubs)
class EnvironmentAccess:
PREFIX = 'LBRY_'
@@ -377,7 +458,7 @@ class ConfigFileAccess:
del self.data[key]
TBC = typing.TypeVar('TBC', bound='BaseConfig')
TBC = TypeVar('TBC', bound='BaseConfig')
class BaseConfig:
@@ -508,6 +589,9 @@ class CLIConfig(TranscodeConfig):
class Config(CLIConfig):
jurisdiction = String("Limit interactions to wallet server in this jurisdiction.")
# directories
data_dir = Path("Directory path to store blobs.", metavar='DIR')
download_dir = Path(
@@ -657,6 +741,7 @@ class Config(CLIConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.set_default_paths()
self.known_hubs = KnownHubsList(self)
def set_default_paths(self):
if 'darwin' in sys.platform.lower():
@@ -678,7 +763,7 @@ class Config(CLIConfig):
return os.path.join(self.data_dir, 'lbrynet.log')
def get_windows_directories() -> typing.Tuple[str, str, str]:
def get_windows_directories() -> Tuple[str, str, str]:
from lbry.winpaths import get_path, FOLDERID, UserHandle, \
PathNotFoundException # pylint: disable=import-outside-toplevel
@@ -700,14 +785,14 @@ def get_windows_directories() -> typing.Tuple[str, str, str]:
return data_dir, lbryum_dir, download_dir
def get_darwin_directories() -> typing.Tuple[str, str, str]:
def get_darwin_directories() -> Tuple[str, str, str]:
data_dir = user_data_dir('LBRY')
lbryum_dir = os.path.expanduser('~/.lbryum')
download_dir = os.path.expanduser('~/Downloads')
return data_dir, lbryum_dir, download_dir
def get_linux_directories() -> typing.Tuple[str, str, str]:
def get_linux_directories() -> Tuple[str, str, str]:
try:
with open(os.path.join(user_config_dir(), 'user-dirs.dirs'), 'r') as xdg:
down_dir = re.search(r'XDG_DOWNLOAD_DIR=(.+)', xdg.read())
+9 -9
View File
@@ -4,7 +4,7 @@ import logging
from binascii import hexlify
from dataclasses import dataclass, field
from functools import lru_cache
from lbry.utils import is_valid_public_ipv4 as _is_valid_public_ipv4
from lbry.utils import is_valid_public_ipv4 as _is_valid_public_ipv4, LRUCache
from lbry.dht import constants
from lbry.dht.serialization.datagram import make_compact_address, make_compact_ip, decode_compact_address
@@ -31,12 +31,12 @@ class PeerManager:
self._rpc_failures: typing.Dict[
typing.Tuple[str, int], typing.Tuple[typing.Optional[float], typing.Optional[float]]
] = {}
self._last_replied: typing.Dict[typing.Tuple[str, int], float] = {}
self._last_sent: typing.Dict[typing.Tuple[str, int], float] = {}
self._last_requested: typing.Dict[typing.Tuple[str, int], float] = {}
self._node_id_mapping: typing.Dict[typing.Tuple[str, int], bytes] = {}
self._node_id_reverse_mapping: typing.Dict[bytes, typing.Tuple[str, int]] = {}
self._node_tokens: typing.Dict[bytes, (float, bytes)] = {}
self._last_replied: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)
self._last_sent: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)
self._last_requested: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)
self._node_id_mapping: typing.Dict[typing.Tuple[str, int], bytes] = LRUCache(2048)
self._node_id_reverse_mapping: typing.Dict[bytes, typing.Tuple[str, int]] = LRUCache(2048)
self._node_tokens: typing.Dict[bytes, (float, bytes)] = LRUCache(2048)
def reset(self):
for statistic in (self._rpc_failures, self._last_replied, self._last_sent, self._last_requested):
@@ -155,9 +155,9 @@ class KademliaPeer:
if self._node_id is not None:
if not len(self._node_id) == constants.HASH_LENGTH:
raise ValueError("invalid node_id: {}".format(hexlify(self._node_id).decode()))
if self.udp_port is not None and not 1 <= self.udp_port <= 65535:
if self.udp_port is not None and not 1024 <= self.udp_port <= 65535:
raise ValueError("invalid udp port")
if self.tcp_port is not None and not 1 <= self.tcp_port <= 65535:
if self.tcp_port is not None and not 1024 <= self.tcp_port <= 65535:
raise ValueError("invalid tcp port")
if not is_valid_public_ipv4(self.address, self.allow_localhost):
raise ValueError(f"invalid ip address: '{self.address}'")
+7 -13
View File
@@ -32,17 +32,15 @@ TIME_TO_FIRST_BYTES = "Time To First Bytes"
log = logging.getLogger(__name__)
def _event_properties(installation_id: str, session_id: str,
event_properties: typing.Optional[typing.Dict]) -> typing.Dict:
def _event_properties(analytics_id: str, event_properties: typing.Optional[typing.Dict]) -> typing.Dict:
properties = {
'lbry_id': installation_id,
'session_id': session_id,
'analytics_id': analytics_id
}
properties.update(event_properties or {})
return properties
def _download_properties(conf: Config, external_ip: str, resolve_duration: float,
def _download_properties(conf: Config, resolve_duration: float,
total_duration: typing.Optional[float], download_id: str, name: str,
outpoint: str, active_peer_count: typing.Optional[int],
tried_peers_count: typing.Optional[int], connection_failures_count: typing.Optional[int],
@@ -54,7 +52,6 @@ def _download_properties(conf: Config, external_ip: str, resolve_duration: float
error: typing.Optional[str] = None, error_msg: typing.Optional[str] = None,
wallet_server: typing.Optional[str] = None) -> typing.Dict:
return {
"external_ip": external_ip,
"download_id": download_id,
"total_duration": round(total_duration, 4),
"resolve_duration": None if not resolve_duration else round(resolve_duration, 4),
@@ -105,17 +102,15 @@ def _make_context(platform):
class AnalyticsManager:
def __init__(self, conf: Config, installation_id: str, session_id: str):
def __init__(self, conf: Config):
self.conf = conf
self.cookies = {}
self.url = ANALYTICS_ENDPOINT
self._write_key = utils.deobfuscate(ANALYTICS_TOKEN)
self._tracked_data = collections.defaultdict(list)
self.context = _make_context(system_info.get_platform())
self.installation_id = installation_id
self.session_id = session_id
self.analytics_id = utils.generate_id().hex()
self.task: typing.Optional[asyncio.Task] = None
self.external_ip: typing.Optional[str] = None
@property
def enabled(self):
@@ -132,7 +127,6 @@ class AnalyticsManager:
async def run(self):
while True:
if self.enabled:
self.external_ip, _ = await utils.get_external_ip(self.conf.lbryum_servers)
await self._send_heartbeat()
await asyncio.sleep(1800)
@@ -194,7 +188,7 @@ class AnalyticsManager:
error_msg: typing.Optional[str] = None,
wallet_server: typing.Optional[str] = None):
await self.track(self._event(TIME_TO_FIRST_BYTES, _download_properties(
self.conf, self.external_ip, resolve_duration, total_duration, download_id, name, outpoint,
self.conf, resolve_duration, total_duration, download_id, name, outpoint,
found_peers_count, tried_peers_count, connection_failures_count, added_fixed_peers, fixed_peers_delay,
sd_hash, sd_download_duration, head_blob_hash, head_blob_length, head_blob_duration, error, error_msg,
wallet_server
@@ -227,7 +221,7 @@ class AnalyticsManager:
return {
'userId': 'lbry',
'event': event,
'properties': _event_properties(self.installation_id, self.session_id, properties),
'properties': _event_properties(self.analytics_id, properties),
'context': self.context,
'timestamp': utils.isonow()
}
+1 -1
View File
@@ -138,7 +138,7 @@ class WalletComponent(Component):
'availability': session.available,
} for session in sessions
],
'known_servers': len(self.wallet_manager.ledger.network.config['default_servers']),
'known_servers': len(self.wallet_manager.ledger.network.known_hubs),
'available_servers': 1 if is_connected else 0
}
+27 -16
View File
@@ -325,8 +325,7 @@ class Daemon(metaclass=JSONRPCServerType):
self._video_file_analyzer = VideoFileAnalyzer(conf)
self._node_id = None
self._installation_id = None
self.session_id = base58.b58encode(utils.generate_id()).decode()
self.analytics_manager = analytics.AnalyticsManager(conf, self.installation_id, self.session_id)
self.analytics_manager = analytics.AnalyticsManager(conf)
self.component_manager = component_manager or ComponentManager(
conf, analytics_manager=self.analytics_manager,
skip_components=conf.components_to_skip or []
@@ -1477,12 +1476,21 @@ class Daemon(metaclass=JSONRPCServerType):
outputs = []
for address in addresses:
self.valid_address_or_error(address)
outputs.append(
Output.pay_pubkey_hash(
amount, self.ledger.address_to_hash160(address)
self.valid_address_or_error(address, allow_script_address=True)
if self.ledger.is_pubkey_address(address):
outputs.append(
Output.pay_pubkey_hash(
amount, self.ledger.address_to_hash160(address)
)
)
)
elif self.ledger.is_script_address(address):
outputs.append(
Output.pay_script_hash(
amount, self.ledger.address_to_hash160(address)
)
)
else:
raise ValueError(f"Unsupported address: '{address}'")
tx = await Transaction.create(
[], outputs, accounts, account
@@ -2352,7 +2360,7 @@ class Daemon(metaclass=JSONRPCServerType):
[--not_locations=<not_locations>...]
[--order_by=<order_by>...] [--no_totals] [--page=<page>] [--page_size=<page_size>]
[--wallet_id=<wallet_id>] [--include_purchase_receipt] [--include_is_my_output]
[--has_source | --has_no_source]
[--remove_duplicates] [--has_source | --has_no_source]
[--new_sdk_server=<new_sdk_server>]
Options:
@@ -2461,6 +2469,8 @@ class Daemon(metaclass=JSONRPCServerType):
has purchased the claim
--include_is_my_output : (bool) lookup and include a boolean indicating
if claim being resolved is yours
--remove_duplicates : (bool) removes duplicated content from search by picking either the
original claim or the oldest matching repost
--has_source : (bool) find claims containing a source field
--has_no_source : (bool) find claims not containing a source field
--new_sdk_server=<new_sdk_server> : (str) URL of the new SDK server (EXPERIMENTAL)
@@ -3938,9 +3948,6 @@ class Daemon(metaclass=JSONRPCServerType):
if replace:
claim = Claim()
claim.collection.message.source.CopyFrom(
old_txo.claim.collection.message.source
)
claim.collection.update(**kwargs)
else:
claim = Claim.from_bytes(old_txo.claim.to_bytes())
@@ -4072,7 +4079,7 @@ class Daemon(metaclass=JSONRPCServerType):
self, claim_id, amount, tip=False,
channel_id=None, channel_name=None, channel_account_id=None,
account_id=None, wallet_id=None, funding_account_ids=None,
preview=False, blocking=False):
comment=None, preview=False, blocking=False):
"""
Create a support or a tip for name claim.
@@ -4080,7 +4087,7 @@ class Daemon(metaclass=JSONRPCServerType):
support_create (<claim_id> | --claim_id=<claim_id>) (<amount> | --amount=<amount>)
[--tip] [--account_id=<account_id>] [--wallet_id=<wallet_id>]
[--channel_id=<channel_id> | --channel_name=<channel_name>]
[--channel_account_id=<channel_account_id>...]
[--channel_account_id=<channel_account_id>...] [--comment=<comment>]
[--preview] [--blocking] [--funding_account_ids=<funding_account_ids>...]
Options:
@@ -4094,6 +4101,7 @@ class Daemon(metaclass=JSONRPCServerType):
--account_id=<account_id> : (str) account to use for holding the transaction
--wallet_id=<wallet_id> : (str) restrict operation to specific wallet
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
--comment=<comment> : (str) add a comment to the support
--preview : (bool) do not broadcast the transaction
--blocking : (bool) wait until transaction is in mempool
@@ -4111,7 +4119,8 @@ class Daemon(metaclass=JSONRPCServerType):
claim_address = await account.receiving.get_or_create_usable_address()
tx = await Transaction.support(
claim.claim_name, claim_id, amount, claim_address, funding_accounts, funding_accounts[0], channel
claim.claim_name, claim_id, amount, claim_address, funding_accounts, funding_accounts[0], channel,
comment=comment
)
new_txo = tx.outputs[0]
@@ -5526,9 +5535,11 @@ class Daemon(metaclass=JSONRPCServerType):
async def broadcast_or_release(self, tx, blocking=False):
await self.wallet_manager.broadcast_or_release(tx, blocking)
def valid_address_or_error(self, address):
def valid_address_or_error(self, address, allow_script_address=False):
try:
assert self.ledger.is_valid_address(address)
assert self.ledger.is_pubkey_address(address) or (
allow_script_address and self.ledger.is_script_address(address)
)
except:
raise Exception(f"'{address}' is not a valid address")
+8 -26
View File
@@ -5,7 +5,7 @@ import logging
from statistics import median
from decimal import Decimal
from typing import Optional, Iterable, Type
from aiohttp.client_exceptions import ContentTypeError
from aiohttp.client_exceptions import ContentTypeError, ClientConnectionError
from lbry.error import InvalidExchangeRateResponseError, CurrencyConversionError
from lbry.utils import aiohttp_request
from lbry.wallet.dewies import lbc_to_dewies
@@ -79,18 +79,23 @@ class MarketFeed:
log.debug("Saving rate update %f for %s from %s", rate, self.market, self.name)
self.rate = ExchangeRate(self.market, rate, int(time.time()))
self.last_check = time.time()
self.event.set()
return self.rate
except asyncio.CancelledError:
raise
except asyncio.TimeoutError:
log.warning("Timed out fetching exchange rate from %s.", self.name)
except json.JSONDecodeError as e:
log.warning("Could not parse exchange rate response from %s: %s", self.name, e.doc)
msg = e.doc if '<html>' not in e.doc else 'unexpected content type.'
log.warning("Could not parse exchange rate response from %s: %s", self.name, msg)
log.debug(e.doc)
except InvalidExchangeRateResponseError as e:
log.warning(str(e))
except ClientConnectionError as e:
log.warning("Error trying to connect to exchange rate %s: %s", self.name, str(e))
except Exception as e:
log.exception("Exchange rate error (%s from %s):", self.market, self.name)
finally:
self.event.set()
async def keep_updated(self):
while True:
@@ -130,27 +135,6 @@ class BittrexUSDFeed(BaseBittrexFeed):
url = "https://api.bittrex.com/v3/markets/LBC-USD/ticker"
class BaseCryptonatorFeed(MarketFeed):
name = "Cryptonator"
market = None
url = None
def get_rate_from_response(self, json_response):
if 'ticker' not in json_response or 'price' not in json_response['ticker']:
raise InvalidExchangeRateResponseError(self.name, 'result not found')
return float(json_response['ticker']['price'])
class CryptonatorBTCFeed(BaseCryptonatorFeed):
market = "BTCLBC"
url = "https://api.cryptonator.com/api/ticker/btc-lbc"
class CryptonatorUSDFeed(BaseCryptonatorFeed):
market = "USDLBC"
url = "https://api.cryptonator.com/api/ticker/usd-lbc"
class BaseCoinExFeed(MarketFeed):
name = "CoinEx"
market = None
@@ -210,8 +194,6 @@ class UPbitBTCFeed(MarketFeed):
FEEDS: Iterable[Type[MarketFeed]] = (
BittrexBTCFeed,
BittrexUSDFeed,
CryptonatorBTCFeed,
CryptonatorUSDFeed,
CoinExBTCFeed,
CoinExUSDFeed,
HotbitBTCFeed,
@@ -234,8 +234,6 @@ class JSONResponseEncoder(JSONEncoder):
output['value_type'] = txo.claim.claim_type
if txo.claim.is_channel:
output['has_signing_key'] = txo.has_private_key
elif txo.script.is_support_claim_data:
output['value_type'] = 'emoji'
if check_signature and txo.signable.is_signed:
if txo.channel is not None:
output['signing_channel'] = self.encode_output(txo.channel)
+1 -1
View File
@@ -132,7 +132,7 @@ class SourceManager:
else:
streams = list(self._sources.values())
if sort_by:
streams.sort(key=lambda s: getattr(s, sort_by))
streams.sort(key=lambda s: getattr(s, sort_by) or "")
if reverse:
streams.reverse()
return streams
+24
View File
@@ -0,0 +1,24 @@
Schema
=====
Those files are generated from the [types repo](https://github.com/lbryio/types). If you are modifying/adding a new type, make sure it is cloned in the same root folder as the SDK repo, like:
```
repos/
- lbry-sdk/
- types/
```
Then, [download protoc 3.2.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.2.0), add it to your PATH. On linux it is:
```bash
cd ~/.local/bin
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
unzip protoc-3.2.0-linux-x86_64.zip bin/protoc -d..
```
Finally, `make` should update everything in place.
### Why protoc 3.2.0?
Different/newer versions will generate larger diffs and we need to make sure they are good. In theory, we can just update to latest and it will all work, but it is a good practice to check blockchain data and retro compatibility before bumping versions (if you do, please update this section!).
+13 -5
View File
@@ -32,6 +32,17 @@ def calculate_sha384_file_hash(file_path):
return sha384.digest()
def country_int_to_str(country: int) -> str:
r = LocationMessage.Country.Name(country)
return r[1:] if r.startswith('R') else r
def country_str_to_int(country: str) -> int:
if len(country) == 3:
country = 'R' + country
return LocationMessage.Country.Value(country)
class Dimmensional(Metadata):
__slots__ = ()
@@ -423,14 +434,11 @@ class Language(Metadata):
@property
def region(self) -> str:
if self.message.region:
r = LocationMessage.Country.Name(self.message.region)
return r[1:] if r.startswith('R') else r
return country_int_to_str(self.message.region)
@region.setter
def region(self, region: str):
if len(region) == 3:
region = 'R'+region
self.message.region = LocationMessage.Country.Value(region)
self.message.region = country_str_to_int(region)
class LanguageList(BaseMessageList[Language]):
+8
View File
@@ -13,3 +13,11 @@ class Support(Signable):
@emoji.setter
def emoji(self, emoji: str):
self.message.emoji = emoji
@property
def comment(self) -> str:
return self.message.comment
@comment.setter
def comment(self, comment: str):
self.message.comment = comment
+9 -2
View File
@@ -19,7 +19,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
name='support.proto',
package='pb',
syntax='proto3',
serialized_pb=_b('\n\rsupport.proto\x12\x02pb\"\x18\n\x07Support\x12\r\n\x05\x65moji\x18\x01 \x01(\tb\x06proto3')
serialized_pb=_b('\n\rsupport.proto\x12\x02pb\")\n\x07Support\x12\r\n\x05\x65moji\x18\x01 \x01(\t\x12\x0f\n\x07\x63omment\x18\x02 \x01(\tb\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@@ -40,6 +40,13 @@ _SUPPORT = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='comment', full_name='pb.Support.comment', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
@@ -53,7 +60,7 @@ _SUPPORT = _descriptor.Descriptor(
oneofs=[
],
serialized_start=21,
serialized_end=45,
serialized_end=62,
)
DESCRIPTOR.message_types_by_name['Support'] = _SUPPORT
-3
View File
@@ -372,9 +372,6 @@ class ManagedStream(ManagedDownloadSource):
protocol.transport.close()
self.uploading_to_reflector = False
if not self.fully_reflected.is_set():
self.fully_reflected.set()
await self.blob_manager.storage.update_reflected_stream(self.sd_hash, f"{host}:{port}")
return sent
async def update_content_claim(self, claim_info: Optional[typing.Dict] = None):
+1 -1
View File
@@ -59,7 +59,7 @@ class StreamReflectorClient(asyncio.Protocol):
return
async def send_request(self, request_dict: typing.Dict, timeout: int = 180):
msg = json.dumps(request_dict)
msg = json.dumps(request_dict, sort_keys=True)
try:
self.transport.write(msg.encode())
self.pending_request = self.loop.create_task(asyncio.wait_for(self.response_queue.get(), timeout))
+18 -13
View File
@@ -17,7 +17,7 @@ log = logging.getLogger(__name__)
class ReflectorServerProtocol(asyncio.Protocol):
def __init__(self, blob_manager: 'BlobManager', response_chunk_size: int = 10000,
stop_event: asyncio.Event = None, incoming_event: asyncio.Event = None,
not_incoming_event: asyncio.Event = None):
not_incoming_event: asyncio.Event = None, partial_event: asyncio.Event = None):
self.loop = asyncio.get_event_loop()
self.blob_manager = blob_manager
self.server_task: asyncio.Task = None
@@ -34,6 +34,7 @@ class ReflectorServerProtocol(asyncio.Protocol):
self.stop_event = stop_event or asyncio.Event(loop=self.loop)
self.chunk_size = response_chunk_size
self.wait_for_stop_task: typing.Optional[asyncio.Task] = None
self.partial_event = partial_event
async def wait_for_stop(self):
await self.stop_event.wait()
@@ -115,10 +116,14 @@ class ReflectorServerProtocol(asyncio.Protocol):
if self.writer:
self.writer.close_handle()
self.writer = None
self.send_response({"send_sd_blob": False, 'needed': [
blob.blob_hash for blob in self.descriptor.blobs[:-1]
if not self.blob_manager.get_blob(blob.blob_hash).get_is_verified()
]})
needs = [blob.blob_hash
for blob in self.descriptor.blobs[:-1]
if not self.blob_manager.get_blob(blob.blob_hash).get_is_verified()]
if needs and not self.partial_event.is_set():
needs = needs[:3]
self.partial_event.set()
self.send_response({"send_sd_blob": False, 'needed_blobs': needs})
return
return
elif self.descriptor:
@@ -153,7 +158,7 @@ class ReflectorServerProtocol(asyncio.Protocol):
class ReflectorServer:
def __init__(self, blob_manager: 'BlobManager', response_chunk_size: int = 10000,
stop_event: asyncio.Event = None, incoming_event: asyncio.Event = None,
not_incoming_event: asyncio.Event = None):
not_incoming_event: asyncio.Event = None, partial_needs=False):
self.loop = asyncio.get_event_loop()
self.blob_manager = blob_manager
self.server_task: typing.Optional[asyncio.Task] = None
@@ -163,19 +168,19 @@ class ReflectorServer:
self.not_incoming_event = not_incoming_event or asyncio.Event(loop=self.loop)
self.response_chunk_size = response_chunk_size
self.stop_event = stop_event
self.partial_needs = partial_needs # for testing cases where it doesn't know what it wants
def start_server(self, port: int, interface: typing.Optional[str] = '0.0.0.0'):
if self.server_task is not None:
raise Exception("already running")
async def _start_server():
server = await self.loop.create_server(
lambda: ReflectorServerProtocol(
self.blob_manager, self.response_chunk_size, self.stop_event, self.incoming_event,
self.not_incoming_event
),
interface, port
)
partial_event = asyncio.Event()
if not self.partial_needs:
partial_event.set()
server = await self.loop.create_server(lambda: ReflectorServerProtocol(
self.blob_manager, self.response_chunk_size, self.stop_event, self.incoming_event,
self.not_incoming_event, partial_event), interface, port)
self.started_listening.set()
self.stopped_listening.clear()
log.info("Reflector server listening on TCP %s:%i", interface, port)
+7 -1
View File
@@ -215,7 +215,7 @@ class StreamManager(SourceManager):
server, port = random.choice(self.config.reflector_servers)
if stream.sd_hash in self.running_reflector_uploads:
return self.running_reflector_uploads[stream.sd_hash]
task = self.loop.create_task(stream.upload_to_reflector(server, port))
task = self.loop.create_task(self._retriable_reflect_stream(stream, server, port))
self.running_reflector_uploads[stream.sd_hash] = task
task.add_done_callback(
lambda _: None if stream.sd_hash not in self.running_reflector_uploads else
@@ -223,6 +223,12 @@ class StreamManager(SourceManager):
)
return task
async def _retriable_reflect_stream(self, stream, host, port):
sent = await stream.upload_to_reflector(host, port)
while not stream.is_fully_reflected and stream.reflector_progress > 0 and len(sent) > 0:
stream.reflector_progress = 0
sent = await stream.upload_to_reflector(host, port)
async def create(self, file_path: str, key: Optional[bytes] = None,
iv_generator: Optional[typing.Generator[bytes, None, None]] = None) -> ManagedStream:
descriptor = await StreamDescriptor.create_stream(
+26 -9
View File
@@ -350,7 +350,11 @@ class CommandTestCase(IntegrationTestCase):
server_tmp_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, server_tmp_dir)
self.server_config = Config()
self.server_config = Config(
data_dir=server_tmp_dir,
wallet_dir=server_tmp_dir,
download_dir=server_tmp_dir
)
self.server_config.transaction_cache_size = 10000
self.server_storage = SQLiteStorage(self.server_config, ':memory:')
await self.server_storage.open()
@@ -374,6 +378,7 @@ class CommandTestCase(IntegrationTestCase):
await daemon.stop()
async def add_daemon(self, wallet_node=None, seed=None):
start_wallet_node = False
if wallet_node is None:
wallet_node = WalletNode(
self.wallet_node.manager_class,
@@ -381,22 +386,23 @@ class CommandTestCase(IntegrationTestCase):
port=self.extra_wallet_node_port
)
self.extra_wallet_node_port += 1
await wallet_node.start(self.conductor.spv_node, seed=seed)
self.extra_wallet_nodes.append(wallet_node)
start_wallet_node = True
upload_dir = os.path.join(wallet_node.data_path, 'uploads')
os.mkdir(upload_dir)
conf = Config()
conf.data_dir = wallet_node.data_path
conf.wallet_dir = wallet_node.data_path
conf.download_dir = wallet_node.data_path
conf = Config(
# needed during instantiation to access known_hubs path
data_dir=wallet_node.data_path,
wallet_dir=wallet_node.data_path,
download_dir=wallet_node.data_path
)
conf.upload_dir = upload_dir # not a real conf setting
conf.share_usage_data = False
conf.use_upnp = False
conf.reflect_streams = True
conf.blockchain_name = 'lbrycrd_regtest'
conf.lbryum_servers = [('127.0.0.1', 50001)]
conf.lbryum_servers = [(self.conductor.spv_node.hostname, self.conductor.spv_node.port)]
conf.reflector_servers = [('127.0.0.1', 5566)]
conf.fixed_peers = [('127.0.0.1', 5567)]
conf.known_dht_nodes = []
@@ -408,7 +414,13 @@ class CommandTestCase(IntegrationTestCase):
]
if self.skip_libtorrent:
conf.components_to_skip.append(LIBTORRENT_COMPONENT)
wallet_node.manager.config = conf
if start_wallet_node:
await wallet_node.start(self.conductor.spv_node, seed=seed, config=conf)
self.extra_wallet_nodes.append(wallet_node)
else:
wallet_node.manager.config = conf
wallet_node.manager.ledger.config['known_hubs'] = conf.known_hubs
def wallet_maker(component_manager):
wallet_component = WalletComponent(component_manager)
@@ -577,6 +589,11 @@ class CommandTestCase(IntegrationTestCase):
self.daemon.jsonrpc_support_abandon(*args, **kwargs), confirm
)
async def account_send(self, *args, confirm=True, **kwargs):
return await self.confirm_and_render(
self.daemon.jsonrpc_account_send(*args, **kwargs), confirm
)
async def wallet_send(self, *args, confirm=True, **kwargs):
return await self.confirm_and_render(
self.daemon.jsonrpc_wallet_send(*args, **kwargs), confirm
+9 -11
View File
@@ -21,7 +21,6 @@ import pkg_resources
import certifi
import aiohttp
from prometheus_client import Counter
from prometheus_client.registry import REGISTRY
from lbry.schema.claim import Claim
@@ -276,12 +275,6 @@ class LRUCacheWithMetrics:
def __del__(self):
self.clear()
if self._track_metrics: # needed for tests
try:
REGISTRY.unregister(self.hits)
REGISTRY.unregister(self.misses)
except AttributeError:
pass
class LRUCache:
@@ -310,11 +303,14 @@ class LRUCache:
self.cache.popitem(last=False)
self.cache[key] = value
def items(self):
return self.cache.items()
def clear(self):
self.cache.clear()
def pop(self, key):
return self.cache.pop(key)
def pop(self, key, default=None):
return self.cache.pop(key, default)
def __setitem__(self, key, value):
return self.set(key, value)
@@ -380,13 +376,15 @@ CARRIER_GRADE_NAT_SUBNET = ipaddress.ip_network('100.64.0.0/10')
IPV4_TO_6_RELAY_SUBNET = ipaddress.ip_network('192.88.99.0/24')
def is_valid_public_ipv4(address, allow_localhost: bool = False):
def is_valid_public_ipv4(address, allow_localhost: bool = False, allow_lan: bool = False):
try:
parsed_ip = ipaddress.ip_address(address)
if parsed_ip.is_loopback and allow_localhost:
return True
if allow_lan and parsed_ip.is_private:
return True
if any((parsed_ip.version != 4, parsed_ip.is_unspecified, parsed_ip.is_link_local, parsed_ip.is_loopback,
parsed_ip.is_multicast, parsed_ip.is_reserved, parsed_ip.is_private, parsed_ip.is_reserved)):
parsed_ip.is_multicast, parsed_ip.is_reserved, parsed_ip.is_private)):
return False
else:
return not any((CARRIER_GRADE_NAT_SUBNET.supernet_of(ipaddress.ip_network(f"{address}/32")),
Binary file not shown.
+4 -3
View File
@@ -769,9 +769,10 @@ class Database(SQLiteMixin):
conn.execute(*self._insert_sql(
"txo", self.txo_to_row(tx, txo), ignore_duplicate=True
)).fetchall()
elif txo.script.is_pay_script_hash:
# TODO: implement script hash payments
log.warning('Database.save_transaction_io: pay script hash is not implemented!')
elif txo.script.is_pay_script_hash and is_my_input:
conn.execute(*self._insert_sql(
"txo", self.txo_to_row(tx, txo), ignore_duplicate=True
)).fetchall()
def save_transaction_io(self, tx: Transaction, address, txhash, history):
return self.save_transaction_io_batch([tx], address, txhash, history)
+15 -2
View File
@@ -178,15 +178,25 @@ class Ledger(metaclass=LedgerRegistry):
raw_address = cls.pubkey_address_prefix + h160
return Base58.encode(bytearray(raw_address + double_sha256(raw_address)[0:4]))
@classmethod
def hash160_to_script_address(cls, h160):
raw_address = cls.script_address_prefix + h160
return Base58.encode(bytearray(raw_address + double_sha256(raw_address)[0:4]))
@staticmethod
def address_to_hash160(address):
return Base58.decode(address)[1:21]
@classmethod
def is_valid_address(cls, address):
def is_pubkey_address(cls, address):
decoded = Base58.decode_check(address)
return decoded[0] == cls.pubkey_address_prefix[0]
@classmethod
def is_script_address(cls, address):
decoded = Base58.decode_check(address)
return decoded[0] == cls.script_address_prefix[0]
@classmethod
def public_key_to_address(cls, public_key):
return cls.hash160_to_address(hash160(public_key))
@@ -713,8 +723,10 @@ class Ledger(metaclass=LedgerRegistry):
self.hash160_to_address(txi.txo_ref.txo.pubkey_hash)
)
for txo in tx.outputs:
if txo.has_address:
if txo.is_pubkey_hash:
addresses.add(self.hash160_to_address(txo.pubkey_hash))
elif txo.is_script_hash:
addresses.add(self.hash160_to_script_address(txo.script_hash))
start = int(time.perf_counter())
while timeout and (int(time.perf_counter()) - start) <= timeout:
if await self._wait_round(tx, height, addresses):
@@ -1189,6 +1201,7 @@ class TestNetLedger(Ledger):
extended_private_key_prefix = unhexlify('04358394')
checkpoints = {}
class RegTestLedger(Ledger):
network_name = 'regtest'
headers_class = UnvalidatedHeaders
+14 -2
View File
@@ -8,7 +8,7 @@ from decimal import Decimal
from typing import List, Type, MutableSequence, MutableMapping, Optional
from lbry.error import KeyFeeAboveMaxAllowedError
from lbry.conf import Config
from lbry.conf import Config, NOT_SET
from .dewies import dewies_to_lbc
from .account import Account
@@ -182,8 +182,11 @@ class WalletManager:
ledger_config = {
'auto_connect': True,
'explicit_servers': [],
'hub_timeout': config.hub_timeout,
'default_servers': config.lbryum_servers,
'known_hubs': config.known_hubs,
'jurisdiction': config.jurisdiction,
'concurrent_hub_requests': config.concurrent_hub_requests,
'data_path': config.wallet_dir,
'tx_cache_size': config.transaction_cache_size
@@ -197,6 +200,10 @@ class WalletManager:
os.path.join(wallets_directory, 'default_wallet')
)
if Config.lbryum_servers.is_set_to_default(config):
with config.update_config() as c:
c.lbryum_servers = NOT_SET
manager = cls.from_config({
'ledgers': {ledger_id: ledger_config},
'wallets': [
@@ -227,11 +234,16 @@ class WalletManager:
async def reset(self):
self.ledger.config = {
'auto_connect': True,
'default_servers': self.config.lbryum_servers,
'explicit_servers': [],
'default_servers': Config.lbryum_servers.default,
'known_hubs': self.config.known_hubs,
'jurisdiction': self.config.jurisdiction,
'hub_timeout': self.config.hub_timeout,
'concurrent_hub_requests': self.config.concurrent_hub_requests,
'data_path': self.config.wallet_dir,
}
if Config.lbryum_servers.is_set(self.config):
self.ledger.config['explicit_servers'] = self.config.lbryum_servers
await self.ledger.stop()
await self.ledger.start()
+43 -3
View File
@@ -14,6 +14,7 @@ from lbry.error import IncompatibleWalletServerError
from lbry.wallet.rpc import RPCSession as BaseClientSession, Connector, RPCError, ProtocolError
from lbry.wallet.stream import StreamController
from lbry.wallet.server.udp import SPVStatusClientProtocol, SPVPong
from lbry.conf import KnownHubsList
log = logging.getLogger(__name__)
@@ -168,9 +169,13 @@ class Network:
self._on_status_controller = StreamController(merge_repeated_events=True)
self.on_status = self._on_status_controller.stream
self._on_hub_controller = StreamController(merge_repeated_events=True)
self.on_hub = self._on_hub_controller.stream
self.subscription_controllers = {
'blockchain.headers.subscribe': self._on_header_controller,
'blockchain.address.subscribe': self._on_status_controller,
'blockchain.peers.subscribe': self._on_hub_controller,
}
self.aiohttp_session: Optional[aiohttp.ClientSession] = None
@@ -182,6 +187,16 @@ class Network:
def config(self):
return self.ledger.config
@property
def known_hubs(self):
if 'known_hubs' not in self.config:
return KnownHubsList()
return self.config['known_hubs']
@property
def jurisdiction(self):
return self.config.get("jurisdiction")
def disconnect(self):
if self._keepalive_task and not self._keepalive_task.done():
self._keepalive_task.cancel()
@@ -192,6 +207,7 @@ class Network:
self.running = True
self.aiohttp_session = aiohttp.ClientSession()
self.on_header.listen(self._update_remote_height)
self.on_hub.listen(self._update_hubs)
self._loop_task = asyncio.create_task(self.network_loop())
self._urgent_need_reconnect.set()
@@ -219,7 +235,13 @@ class Network:
log.exception("error looking up dns for spv server %s:%i", server, port)
# accumulate the dns results
await asyncio.gather(*(resolve_spv(server, port) for (server, port) in self.config['default_servers']))
if self.config['explicit_servers']:
hubs = self.config['explicit_servers']
elif self.known_hubs:
hubs = self.known_hubs
else:
hubs = self.config['default_servers']
await asyncio.gather(*(resolve_spv(server, port) for (server, port) in hubs))
return hostname_to_ip, ip_to_hostnames
async def get_n_fastest_spvs(self, timeout=3.0) -> Dict[Tuple[str, int], Optional[SPVPong]]:
@@ -229,8 +251,9 @@ class Network:
sent_ping_timestamps = {}
_, ip_to_hostnames = await self.resolve_spv_dns()
n = len(ip_to_hostnames)
log.info("%i possible spv servers to try (%i urls in config)", n, len(self.config['default_servers']))
log.info("%i possible spv servers to try (%i urls in config)", n, len(self.config['explicit_servers']))
pongs = {}
known_hubs = self.known_hubs
try:
await loop.create_datagram_endpoint(lambda: connection, ('0.0.0.0', 0))
# could raise OSError if it cant bind
@@ -245,6 +268,9 @@ class Network:
'/'.join(ip_to_hostnames[remote]), remote[1], round(latency * 1000, 2),
pong.available, pong.height)
known_hubs.hubs.setdefault((ip_to_hostnames[remote][0], remote[1]), {}).update(
{"country": pong.country_name}
)
if pong.available:
pongs[(ip_to_hostnames[remote][0], remote[1])] = pong
return pongs
@@ -259,13 +285,17 @@ class Network:
random_server = random.choice(list(ip_to_hostnames.keys()))
host, port = random_server
log.warning("trying fallback to randomly selected spv: %s:%i", host, port)
known_hubs.hubs.setdefault((host, port), {})
return {(host, port): None}
finally:
connection.close()
async def connect_to_fastest(self) -> Optional[ClientSession]:
fastest_spvs = await self.get_n_fastest_spvs()
for (host, port) in fastest_spvs:
for (host, port), pong in fastest_spvs.items():
if (pong is not None and self.jurisdiction is not None) and \
(pong.country_name != self.jurisdiction):
continue
client = ClientSession(network=self, server=(host, port), timeout=self.config['hub_timeout'],
concurrency=self.config['concurrent_hub_requests'])
try:
@@ -297,6 +327,8 @@ class Network:
log.debug("get spv server features %s:%i", *client.server)
features = await client.send_request('server.features', [])
self.client, self.server_features = client, features
log.debug("discover other hubs %s:%i", *client.server)
await self._update_hubs(await client.send_request('server.peers.subscribe', []))
log.info("subscribe to headers %s:%i", *client.server)
self._update_remote_height((await self.subscribe_headers(),))
self._on_connected_controller.add(True)
@@ -365,6 +397,14 @@ class Network:
def _update_remote_height(self, header_args):
self.remote_height = header_args[0]["height"]
async def _update_hubs(self, hubs):
if hubs and hubs != ['']:
try:
if self.known_hubs.add_hubs(hubs):
self.known_hubs.save()
except Exception:
log.exception("could not add hubs: %s", hubs)
def get_transaction(self, tx_hash, known_height=None):
# use any server if its old, otherwise restrict to who gave us the history
restricted = known_height in (None, -1, 0) or 0 > known_height > self.remote_height - 10
+15 -6
View File
@@ -17,6 +17,7 @@ import lbry
from lbry.wallet.server.server import Server
from lbry.wallet.server.env import Env
from lbry.wallet import Wallet, Ledger, RegTestLedger, WalletManager, Account, BlockHeightEvent
from lbry.conf import KnownHubsList, Config
log = logging.getLogger(__name__)
@@ -107,7 +108,8 @@ class Conductor:
class WalletNode:
def __init__(self, manager_class: Type[WalletManager], ledger_class: Type[Ledger],
verbose: bool = False, port: int = 5280, default_seed: str = None) -> None:
verbose: bool = False, port: int = 5280, default_seed: str = None,
data_path: str = None) -> None:
self.manager_class = manager_class
self.ledger_class = ledger_class
self.verbose = verbose
@@ -115,12 +117,12 @@ class WalletNode:
self.ledger: Optional[Ledger] = None
self.wallet: Optional[Wallet] = None
self.account: Optional[Account] = None
self.data_path: Optional[str] = None
self.data_path: str = data_path or tempfile.mkdtemp()
self.port = port
self.default_seed = default_seed
self.known_hubs = KnownHubsList()
async def start(self, spv_node: 'SPVNode', seed=None, connect=True):
self.data_path = tempfile.mkdtemp()
async def start(self, spv_node: 'SPVNode', seed=None, connect=True, config=None):
wallets_dir = os.path.join(self.data_path, 'wallets')
os.mkdir(wallets_dir)
wallet_file_name = os.path.join(wallets_dir, 'my_wallet.json')
@@ -130,14 +132,17 @@ class WalletNode:
'ledgers': {
self.ledger_class.get_id(): {
'api_port': self.port,
'default_servers': [(spv_node.hostname, spv_node.port)],
'explicit_servers': [(spv_node.hostname, spv_node.port)],
'default_servers': Config.lbryum_servers.default,
'data_path': self.data_path,
'known_hubs': config.known_hubs if config else KnownHubsList(),
'hub_timeout': 30,
'concurrent_hub_requests': 32,
}
},
'wallets': [wallet_file_name]
})
self.manager.config = config
self.ledger = self.manager.ledgers[self.ledger_class]
self.wallet = self.manager.default_wallet
if not self.wallet:
@@ -174,6 +179,7 @@ class SPVNode:
self.udp_port = self.port
self.session_timeout = 600
self.rpc_port = '0' # disabled by default
self.stopped = False
async def start(self, blockchain_node: 'BlockchainNode', extraconf=None):
self.data_path = tempfile.mkdtemp()
@@ -203,10 +209,13 @@ class SPVNode:
await self.server.start()
async def stop(self, cleanup=True):
if self.stopped:
return
try:
await self.server.db.search_index.delete_index()
await self.server.db.search_index.stop()
await self.server.stop()
self.stopped = True
finally:
cleanup and self.cleanup()
@@ -412,7 +421,7 @@ class BlockchainNode:
return self._cli_cmnd('getnewaddress', "", address_type)
async def get_balance(self):
return float(await self._cli_cmnd('getbalance'))
return await self._cli_cmnd('getbalance')
def send_to_address(self, address, amount):
return self._cli_cmnd('sendtoaddress', address, str(amount))
-5
View File
@@ -798,11 +798,6 @@ class LBRYBlockProcessor(BlockProcessor):
finally:
if self.sql:
self.sql.commit()
if self.sql and self.db.first_sync and self.height == self.daemon.cached_height():
self.timer.run(self.sql.execute, self.sql.SEARCH_INDEXES, timer_name='executing SEARCH_INDEXES')
if self.env.individual_tag_indexes:
self.timer.run(self.sql.execute, self.sql.TAG_INDEXES, timer_name='executing TAG_INDEXES')
self.timer.run(self.sql.execute, self.sql.LANGUAGE_INDEXES, timer_name='executing LANGUAGE_INDEXES')
def advance_txs(self, height, txs, header, block_hash):
timer = self.timer.sub_timers['advance_blocks']
+1 -1
View File
@@ -25,7 +25,7 @@ def main():
parser = get_argument_parser()
args = parser.parse_args()
coin_class = get_coin_class(args.spvserver)
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)-4s %(name)s:%(lineno)d: %(message)s")
logging.info('lbry.server starting')
logging.getLogger('aiohttp').setLevel(logging.WARNING)
logging.getLogger('elasticsearch').setLevel(logging.WARNING)
+1 -5
View File
@@ -17,10 +17,6 @@ class FindShortestID:
if self.short_id:
return '#'+self.short_id
@classmethod
def factory(cls):
return cls(), cls.step, cls.finalize
def register_canonical_functions(connection):
connection.createaggregatefunction("shortest_id", FindShortestID.factory, 2)
connection.create_aggregate("shortest_id", 2, FindShortestID)
+70 -19
View File
@@ -33,7 +33,15 @@ class StreamResolution(str):
return LookupError(f'Could not find claim at "{url}".')
class IndexVersionMismatch(Exception):
def __init__(self, got_version, expected_version):
self.got_version = got_version
self.expected_version = expected_version
class SearchIndex:
VERSION = 1
def __init__(self, index_prefix: str, search_timeout=3.0, elastic_host='localhost', elastic_port=9200):
self.search_timeout = search_timeout
self.sync_timeout = 600 # wont hit that 99% of the time, but can hit on a fresh import
@@ -48,9 +56,21 @@ class SearchIndex:
self._elastic_host = elastic_host
self._elastic_port = elastic_port
async def start(self):
async def get_index_version(self) -> int:
try:
template = await self.sync_client.indices.get_template(self.index)
return template[self.index]['version']
except NotFoundError:
return 0
async def set_index_version(self, version):
await self.sync_client.indices.put_template(
self.index, body={'version': version, 'index_patterns': ['ignored']}, ignore=400
)
async def start(self) -> bool:
if self.sync_client:
return
return False
hosts = [{'host': self._elastic_host, 'port': self._elastic_port}]
self.sync_client = AsyncElasticsearch(hosts, timeout=self.sync_timeout)
self.search_client = AsyncElasticsearch(hosts, timeout=self.search_timeout)
@@ -61,8 +81,17 @@ class SearchIndex:
except ConnectionError:
self.logger.warning("Failed to connect to Elasticsearch. Waiting for it!")
await asyncio.sleep(1)
res = await self.sync_client.indices.create(self.index, INDEX_DEFAULT_SETTINGS, ignore=400)
return res.get('acknowledged', False)
acked = res.get('acknowledged', False)
if acked:
await self.set_index_version(self.VERSION)
return acked
index_version = await self.get_index_version()
if index_version != self.VERSION:
self.logger.error("es search index has an incompatible version: %s vs %s", index_version, self.VERSION)
raise IndexVersionMismatch(index_version, self.VERSION)
return acked
def stop(self):
clients = [self.sync_client, self.search_client]
@@ -133,6 +162,9 @@ class SearchIndex:
await self.sync_client.update_by_query(
self.index, body=self.update_filter_query(Censor.RESOLVE, blocked_channels, True), slices=4)
await self.sync_client.indices.refresh(self.index)
self.clear_caches()
def clear_caches(self):
self.search_cache.clear()
self.short_id_cache.clear()
self.claim_cache.clear()
@@ -220,20 +252,15 @@ class SearchIndex:
if not kwargs['channel_id'] or not isinstance(kwargs['channel_id'], str):
return [], 0, 0
try:
if 'limit_claims_per_channel' in kwargs:
return await self.search_ahead(**kwargs), 0, 0
else:
result = (await self.search_client.search(
expand_query(**kwargs), index=self.index,
track_total_hits=False if kwargs.get('no_totals') else 10_000
))['hits']
return await self.search_ahead(**kwargs)
except NotFoundError:
return [], 0, 0
return expand_result(result['hits']), 0, result.get('total', {}).get('value', 0)
async def search_ahead(self, **kwargs):
# 'limit_claims_per_channel' case. Fetch 1000 results, reorder, slice, inflate and return
per_channel_per_page = kwargs.pop('limit_claims_per_channel')
per_channel_per_page = kwargs.pop('limit_claims_per_channel', 0) or 0
remove_duplicates = kwargs.pop('remove_duplicates', False)
page_size = kwargs.pop('limit', 10)
offset = kwargs.pop('offset', 0)
kwargs['limit'] = 1000
@@ -246,14 +273,37 @@ class SearchIndex:
reordered_hits = cache_item.result
else:
query = expand_query(**kwargs)
reordered_hits = await self.__search_ahead(query, page_size, per_channel_per_page)
search_hits = deque((await self.search_client.search(
query, index=self.index, track_total_hits=False,
_source_includes=['_id', 'channel_id', 'reposted_claim_id', 'creation_height']
))['hits']['hits'])
if remove_duplicates:
search_hits = self.__remove_duplicates(search_hits)
if per_channel_per_page > 0:
reordered_hits = self.__search_ahead(search_hits, page_size, per_channel_per_page)
else:
reordered_hits = [(hit['_id'], hit['_source']['channel_id']) for hit in search_hits]
cache_item.result = reordered_hits
return list(await self.get_many(*(claim_id for claim_id, _ in reordered_hits[offset:(offset + page_size)])))
result = list(await self.get_many(*(claim_id for claim_id, _ in reordered_hits[offset:(offset + page_size)])))
return result, 0, len(reordered_hits)
async def __search_ahead(self, query: dict, page_size: int, per_channel_per_page: int):
search_hits = deque((await self.search_client.search(
query, index=self.index, track_total_hits=False, _source_includes=['_id', 'channel_id']
))['hits']['hits'])
def __remove_duplicates(self, search_hits: deque) -> deque:
known_ids = {} # claim_id -> (creation_height, hit_id), where hit_id is either reposted claim id or original
dropped = set()
for hit in search_hits:
hit_height, hit_id = hit['_source']['creation_height'], hit['_source']['reposted_claim_id'] or hit['_id']
if hit_id not in known_ids:
known_ids[hit_id] = (hit_height, hit['_id'])
else:
previous_height, previous_id = known_ids[hit_id]
if hit_height < previous_height:
known_ids[hit_id] = (hit_height, hit['_id'])
dropped.add(previous_id)
else:
dropped.add(hit['_id'])
return deque(hit for hit in search_hits if hit['_id'] not in dropped)
def __search_ahead(self, search_hits: list, page_size: int, per_channel_per_page: int):
reordered_hits = []
channel_counters = Counter()
next_page_hits_maybe_check_later = deque()
@@ -266,7 +316,7 @@ class SearchIndex:
break # means last page was incomplete and we are left with bad replacements
for _ in range(len(next_page_hits_maybe_check_later)):
claim_id, channel_id = next_page_hits_maybe_check_later.popleft()
if channel_counters[channel_id] < per_channel_per_page:
if per_channel_per_page > 0 and channel_counters[channel_id] < per_channel_per_page:
reordered_hits.append((claim_id, channel_id))
channel_counters[channel_id] += 1
else:
@@ -274,7 +324,7 @@ class SearchIndex:
while search_hits:
hit = search_hits.popleft()
hit_id, hit_channel_id = hit['_id'], hit['_source']['channel_id']
if hit_channel_id is None:
if hit_channel_id is None or per_channel_per_page <= 0:
reordered_hits.append((hit_id, hit_channel_id))
elif channel_counters[hit_channel_id] < per_channel_per_page:
reordered_hits.append((hit_id, hit_channel_id))
@@ -499,6 +549,7 @@ def expand_query(**kwargs):
query['should'].append(
{"bool": {"must": [{"match": {"has_source": kwargs['has_source']}}, is_stream_or_repost]}})
query['should'].append({"bool": {"must_not": [is_stream_or_repost]}})
query['should'].append({"bool": {"must": [{"term": {"reposted_claim_type": CLAIM_TYPES['channel']}}]}})
if kwargs.get('text'):
query['must'].append(
{"simple_query_string":
+29 -27
View File
@@ -5,24 +5,21 @@ import os
from collections import namedtuple
from multiprocessing import Process
import apsw
import sqlite3
from elasticsearch import AsyncElasticsearch
from elasticsearch.helpers import async_bulk
from lbry.wallet.server.env import Env
from lbry.wallet.server.coin import LBC
from lbry.wallet.server.db.elasticsearch.search import extract_doc, SearchIndex
INDEX = 'claims'
from lbry.wallet.server.db.elasticsearch.search import extract_doc, SearchIndex, IndexVersionMismatch
async def get_all(db, shard_num, shards_total, limit=0):
async def get_all(db, shard_num, shards_total, limit=0, index_name='claims'):
logging.info("shard %d starting", shard_num)
def exec_factory(cursor, statement, bindings):
tpl = namedtuple('row', (d[0] for d in cursor.getdescription()))
cursor.setrowtrace(lambda cursor, row: tpl(*row))
return True
db.setexectrace(exec_factory)
def namedtuple_factory(cursor, row):
Row = namedtuple('Row', (d[0] for d in cursor.description))
return Row(*row)
db.row_factory = namedtuple_factory
total = db.execute(f"select count(*) as total from claim where height % {shards_total} = {shard_num};").fetchone()[0]
for num, claim in enumerate(db.execute(f"""
SELECT claimtrie.claim_hash as is_controlling,
@@ -30,6 +27,7 @@ SELECT claimtrie.claim_hash as is_controlling,
(select group_concat(tag, ',,') from tag where tag.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as tags,
(select group_concat(language, ' ') from language where language.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as languages,
(select cr.has_source from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_has_source,
(select cr.claim_type from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_claim_type,
claim.*
FROM claim LEFT JOIN claimtrie USING (claim_hash)
WHERE claim.height % {shards_total} = {shard_num}
@@ -43,46 +41,50 @@ ORDER BY claim.height desc
claim['languages'] = claim['languages'].split(' ') if claim['languages'] else []
if num % 10_000 == 0:
logging.info("%d/%d", num, total)
yield extract_doc(claim, INDEX)
yield extract_doc(claim, index_name)
if 0 < limit <= num:
break
async def consume(producer):
async def consume(producer, index_name):
env = Env(LBC)
logging.info("ES sync host: %s:%i", env.elastic_host, env.elastic_port)
es = AsyncElasticsearch([{'host': env.elastic_host, 'port': env.elastic_port}])
try:
await async_bulk(es, producer, request_timeout=120)
await es.indices.refresh(index=INDEX)
await es.indices.refresh(index=index_name)
finally:
await es.close()
async def make_es_index():
async def make_es_index(index=None):
env = Env(LBC)
index = SearchIndex('', elastic_host=env.elastic_host, elastic_port=env.elastic_port)
if index is None:
index = SearchIndex('', elastic_host=env.elastic_host, elastic_port=env.elastic_port)
try:
return await index.start()
except IndexVersionMismatch as err:
logging.info(
"dropping ES search index (version %s) for upgrade to version %s", err.got_version, err.expected_version
)
await index.delete_index()
await index.stop()
return await index.start()
finally:
index.stop()
async def run(args, shard):
def itsbusy(*_):
logging.info("shard %d: db is busy, retry", shard)
return True
db = apsw.Connection(args.db_path, flags=apsw.SQLITE_OPEN_READONLY | apsw.SQLITE_OPEN_URI)
db.setbusyhandler(itsbusy)
db.cursor().execute('pragma journal_mode=wal;')
db.cursor().execute('pragma temp_store=memory;')
producer = get_all(db.cursor(), shard, args.clients, limit=args.blocks)
await asyncio.gather(*(consume(producer) for _ in range(min(8, args.clients))))
async def run(db_path, clients, blocks, shard, index_name='claims'):
db = sqlite3.connect(db_path, isolation_level=None, check_same_thread=False, uri=True)
db.execute('pragma journal_mode=wal;')
db.execute('pragma temp_store=memory;')
producer = get_all(db, shard, clients, limit=blocks, index_name=index_name)
await asyncio.gather(*(consume(producer, index_name=index_name) for _ in range(min(8, clients))))
def __run(args, shard):
asyncio.run(run(args, shard))
asyncio.run(run(args.db_path, args.clients, args.blocks, shard))
def run_elastic_sync():
+1 -1
View File
@@ -231,7 +231,7 @@ def run(db, height, final_height, recalculate_claim_hashes):
FROM claim
WHERE claim_hash IN
({','.join('?' for _ in recalculate_claim_hashes)});
""", recalculate_claim_hashes):
""", list(recalculate_claim_hashes)):
trending_data.update_claim(row[0], 1E-8*row[1], time_boost)
trending_log("done.\n")
@@ -5,7 +5,7 @@ decay rate for high valued claims.
import math
import time
import apsw
import sqlite3
# Half life in blocks *for lower LBC claims* (it's shorter for whale claims)
HALF_LIFE = 200
@@ -96,16 +96,16 @@ class TrendingDB:
"""
def __init__(self):
self.conn = apsw.Connection(":memory:")
self.conn = sqlite3.connect(":memory:", check_same_thread=False)
self.cursor = self.conn.cursor()
self.initialised = False
self.write_needed = set()
def execute(self, query, *args, **kwargs):
return self.cursor.execute(query, *args, **kwargs)
return self.conn.execute(query, *args, **kwargs)
def executemany(self, query, *args, **kwargs):
return self.cursor.executemany(query, *args, **kwargs)
return self.conn.executemany(query, *args, **kwargs)
def begin(self):
self.execute("BEGIN;")
@@ -251,7 +251,7 @@ class TrendingDB:
FROM claims
WHERE claim_hash IN
({','.join('?' for _ in self.write_needed)});
""", self.write_needed).fetchall()
""", list(self.write_needed)).fetchall()
db.executemany("""UPDATE claim SET trending_mixed = ?
WHERE claim_hash = ?;""", rows)
@@ -278,7 +278,7 @@ class TrendingDB:
FROM claim
WHERE claim_hash IN
({','.join('?' for _ in recalculate_claim_hashes)});
""", recalculate_claim_hashes):
""", list(recalculate_claim_hashes)):
claim_hash, lbc = row
# Insert into trending db if it does not exist
+2 -6
View File
@@ -47,14 +47,10 @@ class ZScore:
return self.last
return (self.last - self.mean) / (self.standard_deviation or 1)
@classmethod
def factory(cls):
return cls(), cls.step, cls.finalize
def install(connection):
connection.createaggregatefunction("zscore", ZScore.factory, 1)
connection.cursor().execute(CREATE_TREND_TABLE)
connection.create_aggregate("zscore", 1, ZScore)
connection.executescript(CREATE_TREND_TABLE)
def run(db, height, final_height, affected_claims):
+28 -35
View File
@@ -1,11 +1,10 @@
import os
import apsw
import sqlite3
from typing import Union, Tuple, Set, List
from itertools import chain
from decimal import Decimal
from collections import namedtuple
from multiprocessing import Manager
from binascii import unhexlify, hexlify
from lbry.wallet.server.leveldb import LevelDB
from lbry.wallet.server.util import class_logger
@@ -22,6 +21,7 @@ from .common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS, INDEXED_LANGUAGES
from lbry.wallet.server.db.elasticsearch import SearchIndex
ATTRIBUTE_ARRAY_MAX_LENGTH = 100
sqlite3.enable_callback_tracebacks(True)
class SQLDB:
@@ -220,7 +220,6 @@ class SQLDB:
self.db = None
self.logger = class_logger(__name__, self.__class__.__name__)
self.ledger = Ledger if main.coin.NET == 'mainnet' else RegTestLedger
self.state_manager = None
self.blocked_streams = None
self.blocked_channels = None
self.blocking_channel_hashes = {
@@ -235,27 +234,19 @@ class SQLDB:
self.pending_deletes = set()
def open(self):
self.db = apsw.Connection(
self._db_path,
flags=(
apsw.SQLITE_OPEN_READWRITE |
apsw.SQLITE_OPEN_CREATE |
apsw.SQLITE_OPEN_URI
)
)
def exec_factory(cursor, statement, bindings):
tpl = namedtuple('row', (d[0] for d in cursor.getdescription()))
cursor.setrowtrace(lambda cursor, row: tpl(*row))
return True
self.db.setexectrace(exec_factory)
self.execute(self.PRAGMAS)
self.execute(self.CREATE_TABLES_QUERY)
self.db = sqlite3.connect(self._db_path, isolation_level=None, check_same_thread=False, uri=True)
def namedtuple_factory(cursor, row):
Row = namedtuple('Row', (d[0] for d in cursor.description))
return Row(*row)
self.db.row_factory = namedtuple_factory
self.db.executescript(self.PRAGMAS)
self.db.executescript(self.CREATE_TABLES_QUERY)
register_canonical_functions(self.db)
self.state_manager = Manager()
self.blocked_streams = self.state_manager.dict()
self.blocked_channels = self.state_manager.dict()
self.filtered_streams = self.state_manager.dict()
self.filtered_channels = self.state_manager.dict()
self.blocked_streams = {}
self.blocked_channels = {}
self.filtered_streams = {}
self.filtered_channels = {}
self.update_blocked_and_filtered_claims()
for algorithm in self.trending:
algorithm.install(self.db)
@@ -263,8 +254,6 @@ class SQLDB:
def close(self):
if self.db is not None:
self.db.close()
if self.state_manager is not None:
self.state_manager.shutdown()
def update_blocked_and_filtered_claims(self):
self.update_claims_from_channel_hashes(
@@ -324,10 +313,10 @@ class SQLDB:
return f"DELETE FROM {table} WHERE {where}", values
def execute(self, *args):
return self.db.cursor().execute(*args)
return self.db.execute(*args)
def executemany(self, *args):
return self.db.cursor().executemany(*args)
return self.db.executemany(*args)
def begin(self):
self.execute('begin;')
@@ -406,7 +395,8 @@ class SQLDB:
if isinstance(fee.currency, str):
claim_record['fee_currency'] = fee.currency.lower()
if isinstance(fee.amount, Decimal):
claim_record['fee_amount'] = int(fee.amount*1000)
if fee.amount >= 0 and int(fee.amount*1000) < 9223372036854775807:
claim_record['fee_amount'] = int(fee.amount*1000)
elif claim.is_repost:
claim_record['claim_type'] = CLAIM_TYPES['repost']
claim_record['reposted_claim_hash'] = claim.repost.reference.claim_hash
@@ -624,7 +614,7 @@ class SQLDB:
channel_hash IN ({','.join('?' for _ in changed_channel_keys)}) AND
signature IS NOT NULL
"""
for affected_claim in self.execute(sql, changed_channel_keys.keys()):
for affected_claim in self.execute(sql, list(changed_channel_keys.keys())):
if affected_claim.claim_hash not in signables:
claim_updates.append({
'claim_hash': affected_claim.claim_hash,
@@ -681,7 +671,7 @@ class SQLDB:
signature_valid=CASE WHEN signature IS NOT NULL THEN 0 END,
channel_join=NULL, canonical_url=NULL
WHERE channel_hash IN ({','.join('?' for _ in spent_claims)})
""", spent_claims
""", list(spent_claims)
)
sub_timer.stop()
@@ -806,12 +796,13 @@ class SQLDB:
def update_claimtrie(self, height, changed_claim_hashes, deleted_names, timer):
r = timer.run
binary_claim_hashes = list(changed_claim_hashes)
r(self._calculate_activation_height, height)
r(self._update_support_amount, changed_claim_hashes)
r(self._update_support_amount, binary_claim_hashes)
r(self._update_effective_amount, height, changed_claim_hashes)
r(self._perform_overtake, height, changed_claim_hashes, list(deleted_names))
r(self._update_effective_amount, height, binary_claim_hashes)
r(self._perform_overtake, height, binary_claim_hashes, list(deleted_names))
r(self._update_effective_amount, height)
r(self._perform_overtake, height, [], [])
@@ -822,16 +813,18 @@ class SQLDB:
)
def enqueue_changes(self):
for claim in self.execute(f"""
query = """
SELECT claimtrie.claim_hash as is_controlling,
claimtrie.last_take_over_height,
(select group_concat(tag, ',,') from tag where tag.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as tags,
(select group_concat(language, ' ') from language where language.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as languages,
(select cr.has_source from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_has_source,
(select cr.claim_type from claim cr where cr.claim_hash = claim.reposted_claim_hash) as reposted_claim_type,
claim.*
FROM claim LEFT JOIN claimtrie USING (claim_hash)
WHERE claim.claim_hash in (SELECT claim_hash FROM changelog)
"""):
"""
for claim in self.execute(query):
claim = claim._asdict()
id_set = set(filter(None, (claim['claim_hash'], claim['channel_hash'], claim['reposted_claim_hash'])))
claim['censor_type'] = 0
+6
View File
@@ -73,9 +73,12 @@ class Env:
self.tor_banner_file = self.default('TOR_BANNER_FILE', self.banner_file)
self.anon_logs = self.boolean('ANON_LOGS', False)
self.log_sessions = self.integer('LOG_SESSIONS', 3600)
self.allow_lan_udp = self.boolean('ALLOW_LAN_UDP', False)
self.country = self.default('COUNTRY', 'US')
# Peer discovery
self.peer_discovery = self.peer_discovery_enum()
self.peer_announce = self.boolean('PEER_ANNOUNCE', True)
self.peer_hubs = self.extract_peer_hubs()
self.force_proxy = self.boolean('FORCE_PROXY', False)
self.tor_proxy_host = self.default('TOR_PROXY_HOST', 'localhost')
self.tor_proxy_port = self.integer('TOR_PROXY_PORT', None)
@@ -268,3 +271,6 @@ class Env:
return self.PD_SELF
else:
return self.PD_ON
def extract_peer_hubs(self):
return [hub.strip() for hub in self.default('PEER_HUBS', '').split(',')]
-302
View File
@@ -1,302 +0,0 @@
# Copyright (c) 2017, Neil Booth
#
# All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Representation of a peer server."""
from ipaddress import ip_address
from lbry.wallet.server import util
from lbry.wallet.server.util import cachedproperty
from typing import Dict
class Peer:
# Protocol version
ATTRS = ('host', 'features',
# metadata
'source', 'ip_addr',
'last_good', 'last_try', 'try_count')
FEATURES = ('pruning', 'server_version', 'protocol_min', 'protocol_max',
'ssl_port', 'tcp_port')
# This should be set by the application
DEFAULT_PORTS: Dict[str, int] = {}
def __init__(self, host, features, source='unknown', ip_addr=None,
last_good=0, last_try=0, try_count=0):
"""Create a peer given a host name (or IP address as a string),
a dictionary of features, and a record of the source."""
assert isinstance(host, str)
assert isinstance(features, dict)
assert host in features.get('hosts', {})
self.host = host
self.features = features.copy()
# Canonicalize / clean-up
for feature in self.FEATURES:
self.features[feature] = getattr(self, feature)
# Metadata
self.source = source
self.ip_addr = ip_addr
# last_good represents the last connection that was
# successful *and* successfully verified, at which point
# try_count is set to 0. Failure to connect or failure to
# verify increment the try_count.
self.last_good = last_good
self.last_try = last_try
self.try_count = try_count
# Transient, non-persisted metadata
self.bad = False
self.other_port_pairs = set()
self.status = 2
@classmethod
def peers_from_features(cls, features, source):
peers = []
if isinstance(features, dict):
hosts = features.get('hosts')
if isinstance(hosts, dict):
peers = [Peer(host, features, source=source)
for host in hosts if isinstance(host, str)]
return peers
@classmethod
def deserialize(cls, item):
"""Deserialize from a dictionary."""
return cls(**item)
def matches(self, peers):
"""Return peers whose host matches our hostname or IP address.
Additionally include all peers whose IP address matches our
hostname if that is an IP address.
"""
candidates = (self.host.lower(), self.ip_addr)
return [peer for peer in peers
if peer.host.lower() in candidates
or peer.ip_addr == self.host]
def __str__(self):
return self.host
def update_features(self, features):
"""Update features in-place."""
try:
tmp = Peer(self.host, features)
except Exception:
pass
else:
self.update_features_from_peer(tmp)
def update_features_from_peer(self, peer):
if peer != self:
self.features = peer.features
for feature in self.FEATURES:
setattr(self, feature, getattr(peer, feature))
def connection_port_pairs(self):
"""Return a list of (kind, port) pairs to try when making a
connection."""
# Use a list not a set - it's important to try the registered
# ports first.
pairs = [('SSL', self.ssl_port), ('TCP', self.tcp_port)]
while self.other_port_pairs:
pairs.append(self.other_port_pairs.pop())
return [pair for pair in pairs if pair[1]]
def mark_bad(self):
"""Mark as bad to avoid reconnects but also to remember for a
while."""
self.bad = True
def check_ports(self, other):
"""Remember differing ports in case server operator changed them
or removed one."""
if other.ssl_port != self.ssl_port:
self.other_port_pairs.add(('SSL', other.ssl_port))
if other.tcp_port != self.tcp_port:
self.other_port_pairs.add(('TCP', other.tcp_port))
return bool(self.other_port_pairs)
@cachedproperty
def is_tor(self):
return self.host.endswith('.onion')
@cachedproperty
def is_valid(self):
ip = self.ip_address
if ip:
return ((ip.is_global or ip.is_private)
and not (ip.is_multicast or ip.is_unspecified))
return util.is_valid_hostname(self.host)
@cachedproperty
def is_public(self):
ip = self.ip_address
if ip:
return self.is_valid and not ip.is_private
else:
return self.is_valid and self.host != 'localhost'
@cachedproperty
def ip_address(self):
"""The host as a python ip_address object, or None."""
try:
return ip_address(self.host)
except ValueError:
return None
def bucket(self):
if self.is_tor:
return 'onion'
if not self.ip_addr:
return ''
return tuple(self.ip_addr.split('.')[:2])
def serialize(self):
"""Serialize to a dictionary."""
return {attr: getattr(self, attr) for attr in self.ATTRS}
def _port(self, key):
hosts = self.features.get('hosts')
if isinstance(hosts, dict):
host = hosts.get(self.host)
port = self._integer(key, host)
if port and 0 < port < 65536:
return port
return None
def _integer(self, key, d=None):
d = d or self.features
result = d.get(key) if isinstance(d, dict) else None
if isinstance(result, str):
try:
result = int(result)
except ValueError:
pass
return result if isinstance(result, int) else None
def _string(self, key):
result = self.features.get(key)
return result if isinstance(result, str) else None
@cachedproperty
def genesis_hash(self):
"""Returns None if no SSL port, otherwise the port as an integer."""
return self._string('genesis_hash')
@cachedproperty
def ssl_port(self):
"""Returns None if no SSL port, otherwise the port as an integer."""
return self._port('ssl_port')
@cachedproperty
def tcp_port(self):
"""Returns None if no TCP port, otherwise the port as an integer."""
return self._port('tcp_port')
@cachedproperty
def server_version(self):
"""Returns the server version as a string if known, otherwise None."""
return self._string('server_version')
@cachedproperty
def pruning(self):
"""Returns the pruning level as an integer. None indicates no
pruning."""
pruning = self._integer('pruning')
if pruning and pruning > 0:
return pruning
return None
def _protocol_version_string(self, key):
version_str = self.features.get(key)
ptuple = util.protocol_tuple(version_str)
return util.version_string(ptuple)
@cachedproperty
def protocol_min(self):
"""Minimum protocol version as a string, e.g., 1.0"""
return self._protocol_version_string('protocol_min')
@cachedproperty
def protocol_max(self):
"""Maximum protocol version as a string, e.g., 1.1"""
return self._protocol_version_string('protocol_max')
def to_tuple(self):
"""The tuple ((ip, host, details) expected in response
to a peers subscription."""
details = self.real_name().split()[1:]
return (self.ip_addr or self.host, self.host, details)
def real_name(self):
"""Real name of this peer as used on IRC."""
def port_text(letter, port):
if port == self.DEFAULT_PORTS.get(letter):
return letter
else:
return letter + str(port)
parts = [self.host, 'v' + self.protocol_max]
if self.pruning:
parts.append(f'p{self.pruning:d}')
for letter, port in (('s', self.ssl_port), ('t', self.tcp_port)):
if port:
parts.append(port_text(letter, port))
return ' '.join(parts)
@classmethod
def from_real_name(cls, real_name, source):
"""Real name is a real name as on IRC, such as
"erbium1.sytes.net v1.0 s t"
Returns an instance of this Peer class.
"""
host = 'nohost'
features = {}
ports = {}
for n, part in enumerate(real_name.split()):
if n == 0:
host = part
continue
if part[0] in ('s', 't'):
if len(part) == 1:
port = cls.DEFAULT_PORTS[part[0]]
else:
port = part[1:]
if part[0] == 's':
ports['ssl_port'] = port
else:
ports['tcp_port'] = port
elif part[0] == 'v':
features['protocol_max'] = features['protocol_min'] = part[1:]
elif part[0] == 'p':
features['pruning'] = part[1:]
features.update(ports)
features['hosts'] = {host: ports}
return cls(host, features, source)
-506
View File
@@ -1,506 +0,0 @@
# Copyright (c) 2017-2018, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
"""Peer management."""
import asyncio
import random
import socket
import ssl
import time
import typing
from asyncio import Event, sleep
from collections import defaultdict, Counter
from lbry.wallet.tasks import TaskGroup
from lbry.wallet.rpc import (
Connector, RPCSession, SOCKSProxy, Notification, handler_invocation,
SOCKSError, RPCError
)
from lbry.wallet.server.peer import Peer
from lbry.wallet.server.util import class_logger, protocol_tuple
PEER_GOOD, PEER_STALE, PEER_NEVER, PEER_BAD = range(4)
STALE_SECS = 24 * 3600
WAKEUP_SECS = 300
class BadPeerError(Exception):
pass
def assert_good(message, result, instance):
if not isinstance(result, instance):
raise BadPeerError(f'{message} returned bad result type '
f'{type(result).__name__}')
class PeerSession(RPCSession):
"""An outgoing session to a peer."""
async def handle_request(self, request):
# We subscribe so might be unlucky enough to get a notification...
if (isinstance(request, Notification) and
request.method == 'blockchain.headers.subscribe'):
pass
else:
await handler_invocation(None, request) # Raises
class PeerManager:
"""Looks after the DB of peer network servers.
Attempts to maintain a connection with up to 8 peers.
Issues a 'peers.subscribe' RPC to them and tells them our data.
"""
def __init__(self, env, db):
self.logger = class_logger(__name__, self.__class__.__name__)
# Initialise the Peer class
Peer.DEFAULT_PORTS = env.coin.PEER_DEFAULT_PORTS
self.env = env
self.db = db
# Our clearnet and Tor Peers, if any
sclass = env.coin.SESSIONCLS
self.myselves = [Peer(ident.host, sclass.server_features(env), 'env')
for ident in env.identities]
self.server_version_args = sclass.server_version_args()
# Peers have one entry per hostname. Once connected, the
# ip_addr property is either None, an onion peer, or the
# IP address that was connected to. Adding a peer will evict
# any other peers with the same host name or IP address.
self.peers: typing.Set[Peer] = set()
self.permit_onion_peer_time = time.time()
self.proxy = None
self.group = TaskGroup()
def _my_clearnet_peer(self):
"""Returns the clearnet peer representing this server, if any."""
clearnet = [peer for peer in self.myselves if not peer.is_tor]
return clearnet[0] if clearnet else None
def _set_peer_statuses(self):
"""Set peer statuses."""
cutoff = time.time() - STALE_SECS
for peer in self.peers:
if peer.bad:
peer.status = PEER_BAD
elif peer.last_good > cutoff:
peer.status = PEER_GOOD
elif peer.last_good:
peer.status = PEER_STALE
else:
peer.status = PEER_NEVER
def _features_to_register(self, peer, remote_peers):
"""If we should register ourselves to the remote peer, which has
reported the given list of known peers, return the clearnet
identity features to register, otherwise None.
"""
# Announce ourself if not present. Don't if disabled, we
# are a non-public IP address, or to ourselves.
if not self.env.peer_announce or peer in self.myselves:
return None
my = self._my_clearnet_peer()
if not my or not my.is_public:
return None
# Register if no matches, or ports have changed
for peer in my.matches(remote_peers):
if peer.tcp_port == my.tcp_port and peer.ssl_port == my.ssl_port:
return None
return my.features
def _permit_new_onion_peer(self):
"""Accept a new onion peer only once per random time interval."""
now = time.time()
if now < self.permit_onion_peer_time:
return False
self.permit_onion_peer_time = now + random.randrange(0, 1200)
return True
async def _import_peers(self):
"""Import hard-coded peers from a file or the coin defaults."""
imported_peers = self.myselves.copy()
# Add the hard-coded ones unless only reporting ourself
if self.env.peer_discovery != self.env.PD_SELF:
imported_peers.extend(Peer.from_real_name(real_name, 'coins.py')
for real_name in self.env.coin.PEERS)
await self._note_peers(imported_peers, limit=None)
async def _detect_proxy(self):
"""Detect a proxy if we don't have one and some time has passed since
the last attempt.
If found self.proxy is set to a SOCKSProxy instance, otherwise
None.
"""
host = self.env.tor_proxy_host
if self.env.tor_proxy_port is None:
ports = [9050, 9150, 1080]
else:
ports = [self.env.tor_proxy_port]
while True:
self.logger.info(f'trying to detect proxy on "{host}" '
f'ports {ports}')
proxy = await SOCKSProxy.auto_detect_host(host, ports, None)
if proxy:
self.proxy = proxy
self.logger.info(f'detected {proxy}')
return
self.logger.info('no proxy detected, will try later')
await sleep(900)
async def _note_peers(self, peers, limit=2, check_ports=False,
source=None):
"""Add a limited number of peers that are not already present."""
new_peers = []
for peer in peers:
if not peer.is_public or (peer.is_tor and not self.proxy):
continue
matches = peer.matches(self.peers)
if not matches:
new_peers.append(peer)
elif check_ports:
for match in matches:
if match.check_ports(peer):
self.logger.info(f'ports changed for {peer}')
match.retry_event.set()
if new_peers:
source = source or new_peers[0].source
if limit:
random.shuffle(new_peers)
use_peers = new_peers[:limit]
else:
use_peers = new_peers
for peer in use_peers:
self.logger.info(f'accepted new peer {peer} from {source}')
peer.retry_event = Event()
self.peers.add(peer)
await self.group.add(self._monitor_peer(peer))
async def _monitor_peer(self, peer):
# Stop monitoring if we were dropped (a duplicate peer)
while peer in self.peers:
if await self._should_drop_peer(peer):
self.peers.discard(peer)
break
# Figure out how long to sleep before retrying. Retry a
# good connection when it is about to turn stale, otherwise
# exponentially back off retries.
if peer.try_count == 0:
pause = STALE_SECS - WAKEUP_SECS * 2
else:
pause = WAKEUP_SECS * 2 ** peer.try_count
pending, done = await asyncio.wait([peer.retry_event.wait()], timeout=pause)
if done:
peer.retry_event.clear()
async def _should_drop_peer(self, peer):
peer.try_count += 1
is_good = False
for kind, port in peer.connection_port_pairs():
peer.last_try = time.time()
kwargs = {}
if kind == 'SSL':
kwargs['ssl'] = ssl.SSLContext(ssl.PROTOCOL_TLS)
host = self.env.cs_host(for_rpc=False)
if isinstance(host, list):
host = host[0]
if self.env.force_proxy or peer.is_tor:
if not self.proxy:
return
kwargs['proxy'] = self.proxy
kwargs['resolve'] = not peer.is_tor
elif host:
# Use our listening Host/IP for outgoing non-proxy
# connections so our peers see the correct source.
kwargs['local_addr'] = (host, None)
peer_text = f'[{peer}:{port} {kind}]'
try:
async with Connector(PeerSession, peer.host, port,
**kwargs) as session:
await asyncio.wait_for(
self._verify_peer(session, peer),
120 if peer.is_tor else 30
)
is_good = True
break
except BadPeerError as e:
self.logger.error(f'{peer_text} marking bad: ({e})')
peer.mark_bad()
break
except RPCError as e:
self.logger.error(f'{peer_text} RPC error: {e.message} '
f'({e.code})')
except (OSError, SOCKSError, ConnectionError, asyncio.TimeoutError) as e:
self.logger.info(f'{peer_text} {e}')
if is_good:
now = time.time()
elapsed = now - peer.last_try
self.logger.info(f'{peer_text} verified in {elapsed:.1f}s')
peer.try_count = 0
peer.last_good = now
peer.source = 'peer'
# At most 2 matches if we're a host name, potentially
# several if we're an IP address (several instances
# can share a NAT).
matches = peer.matches(self.peers)
for match in matches:
if match.ip_address:
if len(matches) > 1:
self.peers.remove(match)
# Force the peer's monitoring task to exit
match.retry_event.set()
elif peer.host in match.features['hosts']:
match.update_features_from_peer(peer)
else:
# Forget the peer if long-term unreachable
if peer.last_good and not peer.bad:
try_limit = 10
else:
try_limit = 3
if peer.try_count >= try_limit:
desc = 'bad' if peer.bad else 'unreachable'
self.logger.info(f'forgetting {desc} peer: {peer}')
return True
return False
async def _verify_peer(self, session, peer):
if not peer.is_tor:
address = session.peer_address()
if address:
peer.ip_addr = address[0]
# server.version goes first
message = 'server.version'
result = await session.send_request(message, self.server_version_args)
assert_good(message, result, list)
# Protocol version 1.1 returns a pair with the version first
if len(result) != 2 or not all(isinstance(x, str) for x in result):
raise BadPeerError(f'bad server.version result: {result}')
server_version, protocol_version = result
peer.server_version = server_version
peer.features['server_version'] = server_version
ptuple = protocol_tuple(protocol_version)
await asyncio.wait([
self._send_headers_subscribe(session, peer, ptuple),
self._send_server_features(session, peer),
self._send_peers_subscribe(session, peer)
])
async def _send_headers_subscribe(self, session, peer, ptuple):
message = 'blockchain.headers.subscribe'
result = await session.send_request(message)
assert_good(message, result, dict)
our_height = self.db.db_height
if ptuple < (1, 3):
their_height = result.get('block_height')
else:
their_height = result.get('height')
if not isinstance(their_height, int):
raise BadPeerError(f'invalid height {their_height}')
if abs(our_height - their_height) > 5:
raise BadPeerError(f'bad height {their_height:,d} '
f'(ours: {our_height:,d})')
# Check prior header too in case of hard fork.
check_height = min(our_height, their_height)
raw_header = self.db.raw_header(check_height)
if ptuple >= (1, 4):
ours = raw_header.hex()
message = 'blockchain.block.header'
theirs = await session.send_request(message, [check_height])
assert_good(message, theirs, str)
if ours != theirs:
raise BadPeerError(f'our header {ours} and '
f'theirs {theirs} differ')
else:
ours = self.env.coin.electrum_header(raw_header, check_height)
ours = ours.get('prev_block_hash')
message = 'blockchain.block.get_header'
theirs = await session.send_request(message, [check_height])
assert_good(message, theirs, dict)
theirs = theirs.get('prev_block_hash')
if ours != theirs:
raise BadPeerError(f'our header hash {ours} and '
f'theirs {theirs} differ')
async def _send_server_features(self, session, peer):
message = 'server.features'
features = await session.send_request(message)
assert_good(message, features, dict)
hosts = [host.lower() for host in features.get('hosts', {})]
if self.env.coin.GENESIS_HASH != features.get('genesis_hash'):
raise BadPeerError('incorrect genesis hash')
elif peer.host.lower() in hosts:
peer.update_features(features)
else:
raise BadPeerError(f'not listed in own hosts list {hosts}')
async def _send_peers_subscribe(self, session, peer):
message = 'server.peers.subscribe'
raw_peers = await session.send_request(message)
assert_good(message, raw_peers, list)
# Check the peers list we got from a remote peer.
# Each is expected to be of the form:
# [ip_addr, hostname, ['v1.0', 't51001', 's51002']]
# Call add_peer if the remote doesn't appear to know about us.
try:
real_names = [' '.join([u[1]] + u[2]) for u in raw_peers]
peers = [Peer.from_real_name(real_name, str(peer))
for real_name in real_names]
except Exception:
raise BadPeerError('bad server.peers.subscribe response')
await self._note_peers(peers)
features = self._features_to_register(peer, peers)
if not features:
return
self.logger.info(f'registering ourself with {peer}')
# We only care to wait for the response
await session.send_request('server.add_peer', [features])
#
# External interface
#
async def discover_peers(self):
"""Perform peer maintenance. This includes
1) Forgetting unreachable peers.
2) Verifying connectivity of new peers.
3) Retrying old peers at regular intervals.
"""
if self.env.peer_discovery != self.env.PD_ON:
self.logger.info('peer discovery is disabled')
return
self.logger.info(f'beginning peer discovery. Force use of '
f'proxy: {self.env.force_proxy}')
self.group.add(self._detect_proxy())
self.group.add(self._import_peers())
def info(self) -> typing.Dict[str, int]:
"""The number of peers."""
self._set_peer_statuses()
counter = Counter(peer.status for peer in self.peers)
return {
'bad': counter[PEER_BAD],
'good': counter[PEER_GOOD],
'never': counter[PEER_NEVER],
'stale': counter[PEER_STALE],
'total': len(self.peers),
}
async def add_localRPC_peer(self, real_name):
"""Add a peer passed by the admin over LocalRPC."""
await self._note_peers([Peer.from_real_name(real_name, 'RPC')])
async def on_add_peer(self, features, source_info):
"""Add a peer (but only if the peer resolves to the source)."""
if not source_info:
self.logger.info('ignored add_peer request: no source info')
return False
source = source_info[0]
peers = Peer.peers_from_features(features, source)
if not peers:
self.logger.info('ignored add_peer request: no peers given')
return False
# Just look at the first peer, require it
peer = peers[0]
host = peer.host
if peer.is_tor:
permit = self._permit_new_onion_peer()
reason = 'rate limiting'
else:
getaddrinfo = asyncio.get_event_loop().getaddrinfo
try:
infos = await getaddrinfo(host, 80, type=socket.SOCK_STREAM)
except socket.gaierror:
permit = False
reason = 'address resolution failure'
else:
permit = any(source == info[-1][0] for info in infos)
reason = 'source-destination mismatch'
if permit:
self.logger.info(f'accepted add_peer request from {source} '
f'for {host}')
await self._note_peers([peer], check_ports=True)
else:
self.logger.warning(f'rejected add_peer request from {source} '
f'for {host} ({reason})')
return permit
def on_peers_subscribe(self, is_tor):
"""Returns the server peers as a list of (ip, host, details) tuples.
We return all peers we've connected to in the last day.
Additionally, if we don't have onion routing, we return a few
hard-coded onion servers.
"""
cutoff = time.time() - STALE_SECS
recent = [peer for peer in self.peers
if peer.last_good > cutoff and
not peer.bad and peer.is_public]
onion_peers = []
# Always report ourselves if valid (even if not public)
peers = {myself for myself in self.myselves
if myself.last_good > cutoff}
# Bucket the clearnet peers and select up to two from each
buckets = defaultdict(list)
for peer in recent:
if peer.is_tor:
onion_peers.append(peer)
else:
buckets[peer.bucket()].append(peer)
for bucket_peers in buckets.values():
random.shuffle(bucket_peers)
peers.update(bucket_peers[:2])
# Add up to 20% onion peers (but up to 10 is OK anyway)
random.shuffle(onion_peers)
max_onion = 50 if is_tor else max(10, len(peers) // 4)
peers.update(onion_peers[:max_onion])
return [peer.to_tuple() for peer in peers]
def proxy_peername(self):
"""Return the peername of the proxy, if there is a proxy, otherwise
None."""
return self.proxy.peername if self.proxy else None
def rpc_data(self):
"""Peer data for the peers RPC method."""
self._set_peer_statuses()
descs = ['good', 'stale', 'never', 'bad']
def peer_data(peer):
data = peer.serialize()
data['status'] = descs[peer.status]
return data
def peer_key(peer):
return (peer.bad, -peer.last_good)
return [peer_data(peer) for peer in sorted(self.peers, key=peer_key)]
+2 -2
View File
@@ -114,8 +114,8 @@ class Server:
await self.start_prometheus()
if self.env.udp_port:
await self.bp.status_server.start(
0, bytes.fromhex(self.bp.coin.GENESIS_HASH)[::-1],
self.env.host, self.env.udp_port
0, bytes.fromhex(self.bp.coin.GENESIS_HASH)[::-1], self.env.country,
self.env.host, self.env.udp_port, self.env.allow_lan_udp
)
await _start_cancellable(self.bp.fetch_and_process_blocks)
+18 -15
View File
@@ -39,7 +39,6 @@ from lbry.wallet.server import text
from lbry.wallet.server import util
from lbry.wallet.server.hash import sha256, hash_to_hex_str, hex_str_to_hash, HASHX_LEN, Base58Error
from lbry.wallet.server.daemon import DaemonError
from lbry.wallet.server.peers import PeerManager
if typing.TYPE_CHECKING:
from lbry.wallet.server.env import Env
from lbry.wallet.server.mempool import MemPool
@@ -185,7 +184,6 @@ class SessionManager:
self.bp = bp
self.daemon = daemon
self.mempool = mempool
self.peer_mgr = PeerManager(env, db)
self.shutdown_event = shutdown_event
self.logger = util.class_logger(__name__, self.__class__.__name__)
self.servers: typing.Dict[str, asyncio.AbstractServer] = {}
@@ -209,7 +207,7 @@ class SessionManager:
else:
protocol_class = self.env.coin.SESSIONCLS
protocol_factory = partial(protocol_class, self, self.db,
self.mempool, self.peer_mgr, kind)
self.mempool, kind)
host, port = args[:2]
try:
@@ -369,7 +367,7 @@ class SessionManager:
'logged': logged,
'paused': paused,
'pid': os.getpid(),
'peers': self.peer_mgr.info(),
'peers': [],
'requests': pending_requests,
'method_counts': method_counts,
'sessions': self.session_count(),
@@ -436,7 +434,7 @@ class SessionManager:
real_name: "bch.electrumx.cash t50001 s50002" for example
"""
await self.peer_mgr.add_localRPC_peer(real_name)
await self._notify_peer(real_name)
return f"peer '{real_name}' added"
async def rpc_disconnect(self, session_ids):
@@ -487,7 +485,7 @@ class SessionManager:
async def rpc_peers(self):
"""Return a list of data about server peers."""
return self.peer_mgr.rpc_data()
return self.env.peer_hubs
async def rpc_query(self, items, limit):
"""Return a list of data about server peers."""
@@ -578,7 +576,6 @@ class SessionManager:
# Peer discovery should start after the external servers
# because we connect to ourself
await asyncio.wait([
self.peer_mgr.discover_peers(),
self._clear_stale_sessions(),
self._log_sessions(),
self._manage_servers()
@@ -638,6 +635,15 @@ class SessionManager:
self.history_cache[hashX] = await self.db.limited_history(hashX, limit=limit)
return self.history_cache[hashX]
def _notify_peer(self, peer):
notify_tasks = [
session.send_notification('blockchain.peers.subscribe', [peer])
for session in self.sessions.values() if session.subscribe_peers
]
if notify_tasks:
self.logger.info(f'notify {len(notify_tasks)} sessions of new peers')
asyncio.create_task(asyncio.wait(notify_tasks))
async def _notify_sessions(self, height, touched, new_touched):
"""Notify sessions about height changes and touched addresses."""
height_changed = height != self.notified_height
@@ -704,7 +710,7 @@ class SessionBase(RPCSession):
request_handlers: typing.Dict[str, typing.Callable] = {}
version = '0.5.7'
def __init__(self, session_mgr, db, mempool, peer_mgr, kind):
def __init__(self, session_mgr, db, mempool, kind):
connection = JSONRPCConnection(JSONRPCAutoDetect)
self.env = session_mgr.env
super().__init__(connection=connection)
@@ -712,7 +718,6 @@ class SessionBase(RPCSession):
self.session_mgr = session_mgr
self.db = db
self.mempool = mempool
self.peer_mgr = peer_mgr
self.kind = kind # 'RPC', 'TCP' etc.
self.coin = self.env.coin
self.anon_logs = self.env.anon_logs
@@ -904,6 +909,7 @@ class LBRYElectrumX(SessionBase):
LBRYElectrumX.set_server_features(self.env)
self.subscribe_headers = False
self.subscribe_headers_raw = False
self.subscribe_peers = False
self.connection.max_response_size = self.env.max_send
self.hashX_subs = {}
self.sv_seen = False
@@ -1084,7 +1090,8 @@ class LBRYElectrumX(SessionBase):
async def peers_subscribe(self):
"""Return the server peers as a list of (ip, host, details) tuples."""
return self.peer_mgr.on_peers_subscribe(self.is_tor())
self.subscribe_peers = True
return self.env.peer_hubs
async def address_status(self, hashX):
"""Returns an address status.
@@ -1327,11 +1334,7 @@ class LBRYElectrumX(SessionBase):
async def banner(self):
"""Return the server banner text."""
banner = f'You are connected to an {self.version} server.'
if self.is_tor():
banner_file = self.env.tor_banner_file
else:
banner_file = self.env.banner_file
banner_file = self.env.banner_file
if banner_file:
try:
with codecs.open(banner_file, 'r', 'utf-8') as f:
+56 -19
View File
@@ -3,7 +3,8 @@ import struct
from time import perf_counter
import logging
from typing import Optional, Tuple, NamedTuple
from lbry.utils import LRUCache
from lbry.utils import LRUCache, is_valid_public_ipv4
from lbry.schema.attrs import country_str_to_int, country_int_to_str
# from prometheus_client import Counter
@@ -13,6 +14,9 @@ _MAGIC = 1446058291 # genesis blocktime (which is actually wrong)
_PAD_BYTES = b'\x00' * 64
PROTOCOL_VERSION = 1
class SPVPing(NamedTuple):
magic: int
protocol_version: int
@@ -22,8 +26,8 @@ class SPVPing(NamedTuple):
return struct.pack(b'!lB64s', *self)
@staticmethod
def make(protocol_version=1) -> bytes:
return SPVPing(_MAGIC, protocol_version, _PAD_BYTES).encode()
def make() -> bytes:
return SPVPing(_MAGIC, PROTOCOL_VERSION, _PAD_BYTES).encode()
@classmethod
def decode(cls, packet: bytes):
@@ -33,24 +37,40 @@ class SPVPing(NamedTuple):
return decoded
PONG_ENCODING = b'!BBL32s4sH'
class SPVPong(NamedTuple):
protocol_version: int
flags: int
height: int
tip: bytes
source_address_raw: bytes
country: int
def encode(self):
return struct.pack(b'!BBl32s4s', *self)
return struct.pack(PONG_ENCODING, *self)
@staticmethod
def make(height: int, tip: bytes, flags: int, protocol_version: int = 1) -> bytes:
# note: drops the last 4 bytes so the result can be cached and have addresses added to it as needed
return SPVPong(protocol_version, flags, height, tip, b'\x00\x00\x00\x00').encode()[:38]
def encode_address(address: str):
return bytes(int(b) for b in address.split("."))
@classmethod
def make(cls, flags: int, height: int, tip: bytes, source_address: str, country: str) -> bytes:
return SPVPong(
PROTOCOL_VERSION, flags, height, tip,
cls.encode_address(source_address),
country_str_to_int(country)
).encode()
@classmethod
def make_sans_source_address(cls, flags: int, height: int, tip: bytes, country: str) -> Tuple[bytes, bytes]:
pong = cls.make(flags, height, tip, '0.0.0.0', country)
return pong[:38], pong[42:]
@classmethod
def decode(cls, packet: bytes):
return cls(*struct.unpack(b'!BBl32s4s', packet[:42]))
return cls(*struct.unpack(PONG_ENCODING, packet[:44]))
@property
def available(self) -> bool:
@@ -60,29 +80,41 @@ class SPVPong(NamedTuple):
def ip_address(self) -> str:
return ".".join(map(str, self.source_address_raw))
@property
def country_name(self):
return country_int_to_str(self.country)
def __repr__(self) -> str:
return f"SPVPong(external_ip={self.ip_address}, version={self.protocol_version}, " \
f"available={'True' if self.flags & 1 > 0 else 'False'}," \
f" height={self.height}, tip={self.tip[::-1].hex()})"
f" height={self.height}, tip={self.tip[::-1].hex()}, country={self.country_name})"
class SPVServerStatusProtocol(asyncio.DatagramProtocol):
PROTOCOL_VERSION = 1
def __init__(self, height: int, tip: bytes, throttle_cache_size: int = 1024, throttle_reqs_per_sec: int = 10):
def __init__(
self, height: int, tip: bytes, country: str,
throttle_cache_size: int = 1024, throttle_reqs_per_sec: int = 10,
allow_localhost: bool = False, allow_lan: bool = False
):
super().__init__()
self.transport: Optional[asyncio.transports.DatagramTransport] = None
self._height = height
self._tip = tip
self._flags = 0
self._cached_response = None
self._country = country
self._left_cache = self._right_cache = None
self.update_cached_response()
self._throttle = LRUCache(throttle_cache_size)
self._should_log = LRUCache(throttle_cache_size)
self._min_delay = 1 / throttle_reqs_per_sec
self._allow_localhost = allow_localhost
self._allow_lan = allow_lan
def update_cached_response(self):
self._cached_response = SPVPong.make(self._height, self._tip, self._flags, self.PROTOCOL_VERSION)
self._left_cache, self._right_cache = SPVPong.make_sans_source_address(
self._flags, max(0, self._height), self._tip, self._country
)
def set_unavailable(self):
self._flags &= 0b11111110
@@ -109,7 +141,7 @@ class SPVServerStatusProtocol(asyncio.DatagramProtocol):
return False
def make_pong(self, host):
return self._cached_response + bytes(int(b) for b in host.split("."))
return self._left_cache + SPVPong.encode_address(host) + self._right_cache
def datagram_received(self, data: bytes, addr: Tuple[str, int]):
if self.should_throttle(addr[0]):
@@ -119,7 +151,11 @@ class SPVServerStatusProtocol(asyncio.DatagramProtocol):
except (ValueError, struct.error, AttributeError, TypeError):
# log.exception("derp")
return
self.transport.sendto(self.make_pong(addr[0]), addr)
if addr[1] >= 1024 and is_valid_public_ipv4(
addr[0], allow_localhost=self._allow_localhost, allow_lan=self._allow_lan):
self.transport.sendto(self.make_pong(addr[0]), addr)
else:
log.warning("odd packet from %s:%i", addr[0], addr[1])
# ping_count_metric.inc()
def connection_made(self, transport) -> None:
@@ -137,12 +173,14 @@ class StatusServer:
def __init__(self):
self._protocol: Optional[SPVServerStatusProtocol] = None
async def start(self, height: int, tip: bytes, interface: str, port: int):
async def start(self, height: int, tip: bytes, country: str, interface: str, port: int, allow_lan: bool = False):
if self.is_running:
return
loop = asyncio.get_event_loop()
self._protocol = SPVServerStatusProtocol(height, tip)
interface = interface if interface.lower() != 'localhost' else '127.0.0.1'
self._protocol = SPVServerStatusProtocol(
height, tip, country, allow_localhost=interface == '127.0.0.1', allow_lan=allow_lan
)
await loop.create_datagram_endpoint(lambda: self._protocol, (interface, port))
log.info("started udp status server on %s:%i", interface, port)
@@ -169,13 +207,12 @@ class StatusServer:
class SPVStatusClientProtocol(asyncio.DatagramProtocol):
PROTOCOL_VERSION = 1
def __init__(self, responses: asyncio.Queue):
super().__init__()
self.transport: Optional[asyncio.transports.DatagramTransport] = None
self.responses = responses
self._ping_packet = SPVPing.make(self.PROTOCOL_VERSION)
self._ping_packet = SPVPing.make()
def datagram_received(self, data: bytes, addr: Tuple[str, int]):
try:
+1 -1
View File
@@ -1,3 +1,3 @@
# need this to avoid circular import
PROTOCOL_MIN = (0, 54, 0)
PROTOCOL_MAX = (0, 99, 0)
PROTOCOL_MAX = (0, 199, 0)
+28 -6
View File
@@ -272,16 +272,31 @@ class Output(InputOutput):
def id(self):
return self.ref.id
@property
def is_pubkey_hash(self):
return 'pubkey_hash' in self.script.values
@property
def pubkey_hash(self):
return self.script.values['pubkey_hash']
@property
def is_script_hash(self):
return 'script_hash' in self.script.values
@property
def script_hash(self):
return self.script.values['script_hash']
@property
def has_address(self):
return 'pubkey_hash' in self.script.values
return self.is_pubkey_hash or self.is_script_hash
def get_address(self, ledger):
return ledger.hash160_to_address(self.pubkey_hash)
if self.is_pubkey_hash:
return ledger.hash160_to_address(self.pubkey_hash)
elif self.is_script_hash:
return ledger.hash160_to_script_address(self.script_hash)
def get_estimator(self, ledger):
return OutputEffectiveAmountEstimator(ledger, self)
@@ -290,6 +305,10 @@ class Output(InputOutput):
def pay_pubkey_hash(cls, amount, pubkey_hash):
return cls(amount, OutputScript.pay_pubkey_hash(pubkey_hash))
@classmethod
def pay_script_hash(cls, amount, pubkey_hash):
return cls(amount, OutputScript.pay_script_hash(pubkey_hash))
@classmethod
def deserialize_from(cls, stream):
return cls(
@@ -906,15 +925,18 @@ class Transaction:
@classmethod
def support(cls, claim_name: str, claim_id: str, amount: int, holding_address: str,
funding_accounts: List['Account'], change_account: 'Account', signing_channel: Output = None):
funding_accounts: List['Account'], change_account: 'Account', signing_channel: Output = None,
comment: str = None):
ledger, _ = cls.ensure_all_have_same_ledger_and_wallet(funding_accounts, change_account)
if signing_channel is not None:
if signing_channel is not None or comment is not None:
support = Support()
support.emoji = '👍'
if comment is not None:
support.comment = comment
support_output = Output.pay_support_data_pubkey_hash(
amount, claim_name, claim_id, support, ledger.address_to_hash160(holding_address)
)
support_output.sign(signing_channel, b'placeholder txid:nout')
if signing_channel is not None:
support_output.sign(signing_channel, b'placeholder txid:nout')
else:
support_output = Output.pay_support_pubkey_hash(
amount, claim_name, claim_id, ledger.address_to_hash160(holding_address)
+1 -1
View File
@@ -35,7 +35,7 @@ class WalletServerPayer:
if not address or not amount:
continue
if not self.ledger.is_valid_address(address):
if not self.ledger.is_pubkey_address(address):
self._on_payment_controller.add_error(ServerPaymentInvalidAddressError(address))
continue
@@ -196,12 +196,13 @@ class ClaimSearchCommand(ClaimTestCase):
normal = await self.stream_create('normal', data=b'normal')
normal_repost = await self.stream_repost(self.get_claim_id(normal), 'normal-repost')
no_source_repost = await self.stream_repost(self.get_claim_id(no_source), 'no-source-repost')
await self.assertFindsClaims([no_source_repost, no_source, channel], has_no_source=True)
channel_repost = await self.stream_repost(self.get_claim_id(channel), 'channel-repost')
await self.assertFindsClaims([channel_repost, no_source_repost, no_source, channel], has_no_source=True)
await self.assertListsClaims([no_source, channel], has_no_source=True)
await self.assertFindsClaims([normal_repost, normal, channel], has_source=True)
await self.assertListsClaims([no_source_repost, normal_repost, normal], has_source=True)
await self.assertFindsClaims([no_source_repost, normal_repost, normal, no_source, channel])
await self.assertListsClaims([no_source_repost, normal_repost, normal, no_source, channel])
await self.assertFindsClaims([channel_repost, normal_repost, normal, channel], has_source=True)
await self.assertListsClaims([channel_repost, no_source_repost, normal_repost, normal], has_source=True)
await self.assertFindsClaims([channel_repost, no_source_repost, normal_repost, normal, no_source, channel])
await self.assertListsClaims([channel_repost, no_source_repost, normal_repost, normal, no_source, channel])
async def test_pagination(self):
await self.create_channel()
@@ -397,6 +398,32 @@ class ClaimSearchCommand(ClaimTestCase):
limit_claims_per_channel=3, claim_type='stream'
)
async def test_no_duplicates(self):
await self.generate(10)
match = self.assertFindsClaims
claims = []
channels = []
first = await self.stream_create('original_claim0')
second = await self.stream_create('original_claim1')
for i in range(10):
repost_id = self.get_claim_id(second if i % 2 == 0 else first)
channel = await self.channel_create(f'@chan{i}', bid='0.001')
channels.append(channel)
claims.append(
await self.stream_repost(repost_id, f'claim{i}', bid='0.001', channel_id=self.get_claim_id(channel)))
await match([first, second] + channels,
remove_duplicates=True, order_by=['^height'])
await match(list(reversed(channels)) + [second, first],
remove_duplicates=True, order_by=['height'])
# the original claims doesn't show up, so we pick the oldest reposts
await match([channels[0], claims[0], channels[1], claims[1]] + channels[2:],
height='>218',
remove_duplicates=True, order_by=['^height'])
# limit claims per channel, invert order, oldest ones are still chosen
await match(channels[2:][::-1] + [claims[1], channels[1], claims[0], channels[0]],
height='>218', limit_claims_per_channel=1,
remove_duplicates=True, order_by=['height'])
async def test_limit_claims_per_channel_across_sorted_pages(self):
await self.generate(10)
match = self.assertFindsClaims
@@ -428,6 +455,12 @@ class ClaimSearchCommand(ClaimTestCase):
[claims[6], claims[7], last], page_size=4, page=3,
limit_claims_per_channel=1, claim_type='stream', order_by=['^height']
)
# feature disabled on 0 or negative values
for limit in [None, 0, -1]:
await match(
[first, second] + claims + [last],
limit_claims_per_channel=limit, claim_type='stream', order_by=['^height']
)
async def test_claim_type_and_media_type_search(self):
# create an invalid/unknown claim
@@ -541,6 +574,21 @@ class TransactionCommands(ClaimTestCase):
class TransactionOutputCommands(ClaimTestCase):
async def test_support_with_comment(self):
channel = self.get_claim_id(await self.channel_create('@identity'))
stream = self.get_claim_id(await self.stream_create())
support = await self.support_create(stream, channel_id=channel, comment="nice!")
self.assertEqual(support['outputs'][0]['value']['comment'], "nice!")
r, = await self.txo_list(type='support')
self.assertEqual(r['txid'], support['txid'])
self.assertEqual(r['value']['comment'], "nice!")
await self.support_abandon(txid=support['txid'], nout=0, blocking=True)
support = await self.support_create(stream, comment="anonymously great!")
self.assertEqual(support['outputs'][0]['value']['comment'], "anonymously great!")
r, = await self.txo_list(type='support', is_not_spent=True)
self.assertEqual(r['txid'], support['txid'])
self.assertEqual(r['value']['comment'], "anonymously great!")
async def test_txo_list_resolve_supports(self):
channel = self.get_claim_id(await self.channel_create('@identity'))
stream = self.get_claim_id(await self.stream_create())
@@ -1353,9 +1401,6 @@ class StreamCommands(ClaimTestCase):
self.assertTrue(signed['outputs'][0]['is_channel_signature_valid'])
async def test_repost(self):
sql = self.conductor.spv_node.server.bp.sql
sql.execute(sql.TAG_INDEXES)
await self.channel_create('@goodies', '1.0')
tx = await self.stream_create('newstuff', '1.1', channel_name='@goodies', tags=['foo', 'gaming'])
claim_id = self.get_claim_id(tx)
@@ -1377,7 +1422,6 @@ class StreamCommands(ClaimTestCase):
self.assertItemCount(await self.daemon.jsonrpc_claim_search(all_tags=['foo'], claim_type=['stream', 'repost']), 2)
self.assertItemCount(await self.daemon.jsonrpc_claim_search(not_tags=['foo'], claim_type=['stream', 'repost']), 0)
# "common" / indexed tags work too
self.assertIn('gaming', sql.TAG_INDEXES) # if this breaks, next test doesn't make sense
self.assertItemCount(await self.daemon.jsonrpc_claim_search(any_tags=['gaming'], claim_type=['stream', 'repost']), 2)
self.assertItemCount(await self.daemon.jsonrpc_claim_search(all_tags=['gaming'], claim_type=['stream', 'repost']), 2)
self.assertItemCount(await self.daemon.jsonrpc_claim_search(not_tags=['gaming'], claim_type=['stream', 'repost']), 0)
@@ -2125,7 +2169,7 @@ class SupportCommands(CommandTestCase):
# lbrycrd returned 'the transaction was rejected by network rules.'
channel_id = self.get_claim_id(await self.channel_create())
stream_id = self.get_claim_id(await self.stream_create())
tx = await self.support_create(stream_id, '7.967598', channel_id=channel_id)
tx = await self.support_create(stream_id, '7.967601', channel_id=channel_id)
self.assertEqual(len(tx['outputs']), 1) # must be one to reproduce bug
self.assertTrue(tx['outputs'][0]['is_channel_signature_valid'])
@@ -2168,20 +2212,30 @@ class CollectionCommands(CommandTestCase):
tx = await self.collection_create('radjingles', claims=claim_ids, allow_duplicate_name=True)
claim_id2 = self.get_claim_id(tx)
self.assertItemCount(await self.daemon.jsonrpc_collection_list(), 2)
# with clear_claims
await self.collection_update(claim_id, clear_claims=True, claims=claim_ids[:2])
collections = await self.out(self.daemon.jsonrpc_collection_list())
self.assertEquals(len(collections['items']), 2)
self.assertEqual(len(collections['items']), 2)
self.assertNotIn('canonical_url', collections['items'][0])
resolved_collections = await self.out(self.daemon.jsonrpc_collection_list(resolve=True))
self.assertIn('canonical_url', resolved_collections['items'][0])
# with replace
await self.collection_update(claim_id, replace=True, claims=claim_ids[::-1][:2], tags=['cool'])
updated = await self.claim_search(claim_id=claim_id)
self.assertEqual(updated[0]['value']['tags'], ['cool'])
self.assertEqual(updated[0]['value']['claims'], claim_ids[::-1][:2])
await self.collection_update(claim_id, replace=True, claims=claim_ids[:4], languages=['en', 'pt-BR'])
updated = await self.resolve(f'radjingles:{claim_id}')
self.assertEqual(updated['value']['claims'], claim_ids[:4])
self.assertNotIn('tags', updated['value'])
self.assertEqual(updated['value']['languages'], ['en', 'pt-BR'])
await self.collection_abandon(claim_id)
self.assertItemCount(await self.daemon.jsonrpc_collection_list(), 1)
collections = await self.out(self.daemon.jsonrpc_collection_list(resolve_claims=2))
self.assertEquals(len(collections['items'][0]['claims']), 2)
self.assertEqual(len(collections['items'][0]['claims']), 2)
collections = await self.out(self.daemon.jsonrpc_collection_list(resolve_claims=10))
self.assertEqual(len(collections['items'][0]['claims']), 4)
+5 -5
View File
@@ -25,7 +25,7 @@ class NetworkTests(IntegrationTestCase):
'genesis_hash': self.conductor.spv_node.coin_class.GENESIS_HASH,
'hash_function': 'sha256',
'hosts': {},
'protocol_max': '0.99.0',
'protocol_max': '0.199.0',
'protocol_min': '0.54.0',
'pruning': None,
'description': '',
@@ -50,7 +50,7 @@ class NetworkTests(IntegrationTestCase):
'genesis_hash': self.conductor.spv_node.coin_class.GENESIS_HASH,
'hash_function': 'sha256',
'hosts': {},
'protocol_max': '0.99.0',
'protocol_max': '0.199.0',
'protocol_min': '0.54.0',
'pruning': None,
'description': 'Fastest server in the west.',
@@ -69,8 +69,8 @@ class ReconnectTests(IntegrationTestCase):
node2 = SPVNode(self.conductor.spv_module, node_number=2)
await node2.start(self.blockchain)
self.ledger.network.config['default_servers'].append((node2.hostname, node2.port))
self.ledger.network.config['default_servers'].reverse()
self.ledger.network.config['explicit_servers'].append((node2.hostname, node2.port))
self.ledger.network.config['explicit_servers'].reverse()
self.assertEqual(50002, self.ledger.network.client.server[1])
await self.ledger.stop()
await self.ledger.start()
@@ -145,7 +145,7 @@ class ReconnectTests(IntegrationTestCase):
self.assertEqual(self.ledger.network.client.concurrency, 32)
conf.hub_timeout = 123.0
conf.concurrent_hub_requests = 42
conf.lbryum_servers = self.ledger.config['default_servers']
conf.known_hubs = self.ledger.config['known_hubs']
conf.wallet_dir = self.ledger.config['data_path']
self.manager.config = conf
await self.manager.reset()
@@ -44,7 +44,7 @@ class PurchaseCommandTests(CommandTestCase):
await self.account.release_all_outputs()
buyer_balance = await self.account.get_balance()
merchant_balance = lbc_to_dewies(str(await self.blockchain.get_balance()))
merchant_balance = lbc_to_dewies(await self.blockchain.get_balance())
pre_purchase_count = (await self.daemon.jsonrpc_purchase_list())['total_items']
purchase = await operation()
stream_txo, purchase_txo = stream.outputs[0], purchase.outputs[0]
@@ -60,7 +60,9 @@ class PurchaseCommandTests(CommandTestCase):
self.assertEqual(
await self.account.get_balance(), buyer_balance - (purchase.input_sum-purchase.outputs[2].amount))
self.assertEqual(
str(await self.blockchain.get_balance()), dewies_to_lbc(merchant_balance + purchase_txo.amount))
str(float(await self.blockchain.get_balance())),
dewies_to_lbc(merchant_balance + purchase_txo.amount)
)
purchases = await self.daemon.jsonrpc_purchase_list()
self.assertEqual(purchases['total_items'], pre_purchase_count+1)
@@ -57,6 +57,18 @@ class WalletCommands(CommandTestCase):
self.assertEqual(len(status['wallet']['servers']), 1)
self.assertEqual(status['wallet']['servers'][0]['port'], 54320)
async def test_sending_to_scripthash_address(self):
self.assertEqual(await self.blockchain.get_balance(), '95.99973580')
await self.assertBalance(self.account, '10.0')
p2sh_address1 = await self.blockchain.get_new_address(self.blockchain.P2SH_SEGWIT_ADDRESS)
tx = await self.account_send('2.0', p2sh_address1)
self.assertEqual(tx['outputs'][0]['address'], p2sh_address1)
self.assertEqual(await self.blockchain.get_balance(), '98.99973580') # +1 lbc for confirm block
await self.assertBalance(self.account, '7.999877')
await self.wallet_send('3.0', p2sh_address1)
self.assertEqual(await self.blockchain.get_balance(), '102.99973580') # +1 lbc for confirm block
await self.assertBalance(self.account, '4.999754')
async def test_balance_caching(self):
account2 = await self.daemon.jsonrpc_account_create("Tip-er")
address2 = await self.daemon.jsonrpc_address_unused(account2.id)
@@ -4,6 +4,7 @@ import lbry
import lbry.wallet
from lbry.error import ServerPaymentFeeAboveMaxAllowedError
from lbry.wallet.network import ClientSession
from lbry.wallet.server.db.elasticsearch.sync import run as run_sync, make_es_index
from lbry.wallet.server.session import LBRYElectrumX
from lbry.testcase import IntegrationTestCase, CommandTestCase
from lbry.wallet.orchstr8.node import SPVNode
@@ -13,9 +14,6 @@ class TestSessions(IntegrationTestCase):
"""
Tests that server cleans up stale connections after session timeout and client times out too.
"""
LEDGER = lbry.wallet
async def test_session_bloat_from_socket_timeout(self):
await self.conductor.stop_spv()
await self.ledger.stop()
@@ -87,3 +85,107 @@ class TestUsagePayment(CommandTestCase):
self.assertIsNotNone(await self.blockchain.get_raw_transaction(tx.id)) # verify its broadcasted
self.assertEqual(tx.outputs[0].amount, 100000000)
self.assertEqual(tx.outputs[0].get_address(self.ledger), address)
class TestESSync(CommandTestCase):
async def test_es_sync_utility(self):
for i in range(10):
await self.stream_create(f"stream{i}", bid='0.001')
await self.generate(1)
self.assertEqual(10, len(await self.claim_search(order_by=['height'])))
db = self.conductor.spv_node.server.db
await db.search_index.delete_index()
db.search_index.clear_caches()
self.assertEqual(0, len(await self.claim_search(order_by=['height'])))
await db.search_index.stop()
self.assertTrue(await make_es_index(db.search_index))
async def resync():
await db.search_index.start()
db.search_index.clear_caches()
await run_sync(db.sql._db_path, 1, 0, 0, index_name=db.search_index.index)
self.assertEqual(10, len(await self.claim_search(order_by=['height'])))
await resync()
# this time we will test a migration from unversioned to v1
await db.search_index.sync_client.indices.delete_template(db.search_index.index)
await db.search_index.stop()
self.assertTrue(await make_es_index(db.search_index))
await db.search_index.start()
await resync()
class TestHubDiscovery(CommandTestCase):
async def test_hub_discovery(self):
us_final_node = SPVNode(self.conductor.spv_module, node_number=2)
await us_final_node.start(self.blockchain, extraconf={"COUNTRY": "US"})
self.addCleanup(us_final_node.stop)
final_node_host = f"{us_final_node.hostname}:{us_final_node.port}"
kp_final_node = SPVNode(self.conductor.spv_module, node_number=3)
await kp_final_node.start(self.blockchain, extraconf={"COUNTRY": "KP"})
self.addCleanup(kp_final_node.stop)
kp_final_node_host = f"{kp_final_node.hostname}:{kp_final_node.port}"
relay_node = SPVNode(self.conductor.spv_module, node_number=4)
await relay_node.start(self.blockchain, extraconf={
"COUNTRY": "FR",
"PEER_HUBS": ",".join([kp_final_node_host, final_node_host])
})
relay_node_host = f"{relay_node.hostname}:{relay_node.port}"
self.addCleanup(relay_node.stop)
self.assertEqual(list(self.daemon.conf.known_hubs), [])
self.assertEqual(
self.daemon.ledger.network.client.server_address_and_port,
('127.0.0.1', 50002)
)
# connect to relay hub which will tell us about the final hubs
self.daemon.jsonrpc_settings_set('lbryum_servers', [relay_node_host])
await self.daemon.jsonrpc_wallet_reconnect()
self.assertEqual(
self.daemon.conf.known_hubs.filter(), {
(relay_node.hostname, relay_node.port): {"country": "FR"},
(us_final_node.hostname, us_final_node.port): {}, # discovered from relay but not contacted yet
(kp_final_node.hostname, kp_final_node.port): {}, # discovered from relay but not contacted yet
}
)
self.assertEqual(
self.daemon.ledger.network.client.server_address_and_port, ('127.0.0.1', relay_node.port)
)
# use known_hubs to connect to final US hub
self.daemon.jsonrpc_settings_clear('lbryum_servers')
self.daemon.conf.jurisdiction = "US"
await self.daemon.jsonrpc_wallet_reconnect()
self.assertEqual(
self.daemon.conf.known_hubs.filter(), {
(relay_node.hostname, relay_node.port): {"country": "FR"},
(us_final_node.hostname, us_final_node.port): {"country": "US"},
(kp_final_node.hostname, kp_final_node.port): {"country": "KP"},
}
)
self.assertEqual(
self.daemon.ledger.network.client.server_address_and_port, ('127.0.0.1', us_final_node.port)
)
# connection to KP jurisdiction
self.daemon.conf.jurisdiction = "KP"
await self.daemon.jsonrpc_wallet_reconnect()
self.assertEqual(
self.daemon.ledger.network.client.server_address_and_port, ('127.0.0.1', kp_final_node.port)
)
kp_final_node.server.session_mgr._notify_peer('127.0.0.1:9988')
await self.daemon.ledger.network.on_hub.first
await asyncio.sleep(0.5) # wait for above event to be processed by other listeners
self.assertEqual(
self.daemon.conf.known_hubs.filter(), {
(relay_node.hostname, relay_node.port): {"country": "FR"},
(us_final_node.hostname, us_final_node.port): {"country": "US"},
(kp_final_node.hostname, kp_final_node.port): {"country": "KP"},
('127.0.0.1', 9988): {}
}
)
@@ -410,11 +410,12 @@ class FileCommands(CommandTestCase):
await asyncio.wait_for(self.wait_files_to_complete(), timeout=1)
# check that the fee was received
starting_balance = await self.blockchain.get_balance()
starting_balance = float(await self.blockchain.get_balance())
await self.generate(1)
block_reward_and_claim_fee = 2.0
self.assertEqual(
await self.blockchain.get_balance(), starting_balance + block_reward_and_claim_fee
float(await self.blockchain.get_balance()),
starting_balance + block_reward_and_claim_fee
)
# restart the daemon and make sure the fee is still there
@@ -463,11 +464,11 @@ class FileCommands(CommandTestCase):
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
# Assert the transaction is recorded to the blockchain
starting_balance = await self.blockchain.get_balance()
starting_balance = float(await self.blockchain.get_balance())
await self.generate(1)
block_reward_and_claim_fee = 2.0
self.assertEqual(
await self.blockchain.get_balance(), starting_balance + block_reward_and_claim_fee
float(await self.blockchain.get_balance()), starting_balance + block_reward_and_claim_fee
)
async def test_null_fee(self):
@@ -1,6 +1,8 @@
import asyncio
import logging
from decimal import Decimal
from lbry.testcase import AsyncioTestCase
from lbry.extras.daemon.exchange_rate_manager import ExchangeRate, ExchangeRateManager, FEEDS
from lbry.extras.daemon.exchange_rate_manager import ExchangeRate, ExchangeRateManager, FEEDS, MarketFeed
class TestExchangeRateManager(AsyncioTestCase):
@@ -12,13 +14,32 @@ class TestExchangeRateManager(AsyncioTestCase):
self.assertFalse(feed.is_online)
self.assertIsNone(feed.rate)
await manager.wait()
failures = set()
for feed in manager.market_feeds:
self.assertTrue(feed.is_online)
self.assertIsInstance(feed.rate, ExchangeRate)
# print(f'{feed.name} - {feed.market} - {feed.rate.spot}')
if feed.is_online:
self.assertIsInstance(feed.rate, ExchangeRate)
else:
failures.add(feed.name)
self.assertFalse(feed.has_rate)
self.assertLessEqual(len(failures), 1, f"feed failures: {failures}. Please check exchange rate feeds!")
lbc = manager.convert_currency('USD', 'LBC', Decimal('1.0'))
self.assertGreaterEqual(lbc, 2.0)
self.assertLessEqual(lbc, 10.0)
self.assertLessEqual(lbc, 60.0)
lbc = manager.convert_currency('BTC', 'LBC', Decimal('0.01'))
self.assertGreaterEqual(lbc, 1_000)
self.assertLessEqual(lbc, 4_000)
self.assertLessEqual(lbc, 20_000)
async def test_it_handles_feed_being_offline(self):
class FakeFeed(MarketFeed):
name = "fake"
url = "http://impossi.bru"
manager = ExchangeRateManager((FakeFeed,))
manager.start()
self.addCleanup(manager.stop)
for feed in manager.market_feeds:
self.assertFalse(feed.is_online)
self.assertIsNone(feed.rate)
await asyncio.wait_for(manager.wait(), 2)
for feed in manager.market_feeds:
self.assertFalse(feed.is_online)
self.assertFalse(feed.has_rate)
@@ -15,7 +15,7 @@ class AddressManagement(CommandTestCase):
class SettingsManagement(CommandTestCase):
async def test_settings(self):
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('127.0.0.1', 50001))
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('localhost', 50002))
setting = self.daemon.jsonrpc_settings_set('lbryum_servers', ['server:50001'])
self.assertEqual(setting['lbryum_servers'][0], ('server', 50001))
+26 -25
View File
@@ -10,8 +10,8 @@ class PeerTest(AsyncioTestCase):
self.loop = asyncio.get_event_loop()
self.peer_manager = PeerManager(self.loop)
self.node_ids = [generate_id(), generate_id(), generate_id()]
self.first_contact = make_kademlia_peer(self.node_ids[1], '1.0.0.1', udp_port=1000)
self.second_contact = make_kademlia_peer(self.node_ids[0], '1.0.0.2', udp_port=1000)
self.first_contact = make_kademlia_peer(self.node_ids[1], '1.0.0.1', udp_port=1024)
self.second_contact = make_kademlia_peer(self.node_ids[0], '1.0.0.2', udp_port=1024)
def test_peer_is_good_unknown_peer(self):
# Scenario: peer replied, but caller doesn't know the node_id.
@@ -25,36 +25,37 @@ class PeerTest(AsyncioTestCase):
def test_make_contact_error_cases(self):
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4', 100000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4.5', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], 'this is not an ip', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4.5', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], 'this is not an ip', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4', -1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4', 0)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4', 1023)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '1.2.3.4', 70000)
self.assertRaises(ValueError, make_kademlia_peer, b'not valid node id', '1.2.3.4', 1000)
self.assertRaises(ValueError, make_kademlia_peer, b'not valid node id', '1.2.3.4', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '0.0.0.0', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '10.0.0.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '100.64.0.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '127.0.0.1', 1000)
self.assertIsNotNone(make_kademlia_peer(self.node_ids[1], '127.0.0.1', 1000, allow_localhost=True))
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.168.0.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '172.16.0.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '169.254.1.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.0.0.2', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.0.2.2', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.88.99.2', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.18.1.1', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.51.100.2', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.51.100.2', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '203.0.113.4', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '0.0.0.0', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '10.0.0.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '100.64.0.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '127.0.0.1', 1024)
self.assertIsNotNone(make_kademlia_peer(self.node_ids[1], '127.0.0.1', 1024, allow_localhost=True))
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.168.0.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '172.16.0.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '169.254.1.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.0.0.2', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.0.2.2', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '192.88.99.2', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.18.1.1', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.51.100.2', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '198.51.100.2', 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '203.0.113.4', 1024)
for i in range(32):
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], f"{224 + i}.0.0.0", 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '255.255.255.255', 1000)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], f"{224 + i}.0.0.0", 1024)
self.assertRaises(ValueError, make_kademlia_peer, self.node_ids[1], '255.255.255.255', 1024)
self.assertRaises(
ValueError, make_kademlia_peer, self.node_ids[1], 'beee:eeee:eeee:eeee:eeee:eeee:eeee:eeef', 1000
ValueError, make_kademlia_peer, self.node_ids[1], 'beee:eeee:eeee:eeee:eeee:eeee:eeee:eeef', 1024
)
self.assertRaises(
ValueError, make_kademlia_peer, self.node_ids[1], '2001:db8::ff00:42:8329', 1000
ValueError, make_kademlia_peer, self.node_ids[1], '2001:db8::ff00:42:8329', 1024
)
def test_is_valid_ipv4(self):
@@ -79,7 +80,7 @@ class PeerTest(AsyncioTestCase):
def test_boolean(self):
self.assertNotEqual(self.first_contact, self.second_contact)
self.assertEqual(
self.second_contact, make_kademlia_peer(self.node_ids[0], '1.0.0.2', udp_port=1000)
self.second_contact, make_kademlia_peer(self.node_ids[0], '1.0.0.2', udp_port=1024)
)
def test_compact_ip(self):
@@ -4,7 +4,6 @@ from time import time
from lbry.schema.claim import Claim
from lbry.extras.daemon.exchange_rate_manager import (
ExchangeRate, ExchangeRateManager, CurrencyConversionError,
CryptonatorUSDFeed, CryptonatorBTCFeed,
BittrexUSDFeed, BittrexBTCFeed,
CoinExBTCFeed
)
@@ -36,46 +35,6 @@ class ExchangeRateTests(AsyncioTestCase):
with self.assertRaises(CurrencyConversionError):
manager.convert_currency(fee.currency, "LBC", fee.amount)
def test_cryptonator_lbc_feed_response(self):
feed = CryptonatorUSDFeed()
out = feed.get_rate_from_response({
'ticker': {
'base': 'USD', 'target': 'LBC', 'price': 23657.44026496,
'volume': '', 'change': -5.59806916,
},
'timestamp': 1507470422,
'success': True,
'error': ""
})
self.assertEqual(23_657.44026496, out)
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({})
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({
"success": True,
"ticker": {}
})
def test_cryptonator_btc_feed_response(self):
feed = CryptonatorBTCFeed()
out = feed.get_rate_from_response({
'ticker': {
'base': 'BTC', 'target': 'LBC', 'price': 0.00022123,
'volume': '', 'change': -0.00000259,
},
'timestamp': 1507471141,
'success': True,
'error': ''
})
self.assertEqual(0.00022123, out)
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({})
with self.assertRaises(InvalidExchangeRateResponseError):
feed.get_rate_from_response({
"success": True,
"ticker": {}
})
def test_bittrex_feed_response(self):
feed = BittrexBTCFeed()
out = feed.get_rate_from_response({
@@ -105,17 +64,20 @@ class ExchangeRateManagerTests(AsyncioTestCase):
async def test_get_rate_failure_retrieved(self):
manager = ExchangeRateManager([BadMarketFeed])
manager.start()
await asyncio.sleep(1)
await manager.wait()
for feed in manager.market_feeds: # no rate but it tried
self.assertFalse(feed.has_rate)
self.assertTrue(feed.event.is_set())
self.addCleanup(manager.stop)
async def test_median_rate_used(self):
manager = ExchangeRateManager([BittrexBTCFeed, CryptonatorBTCFeed, CoinExBTCFeed])
manager = ExchangeRateManager([BittrexBTCFeed, CoinExBTCFeed])
for feed in manager.market_feeds:
feed.last_check = time()
bittrex, cryptonator, coinex = manager.market_feeds
bittrex, coinex = manager.market_feeds
bittrex.rate = ExchangeRate(bittrex.market, 1.0, time())
cryptonator.rate = ExchangeRate(cryptonator.market, 2.0, time())
coinex.rate = ExchangeRate(coinex.market, 2.0, time())
coinex.rate = ExchangeRate(coinex.market, 3.0, time())
self.assertEqual(14.0, manager.convert_currency("BTC", "LBC", Decimal(7.0)))
cryptonator.rate.spot = 4.0
self.assertEqual(21.0, manager.convert_currency("BTC", "LBC", Decimal(7.0)))
coinex.rate.spot = 4.0
self.assertEqual(17.5, manager.convert_currency("BTC", "LBC", Decimal(7.0)))
+22 -2
View File
@@ -43,19 +43,36 @@ class TestReflector(AsyncioTestCase):
self.stream_manager.config.reflect_streams = False
self.stream = await self.stream_manager.create(file_path)
async def _test_reflect_stream(self, response_chunk_size):
reflector = ReflectorServer(self.server_blob_manager, response_chunk_size=response_chunk_size)
async def _test_reflect_stream(self, response_chunk_size=50, partial_needs=False):
reflector = ReflectorServer(self.server_blob_manager, response_chunk_size=response_chunk_size,
partial_needs=partial_needs)
reflector.start_server(5566, '127.0.0.1')
if partial_needs:
server_blob = self.server_blob_manager.get_blob(self.stream.sd_hash)
client_blob = self.blob_manager.get_blob(self.stream.sd_hash)
with client_blob.reader_context() as handle:
server_blob.set_length(client_blob.get_length())
writer = server_blob.get_blob_writer('nobody', 0)
writer.write(handle.read())
self.server_blob_manager.blob_completed(server_blob)
await reflector.started_listening.wait()
self.addCleanup(reflector.stop_server)
self.assertEqual(0, self.stream.reflector_progress)
sent = await self.stream.upload_to_reflector('127.0.0.1', 5566)
self.assertEqual(100, self.stream.reflector_progress)
if partial_needs:
self.assertFalse(self.stream.is_fully_reflected)
send_more = await self.stream.upload_to_reflector('127.0.0.1', 5566)
self.assertGreater(len(send_more), 0)
sent.extend(send_more)
sent.append(self.stream.sd_hash)
self.assertSetEqual(
set(sent),
set(map(lambda b: b.blob_hash,
self.stream.descriptor.blobs[:-1] + [self.blob_manager.get_blob(self.stream.sd_hash)]))
)
send_more = await self.stream.upload_to_reflector('127.0.0.1', 5566)
self.assertEqual(len(send_more), 0)
self.assertTrue(self.stream.is_fully_reflected)
server_sd_blob = self.server_blob_manager.get_blob(self.stream.sd_hash)
self.assertTrue(server_sd_blob.get_is_verified())
@@ -71,6 +88,9 @@ class TestReflector(AsyncioTestCase):
async def test_reflect_stream(self):
return await asyncio.wait_for(self._test_reflect_stream(response_chunk_size=50), 3, loop=self.loop)
async def test_reflect_stream_but_reflector_changes_its_mind(self):
return await asyncio.wait_for(self._test_reflect_stream(partial_needs=True), 3, loop=self.loop)
async def test_reflect_stream_small_response_chunks(self):
return await asyncio.wait_for(self._test_reflect_stream(response_chunk_size=30), 3, loop=self.loop)
+1 -6
View File
@@ -9,7 +9,6 @@ from decimal import Decimal
from lbry.file.file_manager import FileManager
from tests.unit.blob_exchange.test_transfer_blob import BlobExchangeTestBase
from lbry.testcase import get_fake_exchange_rate_manager
from lbry.utils import generate_id
from lbry.error import InsufficientFundsError
from lbry.error import KeyFeeAboveMaxAllowedError, ResolveError, DownloadSDTimeoutError, DownloadDataTimeoutError
from lbry.wallet import WalletManager, Wallet, Ledger, Transaction, Input, Output, Database
@@ -140,11 +139,7 @@ class TestStreamManager(BlobExchangeTestBase):
self.sd_hash = descriptor.sd_hash
self.mock_wallet, self.uri = await get_mock_wallet(self.sd_hash, self.client_storage, self.client_wallet_dir,
balance, fee)
analytics_manager = AnalyticsManager(
self.client_config,
binascii.hexlify(generate_id()).decode(),
binascii.hexlify(generate_id()).decode()
)
analytics_manager = AnalyticsManager(self.client_config)
self.stream_manager = StreamManager(
self.loop, self.client_config, self.client_blob_manager, self.mock_wallet,
self.client_storage, get_mock_node(self.server_from_client),
+55
View File
@@ -47,6 +47,26 @@ class ConfigurationTests(unittest.TestCase):
c.persisted = {}
self.assertEqual(c.test_str, 'the default')
def test_is_set(self):
c = TestConfig()
self.assertEqual(c.test_str, 'the default')
self.assertFalse(TestConfig.test_str.is_set(c))
c.test_str = 'new value'
self.assertEqual(c.test_str, 'new value')
self.assertTrue(TestConfig.test_str.is_set(c))
def test_is_set_to_default(self):
c = TestConfig()
self.assertEqual(TestConfig.test_str.default, 'the default')
self.assertFalse(TestConfig.test_str.is_set(c))
self.assertFalse(TestConfig.test_str.is_set_to_default(c))
c.test_str = 'new value'
self.assertTrue(TestConfig.test_str.is_set(c))
self.assertFalse(TestConfig.test_str.is_set_to_default(c))
c.test_str = 'the default'
self.assertTrue(TestConfig.test_str.is_set(c))
self.assertTrue(TestConfig.test_str.is_set_to_default(c))
def test_arguments(self):
parser = argparse.ArgumentParser()
TestConfig.contribute_to_argparse(parser)
@@ -255,3 +275,38 @@ class ConfigurationTests(unittest.TestCase):
args = parser.parse_args(['--string-choice', 'c'])
c = TestConfig.create_from_arguments(args)
self.assertEqual("c", c.string_choice)
def test_known_hubs_list(self):
with tempfile.TemporaryDirectory() as temp_dir:
hubs = Config(config=os.path.join(temp_dir, 'settings.yml'), wallet_dir=temp_dir).known_hubs
self.assertEqual(hubs.serialized, {})
self.assertEqual(list(hubs), [])
self.assertFalse(hubs)
hubs.set('new.hub.io:99', {'jurisdiction': 'us'})
self.assertTrue(hubs)
self.assertFalse(hubs.exists)
hubs.save()
self.assertTrue(hubs.exists)
hubs = Config(config=os.path.join(temp_dir, 'settings.yml'), wallet_dir=temp_dir).known_hubs
self.assertEqual(list(hubs), [('new.hub.io', 99)])
self.assertEqual(hubs.serialized, {'new.hub.io:99': {'jurisdiction': 'us'}})
hubs.set('any.hub.io:99', {})
hubs.set('oth.hub.io:99', {'jurisdiction': 'other'})
self.assertEqual(list(hubs), [('new.hub.io', 99), ('any.hub.io', 99), ('oth.hub.io', 99)])
self.assertEqual(hubs.filter(), {
('new.hub.io', 99): {'jurisdiction': 'us'},
('oth.hub.io', 99): {'jurisdiction': 'other'},
('any.hub.io', 99): {}
})
self.assertEqual(hubs.filter(foo="bar"), {})
self.assertEqual(hubs.filter(jurisdiction="us"), {
('new.hub.io', 99): {'jurisdiction': 'us'}
})
self.assertEqual(hubs.filter(jurisdiction="us", match_none=True), {
('new.hub.io', 99): {'jurisdiction': 'us'},
('any.hub.io', 99): {}
})
+12 -30
View File
@@ -1,6 +1,6 @@
import time
import struct
import apsw
import sqlite3
import logging
from operator import itemgetter
from typing import Tuple, List, Dict, Union, Type, Optional
@@ -21,19 +21,20 @@ from lbry.wallet import Ledger, RegTestLedger
from lbry.wallet.server.db.common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS, INDEXED_LANGUAGES
class SQLiteOperationalError(apsw.Error):
class SQLiteOperationalError(sqlite3.OperationalError):
def __init__(self, metrics):
super().__init__('sqlite query errored')
self.metrics = metrics
class SQLiteInterruptedError(apsw.InterruptError):
class SQLiteInterruptedError(sqlite3.OperationalError):
def __init__(self, metrics):
super().__init__('sqlite query interrupted')
self.metrics = metrics
ATTRIBUTE_ARRAY_MAX_LENGTH = 100
sqlite3.enable_callback_tracebacks(True)
INTEGER_PARAMS = {
'height', 'creation_height', 'activation_height', 'expiration_height',
@@ -63,7 +64,7 @@ ORDER_FIELDS = {
@dataclass
class ReaderState:
db: apsw.Connection
db: sqlite3.Connection
stack: List[List]
metrics: Dict
is_tracking_metrics: bool
@@ -90,7 +91,7 @@ class ReaderState:
self.db.interrupt()
return
self.db.setprogresshandler(interruptor, 100)
self.db.set_progress_handler(interruptor, 100)
def get_resolve_censor(self) -> Censor:
return Censor(Censor.RESOLVE)
@@ -105,13 +106,13 @@ ctx: ContextVar[Optional[ReaderState]] = ContextVar('ctx')
def row_factory(cursor, row):
return {
k[0]: (set(row[i].split(',')) if k[0] == 'tags' else row[i])
for i, k in enumerate(cursor.getdescription())
for i, k in enumerate(cursor.description)
}
def initializer(log, _path, _ledger_name, query_timeout, _measure=False, block_and_filter=None):
db = apsw.Connection(_path, flags=apsw.SQLITE_OPEN_READONLY | apsw.SQLITE_OPEN_URI)
db.setrowtrace(row_factory)
db = sqlite3.connect(_path, isolation_level=None, uri=True)
db.row_factory = row_factory
if block_and_filter:
blocked_streams, blocked_channels, filtered_streams, filtered_channels = block_and_filter
else:
@@ -184,31 +185,12 @@ def execute_query(sql, values, row_offset: int, row_limit: int, censor: Censor)
context = ctx.get()
context.set_query_timeout()
try:
c = context.db.cursor()
def row_filter(cursor, row):
nonlocal row_offset
row = row_factory(cursor, row)
if len(row) > 1 and censor.censor(row):
return
if row_offset:
row_offset -= 1
return
return row
c.setrowtrace(row_filter)
i, rows = 0, []
for row in c.execute(sql, values):
i += 1
rows.append(row)
if i >= row_limit:
break
return rows
except apsw.Error as err:
rows = context.db.execute(sql, values).fetchall()
return rows[row_offset:row_limit]
except sqlite3.OperationalError as err:
plain_sql = interpolate(sql, values)
if context.is_tracking_metrics:
context.metrics['execute_query'][-1]['sql'] = plain_sql
if isinstance(err, apsw.InterruptError):
context.log.warning("interrupted slow sqlite query:\n%s", plain_sql)
raise SQLiteInterruptedError(context.metrics)
context.log.exception('failed running query', exc_info=err)
raise SQLiteOperationalError(context.metrics)
+7
View File
@@ -1,4 +1,5 @@
import os
from unittest import TestCase
from binascii import hexlify
from lbry.testcase import AsyncioTestCase
@@ -85,6 +86,12 @@ class LedgerTestCase(AsyncioTestCase):
self.ledger.headers._size = self.ledger.headers.io.seek(0, os.SEEK_END) // self.ledger.headers.header_size
class TestUtils(TestCase):
def test_valid_address(self):
self.assertTrue(Ledger.is_script_address("rCz6yb1p33oYHToGZDzTjX7nFKaU3kNgBd"))
class TestSynchronization(LedgerTestCase):
async def test_update_history(self):