Compare commits
115
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e9ef69bd3 | ||
|
|
5c6d63c93d | ||
|
|
c8c10d2bb0 | ||
|
|
f4d3e9ea6a | ||
|
|
3713d3488d | ||
|
|
9b46d03c91 | ||
|
|
fe4e738580 | ||
|
|
205b0c4263 | ||
|
|
78eef25f1a | ||
|
|
c9305fd070 | ||
|
|
20774280b9 | ||
|
|
74bd2557af | ||
|
|
605fc8ecd8 | ||
|
|
6b745c53dc | ||
|
|
98c60b38fc | ||
|
|
be4515ec9a | ||
|
|
dcb1b64696 | ||
|
|
1190a60c7a | ||
|
|
82ecf207c6 | ||
|
|
84c7f1bf58 | ||
|
|
5ac453fe07 | ||
|
|
c2f39d653d | ||
|
|
748178f536 | ||
|
|
ffbef69dc7 | ||
|
|
3757124323 | ||
|
|
e65f214b3c | ||
|
|
f14004e56b | ||
|
|
dadc004dd6 | ||
|
|
3697d9e1f0 | ||
|
|
94524f7330 | ||
|
|
17d8a3e5d6 | ||
|
|
39996d7612 | ||
|
|
601ee4320f | ||
|
|
6e4f6fa92d | ||
|
|
b7103c29dd | ||
|
|
e53209e5ae | ||
|
|
501fbd3114 | ||
|
|
5626f43e2b | ||
|
|
0185cb48fb | ||
|
|
9a49eb06da | ||
|
|
3fbc012231 | ||
|
|
3938cf33d8 | ||
|
|
38b3d0c87c | ||
|
|
15a2fa6199 | ||
|
|
e834209d40 | ||
|
|
9607d21828 | ||
|
|
6fbbf36143 | ||
|
|
db25f3282e | ||
|
|
ceb92838e7 | ||
|
|
afb98f2cfc | ||
|
|
ed785fb087 | ||
|
|
3921180d77 | ||
|
|
ef36e0311e | ||
|
|
bf4cbe1204 | ||
|
|
28eee4da25 | ||
|
|
933ccf6deb | ||
|
|
9ac41322e5 | ||
|
|
c3233e03ef | ||
|
|
111871bb28 | ||
|
|
bf5b5f43e3 | ||
|
|
2ed8ebff09 | ||
|
|
34eb856d09 | ||
|
|
2d644bdfb0 | ||
|
|
741e5cf103 | ||
|
|
d745c04fe6 | ||
|
|
3a3c63956a | ||
|
|
153bdf576a | ||
|
|
6525ee6510 | ||
|
|
1780ddd329 | ||
|
|
85ad972ca8 | ||
|
|
a90b60799a | ||
|
|
47e8f74da9 | ||
|
|
fac28072ab | ||
|
|
ab77541f36 | ||
|
|
9eb769f340 | ||
|
|
1e81d6f848 | ||
|
|
dc393f4b77 | ||
|
|
dd1de530c3 | ||
|
|
74cd887249 | ||
|
|
b40bb35652 | ||
|
|
dfe257af86 | ||
|
|
ebb2a09107 | ||
|
|
c157909b4e | ||
|
|
a744239b22 | ||
|
|
9b4417be87 | ||
|
|
84f807e278 | ||
|
|
448635a945 | ||
|
|
638e3e6b3d | ||
|
|
bfe711bd42 | ||
|
|
d5eed91e7f | ||
|
|
15abf49211 | ||
|
|
b7eec0586c | ||
|
|
e639124a69 | ||
|
|
22bca7a16e | ||
|
|
6f66b354e5 | ||
|
|
f98e3320ae | ||
|
|
73c958222b | ||
|
|
e43230e46a | ||
|
|
dd07bc29eb | ||
|
|
790bbfcc99 | ||
|
|
994e70d43a | ||
|
|
7d5e19716a | ||
|
|
11530c675d | ||
|
|
1c474352fe | ||
|
|
3b2d635390 | ||
|
|
055c532d31 | ||
|
|
55e08f96a6 | ||
|
|
3e0a9180bc | ||
|
|
01ed71b243 | ||
|
|
595c058517 | ||
|
|
e04b0a6995 | ||
|
|
8961848ab1 | ||
|
|
6fb1c72b7d | ||
|
|
400d79d6ab | ||
|
|
ce6018f387 |
No files matched your search
@@ -0,0 +1,79 @@
|
||||
name: ci
|
||||
on: pull_request
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- run: make install tools
|
||||
- run: make lint
|
||||
|
||||
tests-unit:
|
||||
name: "tests / unit"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- run: make install tools
|
||||
- working-directory: lbry
|
||||
env:
|
||||
HOME: /tmp
|
||||
run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
|
||||
|
||||
tests-integration:
|
||||
name: "tests / integration"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
test:
|
||||
- datanetwork
|
||||
- blockchain
|
||||
- other
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- if: matrix.test == 'other'
|
||||
run: sudo apt install -y --no-install-recommends ffmpeg
|
||||
- run: pip install tox-travis
|
||||
- run: tox -e ${{ matrix.test }}
|
||||
|
||||
build:
|
||||
needs: ["lint", "tests-unit", "tests-integration"]
|
||||
name: "build"
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Setup
|
||||
run: |
|
||||
pip install pyinstaller
|
||||
pip install -e .
|
||||
- if: startsWith(matrix.os, 'windows') == false
|
||||
name: Build & Run (Unix)
|
||||
run: |
|
||||
pyinstaller --onefile --name lbrynet lbry/extras/cli.py
|
||||
chmod +x dist/lbrynet
|
||||
dist/lbrynet --version
|
||||
- if: startsWith(matrix.os, 'windows')
|
||||
name: Build & Run (Windows)
|
||||
run: |
|
||||
pip install pywin32
|
||||
pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico --onefile --name lbrynet lbry/extras/cli.py
|
||||
dist/lbrynet.exe --version
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
/.tox
|
||||
/.coverage*
|
||||
/lbry-venv
|
||||
/venv
|
||||
|
||||
lbry.egg-info
|
||||
__pycache__
|
||||
@@ -13,4 +14,4 @@ _trial_temp/
|
||||
/tests/integration/blockchain/files
|
||||
/tests/.coverage.*
|
||||
|
||||
/lbry/wallet/bin
|
||||
/lbry/wallet/bin
|
||||
+5
-2
@@ -52,6 +52,8 @@ test:blockchain-integration:
|
||||
test:other-integration:
|
||||
stage: test
|
||||
script:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends ffmpeg
|
||||
- pip install tox-travis
|
||||
- tox -e other
|
||||
|
||||
@@ -82,14 +84,15 @@ test:json-api:
|
||||
|
||||
build:linux:
|
||||
extends: .build
|
||||
image: ubuntu:18.04 # cant use python3.7 image - binary won't run on ubuntu
|
||||
image: ubuntu:16.04
|
||||
variables:
|
||||
OS: linux
|
||||
before_script:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends software-properties-common zip curl build-essential
|
||||
- add-apt-repository -y ppa:deadsnakes/ppa
|
||||
- apt-get install -y --no-install-recommends python3.7-dev python3-setuptools python3-wheel
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends python3.7-dev
|
||||
- python3.7 <(curl -q https://bootstrap.pypa.io/get-pip.py) # make sure we get pip with python3.7
|
||||
|
||||
build:mac:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2019 LBRY Inc
|
||||
Copyright (c) 2015-2020 LBRY Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
|
||||
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ports:
|
||||
- "50001:50001" # rpc port
|
||||
- "50005:50005" # websocket port
|
||||
- "2112:2112" # prometheus
|
||||
#- "2112:2112" # uncomment to enable prometheus
|
||||
volumes:
|
||||
- "wallet_server:/database"
|
||||
environment:
|
||||
|
||||
+187
-139
@@ -47,10 +47,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get a file",
|
||||
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet get astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1579400254,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp1ozq8ity\",\n \"download_path\": \"/tmp/tmp1ozq8ity/tmppsu__ylo\",\n \"file_name\": \"tmppsu__ylo\",\n \"height\": 214,\n \"key\": \"b7d93a1d57d3e61812c674a34a4f3961\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c7482562bfe65919bd8f74f3c067fbf4f62cd43fa5f4d8ab7ca870112e7310d70d239ea4d507688327acf4b80eb68fc7a5138726aa8bcd6a61c926732b2f5edf6c36fb5977cbb0c0b36e08980a78166af7fbb9660a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"c0a2bb6f6e97c10717c53e24d8057cafbdc095b9a9f6f78d2bab385a38dcfd226f9731c2dee9eba3463d73bacbc41e94\",\n \"stream_name\": \"tmppsu__ylo\",\n \"streaming_url\": \"http://localhost:5280/stream/a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"suggested_file_name\": \"tmppsu__ylo\",\n \"timestamp\": 1579400270,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"written_bytes\": 11\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet get astream#ca642adaf52552f0bfc746c2ebae77724d123aeb",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1580787018,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf0g7xmd6\",\n \"download_path\": \"/tmp/tmpf0g7xmd6/tmp2mvj0998\",\n \"file_name\": \"tmp2mvj0998\",\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 11\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -76,6 +76,18 @@
|
||||
"description": "path to file to be associated with name.",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "validate_file",
|
||||
"type": "bool",
|
||||
"description": "validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "optimize_file",
|
||||
"type": "bool",
|
||||
"description": "transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "fee_currency",
|
||||
"type": "string",
|
||||
@@ -231,10 +243,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Publish a file",
|
||||
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpc8ov7w53\", \"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/tmpc8ov7w53",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpc8ov7w53\", \"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\": \"010000000167e85c88fde387f326fba37b2612c3a805b2ed9ad4f9e5b46307a48029fa6d87010000006a473044022028798a357db4cf4403bc4cee03faf1b946a88dfa381599d1bfae2cacd3fab5f30220486161df34b2456b078f6d5b930bf437ef846ff6e6d68405cecdf866df177039012102d1577d55cb8cde272aca54b60c9b2be77d45d62367d15a09e05936c1ba3d00d2ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7063386f7637773533180b22186170706c69636174696f6e2f6f637465742d73747265616d3230846e3586adcc755850c7db569c5aaa1fb27e575e33be00c43fe67af34a0932668b3cb4959b38bfd6053beffc9cf7f7766d7576a914709db1a433f5f89b2dd707a1a172889b5ad8b35388ace0b46217000000001976a914b1be5eed89b7362def12fac0f7eda5046d3defa288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mq8BBn6fuhMt5EY9reRSUSwkAWBDpiFUhi\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400270,\n \"txid\": \"876dfa2980a40763b4e5f9d49aedb205a8c312267ba3fb26f387e3fd885ce867\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mqnQtJbG1yPUh9czkmvQWvkCyCB4HdYtdk\",\n \"amount\": \"1.0\",\n \"claim_id\": \"147e85f9f871ac68c1162c6bb0b0a065d67c1c30\",\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#147e85f9f871ac68c1162c6bb0b0a065d67c1c30\",\n \"timestamp\": null,\n \"txid\": \"1653397207802b93eaca0f53d8ca4c86e56f532a3bb7d68731b6e8ba4faf95d8\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpc8ov7w53\",\n \"sd_hash\": \"846e3586adcc755850c7db569c5aaa1fb27e575e33be00c43fe67af34a0932668b3cb4959b38bfd6053beffc9cf7f776\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mwimxCnDnH6Bxpvn3Am4Cq7wzqej7B9oF6\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"1653397207802b93eaca0f53d8ca4c86e56f532a3bb7d68731b6e8ba4faf95d8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"1653397207802b93eaca0f53d8ca4c86e56f532a3bb7d68731b6e8ba4faf95d8\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsknvxuc2\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpsknvxuc2",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsknvxuc2\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015bc2b04ccba1d35b1c942beeac9e3bbb3113cd36eb9ac1d0a4f84c5a2d057fd2010000006b483045022100cbbfb6085367ee776c193804556a42c1840df308ff0a61281a7b3006a86d09ca022027ddfb85c92502cb6350fc8ee19b64864cd51b83470c4a792c072f712320733f012102be714be5898d0b931ea632d814be706430a0bc970e224d1827308b6cb33944cdffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70736b6e7678756332180b22186170706c69636174696f6e2f6f637465742d73747265616d323092b47fe68f0ef8f5f2f2f2e0621589810457e3ff1bc02fa4b48b7a8ac445b470ec5f8c686d9061f640266169fff8a64b6d7576a914c942e5805b2e2efcc4c48564b95ca922a9df998088ace0b46217000000001976a914fee1c3f1738006ada057ff984ac3fed9dfa34bf088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mxUpKsZ6bvqqn3nhpDuC3hZBgjFXid8dc6\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787039,\n \"txid\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941c5bd3a1cb4cb0c25b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mys8FfKeiRYbY7jDyZ7Ux3xdTAcGcqDoYu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"35946fe623d5aeb34b4399c999067cd20e045368\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"a-new-stream\",\n \"normalized_name\": \"a-new-stream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://a-new-stream#35946fe623d5aeb34b4399c999067cd20e045368\",\n \"timestamp\": null,\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpsknvxuc2\",\n \"sd_hash\": \"92b47fe68f0ef8f5f2f2f2e0621589810457e3ff1bc02fa4b48b7a8ac445b470ec5f8c686d9061f640266169fff8a64b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n4kePEXwBnUC4eiH65PmEPAJ2bKZw2UiVH\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"608443b3a86a9874a159c0cd31df0984ad958830f3524055e6714281f14225ae\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -259,10 +271,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Resolve a claim",
|
||||
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"]}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet resolve astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"]}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\": {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3/astream#b\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1579400270,\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#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1579400269,\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#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"short_url\": \"lbry://@channel#3\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"]}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet resolve astream#ca642adaf52552f0bfc746c2ebae77724d123aeb",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\"]}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\": {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -284,7 +296,7 @@
|
||||
"curl": "curl -d'{\"method\": \"status\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet status",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"status\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"installation_id\": \"6bX88naHw5g5pVDihups1vDJAUJX3tPnSTzzX8gqn8GqqhDDAGS8gXYeHYYhkfMeav\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"691772a32fc37ac70ef8cff4ca4d3e3ff3f6e46271d61ebf927976d0fec1aec8\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"127.0.0.1:50002\",\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.010761522004031576,\n \"port\": 50002\n }\n ]\n }\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"max_incoming_mbs\": 0.0,\n \"max_outgoing_mbs\": 0.0,\n \"outgoing_bps\": {},\n \"total_incoming_mbs\": 0.0,\n \"total_outgoing_mbs\": 0.0,\n \"total_received\": 0,\n \"total_sent\": 0\n },\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"ffmpeg_status\": {\n \"analyze_audio_volume\": true,\n \"available\": true,\n \"which\": \"/usr/bin/ffmpeg\"\n },\n \"installation_id\": \"2jezwuwxQ4YaPeK8NWsvHUG3cqafj355AKRN8FTu2it544VPXfKj3zyiy2Q9vDjTk3\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"available_servers\": 1,\n \"best_blockhash\": \"53e5208f4f72ba63ec828e4f3cc51d51a1771862545ed88559ab2fdc9b3ad9dd\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected\": \"127.0.0.1:50002\",\n \"headers_synchronization_progress\": 100,\n \"known_servers\": 1,\n \"servers\": [\n {\n \"availability\": true,\n \"host\": \"localhost\",\n \"latency\": 0.010943017026875168,\n \"port\": 50002\n }\n ]\n }\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -306,7 +318,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.53.3\",\n \"os_release\": \"4.4.0-116-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.5\",\n \"version\": \"0.53.3\"\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"build\": \"dev\",\n \"desktop\": \"GNOME\",\n \"distro\": {\n \"codename\": \"xenial\",\n \"id\": \"ubuntu\",\n \"like\": \"debian\",\n \"version\": \"16.04\",\n \"version_parts\": {\n \"build_number\": \"\",\n \"major\": \"16\",\n \"minor\": \"04\"\n }\n },\n \"lbrynet_version\": \"0.57.0\",\n \"os_release\": \"4.4.0-116-generic\",\n \"os_system\": \"Linux\",\n \"platform\": \"Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial\",\n \"processor\": \"x86_64\",\n \"python_version\": \"3.7.5\",\n \"version\": \"0.57.0\"\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -360,10 +372,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Add an account from seed",
|
||||
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\", \"single_key\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account add \"new account\" --seed=\"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\", \"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\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1579400238.4076705,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPfLMWqQPugfYqk2VbqyAav7taMiAdCUZVBf77qycF8dLQRYCdcZYfEnYn3wwp6WJiXATSf4i1zQPQeDAmhz9ayKfjGQH74aH\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YoPJj44W65CxK41Y1JMVVRVMeECvckMt29MtUNRqK7xGbfyP4PU7giFaGg3k8cFikmVCYvmSwUmJCHQ7Wqoj7G8nM73L6CK\",\n \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\", \"single_key\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account add \"new account\" --seed=\"ten hope good unable volume uniform soda shell issue blame lemon mean\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\", \"single_key\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.8771687,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -401,9 +413,9 @@
|
||||
},
|
||||
{
|
||||
"title": "Get balance for specific account by id",
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account balance \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account balance \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"available\": \"2.0\",\n \"reserved\": \"0.0\",\n \"reserved_subtotals\": {\n \"claims\": \"0.0\",\n \"supports\": \"0.0\",\n \"tips\": \"0.0\"\n },\n \"total\": \"2.0\"\n }\n}"
|
||||
}
|
||||
]
|
||||
@@ -438,7 +450,7 @@
|
||||
"curl": "curl -d'{\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account create \"generated account\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_create\", \"params\": {\"account_name\": \"generated account\", \"single_key\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1579400238.2787437,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPfLMWqQPugfYqk2VbqyAav7taMiAdCUZVBf77qycF8dLQRYCdcZYfEnYn3wwp6WJiXATSf4i1zQPQeDAmhz9ayKfjGQH74aH\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YoPJj44W65CxK41Y1JMVVRVMeECvckMt29MtUNRqK7xGbfyP4PU7giFaGg3k8cFikmVCYvmSwUmJCHQ7Wqoj7G8nM73L6CK\",\n \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\"\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.6951761,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -493,24 +505,24 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Transfer 2 LBC from default account to specific account",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\" --amount=2.0 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000132b8996b03c88232743ed37c9bd5ef57ef57892e42135d46f02f2ae95b341bda000000006b483045022100e401824a767f4cbad7329c6f1ad563bec85e002eebbf0d1b170e5924d3ab85a702202c2d06303dec4a65274f125f2aadba5307614392213dd79b77b9aae204730fbf0121036207aaaac5d1bcaf702f1d662cb1aa1d35b7796d74a0c3b0e45ff3c0abe8aa38ffffffff0200c2eb0b000000001976a91483bf0505a3da64584762ba81cb4612c1e57b89fa88ac90d7ae2f000000001976a914f4748e91a505e9b414274111b7753dda6dcf7d5f88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkAjveCss25NmkHkokv9a43V868iuvSqcQ\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1579400268,\n \"txid\": \"da1b345be92a2ff0465d13422e8957ef57efd59b7cd33e743282c8036b99b832\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"n3oWoNoXgKSWq8ksK8iXes7EkQNh9ZiYLb\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --amount=2.0 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001f626854efbd538a7fc5170b5a945672d21c7c7424c9d157437e35c91fcb7d186010000006a47304402203cf140d1799dd7362424d9c5fde4d626fe53639cc7aba3923ba4b67c751abb14022025b372e48b89b34c6125b3ba3b6adc2c8b3d199c38f535f7d7774031ccb6eafd01210319fc05001cb1e655bde5f78cfbaf99afc6dde8c24ab72ec76a3b7117e3e52a68ffffffff0200c2eb0b000000001976a9140a823bfea253ec344d0d820e36a7c821b4b9a56488ac90d7ae2f000000001976a91406091021a2942d877e0cc114960e14d451f4094b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n2qHgdfzNg8NfkXzggryosZrdxcExzNwyF\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787037,\n \"txid\": \"86d1b7fc915ce33774159d4c42c7c7212d6745a9b57051fca738d5fb4e8526f6\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Spread LBC between multiple addresses",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"from_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\" --from_account=\"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\" --amount=1.5 --outputs=2 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"from_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001004d6230575edb11cc650227154cd6e580a6d9682bf335885f291a7959f083d7000000006a47304402205dc6e0ca05752fbc6a1417d7fbfe19d506565b1bf6454d5cf0956d372373e96b0220391150e2bd6c02230bf1b65298255bef91d0ffdf76362dc6ad44e214cfab37f001210262c4cb530de06e209b04a735d6a9378ce0400e2e7425764350498d418d1c4968ffffffff03c0687804000000001976a91483bf0505a3da64584762ba81cb4612c1e57b89fa88acc0687804000000001976a91483bf0505a3da64584762ba81cb4612c1e57b89fa88ac6cb9fa02000000001976a91494954a46cdbadfd282700522f5b4c4e0c4f2544b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1579400269,\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mu4b9JhJBCaDmdkpSmQURFvhbYy9uUmnr9\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --from_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --amount=1.5 --outputs=2 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001bf6d56758c48ec7adb2b8afd43913f4235cea885e1ff844ab58ec5fefa4af5a3000000006a4730440220099ead4341368eb214450dfc6da61605a0917b989625e470764951af9d035719022028a1aecd1117d9a6c5618ab9eb29d88d7cfb035becd79043aea4e47cfbf302be0121020477c5ab886701bae21cc2b1775af6f704dd4a5326686a18139b7bd1b956f38bffffffff03c0687804000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88acc0687804000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88ac6cb9fa02000000001976a914179c1a2afebd7b122e7a5be2f8daef0238231e6d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Transfer all LBC to a specified account",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --from_account=\"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\" --everything --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"everything\": true, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000037240bfdc7562de1616a14ac8d00ea71e4021126cdf98dc3e755740fc03dd6b67000000006b483045022100ed59201d80743f92e275fdb41099b2db1b25577bd6e8e2bdde6712f37560bcfe02206664ef1be775a1a5c293c05d9c1549c88577cf5e7c6aeb088ea70fdcae98792d01210262c4cb530de06e209b04a735d6a9378ce0400e2e7425764350498d418d1c4968ffffffff7240bfdc7562de1616a14ac8d00ea71e4021126cdf98dc3e755740fc03dd6b67010000006b48304502210097df72fdc6f40bb4b119baba6d6232065aa86e06082a7d84776eb442e8847f720220483c841aaed85c5e063e59885bf65891dae92561c47d68147096c4d534a275d201210262c4cb530de06e209b04a735d6a9378ce0400e2e7425764350498d418d1c4968ffffffff7240bfdc7562de1616a14ac8d00ea71e4021126cdf98dc3e755740fc03dd6b67020000006b483045022100cdafc9dd334b238845fdbbec3f1e90f18f608cff017fc2ae1df569f8d9ff744c022032459996bfe81fdc20e89fe59bb82131c52d77f6fe3ddd791665c9aaea807a28012102827e9ee79680f998b2072aac822e794621ab77994880c0f811215aa7556c3796ffffffff015027eb0b000000001976a914291cb899cee628ed4076d8aff8c17e3b9ff8685e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1579400269,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400269,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mu4b9JhJBCaDmdkpSmQURFvhbYy9uUmnr9\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1579400269,\n \"txid\": \"676bdd03fc4057753edc98df6c1221401ea70ed0c84aa11616de6275dcbf4072\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjGLQViMN89giFBMxP4E8VAMUcbxyjywk7\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"e356d9edcef5b1f9dc1620d7c703f13a4046b49e3ffc4e924778b1ac6600b3fe\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"e356d9edcef5b1f9dc1620d7c703f13a4046b49e3ffc4e924778b1ac6600b3fe\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --from_account=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\" --everything --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"everything\": true, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000035bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3000000006b483045022100ee58553826cedd5b9351ae6f0086d8bd708fb5fa433d5895dbc0f8805b43130702203368391620d0b8de296dff58f2bd803e1407cc77e21168035560866d7cb4f1970121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff5bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3010000006a47304402200a811fc0e2756a3ffa190bc681b6db9d0a256b09caa8c884634979db33e775c202206f377b5ed0cfcbec292fdefcd195d4f6dc819cab494182f892fff1333b6aa3d90121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff5bd6006b2392e1d98e03b8b7e8802d7fff3d9d93f4121587a8f8f32f9715ada3020000006b48304502210085a62bb096663852946d669bac6e1ddfb37cc6e53b5f5a86df3858110f33c11402207fc4485a1a69a2834d0e521ca4b879170c9d755fec917e3d88959ea7301e683c0121027a4eb6ff21d85fea2f563d0533ab68abeb98995a4b205d50d33c4ccb2c50aee9ffffffff015027eb0b000000001976a914f4f8881aa702cc7f114d4039d0e39188d368224188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1580787038,\n \"txid\": \"a3ad15972ff3f8a8871512f4939d3dff7f2d80e8b7b8038ed9e192236b00d65b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n3rEu9EusAUzTr7gVuhYiWGFoM7Vs5SkAb\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -568,7 +580,7 @@
|
||||
"curl": "curl -d'{\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mtoi8LVg42arZktjQKe9Kjkn3hB5RfQjtR\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mtoi8LVg42arZktjQKe9Kjkn3hB5RfQjtR\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WZzDVYzTURW6cCCz7UcQh8zCz2gLc3eif8LciP36qBtz1nyWjKm5qL5zQbFwTT6GoFBDy84fqiyVt6BDDr17s51vLbF9sAk\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"is_default\": true,\n \"ledger\": \"lbc_regtest\",\n \"name\": \"Account #mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WSAvo4W9rVBzqqFz2veB26nGaFyLh867KqXWPvQH3dxxJX6cWKQFShiTyqRaSRc3HR4eXmve3sAdXL91GfMvrYRFsqonnsa\",\n \"satoshis\": 1000000000\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -613,10 +625,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Remove an account",
|
||||
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account remove mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}).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\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1579400238.2787437,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPfLMWqQPugfYqk2VbqyAav7taMiAdCUZVBf77qycF8dLQRYCdcZYfEnYn3wwp6WJiXATSf4i1zQPQeDAmhz9ayKfjGQH74aH\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YoPJj44W65CxK41Y1JMVVRVMeECvckMt29MtUNRqK7xGbfyP4PU7giFaGg3k8cFikmVCYvmSwUmJCHQ7Wqoj7G8nM73L6CK\",\n \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account remove mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.6951761,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -703,10 +715,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Modify maximum number of times a change address can be reused",
|
||||
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account set mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT --change_max_uses=10",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\", \"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\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1579400238.461284,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPfLMWqQPugfYqk2VbqyAav7taMiAdCUZVBf77qycF8dLQRYCdcZYfEnYn3wwp6WJiXATSf4i1zQPQeDAmhz9ayKfjGQH74aH\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YoPJj44W65CxK41Y1JMVVRVMeECvckMt29MtUNRqK7xGbfyP4PU7giFaGg3k8cFikmVCYvmSwUmJCHQ7Wqoj7G8nM73L6CK\",\n \"seed\": \"blossom warfare trial oil essay six develop bless remember recipe wasp avoid\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account set mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT --change_max_uses=10",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\", \"default\": false, \"change_max_uses\": 10}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 10\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"encrypted\": false,\n \"id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1580787005.9331355,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPent5uR3xLzqRGKn9H1XdTzLp5ybwM6qcA2DrngUrE2r6UDc14TLa4gJX7NtX6BquQ7KhedKSDuGkphGDnCHF5jYU9wKCV35\",\n \"public_key\": \"tpubD6NzVbkrYhZ4YFuso4iYkQVXqMJ5SLiY3HwbNVeEmNdzzWUdR5JSQXTxeLtn3jRPmCsR4FYoYr66QGmQqBYsUvEvrGvBqbUgYYx1XNqDQ2H\",\n \"seed\": \"ten hope good unable volume uniform soda shell issue blame lemon mean\"\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -742,9 +754,9 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Check if address is mine",
|
||||
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mqMjLadUVYcKcoUD6bDjtymz3mw5o85a9f\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address is_mine mqMjLadUVYcKcoUD6bDjtymz3mw5o85a9f",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mqMjLadUVYcKcoUD6bDjtymz3mw5o85a9f\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address is_mine mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
|
||||
}
|
||||
]
|
||||
@@ -791,14 +803,14 @@
|
||||
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mhBD332VegShAorKpxukWrEWmbUzfdzDhS\",\n \"pubkey\": \"tpubDA9GDAntyJu55PTWeX41jxL6f4ZW1EGTUiYjcfXbpbpz2GBPp6Yi2x1FVA2d12KnUPDYuKPUWGw1Dh9ZntinTb8D7ZUFAKCKyN93Hdqvqms\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"miwwrn6FK5FY6sQbDcU7YNcd6oTHtwJvQH\",\n \"pubkey\": \"tpubDA9GDAntyJu52wuCcgVYDVds4DcRGs71e2TH4k5yfFudwwjq5439ojn1o24jDtew9AggW7TUcF34NT54mPeZEZazy4bWQYwtf5GEgY3V2SQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mjwdqgZ3k5cTKLzzqj6jeKHWbPpauWrBwv\",\n \"pubkey\": \"tpubDA9GDAntyJu4NL6PR5ZY1orKdmJJmQUb16RH2pvPhrxbqyEzVvAT3MSQn7LinV1VonLQBGhckU6eeELehxpGb12aLscaiUuY1soB38Zq84t\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mmE9RDU2T1HD9oX9SNVoQA7vD3A359qkRR\",\n \"pubkey\": \"tpubDA9GDAntyJu4SnoQ8QZEPs9SAKh1qkuJ2j6iStdRTpr6LwARWVfwdve4y6DyyCcBKTpotUPGypdiiw1PSJuTBNbApaq2SZGHsU7td35AyPQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mn8QjQsVrYXU8zYorX95cYPwa79Z7uNxq1\",\n \"pubkey\": \"tpubDA9GDAntyJu4qb6PvTo3wt3dQYE46LJM3czxuhSgrzst8LGSrux8NxHNeEMgxCHXnPyruimAw5Yp1tuS3nyRUUowEfPjKrCWmBE3jSuyrac\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"moKAJoi8inN2KjDeqJZcyqzPWotVbUHuVe\",\n \"pubkey\": \"tpubDA9GDAntyJu4fu7FweQwbXz15syBjxW3Qmnyyt8wjWPgoLPpe7Kx76Z2yVb6nwMXE3vVvYJTYyrL9BePyiUxK4s56fP6W7HCq8F8qPcr2Ae\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mpSC61mQBsRYVx57wvwRf7TJ3SR1uf4YJk\",\n \"pubkey\": \"tpubDA9GDAntyJu4RgxjLgKhVanz5KdQy2kGJhLkP62Qhu2ToZSV4u6m1fwkdTNve8ideaEix1rKFVnenUKGUL3iTZpixHH8bsAAE1CutJFhupm\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mpSdwtjqtiSix4WPWPDmEQWyd9ND54dcXn\",\n \"pubkey\": \"tpubDA9GDAntyJu4H2jN5FGPJdo2NKGHnNcoZfACWe2goMeKwy69UB7J3FpMhCDffHSXuHhVG8gJrf8Qm6cAcimhwmFN18oWF8ZE1h7s6SeNUYW\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mqyx9wR5hV4h7eg8731X1XxTTq9GhXzo8E\",\n \"pubkey\": \"tpubDA9GDAntyJu4vyXxpCj5dtueXk7vY1bD3jPdpAnDDrPDQWCmT92ATZxCJCZNnxD77JgwamFvLHzRVbqMVdny4dSunNKntVSwig81XsZ9MA7\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mrW3GqozotWt25hEfnQCnwRCgAEgnqVVUa\",\n \"pubkey\": \"tpubDA9GDAntyJu4o5HeVMXjD64V8bJRU9VsHfRkoCigJsUjW4SunbFmtifvLazZKPDcfmoWgz6kR3NHpE1yXZozQU65MmK1HPS9Zd8fwCzGY3V\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"pubkey\": \"tpubDA9GDAntyJu4ExrVLbVAKrFQE46Fg5bcHtLRuYeHi7WEvTzVfwUmmHzhQ79HC45h9uKPLmWN7Y5SRzi31kxonKpDtxyLcUQjSYLXSgMdx1M\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mskMFx1gcztwp3GVX4pQhpebSQHxUSWbg9\",\n \"pubkey\": \"tpubDA9GDAntyJu4JciDnjGGkpLCzn3M11GZ6uW9ipEaMHM5nsDeAkoW8yLaBc4tHVhQKP7GMoNp2ySnbwKsezXC39hLcGTyMWXibYcNWPcvv6d\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mtCpZhdUga64KZxcie9UzJGRBhLY99pB6s\",\n \"pubkey\": \"tpubDA9GDAntyJu4uNESG5uscZXCCNwqF3tJWw7VgABooB4VQ6SSszVbLBNbXTbhFdDoZEe9UHuLScKzjMU6X8FjvuL4iumBpDqA6nTxJheMQwa\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mtX3UmbqJQ8wNShAjKNDMd1dvrzh3tHitR\",\n \"pubkey\": \"tpubDA9GDAntyJu4zsgAwf58DXNW9uajnXp6hNDExgWKEwFSg7vTf1UkWsfXmamCSH6PBc2h4mcznVY5dLnGpwV1d8fhdGoUX6dUvaSYT2GycGo\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mu4b9JhJBCaDmdkpSmQURFvhbYy9uUmnr9\",\n \"pubkey\": \"tpubDA9GDAntyJu4Kin1srBhnMwUZ9bMrUXvKBudKxkeumaCDe9JzbBy7oHZVDArCHhpcy67tweE8LMNhYxQYShZ6PqefMSMF4hQGWFUeAi9D88\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mv4KUj3getjB1DwQ2GxP3ncVox9T3h5wDj\",\n \"pubkey\": \"tpubDA9GDAntyJu4YPg9jamaGsUjnf5KBpfvrRqtYVfAV6iqJg1zbF96ixnBV4E3ynvgYZgRf7GzKeTZ4BfPWGXWY1tUCk4Q2rMogze7UG3vcZu\",\n \"Line truncated
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"pubkey\": \"tpubDA9GDAntyJu4TrJhMhaeoxsf3KznrGecoJfwGzrNxMxokxM12paw697yxXMkJdcdCfoTW9Zmi6EMKug2DLsDpCcgCzYqaHbGbKNjbkjS3qk\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mgXfHPzpiAJuPDeBXhDVQmwpQsRwrQ3msZ\",\n \"pubkey\": \"tpubDA9GDAntyJu4vvvuf3ZfJzi1HBXTdrcrpNCZqWrwAmfa7e6Jc6AMb9TRmLvUaSjXrHg1GpqRqwTXkU7KeAsYNoXCr3iuPSoVZKSbcvN5oMM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"pubkey\": \"tpubDA9GDAntyJu4NNvtdYwfqaFhTwjXhymLnRTvLCLuNEbkKpEdChkQyHhkJMzrqMxLYunNimWfatywjrcZogcqCo6CtpPRZfxvsmmTTSisVnG\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjoRtVG4ghTdsRuuDorE7RKXwKYDP5jzRV\",\n \"pubkey\": \"tpubDA9GDAntyJu4WHgaUn84C3vaEw2FbBB5tbhNQfsVSmBp1oAinGKakGgLwvDUWjhJnnVGwcBiyNU4xYYmzXEDr3Yy5QHq2HRcR2tKDg91Ryj\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mjtFmUSHfvKQ1YJMD7QZKaZoRTV3Et567P\",\n \"pubkey\": \"tpubDA9GDAntyJu4n5NEU7oHd1rj9wiUTMB4TD2im5y4LjxXUKFAAKdhj2qiJLDSjkmMQgxRf9MQwmKWwxDbEeeym48o28FwtG6TNYRRvTtJtu9\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"pubkey\": \"tpubDA9GDAntyJu4QyP6CWsuhNf24A3kpr6hdHur3V8z237Kgg45P5BPXZYJJKd8UVFyroZ3uYSmtDJwhAuzg27ovsTNt9Q98UMx1xUFTYYXM69\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkJx7UPdnqoFcaYB6jZkWUGY3Ji4z7NtJ1\",\n \"pubkey\": \"tpubDA9GDAntyJu52dx53ttzWLsT1mExLJ3MyRYsrVd6cgXB8KHUx6vfqxYc2gVAXEmRp9w1FxukgSV4fMFebVF3oH9d8WcagQg6xeFMoMRrkwJ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkcoQLhx9Cvvx45fNjXmQaarDZCS12gEo5\",\n \"pubkey\": \"tpubDA9GDAntyJu4os9QDdEYzjAdMoNYneChu1mTgpd7y5rtJXULZ1yG2gWhaptyLzZnkPBLEcbu9fno6rpjw1fPXURt1dfc4Cj2ysfTZwwDJvg\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mkzzf2aKuyvRjV2uXfBwWTJWaxVeSoeSHh\",\n \"pubkey\": \"tpubDA9GDAntyJu4sg1iqSdVMx5ZDu8PpEs73MGNHngUzhbDN5qbnMdiVbKgtCeV8g45fdaSZmWDEqt5oQQkE3PQd2AEVySthGzJkfDGVk4aAax\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mmwn9tCu54gvAaVXwP5gLUeSpHtyCt3mQr\",\n \"pubkey\": \"tpubDA9GDAntyJu561eFZrne4Uhryk7ya2jRdPVRZuAxMixhefoN4Qu1a1G6PDtNtTXNHy1yW1nmZxHW2GJKiicMSsoSJDRHW6tSkgmYvaL4y2E\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"pubkey\": \"tpubDA9GDAntyJu4h9BTNXfq1EubM3P92YcHsppTtAgKwLt7F6fUb77bQbQzaRCmnsVrAco8QXN4yBS17xWthKmvNYdqzvuLrny7xAYLvedN42k\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\",\n \"pubkey\": \"tpubDA9GDAntyJu4XuRPXtLyopDiZFA4JEK7u7SjGLVNqHvnDsJHKsnhwAm3ghkWMbcDbpA6UA84T6LeTv8H8uHWLSZ1uYx3nUv57jCMo9h7Q1p\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpaFPKG87uCvLBfx3scBqEt2gQmxDHvLEo\",\n \"pubkey\": \"tpubDA9GDAntyJu4iD68JkxhyEVVuMGA9YrZG9sz3FbGPbNeHKoQJvQ27ocYEBNeMsgfWb7FdrbGXVhftFiyRaF3vrLShB5LMA44RREGHePWhpw\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mpfngLET5nhTZzvWRD71poTMg3y288NbM1\",\n \"pubkey\": \"tpubDA9GDAntyJu4bKkMM54YZkXFmmw4Rb6RnjazGb4mrkFYDKwRhMTpoRVF8LB8FtPuE1k9bhXXheg9MMQFucyDYyDMnCKzbmxgoaJ5CC8av2F\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"msrzeC3SYYH5DxhMt91jSkUcqguyKKPSJD\",\n \"pubkey\": \"tpubDA9GDAntyJu4z217gK7uH5RVaaFTTifA25guGnMMMt7EQBJDjzvG8NZiRBRfhqc5yoMo7UD9f5bakz9U7sLpBrwdS5NbDdrKxjjHhsudqZD\",\n \"used_times\": 0\n },\n {\n \"account\": \"mp29NVVYf3k331DGBfC3cv874z5KdyDU5V\",\n \"address\": \"mvS5DbYDZnnCA79uE4d49Vg5bxSXyLqScx\",\n \"pubkey\": \"tpubDA9GDAntyJu4JprXk2XBTLWfUw76U3y5pCSRcHdevM8gxhZD5xLZ9XXV3tAfTgxj77RkRiKKhq3KfMuBTaT79P6nwoMjk8XyT2QSWuEWdFM\",\n \"Line truncated
|
||||
},
|
||||
{
|
||||
"title": "List addresses in specified account",
|
||||
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address list --account_id=\"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mhBD332VegShAorKpxukWrEWmbUzfdzDhS\",\n \"pubkey\": \"tpubDA9GDAntyJu55PTWeX41jxL6f4ZW1EGTUiYjcfXbpbpz2GBPp6Yi2x1FVA2d12KnUPDYuKPUWGw1Dh9ZntinTb8D7ZUFAKCKyN93Hdqvqms\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"miwwrn6FK5FY6sQbDcU7YNcd6oTHtwJvQH\",\n \"pubkey\": \"tpubDA9GDAntyJu52wuCcgVYDVds4DcRGs71e2TH4k5yfFudwwjq5439ojn1o24jDtew9AggW7TUcF34NT54mPeZEZazy4bWQYwtf5GEgY3V2SQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mjwdqgZ3k5cTKLzzqj6jeKHWbPpauWrBwv\",\n \"pubkey\": \"tpubDA9GDAntyJu4NL6PR5ZY1orKdmJJmQUb16RH2pvPhrxbqyEzVvAT3MSQn7LinV1VonLQBGhckU6eeELehxpGb12aLscaiUuY1soB38Zq84t\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mmE9RDU2T1HD9oX9SNVoQA7vD3A359qkRR\",\n \"pubkey\": \"tpubDA9GDAntyJu4SnoQ8QZEPs9SAKh1qkuJ2j6iStdRTpr6LwARWVfwdve4y6DyyCcBKTpotUPGypdiiw1PSJuTBNbApaq2SZGHsU7td35AyPQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mn8QjQsVrYXU8zYorX95cYPwa79Z7uNxq1\",\n \"pubkey\": \"tpubDA9GDAntyJu4qb6PvTo3wt3dQYE46LJM3czxuhSgrzst8LGSrux8NxHNeEMgxCHXnPyruimAw5Yp1tuS3nyRUUowEfPjKrCWmBE3jSuyrac\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"moKAJoi8inN2KjDeqJZcyqzPWotVbUHuVe\",\n \"pubkey\": \"tpubDA9GDAntyJu4fu7FweQwbXz15syBjxW3Qmnyyt8wjWPgoLPpe7Kx76Z2yVb6nwMXE3vVvYJTYyrL9BePyiUxK4s56fP6W7HCq8F8qPcr2Ae\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mpSC61mQBsRYVx57wvwRf7TJ3SR1uf4YJk\",\n \"pubkey\": \"tpubDA9GDAntyJu4RgxjLgKhVanz5KdQy2kGJhLkP62Qhu2ToZSV4u6m1fwkdTNve8ideaEix1rKFVnenUKGUL3iTZpixHH8bsAAE1CutJFhupm\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mpSdwtjqtiSix4WPWPDmEQWyd9ND54dcXn\",\n \"pubkey\": \"tpubDA9GDAntyJu4H2jN5FGPJdo2NKGHnNcoZfACWe2goMeKwy69UB7J3FpMhCDffHSXuHhVG8gJrf8Qm6cAcimhwmFN18oWF8ZE1h7s6SeNUYW\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mqyx9wR5hV4h7eg8731X1XxTTq9GhXzo8E\",\n \"pubkey\": \"tpubDA9GDAntyJu4vyXxpCj5dtueXk7vY1bD3jPdpAnDDrPDQWCmT92ATZxCJCZNnxD77JgwamFvLHzRVbqMVdny4dSunNKntVSwig81XsZ9MA7\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mrW3GqozotWt25hEfnQCnwRCgAEgnqVVUa\",\n \"pubkey\": \"tpubDA9GDAntyJu4o5HeVMXjD64V8bJRU9VsHfRkoCigJsUjW4SunbFmtifvLazZKPDcfmoWgz6kR3NHpE1yXZozQU65MmK1HPS9Zd8fwCzGY3V\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"msXZeTbziXSNU1iSU2tvYkHGgHWtmN9LqV\",\n \"pubkey\": \"tpubDA9GDAntyJu4ExrVLbVAKrFQE46Fg5bcHtLRuYeHi7WEvTzVfwUmmHzhQ79HC45h9uKPLmWN7Y5SRzi31kxonKpDtxyLcUQjSYLXSgMdx1M\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mskMFx1gcztwp3GVX4pQhpebSQHxUSWbg9\",\n \"pubkey\": \"tpubDA9GDAntyJu4JciDnjGGkpLCzn3M11GZ6uW9ipEaMHM5nsDeAkoW8yLaBc4tHVhQKP7GMoNp2ySnbwKsezXC39hLcGTyMWXibYcNWPcvv6d\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mtCpZhdUga64KZxcie9UzJGRBhLY99pB6s\",\n \"pubkey\": \"tpubDA9GDAntyJu4uNESG5uscZXCCNwqF3tJWw7VgABooB4VQ6SSszVbLBNbXTbhFdDoZEe9UHuLScKzjMU6X8FjvuL4iumBpDqA6nTxJheMQwa\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mtX3UmbqJQ8wNShAjKNDMd1dvrzh3tHitR\",\n \"pubkey\": \"tpubDA9GDAntyJu4zsgAwf58DXNW9uajnXp6hNDExgWKEwFSg7vTf1UkWsfXmamCSH6PBc2h4mcznVY5dLnGpwV1d8fhdGoUX6dUvaSYT2GycGo\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mu4b9JhJBCaDmdkpSmQURFvhbYy9uUmnr9\",\n \"pubkey\": \"tpubDA9GDAntyJu4Kin1srBhnMwUZ9bMrUXvKBudKxkeumaCDe9JzbBy7oHZVDArCHhpcy67tweE8LMNhYxQYShZ6PqefMSMF4hQGWFUeAi9D88\",\n \"used_times\": 0\n },\n {\n \"account\": \"mgfeXcmpqs1EQkuxsAzKFwXWTk15F9hDpT\",\n \"address\": \"mv4KUj3getjB1DwQ2GxP3ncVox9T3h5wDj\",\n \"pubkey\": \"tpubDA9GDAntyJu4YPg9jamaGsUjnf5KBpfvrRqtYVfAV6iqJg1zbF96ixnBV4E3ynvgYZgRf7GzKeTZ4BfPWGXWY1tUCk4Q2rMogze7UG3vcZu\",\n \"Line truncated
|
||||
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address list --account_id=\"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mfat1w5NsfN7tQqYeGYtK65Zm2ey39DGUC\",\n \"pubkey\": \"tpubDA9GDAntyJu55myzAeyCFYX3RbLMYRp1fKJvKKViW1W4tyeG9ACeBZsKZmrAxep6tHEHL8sXojD7d3yauJJh3aXDEeSKztCXRUFifSYx4Fg\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mfxZThzQEkE5eKzF4B1cS5MLaB87RLAZbi\",\n \"pubkey\": \"tpubDA9GDAntyJu4rwh3fvSRr1EVsRFSvGXXF5GHNzkpoH49s2W5vzcfn533313cyrdMDstefavVQwxEd3jaE9x3d7CZSsGbwJvHiXMTfy2pkLQ\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mgUX4pABAVjKEZAShzA5ArMvuFjpUB24LC\",\n \"pubkey\": \"tpubDA9GDAntyJu4GonvTxsUMQQNFdwnSwqubdkk3bh7SeBxfBAZ3Wddj7firFd711BXCkDsqC36jBSEYi1SDER3F7Z8vYsYFsUHoRtBHCFtnvK\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mhfnqdysV2yQPxtGvFegYLsTGVyHMRvp38\",\n \"pubkey\": \"tpubDA9GDAntyJu4SA3YfjCsVDofEka7XFaTF1cMfPn3ZmKs9xdZMU6vSdLGb71a8DvcpDWEP6UaDews2Y6AKtm8HHduDv8hmnRW4EC9w1G3ELf\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mjRGG3iw1x2EM2mTPW7YRQxjNoYYLQ5fnp\",\n \"pubkey\": \"tpubDA9GDAntyJu4eEFTtCkDYMLLa7ppmgdTgLmUSQSUabXoXasNXthh7vZKzTuh1HgVSnGyyxE37ncqaR2QDG5GvB7kSKv3kLdrpyeU61Q7DZ7\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mk4CenuF879p2u96oqJLzBTeiMW8LCMYbb\",\n \"pubkey\": \"tpubDA9GDAntyJu4ZGGwV5JjN8CRQxdh2nr5afiBiE23zR6SHE118eguHX4iQkzhzZx1L1SrqePkKL1Hc6Ut7vGJ8VnQsH4qvAQSqnqpPYfikUX\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mk4VyfUwWurYozf94ZGNTHtWtreNC6fUbU\",\n \"pubkey\": \"tpubDA9GDAntyJu4vPcGm18dbULrbAKAvv5wQ6xKuxN3MpvaxqcEh6X59fHWmDRk19xn7iH4Pxrqtc1aVoqEha2gtoXELLzQ4yjPFhy6xght4UC\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mkLQGh5bwpQ7YGQvPn3QxhndHWsM67ohoT\",\n \"pubkey\": \"tpubDA9GDAntyJu4DzSi6gLMPrLeSJBFhEMbXPJF9tYi5S3uCNUbpFtfUZG3Zpj7hRTLRUeznSzH5jozXXuq72bQ43X32ShSzawhC3ZdxZWekiM\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mmt58zLT21KRiCwESwajXAbJh8kwCzo2o3\",\n \"pubkey\": \"tpubDA9GDAntyJu4Tp2hABXqkwJxHFeChbqJ1CfbsaCNqxyFAGQbEGGza9UmBKSbZCxMQizwJiyjNtjsfmSB54odAtwLkuceLitsPYwrvzLmmj8\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mnBSAY9BnmoLPzzXm2Xoc15oGXvDMcnTcS\",\n \"pubkey\": \"tpubDA9GDAntyJu4MHsHpZk2XBCrF5MnTt1rxrtoZTGyXwUUDz3ZLzJipGc8iYthCFGKnTwEGoQrtCR8gwhsMewJAf9T4jWmvvo8nD6CKdB8oZx\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrKcp7mf3d1byeZmDfqJ8BdRXDCmCi39V1\",\n \"pubkey\": \"tpubDA9GDAntyJu4EnPW1VYseMJ5rsm8UeyrDyK3t5SohYoTKFkHseexhhMi4C2opLjn6BivojfDhiFe61R1Rhqpz6DWjkiqpB1SJkFPaevdJv9\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrQZgHT4iNRBTKAhuwq7GChomJnaB7bFmp\",\n \"pubkey\": \"tpubDA9GDAntyJu4k3siG2Vpg4FVePFqgc8eFjCtC2FZszwpuqrXzfPiA1X9n9yXeekwkQiXS93j5cUdz1Ai4ACcYhHFUpnw2N7pMiuFpW4BS4K\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrhvBJT8niVCGT4bmZ7ngGDDNm197cNA8p\",\n \"pubkey\": \"tpubDA9GDAntyJu4yJ7wHRBDCnyby95izJiopfRpgKP233hkSmo5w8gshmdg8YZXLXo8wprsM7YEREE47AQ7pyFYFHSWdYW4RHtNkcf3uiq8LH4\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mrxxeBwGQYwLm5oJRw7tNYBU8b82FNm6Vb\",\n \"pubkey\": \"tpubDA9GDAntyJu4LeunT5yfFALZJu21VTqaidFLnPHPkZeswvJHNLCeheGakQidVFfW3mNws61eeWUULE4GtEJRSQFQ44au9ZEwVLcTB7epYvs\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"mtk5c8YcgDtkF1YhzWwMNztMnJu71G79mP\",\n \"pubkey\": \"tpubDA9GDAntyJu4vgagzy68rLgER3fSxQ9pb2XrQBdYwVx8bcAf97TF55dhB5UM2qFnWkCqvNHCwB9kE2uNwhBMXC7haMWT5cn2H3Lc4ibvrma\",\n \"used_times\": 0\n },\n {\n \"account\": \"mrnadPzdQ5B3NqQeA5pN2UZUeKnzNmjLxT\",\n \"address\": \"muuy1gdKpeFDhprf6j2DBZh9zAyMh7PXPB\",\n \"pubkey\": \"tpubDA9GDAntyJu4JxKBQd6Ddrrs8q5zntWfiBzGwiTxCcxMPa6nKcoSicNN4HjJYb3jaCeC6WDq4nz4EHePce6KsVQ7mRjqBKY3wxG5RFrxVV9\",\n \"Line truncated
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -826,7 +838,7 @@
|
||||
"curl": "curl -d'{\"method\": \"address_unused\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address unused",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_unused\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mqMjLadUVYcKcoUD6bDjtymz3mw5o85a9f\"\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\"\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -876,10 +888,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Delete a blob",
|
||||
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f2c7e91c86074ee51fbd5fb7a609baf15237790c286bb57682a30aaff8f635d614c16acbfaa2b63a28f62f10692b6fc4\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet blob delete f2c7e91c86074ee51fbd5fb7a609baf15237790c286bb57682a30aaff8f635d614c16acbfaa2b63a28f62f10692b6fc4",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"f2c7e91c86074ee51fbd5fb7a609baf15237790c286bb57682a30aaff8f635d614c16acbfaa2b63a28f62f10692b6fc4\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted f2c7e91c86074ee51fbd5fb7a609baf15237790c286bb57682a30aaff8f635d614c16acbfaa2b63a28f62f10692b6fc4\"\n}"
|
||||
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet blob delete 756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted 756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\"\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -957,7 +969,7 @@
|
||||
"curl": "curl -d'{\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet blob list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_list\", \"params\": {\"needed\": false, \"finished\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"f2c7e91c86074ee51fbd5fb7a609baf15237790c286bb57682a30aaff8f635d614c16acbfaa2b63a28f62f10692b6fc4\",\n \"3fab0258c15b9cacf5f42e3d531d64f0bf50e398903a172ef461b5337cf4b3394e85b5bd00fd044315884a310cbb8c1c\",\n \"4f2f2a425212f91080b92ee4edeac1ac88138133df17419984969791aae9f5ce4640952b41cd27686ed0c6692db77573\",\n \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n \"756ffee0f7af3b702889cf33f4bd09405295c05dc4fef1f2f597e1d52fdd4727f6fe85ce5754036a9d2357ba6c53fb4a\",\n \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"2284855cae256da0a8adf8f8fbfc794cb7ec25c89ddbbe908755d762bc59d997e368356e226b02d0f0984f87ab9016cc\",\n \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\"\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 4,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1038,10 +1050,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Abandon a channel claim",
|
||||
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel abandon 3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000014f152a43af3447df92b5502f205594b0b27c5c3abe4441fe4e571230b4f719e5000000006a4730440220054c34959eb83de5d08179f34d0e3fc24f8bbe995ec076bff9c494c3f0cc4d520220393d7b25ca273813a4baef15f9f4483e42f48f3f8dcd64ad326686df48d7c6fc01210221ef54d238f749a1d2deb3dd483977d0788ffea39fe7ddb90105a640c8dd5df0ffffffff0134b7f505000000001976a9142d49e03ebc21902a3c69968fc5e9671ef0826ed188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjeRCgGffix8mdBKxWWp1UCeci5fiENzke\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"9d03d5164405955e62c84ae0855bf2f5cebe560f3c881c522ce322d99ab4edfc\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"9d03d5164405955e62c84ae0855bf2f5cebe560f3c881c522ce322d99ab4edfc\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel abandon 78e0769111742d63461837d031f318ba33385c77",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012352ea95064b18dbc55a0fef31fec33d26a27f27b5d38ee923372db353d0c22c000000006b483045022100ab6ae56030c41e53f218a52911f250e1d45a1aa508ad757119f8364f8c8f532702206e55772f83786e7574e83b69c434aa4e890068ca9fca5a1377b73628dbfa0466012102525cc908004ae60af279c13dcd258cd78c21008d49cba99f6897e755fbcd8973ffffffff0134b7f505000000001976a91416ea93f6448bc517de5b07dede7816f828ec9a8688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhc8B39XVpZP9KEwQDHjb1B9PmiF91usho\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"9eeb64a183fe004303dc37081669a439c8d8960c49192fe8e0b1828a70c0c1eb\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"9eeb64a183fe004303dc37081669a439c8d8960c49192fe8e0b1828a70c0c1eb\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1171,14 +1183,14 @@
|
||||
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel create @channel 1.0",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001004d6230575edb11cc650227154cd6e580a6d9682bf335885f291a7959f083d7010000006b483045022100cd41aa71dc9baaf282518a1a828a8aee40b5240c7c46552bbdc4edbcf0d95a630220641ace025295940d042018e6ddaeac6d630867c886e01ed2f34144438bb752ab01210346a0dc2ed9b6f183df7dcab18a08029e39ab410e90d036b5158e9e17f18349e8ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea006d7576a9148b60feaab143c74c08b53029db8c6de10dedd3c588acc462a029000000001976a9140f5183703edf7ab410e57cf32d5e1b8cf4d0557388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n3oWoNoXgKSWq8ksK8iXes7EkQNh9ZiYLb\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400269,\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\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#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": null,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mgux5apnZu14xZczXd8XJsCYpfqtyis7fL\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\"\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001bf6d56758c48ec7adb2b8afd43913f4235cea885e1ff844ab58ec5fefa4af5a3010000006b483045022100d7aeb8e2d3532a5b1dc234ebc1825ddfe969186fb91a7cea8efb18afd41b53300220046a29c67406ff3a94cf38e3bc2330fe01c5aa827f528cad7c8b213d19c318930121029c1a1db6dcdd769b9b0f6386840215fcb12b76768f1dccde101f5b6fca8130d7ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e176d7576a9144f1fcb21dab8b64bb790d10d206273a6c62e2d2488acc462a029000000001976a91434807a5145d4898b3ef0d69b2c83ba658aac505a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mg4sCuydWT3EaoFuCadCSoVuxHqfCnvb4v\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": null,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Create a channel claim with all metadata",
|
||||
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel create @bigchannel 1.0 --title=\"Big Channel\" --description=\"A channel with lots of videos.\" --email=\"creator@smallmedia.com\" --tags=music --tags=art --languages=pt-BR --languages=uk --locations=BR --locations=UA::Kiyv --website_url=\"http://smallmedia.com\" --thumbnail_url=\"http://smallmedia.com/logo.jpg\" --cover_url=\"http://smallmedia.com/logo.jpg\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000014f152a43af3447df92b5502f205594b0b27c5c3abe4441fe4e571230b4f719e5010000006a473044022061d8b7d44cc8d4341f6a6413ec4ab49e1bb255c9c0a89ae878689bdd935c90d20220417383a7e4fcbd344b3db67e8cbb3222a972012c6be5b6de56a07c1656f6b3d2012103d66dfdc764a5619ad0900de587b4e939eaebf57275b4362ce09a6734a2d6499bffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004b43253b247edef2e75be3a1bba5783c4a4bd4369e0952717fbfcc26877ea78dd3f0fd0af0d088b63936595a175ed6645fa6bc58c3cd92f9d592b0ee93323835c121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9141d96781c411576a0ef8098d1ad193cd754462c5088ace221d305000000001976a91479fb112f3ee8ac1754a98f86bdc30ffd6c633b7488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvjpjwcyFwQ9LduzW28nHywqRMzS2H7wnV\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"miDQ9Q6oPAYgtjecojcdNBjSZkfb523m2e\",\n \"amount\": \"1.0\",\n \"claim_id\": \"f11f553c0a8d3bb5d341e397570db0325adcf865\",\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#f11f553c0a8d3bb5d341e397570db0325adcf865\",\n \"timestamp\": null,\n \"txid\": \"40191b15d2bc3eaff9289ebd7bbba0e192a416c3deceb4b1978b19580ef461db\",\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\": \"3056301006072a8648ce3d020106052b8104000a03420004b43253b247edef2e75be3a1bba5783c4a4bd4369e0952717fbfcc26877ea78dd3f0fd0af0d088b63936595a175ed6645fa6bc58c3cd92f9d592b0ee93323835c\",\n \"public_key_id\": \"myPsvzUSyDKbmyNh6u97527qikAUz1Crcp\",\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\": \"mrdvpiSawqx4bm35RPdTrHYvN4Eqy7KpXq\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"40191b15d2bc3eaff9289ebd7bbba0e192a416c3deceb4b1978b19580ef461db\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"40191b15d2bc3eaff9289ebd7bbba0e192a416c3deceb4b1978b19580ef461db\"\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012352ea95064b18dbc55a0fef31fec33d26a27f27b5d38ee923372db353d0c22c010000006a47304402200d248bab954394c408ac383c04b56e42a33f4a165a54a567b36e499c9d5cbe6a02207e9e01f0c75eb2736b53ab1b9d7c2301f4a8e6e7ace8e0192bc23d0f8c54704b01210377c7f0303e107007fc882517927bf0ba6eaa8220d9cb5d8856fc7badba38c78bffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004bccd90ca1f59750072516c9784f2b7dff52b24c8a6bf7151efe5a632834c3d0f7428e08ed28f4d28e3e1f9a2faaa4540b1ba943cc0e2e8104251f4c76e7e2ce4121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914609fc28b7c0a1f66195d5c51cf140d210f7df2fc88ace221d305000000001976a91428ffdcf0a939d86244b11d5be68013689809080588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msVHKAhna4JmZbwHNA8zm85yJhnATsrGiw\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mpKrYnV7Fp7pWNH73UbkLdaqdU7LhZkAkP\",\n \"amount\": \"1.0\",\n \"claim_id\": \"6ee246f886ba0081b1d0e84dab086ca1b036e234\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#6ee246f886ba0081b1d0e84dab086ca1b036e234\",\n \"timestamp\": null,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"claim\",\n \"value\": {\n \"cover\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"description\": \"A channel with lots of videos.\",\n \"email\": \"creator@smallmedia.com\",\n \"languages\": [\n \"pt-BR\",\n \"uk\"\n ],\n \"locations\": [\n {\n \"country\": \"BR\"\n },\n {\n \"city\": \"Kiyv\",\n \"country\": \"UA\"\n }\n ],\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004bccd90ca1f59750072516c9784f2b7dff52b24c8a6bf7151efe5a632834c3d0f7428e08ed28f4d28e3e1f9a2faaa4540b1ba943cc0e2e8104251f4c76e7e2ce4\",\n \"public_key_id\": \"mzgLp9FA3JfjL2DaTg4aJvY5oNvTcZi1zL\",\n \"tags\": [\n \"music\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/logo.jpg\"\n },\n \"title\": \"Big Channel\",\n \"website_url\": \"http://smallmedia.com\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mjFjqQMMroPbKTLQ2KzTY9UFHsyZLXJnYa\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1261,23 +1273,29 @@
|
||||
"type": "int",
|
||||
"description": "number of items on page during pagination",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "resolve",
|
||||
"type": "bool",
|
||||
"description": "resolves each channel to provide additional metadata",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "List your channel claims",
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your channel claims",
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1434,10 +1452,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Update a channel claim",
|
||||
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"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 3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7 --title=\"New Channel\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"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\": \"01000000027ae11f08d3bfe1d7aa0c030140a5f661267784bacf26ad94fc4d59b0c73b90b6000000006b483045022100aa830c924d60c7891fa07bf8c113f495da6d9fc4518a187811f7899d6425c18e02203f40187984b2c36ac131c0bb0d6a6dd564a815eaffc897aa30b8938a7c28d25601210221ef54d238f749a1d2deb3dd483977d0788ffea39fe7ddb90105a640c8dd5df0fffffffffeb30066acb17847924efc3f9eb446403af103c7d72016dcf9b1f5ceedd956e3000000006b483045022100aa318cb4c5640147c9c5263f33632def50caae65e2100e159f8b8a8640ae07ab02204c9a430ca449040d3f318dd4a90931c730a96926baffdb09a63acfec3a3675510121024827cb142e9a1b919e8a5e27cb9bad94c8455254bb8ca8ff1b267f2bed67bd20ffffffff0200e1f50500000000a6b708406368616e6e656c14c7482562bfe65919bd8f74f3c067fbf4f62cd43f4c6a00125a0a583056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00420b4e6577204368616e6e656c6d6d76a9148b60feaab143c74c08b53029db8c6de10dedd3c588ac6ebeea0b000000001976a914a6f8fd2194ac23e5ea3b611a9ff14ed34c5b3c0d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mjGLQViMN89giFBMxP4E8VAMUcbxyjywk7\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1579400269,\n \"txid\": \"e356d9edcef5b1f9dc1620d7c703f13a4046b49e3ffc4e924778b1ac6600b3fe\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\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#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": null,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mvjpjwcyFwQ9LduzW28nHywqRMzS2H7wnV\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel update 78e0769111742d63461837d031f318ba33385c77 --title=\"New Channel\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000020e0a7f2b61a7a06502fe601413fe7e3c6698ce3bec4eed290d27d08a2a61b699000000006b48304502210092930b1f59557b7f5da4a5d8448de598d65dd3174e69d8aa8fb7011174262e79022023ab1dba1209c3b035c54fcc498e929296110f312a85de2c86e9da4622b3be95012102525cc908004ae60af279c13dcd258cd78c21008d49cba99f6897e755fbcd8973ffffffff6d10c36bc0ba866b7a37c31829c49b5f5d4ecce95850f59d6aa60cc122d2f929000000006a473044022007ae12a8b5fc737d8f20151b3a488dc299b7362b0f44c8a40a3731dbf7cc1aaa022030d0f0580c954b07d07f4fbfd124f1c16cb4c90afe9da30807df97707eac87f3012102aa0c29c64c81687eb888e766b20650fb8847cf07f624d2cea8c910f7a0c0e1b4ffffffff0200e1f50500000000a6b708406368616e6e656c14775c3833ba18f331d0371846632d74119176e0784c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17420b4e6577204368616e6e656c6d6d76a9144f1fcb21dab8b64bb790d10d206273a6c62e2d2488ac6ebeea0b000000001976a91483508dcd88f7825b64342cb079447438b1d237dd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"has_signing_key\": true,\n \"height\": 209,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n3rEu9EusAUzTr7gVuhYiWGFoM7Vs5SkAb\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1580787038,\n \"txid\": \"29f9d222c10ca66a9df55058e9cc4e5d5f9bc42918c3377a6b86bac06bc3106d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"has_signing_key\": true,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": null,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"msVHKAhna4JmZbwHNA8zm85yJhnATsrGiw\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\"\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1479,23 +1497,29 @@
|
||||
"type": "int",
|
||||
"description": "number of items on page during pagination",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "resolve",
|
||||
"type": "bool",
|
||||
"description": "resolves each claim to provide additional metadata",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "List all your claims",
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your claims",
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1713,6 +1737,12 @@
|
||||
"description": "content download fee (supports equality constraints)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"type": "int",
|
||||
"description": "duration of video or audio in seconds (supports equality constraints)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "any_tags",
|
||||
"type": "list",
|
||||
@@ -1805,14 +1835,14 @@
|
||||
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim search --channel=@channel",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"claim_ids\": [], \"channel\": \"@channel\", \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3/astream#b\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\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\": 1579400270,\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#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\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\": 1579400269,\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#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"short_url\": \"lbry://@channel#3\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": {},\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Search for claims matching a name",
|
||||
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim search --name=\"astream\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"claim_ids\": [], \"channel_ids\": [], \"not_channel_ids\": [], \"has_channel_signature\": false, \"valid_channel_signature\": false, \"invalid_channel_signature\": false, \"is_controlling\": false, \"stream_types\": [], \"media_types\": [], \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3/astream#b\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\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\": 1579400270,\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#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"short_url\": \"lbry://astream#b\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#3\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\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\": 1579400269,\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#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"short_url\": \"lbry://@channel#3\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blocked\": {\n \"channels\": {},\n \"total\": 0\n },\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7/astream#c\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_channel_signature_valid\": true,\n \"meta\": {\n \"activation_height\": 213,\n \"creation_height\": 213,\n \"creation_timestamp\": 1580787039,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 213,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"short_url\": \"lbry://astream#c\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#7\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": false,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1580787038,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"reposted\": 0,\n \"support_amount\": \"0.0\",\n \"take_over_height\": 209,\n \"trending_global\": 0.0,\n \"trending_group\": 0,\n \"trending_local\": 0.0,\n \"trending_mixed\": 0.0\n },\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"short_url\": \"lbry://@channel#7\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2223,9 +2253,9 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Abandon a comment",
|
||||
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment abandon 71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment abandon b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_abandon\", \"params\": {\"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"abandoned\": false\n }\n}"
|
||||
}
|
||||
]
|
||||
@@ -2281,17 +2311,17 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Posting a comment as your channel",
|
||||
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=bfdbf31b0af4091febc7cd1a2945ea5fa93f0711",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"0d89339695ee2cf301fd7224d6c313d2c226887e3ffd42c96d9f25185b8c54bbba65d311f20416502b808542a9d88e0568c386e93e8ae607d1f283cca7f26580\",\n \"signing_ts\": \"1579400249\",\n \"timestamp\": 1579400250\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment create --comment=\"Thank you Based God\" --channel_name=@channel --claim_id=ca642adaf52552f0bfc746c2ebae77724d123aeb",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"Thank you Based God\", \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "You can r",
|
||||
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\", \"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=71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"06b54746ce74e42aa7760ce9d3b609b5ab30a4b59f0e3eb2c67cdc00eba7d7e0\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\",\n \"signature\": \"d45617c4ab93c956c50454e0bad50e3006813d6ebe5693647f0f2f9a23aff7576b90bb08844f314bd92ce36d98c677c58c263b9b8f9c5d6d3cdae14d89af396d\",\n \"signing_ts\": \"1579400250\",\n \"timestamp\": 1579400251\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment create --comment=\"I have photographic evidence confirming Sasquatch exists\" --channel_name=@channel --parent_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_create\", \"params\": {\"comment\": \"I have photographic evidence confirming Sasquatch exists\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"channel_name\": \"@channel\", \"channel_account_id\": []}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"d618940bf1b976f5fca41771f1ba2b6cbc8aa5bc7899232c37252498eb2c66ed\",\n \"is_claim_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"signature\": \"a57c7562d39fcaecb94bed0de0c71c826c3550fe29425b21c9bc3a878c31614082f1125b43d88b34011b6ac59f5bbbbd622c216be28a731966b5daf6268969ea\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2372,17 +2402,17 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "List all comments on a claim",
|
||||
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment list bfdbf31b0af4091febc7cd1a2945ea5fa93f0711 --include_replies",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"06b54746ce74e42aa7760ce9d3b609b5ab30a4b59f0e3eb2c67cdc00eba7d7e0\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\",\n \"signature\": \"d45617c4ab93c956c50454e0bad50e3006813d6ebe5693647f0f2f9a23aff7576b90bb08844f314bd92ce36d98c677c58c263b9b8f9c5d6d3cdae14d89af396d\",\n \"signing_ts\": \"1579400250\",\n \"timestamp\": 1579400251\n },\n {\n \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"0d89339695ee2cf301fd7224d6c313d2c226887e3ffd42c96d9f25185b8c54bbba65d311f20416502b808542a9d88e0568c386e93e8ae607d1f283cca7f26580\",\n \"signing_ts\": \"1579400249\",\n \"timestamp\": 1579400250\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\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment list ca642adaf52552f0bfc746c2ebae77724d123aeb --include_replies",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"include_replies\": true, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n },\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"I have photographic evidence confirming Sasquatch exists\",\n \"comment_id\": \"d618940bf1b976f5fca41771f1ba2b6cbc8aa5bc7899232c37252498eb2c66ed\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"signature\": \"a57c7562d39fcaecb94bed0de0c71c826c3550fe29425b21c9bc3a878c31614082f1125b43d88b34011b6ac59f5bbbbd622c216be28a731966b5daf6268969ea\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "List a comment thread replying to a top level comment",
|
||||
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment list bfdbf31b0af4091febc7cd1a2945ea5fa93f0711 --parent_id=71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"parent_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"0d89339695ee2cf301fd7224d6c313d2c226887e3ffd42c96d9f25185b8c54bbba65d311f20416502b808542a9d88e0568c386e93e8ae607d1f283cca7f26580\",\n \"signing_ts\": \"1579400249\",\n \"timestamp\": 1579400250\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment list ca642adaf52552f0bfc746c2ebae77724d123aeb --parent_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"parent_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\", \"include_replies\": false, \"is_channel_signature_valid\": false, \"visible\": false, \"hidden\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"has_hidden_comments\": false,\n \"items\": [\n {\n \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"channel_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"comment\": \"Thank you Based God\",\n \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\",\n \"is_channel_signature_valid\": true,\n \"is_hidden\": false,\n \"signature\": \"bad21d0ea39ad40531c98c5a713302c2d37552a75863cc2d2938e49e19acf897398cc387492ffd9e72cc9ed9c0c34b7e0b5862f2260a4c1aadea31f1eef5b701\",\n \"signing_ts\": \"1580787015\",\n \"timestamp\": 1580787015\n }\n ],\n \"page\": 1,\n \"page_size\": 50,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2413,9 +2443,9 @@
|
||||
"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\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"71e2866380adfc3595879353a57608e2b4dcda36bf311b102265bbca5b8f37d1\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet comment update Where there was once sasquatch, there is not --comment_id=b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"b4fe9a306a7c40e2baffd33f4dba495b53fc4c6f5fdc62ac4f81e76b77c53036\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": null\n}"
|
||||
}
|
||||
]
|
||||
@@ -2506,9 +2536,9 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Delete a file",
|
||||
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file delete --claim_id=\"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file delete --claim_id=\"ca642adaf52552f0bfc746c2ebae77724d123aeb\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
|
||||
}
|
||||
]
|
||||
@@ -2639,14 +2669,14 @@
|
||||
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"reverse\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"reverse\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"b7d93a1d57d3e61812c674a34a4f3961\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c7482562bfe65919bd8f74f3c067fbf4f62cd43fa5f4d8ab7ca870112e7310d70d239ea4d507688327acf4b80eb68fc7a5138726aa8bcd6a61c926732b2f5edf6c36fb5977cbb0c0b36e08980a78166af7fbb9660a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"c0a2bb6f6e97c10717c53e24d8057cafbdc095b9a9f6f78d2bab385a38dcfd226f9731c2dee9eba3463d73bacbc41e94\",\n \"stream_name\": \"tmppsu__ylo\",\n \"streaming_url\": \"http://localhost:5280/stream/a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"suggested_file_name\": \"tmppsu__ylo\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\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\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"1473978f00fed53c4b18ddf24b9990a954eb4b00\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"134f4e871ad788d059bc8e2b3fe31ebf\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mggQVVstsxpesZJrF3TefabV5ZQ2pp9rBD\",\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\": \"1579400247\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpsyd4i3_g.png\",\n \"sd_hash\": \"4f2f2a425212f91080b92ee4edeac1ac88138133df17419984969791aae9f5ce4640952b41cd27686ed0c6692db77573\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"876dfa2980a40763b4e5f9d49aedb205a8c312267ba3fb26Line truncated
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 0\n },\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"claim_name\": \"blank-image\",\n \"completed\": false,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"7580ab9a0a85562a6f6c13bd59e84d0f\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1580787013\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpw_1zp_we.png\",\n \"sd_hash\": \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n \"thumbnail\": {\n \"url\": \"http://smallmedia.com/thumbnail.jpg\"\n },\n \"title\": \"Blank Image\"\n },\n \"mime_type\": \"image/png\",\n \"nout\": 0,\n \"outpoint\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941cLine truncated
|
||||
},
|
||||
{
|
||||
"title": "List files matching a parameter",
|
||||
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"reverse\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file list --claim_id=\"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"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\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"b7d93a1d57d3e61812c674a34a4f3961\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c7482562bfe65919bd8f74f3c067fbf4f62cd43fa5f4d8ab7ca870112e7310d70d239ea4d507688327acf4b80eb68fc7a5138726aa8bcd6a61c926732b2f5edf6c36fb5977cbb0c0b36e08980a78166af7fbb9660a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"c0a2bb6f6e97c10717c53e24d8057cafbdc095b9a9f6f78d2bab385a38dcfd226f9731c2dee9eba3463d73bacbc41e94\",\n \"stream_name\": \"tmppsu__ylo\",\n \"streaming_url\": \"http://localhost:5280/stream/a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"suggested_file_name\": \"tmppsu__ylo\",\n \"timestamp\": 1579400270,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"reverse\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file list --claim_id=\"ca642adaf52552f0bfc746c2ebae77724d123aeb\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"reverse\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"added_on\": null,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 0\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2763,10 +2793,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Save a file to the downloads directory",
|
||||
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file save --sd_hash=\"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1579400254,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmp1ozq8ity\",\n \"download_path\": \"/tmp/tmp1ozq8ity/tmppsu__ylo_1\",\n \"file_name\": \"tmppsu__ylo_1\",\n \"height\": 214,\n \"key\": \"b7d93a1d57d3e61812c674a34a4f3961\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01c7482562bfe65919bd8f74f3c067fbf4f62cd43fa5f4d8ab7ca870112e7310d70d239ea4d507688327acf4b80eb68fc7a5138726aa8bcd6a61c926732b2f5edf6c36fb5977cbb0c0b36e08980a78166af7fbb9660a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"c0a2bb6f6e97c10717c53e24d8057cafbdc095b9a9f6f78d2bab385a38dcfd226f9731c2dee9eba3463d73bacbc41e94\",\n \"stream_name\": \"tmppsu__ylo\",\n \"streaming_url\": \"http://localhost:5280/stream/a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"suggested_file_name\": \"tmppsu__ylo\",\n \"timestamp\": 1579400270,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"written_bytes\": 11\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file save --sd_hash=\"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"added_on\": 1580787018,\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf0g7xmd6\",\n \"download_path\": \"/tmp/tmpf0g7xmd6/tmp2mvj0998_1\",\n \"file_name\": \"tmp2mvj0998_1\",\n \"height\": 214,\n \"key\": \"159a191d5364218290065f82af17512a\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"01775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"purchase_receipt\": null,\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"a44f91e5b3806ab20a7e0b3dbe5a431d0cbd6f7579b2ed5c7f9818fe5ecb34d8885d6bc461348de3a0cea293628721f1\",\n \"stream_name\": \"tmp2mvj0998\",\n \"streaming_url\": \"http://localhost:5280/stream/425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"suggested_file_name\": \"tmp2mvj0998\",\n \"timestamp\": 1580787039,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"written_bytes\": 11\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3047,7 +3077,7 @@
|
||||
"curl": "curl -d'{\"method\": \"settings_get\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet settings get",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"settings_get\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"https://comments.lbry.com/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmp1ozq8ity\",\n \"download_dir\": \"/tmp/tmp1ozq8ity\",\n \"download_timeout\": 30.0,\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"wallet_dir\": \"/tmp/tmp1ozq8ity\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"audio_encoder\": \"aac -b:a 192k\",\n \"blob_download_timeout\": 30.0,\n \"blob_lru_cache_size\": 0,\n \"blockchain_name\": \"lbrycrd_regtest\",\n \"cache_time\": 150,\n \"coin_selection_strategy\": \"standard\",\n \"comment_server\": \"https://comments.lbry.com/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpf0g7xmd6\",\n \"download_dir\": \"/tmp/tmpf0g7xmd6\",\n \"download_timeout\": 30.0,\n \"ffmpeg_folder\": \"\",\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"prometheus_port\": 0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"track_bandwidth\": true,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"video_encoder\": \"libx264 -crf 18 -vf \\\"format=yuv420p\\\"\",\n \"volume_analysis_time\": \"240\",\n \"volume_filter\": \"-af loudnorm\",\n \"wallet_dir\": \"/tmp/tmpf0g7xmd6\",\n \"wallets\": [\n \"default_wallet\"\n ]\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3122,10 +3152,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Abandon a stream claim",
|
||||
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream abandon bfdbf31b0af4091febc7cd1a2945ea5fa93f0711",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001500433ee87ae4b6f16240b7f2b5b43834ac32c9b49fc8250a67d62fa3f1f705d000000006a47304402202e9ade76631162d8694ca7f67a1ac7e255e3e65eb290b8847b4bdba1d0a9a3b1022025aed44a70e2ba5a59713213fa566507deca483483f9d14444167bfe9231ea3501210249220d8b62e50bc2554469a35becdb252fc98336058afafbb2bf0b1ea8926200ffffffff0134b7f505000000001976a91428f1254f7d792510b4c745109d84b09d9ec35fd288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjFSCpwDqXiDrwroNTLwTnkfqT8U3p9Y9x\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"34804102d654b8d05953b4bd81b3023f384352e9b62d2b858ad259ac7b67839b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"34804102d654b8d05953b4bd81b3023f384352e9b62d2b858ad259ac7b67839b\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream abandon ca642adaf52552f0bfc746c2ebae77724d123aeb",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000124fbe60deb75dc0bb3612fa870e07330706a03e8ef89144f6b183cf2de303a34000000006a47304402204a2c679e653b096f5a8387251f751b74228bae7a70849c6be09fb5b5dc67af5c02205ca7604ebf3dbafae917015eb1e437810a76b36f930e71370b15596e56aeea60012102663f1832b7906bdce2af55d6950114be6d7e4bc3fae658caa6b5f7b8dbbdf47bffffffff0134b7f505000000001976a914991d30b9508a7cd112148485c7e06f11f76ed32288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 3,\n \"height\": 214,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"muUYeaoUkFAazwbpkdnE3ng5QgVTgnBQdt\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"f96b71572ed7a8fdcfa80aba4ef639cb0b31082ad89ac041edf1e0831334e1eb\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"f96b71572ed7a8fdcfa80aba4ef639cb0b31082ad89ac041edf1e0831334e1eb\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3165,6 +3195,18 @@
|
||||
"description": "path to file to be associated with name.",
|
||||
"is_required": true
|
||||
},
|
||||
{
|
||||
"name": "validate_file",
|
||||
"type": "bool",
|
||||
"description": "validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "optimize_file",
|
||||
"type": "bool",
|
||||
"description": "transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "allow_duplicate_name",
|
||||
"type": "bool",
|
||||
@@ -3326,17 +3368,17 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Create a stream claim without metadata",
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmppsu__ylo\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmppsu__ylo",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmppsu__ylo\", \"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\": \"01000000017ae11f08d3bfe1d7aa0c030140a5f661267784bacf26ad94fc4d59b0c73b90b6010000006a47304402200b9d3230d5fefcc25c25ed698f4ff07756c4b68ca4eb1e2b0e375d7ff218367302205cbe18806f1c2048f5189080acd5693f36e2770f87c47b3dd182a5217852c6350121032f98a457e4b23c99b3ecf17dc0ca3fb088400c0bd818f93c9e27eb2b3e5db4efffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b6d7576a9143ce13aed49065382390a945c0ffaa39f10401a4888ac38fb9423000000001976a91446cd176a3f02ed515c9c47d4554d80091f0fe16688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mgux5apnZu14xZczXd8XJsCYpfqtyis7fL\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400269,\n \"txid\": \"b6903bc7b0594dfc94ad26cfba84772661f6a54001030caad7e1bfd3081fe17a\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\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#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"timestamp\": null,\n \"txid\": \"960cfa157e4279343626da119b389f16dc11d9f5cd70b4333305348d8dabd50d\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mmyKHVCN9y2Ld4bstWW7jMBrUzd1eYuLu9\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"960cfa157e4279343626da119b389f16dc11d9f5cd70b4333305348d8dabd50d\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"960cfa157e4279343626da119b389f16dc11d9f5cd70b4333305348d8dabd50d\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp2mvj0998\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmp2mvj0998",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp2mvj0998\", \"validate_file\": false, \"optimize_file\": false, \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000010e0a7f2b61a7a06502fe601413fe7e3c6698ce3bec4eed290d27d08a2a61b699010000006b483045022100bca41fd4c2fbe78a471862a0cbcada72dec85928c003096b89711262a6afa904022046091f619cbc19cb466d217f9664fb2fea6894a84791bc816e0cdae14390395b01210302992bba48b71d309cebbfa183094de20158f078d0d32b4fd794ec2a00cade1effffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f6d7576a914cfd4d42838e26f3ecaea287f6361f360dcb4288788ac38fb9423000000001976a914ddf9fe5f71d19f344f2d0c54a0f5d85206fd9ad888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mkJZLpiG2hujADdJsYUS8JYydVn8kobGu2\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"99b6612a8ad0270d29ed4eec3bce98663c7efe131460fe0265a0a7612b7f0a0e\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": null,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n1kf7K1vAFwRL8xfCUgJFoyc68jrX5Mq4a\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Create an image stream claim with all metadata and fee",
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsyd4i3_g.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1579400247, \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpsyd4i3_g.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=1579400247 --channel_id=\"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpsyd4i3_g.png\", \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1579400247, \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000010dd5ab8d8d34053333b470cdf5d911dc169f389b11da26363479427e15fa0c96010000006b4830450221008b3a286c9c6ecb9f14c875c33b4eb1a8cf64478dfe564f0d95082a61488af3040220363afe6e832f5bb6f6ebaaafb710bc560cce9ae8aa7b1f7b13e71e09512a15220121032b0568f9ad906425aaa666aa33b367304fc1f1f452bbfd878501e78b0279136affffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101c7482562bfe65919bd8f74f3c067fbf4f62cd43f9bf76a5a0c03757ca393073f855ffbebc226220c971a2a940b7bd16a67c5a6a84b0634c03adfee9c0f9011a1f13f98312e70b5eaa2ecd1e75d1e4ee6043eea0b0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d707379643469335f672e706e6718632209696d6167652f706e6732304f2f2a425212f91080b92ee4edeac1ac88138133df17419984969791aae9f5ce4640952b41cd27686ed0c6692db77573120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728b7f88ef1053222080112196f0cc1bce498b9f602f5a0553a8398c62884f7ba8cc916c584188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9140cc1bce498b9f602f5a0553a8398c62884f7ba8c88acac5e7d1d000000001976a914696273c68ecdd2f6919f1294253cd6a10f48b3a288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mmyKHVCN9y2Ld4bstWW7jMBrUzd1eYuLu9\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400270,\n \"txid\": \"960cfa157e4279343626da119b389f16dc11d9f5cd70b4333305348d8dabd50d\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mggQVVstsxpesZJrF3TefabV5ZQ2pp9rBD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"1473978f00fed53c4b18ddf24b9990a954eb4b00\",\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#1473978f00fed53c4b18ddf24b9990a954eb4b00\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"876dfa2980a40763b4e5f9d49aedb205a8c312267ba3fb26f387e3fd885ce867\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mggQVVstsxpesZJrF3TefabV5ZQ2pp9rBD\",\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\": \"1579400247\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpsyd4i3_g.png\",\n \"sd_hash\": \"4f2f2a425212f91080b92ee4edeac1ac88138133df17419984969791aae9f5ce4640952b41cd27686ed0c6692db77573\",\n \"size\": \"99\"\n },\n \"strLine truncated
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpw_1zp_we.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1580787013, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpw_1zp_we.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title=\"Blank Image\" --description=\"A blank PNG that is 5x7.\" --author=Picaso --license=\"Public Domain\" --license_url=http://public-domain.org --thumbnail_url=\"http://smallmedia.com/thumbnail.jpg\" --release_time=1580787013 --channel_id=\"78e0769111742d63461837d031f318ba33385c77\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpw_1zp_we.png\", \"validate_file\": false, \"optimize_file\": false, \"fee_currency\": \"LBC\", \"fee_amount\": \"0.3\", \"title\": \"Blank Image\", \"description\": \"A blank PNG that is 5x7.\", \"author\": \"Picaso\", \"tags\": [\"blank\", \"art\"], \"languages\": [\"en\"], \"locations\": [\"US:NH:Manchester\"], \"license\": \"Public Domain\", \"license_url\": \"http://public-domain.org\", \"thumbnail_url\": \"http://smallmedia.com/thumbnail.jpg\", \"release_time\": 1580787013, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001756730ee9f4cf6e0b3ac37426a6de788d95f3995a3d474b9ee44b057ac66d295010000006b483045022100cf9ef3f2bdbdc84282ad8655c45bd744c56e235cbce75bb391c999f1e8c942d1022073b534e9e0f98a315d3b2b56c5f3c588427dd46cbea769e47a1ca074a60f1b09012102bce50c23209e12358222c1e0b2a4f0ebb1a52958ffa6bc8f1efcba6cd73c10abffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101775c3833ba18f331d0371846632d74119176e0788971c8a96b0c86b464771c4d2cfdbe1041beaec22d10e1caf5caffe66cdb1ec0d9b244a0ba024bd9318a4f4dac3d95ee4cd5eaaa9ade4d3ed43adda5525bad060ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d70775f317a705f77652e706e6718632209696d6167652f706e6732309872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728c5cae3f1053222080112196f2cb51096ada6af68d92aa5e9256f76a95cd0f761d22acf6a188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9142cb51096ada6af68d92aa5e9256f76a95cd0f76188acac5e7d1d000000001976a914ba12a78dd8482240f8a74dc3d3d9b0cec11cc50d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1kf7K1vAFwRL8xfCUgJFoyc68jrX5Mq4a\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787039,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"blank-image\",\n \"normalized_name\": \"blank-image\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://blank-image#3afacf53358a8234b23ff60e51231b3a62b28165\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"d27f052d5a4cf8a4d0c19aeb36cd1331bb3b9eacee2b941c5bd3a1cb4cb0c25b\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mjbLw6bmUb6DwU1UJyvMnzWkVEaAefzByj\",\n \"amount\": \"0.3\",\n \"currency\": \"LBC\"\n },\n \"image\": {\n \"height\": 7,\n \"width\": 5\n },\n \"languages\": [\n \"en\"\n ],\n \"license\": \"Public Domain\",\n \"license_url\": \"http://public-domain.org\",\n \"locations\": [\n {\n \"city\": \"Manchester\",\n \"country\": \"US\",\n \"state\": \"NH\"\n }\n ],\n \"release_time\": \"1580787013\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpw_1zp_we.png\",\n \"sd_hash\": \"9872b781dffda958c58a2cd59bf744a01bab989e6a451f31b979e2f5eee87ec27e739e409da4f0760d5fc3e4c15df7e6\",\n \"size\": \"99\"\n },\n \"strLine truncated
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3367,23 +3409,29 @@
|
||||
"type": "int",
|
||||
"description": "number of items on page during pagination",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "resolve",
|
||||
"type": "bool",
|
||||
"description": "resolves each stream to provide additional metadata",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"page\": \"Page number of the current items.\",\n \"page_size\": \"Number of items to show on a page.\",\n \"total_pages\": \"Total number of pages.\",\n \"total_items\": \"Total number of items.\",\n \"items\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'purchase'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim', 'support' or 'purchase', this is the claim id\",\n \"claim_op\": \"when type is 'claim', this determines if it is 'create' or 'update'\",\n \"value\": \"when type is 'claim' or 'support' with payload, this is the decoded protobuf payload\",\n \"value_type\": \"determines the type of the 'value' field: 'channel', 'stream', etc\",\n \"protobuf\": \"hex encoded raw protobuf version of 'value' field\",\n \"permanent_url\": \"when type is 'claim' or 'support', this is the long permanent claim URL\",\n \"claim\": \"for purchase outputs only, metadata of purchased claim\",\n \"reposted_claim\": \"for repost claims only, metadata of claim being reposted\",\n \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\",\n \"purchase_receipt\": \"metadata for the purchase transaction associated with this claim\"\n }\n ]\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "List all your stream claims",
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your stream claims",
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1579400270,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20, \"resolve\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": 1,\n \"height\": 214,\n \"is_change\": false,\n \"is_channel_signature_valid\": true,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1580787039,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3704,10 +3752,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Update a stream claim to add channel",
|
||||
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream update bfdbf31b0af4091febc7cd1a2945ea5fa93f0711 --channel_id=\"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\", \"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\": \"01000000020dd5ab8d8d34053333b470cdf5d911dc169f389b11da26363479427e15fa0c96000000006a47304402201177d3c1018a1ba4cacbe12f5b353882321af4a3ec110d5d32c80cd53363fa0702206b779bade0fb1c80ba914bed41b2174a9d8f00e37856aadb5c5661903b58d5ab01210249220d8b62e50bc2554469a35becdb252fc98336058afafbb2bf0b1ea8926200ffffffffdb61f40e58198b97b1b4cedec316a492e1a0bb7bbd9e28f9af3ebcd2151b1940010000006b483045022100bc62bc7cfe201921998f2019d3702034bc011bcf9f7e1f9de2027924fae8f5f6022023b452c8687b8ce07168b8befb6f1ad1f008445a1b7e1db0d94499283c4a0183012103982c03f90e7196836e8033ce0f70e3a394829b9a14f057fb3c60776bdfef60c2ffffffff0200e1f50500000000fd2301b7076173747265616d1411073fa95fea45291acdc7eb1f09f40a1bf3dbbf4ce801c7482562bfe65919bd8f74f3c067fbf4f62cd43fa5f4d8ab7ca870112e7310d70d239ea4d507688327acf4b80eb68fc7a5138726aa8bcd6a61c926732b2f5edf6c36fb5977cbb0c0b36e08980a78166af7fbb9660a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707073755f5f796c6f180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b6d6d76a9143ce13aed49065382390a945c0ffaa39f10401a4888ac32a0d205000000001976a914af3f9b41e32d887a1a3b04d532bf4c260b5b535488ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"timestamp\": 1579400270,\n \"txid\": \"960cfa157e4279343626da119b389f16dc11d9f5cd70b4333305348d8dabd50d\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmppsu__ylo\",\n \"sd_hash\": \"a40fb1a597f6933a1d60bd8f461a109a4e50247a5aea4709d20ef75b2e3da600632621b9d463fa9f9b6ce3ffbc3ebc3b\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mrdvpiSawqx4bm35RPdTrHYvN4Eqy7KpXq\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1579400269,\n \"txid\": \"40191b15d2bc3eaff9289ebd7bbba0e192a416c3deceb4b1978b19580ef461db\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mm4reqApxMGhBDpeWEVfhAeCWGrtkMpn9r\",\n \"amount\": \"1.0\",\n \"claim_id\": \"bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\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#bfdbf31b0af4091febc7cd1a2945ea5fa93f0711\",\n \"signing_channel\": {\n \"address\": \"mtDvR2y9mdUW6zGkoKbDrnEFjDv3zjYbUD\",\n \"amount\": \"1.0\",\n \"claim_id\": \"3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#3fd42cf6f4fb67c0f3748fbd1959e6bf622548c7\",\n \"timestamp\": 1579400269,\n \"txid\": \"e519f7b43012574efe4144be3a5c7cb2b09455202f50b592df4734af432a154f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000457b1f020041b2ad401abb5135e306ea03ee4353f7da63b98cb81fdeee3fa0fcf768cce00a36cb3f72ecb16af6b1606f7f8a303b7a6892e93e1946122cbf6ea00\",\n \"public_key_id\": \"mrW9NiUf9kwrAghgoSb13EViJDjzEs1NXk\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"5d701f3ffa627da65082fc499b2cc34a83435b2b7f0b24166f4bae87ee330450\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n Line truncated
|
||||
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream update ca642adaf52552f0bfc746c2ebae77724d123aeb --channel_id=\"78e0769111742d63461837d031f318ba33385c77\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"78e0769111742d63461837d031f318ba33385c77\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002756730ee9f4cf6e0b3ac37426a6de788d95f3995a3d474b9ee44b057ac66d295000000006a473044022017c35e499a06449082d37319300a3ab123d65dfe443ea88471de8b55b899a0ca02204f105a09bee5afd441f7428dc8ec698962ff29d6adc3787e0bb675b23e0e78d4012102663f1832b7906bdce2af55d6950114be6d7e4bc3fae658caa6b5f7b8dbbdf47bffffffffe89ff3143a4eef48aec22c903584af10a706008c73b8175a5cc6b35073de134d010000006b483045022100d84db641a86c6e3d6da6c3a0120a805cdb6e8b6648f6b81fa88aa0fcc48e1d7e0220533ab4b67510263f6732d2be5791fb5fa2747c6d1c08ac4707aefc732b698b7301210265859227aa59bab66198913f4f8486cd39381ca8809f03591e6bd711367c67b7ffffffff0200e1f50500000000fd2301b7076173747265616d14eb3a124d7277aeebc246c7bff05225f5da2a64ca4ce801775c3833ba18f331d0371846632d74119176e078aeb47d02b808dcb36d6bbeba1438b303c03e746500d126fd08f92ec6a26509e6f218d2d600300debf6077650fe23f1a9c92afd1ed7c4abb81ac37a0ea6a4e0d20a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70326d766a30393938180b22186170706c69636174696f6e2f6f637465742d73747265616d3230425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f6d6d76a914cfd4d42838e26f3ecaea287f6361f360dcb4288788ac32a0d205000000001976a914df1c174e484b9f4470019bf89261d761d4bd83fd88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\n \"height\": 213,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"timestamp\": 1580787039,\n \"txid\": \"95d266ac57b044eeb974d4a395395fd988e76d6a4237acb3e0f64c9fee306775\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp2mvj0998\",\n \"sd_hash\": \"425d8f86f518cb36d0eb8532779ebb3dc23cce40f5f32ca4d961f1a861169ffae5b3b21a4b023dc38359321c74e5952f\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mjFjqQMMroPbKTLQ2KzTY9UFHsyZLXJnYa\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1580787038,\n \"txid\": \"4d13de7350b3c65c5a17b8738c0006a710af8435902cc2ae48ef4e3a14f39fe8\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mzTs8N19cDptAh1AbEW3wuKEXJBcJugRAd\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"is_channel_signature_valid\": true,\n \"meta\": {},\n \"name\": \"astream\",\n \"normalized_name\": \"astream\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://astream#ca642adaf52552f0bfc746c2ebae77724d123aeb\",\n \"signing_channel\": {\n \"address\": \"mnjKmFxZTu7DBwXpLQvyVQwUCXnofLDesW\",\n \"amount\": \"1.0\",\n \"claim_id\": \"78e0769111742d63461837d031f318ba33385c77\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\n \"has_signing_key\": true,\n \"height\": 210,\n \"is_change\": false,\n \"is_mine\": true,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#78e0769111742d63461837d031f318ba33385c77\",\n \"timestamp\": 1580787038,\n \"txid\": \"2cc2d053b32d3723e98ed3b5277fa2263dc3fe31ef0f5ac5db184b0695ea5223\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004c081899169bff6634f20e59e90318a963bb6760e9cc21ed980ac41593e277b54d04386c2720acef997a431e5c0fc3551d40f36e79f29a2109a23a50f432e0e17\",\n \"public_key_id\": \"mrMajaekWv14aDoSWK2Jg7euMjYey5peju\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"343a30def23c186b4f1489efe8036a703073e070a82f61b30bdc75eb0de6fb24\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n Line truncated
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3952,7 +4000,7 @@
|
||||
"curl": "curl -d'{\"method\": \"transaction_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet transaction list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"transaction_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2020-01-18 21:17\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1579400269,\n \"txid\": \"d783f059791a295f8835f32b68d9a680e5d64c15270265cc11db5e5730624d00\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2020-01-18 21:17\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1579400268,\n \"txid\": \"da1b345be92a2ff0465d13422e8957ef57efd59b7cd33e743282c8036b99b832\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2020-02-03 22:30\",\n \"fee\": \"-0.000124\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1580787038,\n \"txid\": \"a3f54afafec58eb54a84ffe185a8ce35423f9143fd8a2bdb7aec488c75566dbf\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2020-02-03 22:30\",\n \"fee\": \"0.0\",\n \"purchase_info\": [],\n \"support_info\": [],\n \"timestamp\": 1580787037,\n \"txid\": \"86d1b7fc915ce33774159d4c42c7c7212d6745a9b57051fca738d5fb4e8526f6\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
__version__ = "0.54.1"
|
||||
__version__ = "0.59.1"
|
||||
version = tuple(map(int, __version__.split('.'))) # pylint: disable=invalid-name
|
||||
@@ -167,7 +167,7 @@ class AbstractBlob:
|
||||
with self.reader_context() as handle:
|
||||
try:
|
||||
return await self.loop.sendfile(writer.transport, handle, count=self.get_length())
|
||||
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError, AttributeError):
|
||||
except (ConnectionError, BrokenPipeError, RuntimeError, OSError, AttributeError):
|
||||
return -1
|
||||
|
||||
def decrypt(self, key: bytes, iv: bytes) -> bytes:
|
||||
|
||||
@@ -105,18 +105,21 @@ class BlobServerProtocol(asyncio.Protocol):
|
||||
self.blob_manager.connection_manager.sent_data(self.peer_address_and_port, sent)
|
||||
log.info("sent %s (%i bytes) to %s:%i", blob_hash, sent, peer_address, peer_port)
|
||||
else:
|
||||
self.close()
|
||||
log.debug("stopped sending %s to %s:%i", blob_hash, peer_address, peer_port)
|
||||
except (OSError, asyncio.TimeoutError) as err:
|
||||
return
|
||||
except (OSError, ValueError, asyncio.TimeoutError) as err:
|
||||
if isinstance(err, asyncio.TimeoutError):
|
||||
log.debug("timed out sending blob %s to %s", blob_hash, peer_address)
|
||||
else:
|
||||
log.warning("could not read blob %s to send %s:%i", blob_hash, peer_address, peer_port)
|
||||
self.close()
|
||||
return
|
||||
finally:
|
||||
self.transfer_finished.set()
|
||||
else:
|
||||
log.info("don't have %s to send %s:%i", blob.blob_hash[:8], peer_address, peer_port)
|
||||
if responses:
|
||||
if responses and not self.transport.is_closing():
|
||||
self.send_response(responses)
|
||||
|
||||
def data_received(self, data):
|
||||
|
||||
+28
-10
@@ -462,7 +462,20 @@ class BaseConfig:
|
||||
self.persisted.save()
|
||||
|
||||
|
||||
class CLIConfig(BaseConfig):
|
||||
class TranscodeConfig(BaseConfig):
|
||||
|
||||
ffmpeg_folder = String('The path to ffmpeg and ffprobe', '')
|
||||
video_encoder = String('FFmpeg codec and parameters for the video encoding. '
|
||||
'Example: libaom-av1 -crf 25 -b:v 0 -strict experimental',
|
||||
'libx264 -crf 18 -vf "format=yuv420p"')
|
||||
audio_encoder = String('FFmpeg codec and parameters for the audio encoding. '
|
||||
'Example: libopus -b:a 128k',
|
||||
'aac -b:a 192k')
|
||||
volume_filter = String('FFmpeg filter for audio normalization.', '-af loudnorm')
|
||||
volume_analysis_time = Integer('Maximum seconds into the file that we examine audio volume (0 to disable).', '240')
|
||||
|
||||
|
||||
class CLIConfig(TranscodeConfig):
|
||||
|
||||
api = String('Host name and port for lbrynet daemon API.', 'localhost:5279', metavar='HOST:PORT')
|
||||
|
||||
@@ -560,15 +573,15 @@ class Config(CLIConfig):
|
||||
('reflector.lbry.com', 5566)
|
||||
])
|
||||
lbryum_servers = Servers("SPV wallet servers", [
|
||||
('spv1.lbry.com', 50001),
|
||||
('spv2.lbry.com', 50001),
|
||||
('spv3.lbry.com', 50001),
|
||||
('spv4.lbry.com', 50001),
|
||||
('spv5.lbry.com', 50001),
|
||||
('spv6.lbry.com', 50001),
|
||||
('spv7.lbry.com', 50001),
|
||||
('spv8.lbry.com', 50001),
|
||||
('spv9.lbry.com', 50001),
|
||||
('spv11.lbry.com', 50001),
|
||||
('spv12.lbry.com', 50001),
|
||||
('spv13.lbry.com', 50001),
|
||||
('spv14.lbry.com', 50001),
|
||||
('spv15.lbry.com', 50001),
|
||||
('spv16.lbry.com', 50001),
|
||||
('spv17.lbry.com', 50001),
|
||||
('spv18.lbry.com', 50001),
|
||||
('spv19.lbry.com', 50001),
|
||||
])
|
||||
known_dht_nodes = Servers("Known nodes for bootstrapping connection to the DHT", [
|
||||
('lbrynet1.lbry.com', 4444), # US EAST
|
||||
@@ -603,6 +616,11 @@ class Config(CLIConfig):
|
||||
"Strategy to use when selecting UTXOs for a transaction",
|
||||
STRATEGIES, "standard")
|
||||
|
||||
save_resolved_claims = Toggle(
|
||||
"Save content claims to the database when they are resolved to keep file_list up to date, "
|
||||
"only disable this if file_x commands are not needed", True
|
||||
)
|
||||
|
||||
@property
|
||||
def streaming_host(self):
|
||||
return self.streaming_server.split(':')[0]
|
||||
|
||||
@@ -51,11 +51,12 @@ Code | Name | Message
|
||||
405 | ChannelKeyNotFound | Channel signing key not found.
|
||||
406 | ChannelKeyInvalid | Channel signing key is out of date. -- For example, channel was updated but you don't have the updated key.
|
||||
407 | DataDownload | Failed to download blob. *generic*
|
||||
408 | Resolve | Failed to resolve '{url}'.
|
||||
409 | ResolveTimeout | Failed to resolve '{url}' within the timeout.
|
||||
410 | KeyFeeAboveMaxAllowed | {message}
|
||||
411 | InvalidPassword | Password is invalid.
|
||||
412 | IncompatibleWalletServer | '{server}:{port}' has an incompatibly old version.
|
||||
410 | Resolve | Failed to resolve '{url}'.
|
||||
411 | ResolveTimeout | Failed to resolve '{url}' within the timeout.
|
||||
411 | ResolveCensored | Resolve of '{url}' was censored by channel with claim id '{claim_id(censor_hash)}'.
|
||||
420 | KeyFeeAboveMaxAllowed | {message}
|
||||
421 | InvalidPassword | Password is invalid.
|
||||
422 | IncompatibleWalletServer | '{server}:{port}' has an incompatibly old version.
|
||||
**5xx** | Blob | **Blobs**
|
||||
500 | BlobNotFound | Blob not found.
|
||||
501 | BlobPermissionDenied | Permission denied to read blob.
|
||||
|
||||
+39
-1
@@ -1,4 +1,4 @@
|
||||
from .base import BaseError
|
||||
from .base import BaseError, claim_id
|
||||
|
||||
|
||||
class UserInputError(BaseError):
|
||||
@@ -16,18 +16,22 @@ class CommandError(UserInputError):
|
||||
class CommandDoesNotExistError(CommandError):
|
||||
|
||||
def __init__(self, command):
|
||||
self.command = command
|
||||
super().__init__(f"Command '{command}' does not exist.")
|
||||
|
||||
|
||||
class CommandDeprecatedError(CommandError):
|
||||
|
||||
def __init__(self, command):
|
||||
self.command = command
|
||||
super().__init__(f"Command '{command}' is deprecated.")
|
||||
|
||||
|
||||
class CommandInvalidArgumentError(CommandError):
|
||||
|
||||
def __init__(self, argument, command):
|
||||
self.argument = argument
|
||||
self.command = command
|
||||
super().__init__(f"Invalid argument '{argument}' to command '{command}'.")
|
||||
|
||||
|
||||
@@ -37,6 +41,7 @@ class CommandTemporarilyUnavailableError(CommandError):
|
||||
"""
|
||||
|
||||
def __init__(self, command):
|
||||
self.command = command
|
||||
super().__init__(f"Command '{command}' is temporarily unavailable.")
|
||||
|
||||
|
||||
@@ -46,6 +51,7 @@ class CommandPermanentlyUnavailableError(CommandError):
|
||||
"""
|
||||
|
||||
def __init__(self, command):
|
||||
self.command = command
|
||||
super().__init__(f"Command '{command}' is permanently unavailable.")
|
||||
|
||||
|
||||
@@ -58,12 +64,15 @@ class InputValueError(UserInputError, ValueError):
|
||||
class GenericInputValueError(InputValueError):
|
||||
|
||||
def __init__(self, value, argument):
|
||||
self.value = value
|
||||
self.argument = argument
|
||||
super().__init__(f"The value '{value}' for argument '{argument}' is not valid.")
|
||||
|
||||
|
||||
class InputValueIsNoneError(InputValueError):
|
||||
|
||||
def __init__(self, argument):
|
||||
self.argument = argument
|
||||
super().__init__(f"None or null is not valid value for argument '{argument}'.")
|
||||
|
||||
|
||||
@@ -79,6 +88,7 @@ class ConfigWriteError(ConfigurationError):
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
super().__init__(f"Cannot write configuration file '{path}'.")
|
||||
|
||||
|
||||
@@ -88,6 +98,7 @@ class ConfigReadError(ConfigurationError):
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
super().__init__(f"Cannot find provided configuration file '{path}'.")
|
||||
|
||||
|
||||
@@ -97,18 +108,21 @@ class ConfigParseError(ConfigurationError):
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
super().__init__(f"Failed to parse the configuration file '{path}'.")
|
||||
|
||||
|
||||
class ConfigMissingError(ConfigurationError):
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
super().__init__(f"Configuration file '{path}' is missing setting that has no default / fallback.")
|
||||
|
||||
|
||||
class ConfigInvalidError(ConfigurationError):
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
super().__init__(f"Configuration file '{path}' has setting with invalid value.")
|
||||
|
||||
|
||||
@@ -188,18 +202,29 @@ class DataDownloadError(WalletError):
|
||||
class ResolveError(WalletError):
|
||||
|
||||
def __init__(self, url):
|
||||
self.url = url
|
||||
super().__init__(f"Failed to resolve '{url}'.")
|
||||
|
||||
|
||||
class ResolveTimeoutError(WalletError):
|
||||
|
||||
def __init__(self, url):
|
||||
self.url = url
|
||||
super().__init__(f"Failed to resolve '{url}' within the timeout.")
|
||||
|
||||
|
||||
class ResolveCensoredError(WalletError):
|
||||
|
||||
def __init__(self, url, censor_hash):
|
||||
self.url = url
|
||||
self.censor_hash = censor_hash
|
||||
super().__init__(f"Resolve of '{url}' was censored by channel with claim id '{claim_id(censor_hash)}'.")
|
||||
|
||||
|
||||
class KeyFeeAboveMaxAllowedError(WalletError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
@@ -212,6 +237,8 @@ class InvalidPasswordError(WalletError):
|
||||
class IncompatibleWalletServerError(WalletError):
|
||||
|
||||
def __init__(self, server, port):
|
||||
self.server = server
|
||||
self.port = port
|
||||
super().__init__(f"'{server}:{port}' has an incompatibly old version.")
|
||||
|
||||
|
||||
@@ -272,30 +299,35 @@ class DownloadCancelledError(BlobError):
|
||||
class DownloadSDTimeoutError(BlobError):
|
||||
|
||||
def __init__(self, download):
|
||||
self.download = download
|
||||
super().__init__(f"Failed to download sd blob {download} within timeout.")
|
||||
|
||||
|
||||
class DownloadDataTimeoutError(BlobError):
|
||||
|
||||
def __init__(self, download):
|
||||
self.download = download
|
||||
super().__init__(f"Failed to download data blobs for sd hash {download} within timeout.")
|
||||
|
||||
|
||||
class InvalidStreamDescriptorError(BlobError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
class InvalidDataError(BlobError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
class InvalidBlobHashError(BlobError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
@@ -308,12 +340,14 @@ class ComponentError(BaseError):
|
||||
class ComponentStartConditionNotMetError(ComponentError):
|
||||
|
||||
def __init__(self, components):
|
||||
self.components = components
|
||||
super().__init__(f"Unresolved dependencies for: {components}")
|
||||
|
||||
|
||||
class ComponentsNotStartedError(ComponentError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
@@ -326,16 +360,20 @@ class CurrencyExchangeError(BaseError):
|
||||
class InvalidExchangeRateResponseError(CurrencyExchangeError):
|
||||
|
||||
def __init__(self, source, reason):
|
||||
self.source = source
|
||||
self.reason = reason
|
||||
super().__init__(f"Failed to get exchange rate from {source}: {reason}")
|
||||
|
||||
|
||||
class CurrencyConversionError(CurrencyExchangeError):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super().__init__(f"{message}")
|
||||
|
||||
|
||||
class InvalidCurrencyError(CurrencyExchangeError):
|
||||
|
||||
def __init__(self, currency):
|
||||
self.currency = currency
|
||||
super().__init__(f"Invalid currency: {currency} is not a supported currency.")
|
||||
@@ -1,2 +1,9 @@
|
||||
from binascii import hexlify
|
||||
|
||||
|
||||
def claim_id(claim_hash):
|
||||
return hexlify(claim_hash[::-1]).decode()
|
||||
|
||||
|
||||
class BaseError(Exception):
|
||||
pass
|
||||
+17
-4
@@ -13,10 +13,12 @@ class {name}({parents}):{doc}
|
||||
"""
|
||||
|
||||
INIT = """
|
||||
def __init__({args}):
|
||||
def __init__({args}):{fields}
|
||||
super().__init__({format}"{message}")
|
||||
"""
|
||||
|
||||
FUNCTIONS = ['claim_id']
|
||||
|
||||
|
||||
class ErrorClass:
|
||||
|
||||
@@ -50,10 +52,20 @@ class ErrorClass:
|
||||
|
||||
def get_arguments(self):
|
||||
args = ['self']
|
||||
for arg in re.findall('{([a-z0-1]+)}', self.message):
|
||||
for arg in re.findall('{([a-z0-1_()]+)}', self.message):
|
||||
for func in FUNCTIONS:
|
||||
if arg.startswith(f'{func}('):
|
||||
arg = arg[len(f'{func}('):-1]
|
||||
break
|
||||
args.append(arg)
|
||||
return args
|
||||
|
||||
@staticmethod
|
||||
def get_fields(args):
|
||||
if len(args) > 1:
|
||||
return f''.join(f'\n{INDENT*2}self.{field} = {field}' for field in args[1:])
|
||||
return ''
|
||||
|
||||
@staticmethod
|
||||
def get_doc_string(doc):
|
||||
if doc:
|
||||
@@ -69,7 +81,8 @@ class ErrorClass:
|
||||
args = self.get_arguments()
|
||||
if self.is_leaf:
|
||||
out.write((CLASS + INIT).format(
|
||||
name=self.class_name, parents=', '.join(parents), args=', '.join(args),
|
||||
name=self.class_name, parents=', '.join(parents),
|
||||
args=', '.join(args), fields=self.get_fields(args),
|
||||
message=self.message, doc=self.get_doc_string(self.comment), format='f' if len(args) > 1 else ''
|
||||
))
|
||||
else:
|
||||
@@ -102,7 +115,7 @@ def find_parent(stack, child):
|
||||
|
||||
|
||||
def generate(out):
|
||||
out.write('from .base import BaseError\n')
|
||||
out.write(f"from .base import BaseError, {', '.join(FUNCTIONS)}\n")
|
||||
stack = {}
|
||||
for error in get_errors():
|
||||
error.render(out, find_parent(stack, error))
|
||||
|
||||
@@ -3,6 +3,7 @@ import sys
|
||||
import shutil
|
||||
import signal
|
||||
import pathlib
|
||||
import platform
|
||||
import json
|
||||
import asyncio
|
||||
import argparse
|
||||
@@ -262,6 +263,9 @@ def setup_logging(logger: logging.Logger, args: argparse.Namespace, conf: Config
|
||||
|
||||
|
||||
def run_daemon(args: argparse.Namespace, conf: Config):
|
||||
if sys.version_info < (3, 8) and platform.system() == "Windows":
|
||||
# TODO: remove after we move to requiring Python 3.8
|
||||
asyncio.set_event_loop(asyncio.ProactorEventLoop())
|
||||
loop = asyncio.get_event_loop()
|
||||
if args.verbose is not None:
|
||||
loop.set_debug(True)
|
||||
|
||||
+102
-46
@@ -44,6 +44,7 @@ from lbry.extras.daemon.componentmanager import ComponentManager
|
||||
from lbry.extras.daemon.json_response_encoder import JSONResponseEncoder
|
||||
from lbry.extras.daemon import comment_client
|
||||
from lbry.extras.daemon.undecorated import undecorated
|
||||
from lbry.file_analysis import VideoFileAnalyzer
|
||||
from lbry.schema.claim import Claim
|
||||
from lbry.schema.url import URL
|
||||
|
||||
@@ -296,6 +297,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
def __init__(self, conf: Config, component_manager: typing.Optional[ComponentManager] = None):
|
||||
self.conf = conf
|
||||
self.platform_info = system_info.get_platform()
|
||||
self._video_file_analyzer = VideoFileAnalyzer(conf)
|
||||
self._node_id = None
|
||||
self._installation_id = None
|
||||
self.session_id = base58.b58encode(utils.generate_id()).decode()
|
||||
@@ -305,7 +308,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
skip_components=conf.components_to_skip or []
|
||||
)
|
||||
self.component_startup_task = None
|
||||
self._connection_status: typing.Tuple[float, bool] = [self.component_manager.loop.time(), False]
|
||||
self._connection_status: typing.Tuple[float, bool] = (self.component_manager.loop.time(), False)
|
||||
|
||||
logging.getLogger('aiohttp.access').setLevel(logging.WARN)
|
||||
rpc_app = web.Application()
|
||||
@@ -447,7 +450,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
async def start(self):
|
||||
log.info("Starting LBRYNet Daemon")
|
||||
log.debug("Settings: %s", json.dumps(self.conf.settings_dict, indent=2))
|
||||
log.info("Platform: %s", json.dumps(system_info.get_platform(), indent=2))
|
||||
log.info("Platform: %s", json.dumps(self.platform_info, indent=2))
|
||||
await self.analytics_manager.send_server_startup()
|
||||
await self.rpc_runner.setup()
|
||||
await self.streaming_runner.setup()
|
||||
@@ -851,6 +854,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
"""
|
||||
|
||||
connection_code = await self.get_connection_status()
|
||||
ffmpeg_status = await self._video_file_analyzer.status()
|
||||
|
||||
response = {
|
||||
'installation_id': self.installation_id,
|
||||
@@ -861,6 +865,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
'code': connection_code,
|
||||
'message': CONNECTION_MESSAGES[connection_code],
|
||||
},
|
||||
'ffmpeg_status': ffmpeg_status
|
||||
}
|
||||
for component in self.component_manager.components:
|
||||
status = await component.get_status()
|
||||
@@ -890,9 +895,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
'build': (str) "dev" | "qa" | "rc" | "release",
|
||||
}
|
||||
"""
|
||||
platform_info = system_info.get_platform()
|
||||
log.info("Get version info: %s", json.dumps(platform_info))
|
||||
return platform_info
|
||||
return self.platform_info
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_resolve(self, urls: typing.Union[str, list], wallet_id=None):
|
||||
@@ -1398,7 +1401,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.ledger.broadcast(tx)
|
||||
await self.analytics_manager.send_credits_sent()
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_credits_sent())
|
||||
else:
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
@@ -2144,14 +2147,16 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
"""
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
def jsonrpc_claim_list(self, claim_type=None, account_id=None, wallet_id=None, page=None, page_size=None):
|
||||
def jsonrpc_claim_list(
|
||||
self, claim_type=None, account_id=None, wallet_id=None, page=None, page_size=None, resolve=False):
|
||||
"""
|
||||
List my stream and channel claims.
|
||||
|
||||
Usage:
|
||||
claim_list [--claim_type=<claim_type>]
|
||||
claim_list [--claim_type=<claim_type>...]
|
||||
[--account_id=<account_id>] [--wallet_id=<wallet_id>]
|
||||
[--page=<page>] [--page_size=<page_size>]
|
||||
[--resolve]
|
||||
|
||||
Options:
|
||||
--claim_type=<claim_type> : (str) claim type: channel, stream, repost, collection
|
||||
@@ -2159,6 +2164,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
|
||||
--page=<page> : (int) page to return during paginating
|
||||
--page_size=<page_size> : (int) number of items on page during pagination
|
||||
--resolve : (bool) resolves each claim to provide additional metadata
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
@@ -2170,10 +2176,15 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
else:
|
||||
claims = partial(self.ledger.get_claims, wallet=wallet, accounts=wallet.accounts)
|
||||
claim_count = partial(self.ledger.get_claim_count, wallet=wallet, accounts=wallet.accounts)
|
||||
return paginate_rows(claims, claim_count, page, page_size, claim_type=claim_type)
|
||||
return paginate_rows(claims, claim_count, page, page_size, claim_type=claim_type, resolve=resolve)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_claim_search(self, **kwargs):
|
||||
async def jsonrpc_claim_search(self, claim_ids=None, channel_ids=None, not_channel_ids=None,
|
||||
has_channel_signature=False, valid_channel_signature=False,
|
||||
invalid_channel_signature=False, is_controlling=False, stream_types=None,
|
||||
media_types=None, any_tags=None, all_tags=None, not_tags=None, any_languages=None,
|
||||
all_languages=None, not_languages=None, any_locations=None, all_locations=None,
|
||||
not_locations=None, order_by=None, **kwargs):
|
||||
"""
|
||||
Search for stream and channel claims on the blockchain.
|
||||
|
||||
@@ -2198,6 +2209,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--reposted_claim_id=<reposted_claim_id>] [--reposted=<reposted>]
|
||||
[--claim_type=<claim_type>] [--stream_types=<stream_types>...] [--media_types=<media_types>...]
|
||||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>]
|
||||
[--duration=<duration>]
|
||||
[--any_tags=<any_tags>...] [--all_tags=<all_tags>...] [--not_tags=<not_tags>...]
|
||||
[--any_languages=<any_languages>...] [--all_languages=<all_languages>...]
|
||||
[--not_languages=<not_languages>...]
|
||||
@@ -2284,6 +2296,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--media_types=<media_types> : (list) filter by 'video/mp4', 'image/png', etc
|
||||
--fee_currency=<fee_currency> : (string) specify fee currency: LBC, BTC, USD
|
||||
--fee_amount=<fee_amount> : (decimal) content download fee (supports equality constraints)
|
||||
--duration=<duration> : (int) duration of video or audio in seconds
|
||||
(supports equality constraints)
|
||||
--any_tags=<any_tags> : (list) find claims containing any of the tags
|
||||
--all_tags=<all_tags> : (list) find claims containing every tag
|
||||
--not_tags=<not_tags> : (list) find claims not containing any of these tags
|
||||
@@ -2307,23 +2321,50 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
wallet = self.wallet_manager.get_wallet_or_default(kwargs.pop('wallet_id', None))
|
||||
if {'claim_id', 'claim_ids'}.issubset(kwargs):
|
||||
|
||||
_kwargs = {}
|
||||
_kwargs.update(kwargs)
|
||||
_kwargs.update(
|
||||
{
|
||||
'claim_ids': claim_ids or [],
|
||||
'channel_ids': channel_ids or [],
|
||||
'not_channel_ids': not_channel_ids or [],
|
||||
'has_channel_signature': has_channel_signature,
|
||||
'valid_channel_signature': valid_channel_signature,
|
||||
'invalid_channel_signature': invalid_channel_signature,
|
||||
'is_controlling': is_controlling,
|
||||
'stream_types': stream_types or [],
|
||||
'media_types': media_types or [],
|
||||
'any_tags': any_tags or [],
|
||||
'all_tags': all_tags or [],
|
||||
'not_tags': not_tags or [],
|
||||
'any_languages': any_languages or [],
|
||||
'all_languages': all_languages or [],
|
||||
'not_languages': not_languages or [],
|
||||
'any_locations': any_locations or [],
|
||||
'all_locations': all_locations or [],
|
||||
'not_locations': not_locations or [],
|
||||
'order_by': order_by or []
|
||||
}
|
||||
)
|
||||
wallet = self.wallet_manager.get_wallet_or_default(_kwargs.pop('wallet_id', None))
|
||||
if {'claim_id', 'claim_ids'}.issubset(_kwargs):
|
||||
raise ValueError("Only 'claim_id' or 'claim_ids' is allowed, not both.")
|
||||
if kwargs.pop('valid_channel_signature', False):
|
||||
kwargs['signature_valid'] = 1
|
||||
if kwargs.pop('invalid_channel_signature', False):
|
||||
kwargs['signature_valid'] = 0
|
||||
page_num, page_size = abs(kwargs.pop('page', 1)), min(abs(kwargs.pop('page_size', DEFAULT_PAGE_SIZE)), 50)
|
||||
kwargs.update({'offset': page_size * (page_num - 1), 'limit': page_size})
|
||||
txos, blocked, _, total = await self.ledger.claim_search(wallet.accounts, **kwargs)
|
||||
if _kwargs.pop('valid_channel_signature', False):
|
||||
_kwargs['signature_valid'] = 1
|
||||
if _kwargs.pop('invalid_channel_signature', False):
|
||||
_kwargs['signature_valid'] = 0
|
||||
|
||||
page_num, page_size = abs(_kwargs.pop('page', 1)), min(abs(_kwargs.pop('page_size', DEFAULT_PAGE_SIZE)), 50)
|
||||
_kwargs.update({'offset': page_size * (page_num - 1), 'limit': page_size})
|
||||
txos, blocked, _, total = await self.ledger.claim_search(wallet.accounts, **_kwargs)
|
||||
result = {
|
||||
"items": txos,
|
||||
"blocked": blocked,
|
||||
"page": page_num,
|
||||
"page_size": page_size
|
||||
}
|
||||
if not kwargs.pop('no_totals', False):
|
||||
if not _kwargs.pop('no_totals', False):
|
||||
result['total_pages'] = int((total + (page_size - 1)) / page_size)
|
||||
result['total_items'] = total
|
||||
return result
|
||||
@@ -2448,7 +2489,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||
tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||
)])
|
||||
await self.analytics_manager.send_new_channel()
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -2604,7 +2645,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
||||
)])
|
||||
await self.analytics_manager.send_new_channel()
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -2663,26 +2704,27 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
return tx
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
def jsonrpc_channel_list(self, account_id=None, wallet_id=None, page=None, page_size=None):
|
||||
def jsonrpc_channel_list(self, account_id=None, wallet_id=None, page=None, page_size=None, resolve=False):
|
||||
"""
|
||||
List my channel claims.
|
||||
|
||||
Usage:
|
||||
channel_list [<account_id> | --account_id=<account_id>] [--wallet_id=<wallet_id>]
|
||||
[--page=<page>] [--page_size=<page_size>]
|
||||
[--page=<page>] [--page_size=<page_size>] [--resolve]
|
||||
|
||||
Options:
|
||||
--account_id=<account_id> : (str) id of the account to use
|
||||
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
|
||||
--page=<page> : (int) page to return during paginating
|
||||
--page_size=<page_size> : (int) number of items on page during pagination
|
||||
--resolve : (bool) resolves each channel to provide additional metadata
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
@@ -2694,7 +2736,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
else:
|
||||
channels = partial(self.ledger.get_channels, wallet=wallet, accounts=wallet.accounts)
|
||||
channel_count = partial(self.ledger.get_channel_count, wallet=wallet, accounts=wallet.accounts)
|
||||
return paginate_rows(channels, channel_count, page, page_size)
|
||||
return paginate_rows(channels, channel_count, page, page_size, resolve=resolve)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_channel_export(self, channel_id=None, channel_name=None, account_id=None, wallet_id=None):
|
||||
@@ -2801,6 +2843,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Usage:
|
||||
publish (<name> | --name=<name>) [--bid=<bid>] [--file_path=<file_path>]
|
||||
[--validate_file] [--optimize_file]
|
||||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
|
||||
[--title=<title>] [--description=<description>] [--author=<author>]
|
||||
[--tags=<tags>...] [--languages=<languages>...] [--locations=<locations>...]
|
||||
@@ -2816,6 +2859,11 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
|
||||
--bid=<bid> : (decimal) amount to back the claim
|
||||
--file_path=<file_path> : (str) path to file to be associated with name.
|
||||
--validate_file : (bool) validate that the video container and encodings match
|
||||
common web browser support or that optimization succeeds if specified.
|
||||
FFmpeg is required
|
||||
--optimize_file : (bool) transcode the video & audio if necessary to ensure
|
||||
common web browser support. FFmpeg is required
|
||||
--fee_currency=<fee_currency> : (string) specify fee currency
|
||||
--fee_amount=<fee_amount> : (decimal) content download fee
|
||||
--fee_address=<fee_address> : (str) address where to send fee payments, will use
|
||||
@@ -2976,7 +3024,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('publish')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -2987,12 +3035,13 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
self, name, bid, file_path, allow_duplicate_name=False,
|
||||
channel_id=None, channel_name=None, channel_account_id=None,
|
||||
account_id=None, wallet_id=None, claim_address=None, funding_account_ids=None,
|
||||
preview=False, blocking=False, **kwargs):
|
||||
preview=False, blocking=False, validate_file=False, optimize_file=False, **kwargs):
|
||||
"""
|
||||
Make a new stream claim and announce the associated file to lbrynet.
|
||||
|
||||
Usage:
|
||||
stream_create (<name> | --name=<name>) (<bid> | --bid=<bid>) (<file_path> | --file_path=<file_path>)
|
||||
[--validate_file] [--optimize_file]
|
||||
[--allow_duplicate_name=<allow_duplicate_name>]
|
||||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
|
||||
[--title=<title>] [--description=<description>] [--author=<author>]
|
||||
@@ -3009,6 +3058,11 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
|
||||
--bid=<bid> : (decimal) amount to back the claim
|
||||
--file_path=<file_path> : (str) path to file to be associated with name.
|
||||
--validate_file : (bool) validate that the video container and encodings match
|
||||
common web browser support or that optimization succeeds if specified.
|
||||
FFmpeg is required
|
||||
--optimize_file : (bool) transcode the video & audio if necessary to ensure
|
||||
common web browser support. FFmpeg is required
|
||||
--allow_duplicate_name=<allow_duplicate_name> : (bool) create new claim even if one already exists with
|
||||
given name. default: false.
|
||||
--fee_currency=<fee_currency> : (string) specify fee currency
|
||||
@@ -3100,6 +3154,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
f"Use --allow-duplicate-name flag to override."
|
||||
)
|
||||
|
||||
file_path = await self._video_file_analyzer.verify_or_repair(validate_file, optimize_file, file_path)
|
||||
|
||||
claim = Claim()
|
||||
claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs)
|
||||
tx = await Transaction.claim_create(
|
||||
@@ -3123,7 +3179,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
tx, new_txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||
)])
|
||||
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)
|
||||
await self.analytics_manager.send_claim_action('publish')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -3308,17 +3364,16 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
stream_hash = None
|
||||
if not preview:
|
||||
old_stream_hash = await self.storage.get_stream_hash_for_sd_hash(old_txo.claim.stream.source.sd_hash)
|
||||
old_stream = self.stream_manager.streams.get(old_txo.claim.stream.source.sd_hash, None)
|
||||
if file_path is not None:
|
||||
if old_stream_hash:
|
||||
stream_to_delete = self.stream_manager.get_stream_by_stream_hash(old_stream_hash)
|
||||
await self.stream_manager.delete_stream(stream_to_delete, delete_file=False)
|
||||
if old_stream:
|
||||
await self.stream_manager.delete_stream(old_stream, delete_file=False)
|
||||
file_stream = await self.stream_manager.create_stream(file_path)
|
||||
new_txo.claim.stream.source.sd_hash = file_stream.sd_hash
|
||||
new_txo.script.generate()
|
||||
stream_hash = file_stream.stream_hash
|
||||
else:
|
||||
stream_hash = old_stream_hash
|
||||
elif old_stream:
|
||||
stream_hash = old_stream.stream_hash
|
||||
|
||||
if channel:
|
||||
new_txo.sign(channel)
|
||||
@@ -3331,7 +3386,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
)])
|
||||
if stream_hash:
|
||||
await self.storage.save_content_claim(stream_hash, new_txo.id)
|
||||
await self.analytics_manager.send_claim_action('publish')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -3390,26 +3445,27 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
|
||||
else:
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
return tx
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
def jsonrpc_stream_list(self, account_id=None, wallet_id=None, page=None, page_size=None):
|
||||
def jsonrpc_stream_list(self, account_id=None, wallet_id=None, page=None, page_size=None, resolve=False):
|
||||
"""
|
||||
List my stream claims.
|
||||
|
||||
Usage:
|
||||
stream_list [<account_id> | --account_id=<account_id>] [--wallet_id=<wallet_id>]
|
||||
[--page=<page>] [--page_size=<page_size>]
|
||||
[--page=<page>] [--page_size=<page_size>] [--resolve]
|
||||
|
||||
Options:
|
||||
--account_id=<account_id> : (str) id of the account to query
|
||||
--wallet_id=<wallet_id> : (str) restrict results to specific wallet
|
||||
--page=<page> : (int) page to return during paginating
|
||||
--page_size=<page_size> : (int) number of items on page during pagination
|
||||
--resolve : (bool) resolves each stream to provide additional metadata
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
@@ -3421,7 +3477,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
else:
|
||||
streams = partial(self.ledger.get_streams, wallet=wallet, accounts=wallet.accounts)
|
||||
stream_count = partial(self.ledger.get_stream_count, wallet=wallet, accounts=wallet.accounts)
|
||||
return paginate_rows(streams, stream_count, page, page_size)
|
||||
return paginate_rows(streams, stream_count, page, page_size, resolve=resolve)
|
||||
|
||||
@requires(WALLET_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT, BLOB_COMPONENT,
|
||||
DHT_COMPONENT, DATABASE_COMPONENT)
|
||||
@@ -3554,7 +3610,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('publish')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -3708,7 +3764,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('publish')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -3860,7 +3916,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
'claim_id': claim_id,
|
||||
'amount': dewies_to_lbc(amount)
|
||||
}]})
|
||||
await self.analytics_manager.send_claim_action('new_support')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('new_support'))
|
||||
else:
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
@@ -3960,7 +4016,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if not preview:
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
|
||||
else:
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
@@ -4364,7 +4420,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
else:
|
||||
server, port = random.choice(self.conf.reflector_servers)
|
||||
reflected = await asyncio.gather(*[
|
||||
stream.upload_to_reflector(server, port)
|
||||
self.stream_manager.reflect_stream(stream, server, port)
|
||||
for stream in self.stream_manager.get_filtered_streams(**kwargs)
|
||||
])
|
||||
total = []
|
||||
@@ -4828,7 +4884,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
async def resolve(self, accounts, urls):
|
||||
results = await self.ledger.resolve(accounts, urls)
|
||||
if results:
|
||||
if self.conf.save_resolved_claims and results:
|
||||
try:
|
||||
claims = self.stream_manager._convert_to_old_resolve_output(self.wallet_manager, results)
|
||||
await self.storage.save_claims_for_resolve([
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
import shlex
|
||||
import shutil
|
||||
|
||||
from lbry.conf import TranscodeConfig
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class VideoFileAnalyzer:
|
||||
|
||||
def __init__(self, conf: TranscodeConfig):
|
||||
self._conf = conf
|
||||
self._available_encoders = ""
|
||||
self._ffmpeg_installed = False
|
||||
self._which = None
|
||||
|
||||
async def _execute(self, command, arguments):
|
||||
args = shlex.split(arguments)
|
||||
process = await asyncio.create_subprocess_exec(self._conf.ffmpeg_folder + command, *args,
|
||||
stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
||||
stdout, stderr = await process.communicate() # returns when the streams are closed
|
||||
return stdout.decode(errors='replace') + stderr.decode(errors='replace'), process.returncode
|
||||
|
||||
async def _verify_executable(self, name):
|
||||
try:
|
||||
version, code = await self._execute(name, "-version")
|
||||
except Exception as e:
|
||||
log.warning("Unable to run %s, but it was requested. Message: %s", name, str(e))
|
||||
code = -1
|
||||
version = ""
|
||||
if code != 0 or not version.startswith(name):
|
||||
raise FileNotFoundError(f"Unable to locate or run {name}. Please install FFmpeg "
|
||||
f"and ensure that it is callable via PATH or conf.ffmpeg_folder")
|
||||
return version
|
||||
|
||||
async def _verify_ffmpeg_installed(self):
|
||||
if self._ffmpeg_installed:
|
||||
return
|
||||
await self._verify_executable("ffprobe")
|
||||
version = await self._verify_executable("ffmpeg")
|
||||
self._which = shutil.which(f"{self._conf.ffmpeg_folder}ffmpeg")
|
||||
self._ffmpeg_installed = True
|
||||
log.debug("Using %s at %s", version.splitlines()[0].split(" Copyright")[0], self._which)
|
||||
|
||||
async def status(self, reset=False):
|
||||
if reset:
|
||||
self._available_encoders = ""
|
||||
self._ffmpeg_installed = False
|
||||
self._which = None
|
||||
|
||||
installed = True
|
||||
try:
|
||||
await self._verify_ffmpeg_installed()
|
||||
except FileNotFoundError:
|
||||
installed = False
|
||||
|
||||
return {
|
||||
"available": installed,
|
||||
"which": self._which,
|
||||
"analyze_audio_volume": int(self._conf.volume_analysis_time) > 0
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _verify_container(scan_data: json):
|
||||
container = scan_data["format"]["format_name"]
|
||||
log.debug(" Detected container is %s", container)
|
||||
if not {"webm", "mp4", "3gp", "ogg"}.intersection(container.split(",")):
|
||||
return "Container format is not in the approved list of WebM, MP4. " \
|
||||
f"Actual: {container} [{scan_data['format']['format_long_name']}]"
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def _verify_video_encoding(scan_data: json):
|
||||
for stream in scan_data["streams"]:
|
||||
if stream["codec_type"] != "video":
|
||||
continue
|
||||
codec = stream["codec_name"]
|
||||
log.debug(" Detected video codec is %s, format is %s", codec, stream["pix_fmt"])
|
||||
if not {"h264", "vp8", "vp9", "av1", "theora"}.intersection(codec.split(",")):
|
||||
return "Video codec is not in the approved list of H264, VP8, VP9, AV1, Theora. " \
|
||||
f"Actual: {codec} [{stream['codec_long_name']}]"
|
||||
|
||||
if "h264" in codec.split(",") and stream["pix_fmt"] != "yuv420p":
|
||||
return "Video codec is H264, but its pixel format does not match the approved yuv420p. " \
|
||||
f"Actual: {stream['pix_fmt']}"
|
||||
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def _verify_bitrate(scan_data: json):
|
||||
if "bit_rate" not in scan_data["format"]:
|
||||
return ""
|
||||
|
||||
bit_rate = float(scan_data["format"]["bit_rate"])
|
||||
log.debug(" Detected bitrate is %s Mbps", str(bit_rate / 1000000.0))
|
||||
pixels = -1.0
|
||||
for stream in scan_data["streams"]:
|
||||
if stream["codec_type"] == "video":
|
||||
pieces = stream["r_frame_rate"].split('/', 1)
|
||||
frame_rate = float(pieces[0]) if len(pieces) == 1 \
|
||||
else float(pieces[0]) / float(pieces[1])
|
||||
pixels = max(pixels, float(stream["height"]) * float(stream["width"]) * frame_rate)
|
||||
|
||||
if pixels > 0.0 and pixels / bit_rate < 3.0:
|
||||
return "Bits per second is excessive for this data; this may impact web streaming performance. " \
|
||||
f"Actual: {str(bit_rate / 1000000.0)} Mbps"
|
||||
|
||||
return ""
|
||||
|
||||
async def _verify_fast_start(self, scan_data: json, video_file):
|
||||
container = scan_data["format"]["format_name"]
|
||||
if {"webm", "ogg"}.intersection(container.split(",")):
|
||||
return ""
|
||||
|
||||
result, _ = await self._execute("ffprobe", f'-v debug "{video_file}"')
|
||||
match = re.search(r"Before avformat_find_stream_info.+?\s+seeks:(\d+)\s+", result)
|
||||
if match and int(match.group(1)) != 0:
|
||||
return "Video stream descriptors are not at the start of the file (the faststart flag was not used)."
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def _verify_audio_encoding(scan_data: json):
|
||||
for stream in scan_data["streams"]:
|
||||
if stream["codec_type"] != "audio":
|
||||
continue
|
||||
codec = stream["codec_name"]
|
||||
log.debug(" Detected audio codec is %s", codec)
|
||||
if not {"aac", "mp3", "flac", "vorbis", "opus"}.intersection(codec.split(",")):
|
||||
return "Audio codec is not in the approved list of AAC, FLAC, MP3, Vorbis, and Opus. " \
|
||||
f"Actual: {codec} [{stream['codec_long_name']}]"
|
||||
|
||||
return ""
|
||||
|
||||
async def _verify_audio_volume(self, seconds, video_file):
|
||||
try:
|
||||
validate_volume = int(seconds) > 0
|
||||
except ValueError:
|
||||
validate_volume = False
|
||||
|
||||
if not validate_volume:
|
||||
return ""
|
||||
|
||||
result, _ = await self._execute("ffmpeg", f'-i "{video_file}" -t {seconds} '
|
||||
f'-af volumedetect -vn -sn -dn -f null "{os.devnull}"')
|
||||
try:
|
||||
mean_volume = float(re.search(r"mean_volume:\s+([-+]?\d*\.\d+|\d+)", result).group(1))
|
||||
max_volume = float(re.search(r"max_volume:\s+([-+]?\d*\.\d+|\d+)", result).group(1))
|
||||
except Exception as e:
|
||||
log.debug(" Failure in volume analysis. Message: %s", str(e))
|
||||
return ""
|
||||
|
||||
if max_volume < -5.0 and mean_volume < -22.0:
|
||||
return "Audio is at least five dB lower than prime. " \
|
||||
f"Actual max: {max_volume}, mean: {mean_volume}"
|
||||
|
||||
log.debug(" Detected audio volume has mean, max of %f, %f dB", mean_volume, max_volume)
|
||||
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def _compute_crf(scan_data):
|
||||
height = 240.0
|
||||
for stream in scan_data["streams"]:
|
||||
if stream["codec_type"] == "video":
|
||||
height = max(height, float(stream["height"]))
|
||||
|
||||
# https://developers.google.com/media/vp9/settings/vod/
|
||||
return int(-0.011 * height + 40)
|
||||
|
||||
async def _get_video_encoder(self, scan_data):
|
||||
# use what the user said if it's there:
|
||||
# if it's not there, use h264 if we can because it's way faster than the others
|
||||
# if we don't have h264 use vp9; it's fairly compatible even though it's slow
|
||||
|
||||
if not self._available_encoders:
|
||||
self._available_encoders, _ = await self._execute("ffmpeg", "-encoders -v quiet")
|
||||
|
||||
encoder = self._conf.video_encoder.split(" ", 1)[0]
|
||||
if re.search(fr"^\s*V..... {encoder} ", self._available_encoders, re.MULTILINE):
|
||||
return self._conf.video_encoder
|
||||
|
||||
if re.search(r"^\s*V..... libx264 ", self._available_encoders, re.MULTILINE):
|
||||
if encoder:
|
||||
log.warning(" Using libx264 since the requested encoder was unavailable. Requested: %s", encoder)
|
||||
return 'libx264 -crf 19 -vf "format=yuv420p"'
|
||||
|
||||
if not encoder:
|
||||
encoder = "libx264"
|
||||
|
||||
if re.search(r"^\s*V..... libvpx-vp9 ", self._available_encoders, re.MULTILINE):
|
||||
log.warning(" Using libvpx-vp9 since the requested encoder was unavailable. Requested: %s", encoder)
|
||||
crf = self._compute_crf(scan_data)
|
||||
return f"libvpx-vp9 -crf {crf} -b:v 0"
|
||||
|
||||
if re.search(r"^\s*V..... libtheora", self._available_encoders, re.MULTILINE):
|
||||
log.warning(" Using libtheora since the requested encoder was unavailable. Requested: %s", encoder)
|
||||
return "libtheora -q:v 7"
|
||||
|
||||
raise Exception(f"The video encoder is not available. Requested: {encoder}")
|
||||
|
||||
async def _get_audio_encoder(self, extension):
|
||||
# if the video encoding is theora or av1/vp8/vp9 use opus (or fallback to vorbis)
|
||||
# or we don't have a video encoding but we have an ogg or webm container use opus
|
||||
# if we need to use opus/vorbis see if the conf file has it else use our own params
|
||||
# else use the user-set value if it exists
|
||||
# else use aac
|
||||
|
||||
wants_opus = extension != "mp4"
|
||||
if not self._available_encoders:
|
||||
self._available_encoders, _ = await self._execute("ffmpeg", "-encoders -v quiet")
|
||||
|
||||
encoder = self._conf.audio_encoder.split(" ", 1)[0]
|
||||
if wants_opus and 'opus' in encoder:
|
||||
return self._conf.audio_encoder
|
||||
|
||||
if wants_opus and re.search(r"^\s*A..... libopus ", self._available_encoders, re.MULTILINE):
|
||||
return "libopus -b:a 160k"
|
||||
|
||||
if wants_opus and 'vorbis' in encoder:
|
||||
return self._conf.audio_encoder
|
||||
|
||||
if wants_opus and re.search(r"^\s*A..... libvorbis ", self._available_encoders, re.MULTILINE):
|
||||
return "libvorbis -q:a 6"
|
||||
|
||||
if re.search(fr"^\s*A..... {encoder} ", self._available_encoders, re.MULTILINE):
|
||||
return self._conf.audio_encoder
|
||||
|
||||
if re.search(r"^\s*A..... aac ", self._available_encoders, re.MULTILINE):
|
||||
return "aac -b:a 192k"
|
||||
|
||||
raise Exception(f"The audio encoder is not available. Requested: {encoder or 'aac'}")
|
||||
|
||||
async def _get_volume_filter(self):
|
||||
return self._conf.volume_filter if self._conf.volume_filter else "-af loudnorm"
|
||||
|
||||
@staticmethod
|
||||
def _get_best_container_extension(scan_data, video_encoder):
|
||||
# the container is chosen by the video format
|
||||
# if we are theora-encoded, we want ogg
|
||||
# if we are vp8/vp9/av1 we want webm
|
||||
# use mp4 for anything else
|
||||
|
||||
if not video_encoder: # not re-encoding video
|
||||
for stream in scan_data["streams"]:
|
||||
if stream["codec_type"] != "video":
|
||||
continue
|
||||
codec = stream["codec_name"].split(",")
|
||||
if "theora" in codec:
|
||||
return "ogg"
|
||||
if {"vp8", "vp9", "av1"}.intersection(codec):
|
||||
return "webm"
|
||||
|
||||
if "theora" in video_encoder:
|
||||
return "ogg"
|
||||
elif re.search(r"vp[89x]|av1", video_encoder.split(" ", 1)[0]):
|
||||
return "webm"
|
||||
return "mp4"
|
||||
|
||||
async def _get_scan_data(self, validate, file_path):
|
||||
result, _ = await self._execute("ffprobe",
|
||||
f'-v quiet -print_format json -show_format -show_streams "{file_path}"')
|
||||
try:
|
||||
scan_data = json.loads(result)
|
||||
except Exception as e:
|
||||
log.debug("Failure in JSON parsing ffprobe results. Message: %s", str(e))
|
||||
if validate:
|
||||
raise Exception(f'Invalid video file: {file_path}')
|
||||
log.info("Unable to optimize %s . FFmpeg output was unreadable.", file_path)
|
||||
return
|
||||
|
||||
if "format" not in scan_data:
|
||||
if validate:
|
||||
raise FileNotFoundError(f'Unexpected or absent video file contents at: {file_path}')
|
||||
log.info("Unable to optimize %s . FFmpeg output is missing the format section.", file_path)
|
||||
return
|
||||
|
||||
return scan_data
|
||||
|
||||
async def verify_or_repair(self, validate, repair, file_path):
|
||||
if not validate and not repair:
|
||||
return file_path
|
||||
|
||||
await self._verify_ffmpeg_installed()
|
||||
scan_data = await self._get_scan_data(validate, file_path)
|
||||
|
||||
fast_start_msg = await self._verify_fast_start(scan_data, file_path)
|
||||
log.debug("Analyzing %s:", file_path)
|
||||
log.debug(" Detected faststart is %s", "false" if fast_start_msg else "true")
|
||||
container_msg = self._verify_container(scan_data)
|
||||
bitrate_msg = self._verify_bitrate(scan_data)
|
||||
video_msg = self._verify_video_encoding(scan_data)
|
||||
audio_msg = self._verify_audio_encoding(scan_data)
|
||||
volume_msg = await self._verify_audio_volume(self._conf.volume_analysis_time, file_path)
|
||||
messages = [container_msg, bitrate_msg, fast_start_msg, video_msg, audio_msg, volume_msg]
|
||||
|
||||
if not any(messages):
|
||||
return file_path
|
||||
|
||||
if not repair:
|
||||
errors = ["Streamability verification failed:"]
|
||||
errors.extend(filter(None, messages))
|
||||
raise Exception("\n ".join(errors))
|
||||
|
||||
# the plan for transcoding:
|
||||
# we have to re-encode the video if it is in a nonstandard format
|
||||
# we also re-encode if we are h264 but not yuv420p (both errors caught in video_msg)
|
||||
# we also re-encode if our bitrate is too high
|
||||
|
||||
try:
|
||||
transcode_command = [f'-i "{file_path}" -y -c:s copy -c:d copy -c:v']
|
||||
|
||||
video_encoder = ""
|
||||
if video_msg or bitrate_msg:
|
||||
video_encoder = await self._get_video_encoder(scan_data)
|
||||
transcode_command.append(video_encoder)
|
||||
else:
|
||||
transcode_command.append("copy")
|
||||
|
||||
transcode_command.append("-movflags +faststart -c:a")
|
||||
path = pathlib.Path(file_path)
|
||||
extension = self._get_best_container_extension(scan_data, video_encoder)
|
||||
|
||||
if audio_msg or volume_msg:
|
||||
audio_encoder = await self._get_audio_encoder(extension)
|
||||
transcode_command.append(audio_encoder)
|
||||
if volume_msg:
|
||||
volume_filter = await self._get_volume_filter()
|
||||
transcode_command.append(volume_filter)
|
||||
else:
|
||||
transcode_command.append("copy")
|
||||
|
||||
# TODO: put it in a temp folder and delete it after we upload?
|
||||
output = path.parent / f"{path.stem}_fixed.{extension}"
|
||||
transcode_command.append(f'"{output}"')
|
||||
|
||||
ffmpeg_command = " ".join(transcode_command)
|
||||
log.info("Proceeding on transcode via: ffmpeg %s", ffmpeg_command)
|
||||
result, code = await self._execute("ffmpeg", ffmpeg_command)
|
||||
if code != 0:
|
||||
raise Exception(f"Failure to complete the transcode command. Output: {result}")
|
||||
except Exception as e:
|
||||
if validate:
|
||||
raise
|
||||
log.info("Unable to transcode %s . Message: %s", file_path, str(e))
|
||||
# TODO: delete partial output file here if it exists?
|
||||
return file_path
|
||||
|
||||
return str(output)
|
||||
+50
-32
@@ -4,7 +4,23 @@ from typing import List
|
||||
from binascii import hexlify
|
||||
from itertools import chain
|
||||
|
||||
from lbry.error import ResolveCensoredError
|
||||
from lbry.schema.types.v2.result_pb2 import Outputs as OutputsMessage
|
||||
from lbry.schema.types.v2.result_pb2 import Error as ErrorMessage
|
||||
|
||||
INVALID = ErrorMessage.Code.Name(ErrorMessage.INVALID)
|
||||
NOT_FOUND = ErrorMessage.Code.Name(ErrorMessage.NOT_FOUND)
|
||||
BLOCKED = ErrorMessage.Code.Name(ErrorMessage.BLOCKED)
|
||||
|
||||
|
||||
def set_reference(reference, claim_hash, rows):
|
||||
if claim_hash:
|
||||
for txo in rows:
|
||||
if claim_hash == txo['claim_hash']:
|
||||
reference.tx_hash = txo['txo_hash'][:32]
|
||||
reference.nout = struct.unpack('<I', txo['txo_hash'][32:])[0]
|
||||
reference.height = txo['height']
|
||||
return
|
||||
|
||||
|
||||
class Censor:
|
||||
@@ -33,12 +49,12 @@ class Censor:
|
||||
self.total += 1
|
||||
return was_censored
|
||||
|
||||
def to_message(self, outputs: OutputsMessage):
|
||||
def to_message(self, outputs: OutputsMessage, extra_txo_rows):
|
||||
outputs.blocked_total = self.total
|
||||
for censoring_channel_hash, count in self.censored.items():
|
||||
block = outputs.blocked.add()
|
||||
block.count = count
|
||||
block.channel_hash = censoring_channel_hash
|
||||
blocked = outputs.blocked.add()
|
||||
blocked.count = count
|
||||
set_reference(blocked.channel, censoring_channel_hash, extra_txo_rows)
|
||||
|
||||
|
||||
class Outputs:
|
||||
@@ -60,21 +76,35 @@ class Outputs:
|
||||
for txo_message in self.extra_txos:
|
||||
self.message_to_txo(txo_message, tx_map)
|
||||
txos = [self.message_to_txo(txo_message, tx_map) for txo_message in self.txos]
|
||||
return txos, self.inflate_blocked()
|
||||
return txos, self.inflate_blocked(tx_map)
|
||||
|
||||
def inflate_blocked(self):
|
||||
def inflate_blocked(self, tx_map):
|
||||
return {
|
||||
"total": self.blocked_total,
|
||||
"channels": {
|
||||
hexlify(message.channel_hash[::-1]).decode(): message.count
|
||||
for message in self.blocked
|
||||
}
|
||||
"channels": [{
|
||||
'channel': self.message_to_txo(blocked.channel, tx_map),
|
||||
'blocked': blocked.count
|
||||
} for blocked in self.blocked]
|
||||
}
|
||||
|
||||
def message_to_txo(self, txo_message, tx_map):
|
||||
if txo_message.WhichOneof('meta') == 'error':
|
||||
return None
|
||||
txo = tx_map[txo_message.tx_hash].outputs[txo_message.nout]
|
||||
error = {
|
||||
'error': {
|
||||
'name': txo_message.error.Code.Name(txo_message.error.code),
|
||||
'text': txo_message.error.text,
|
||||
}
|
||||
}
|
||||
if error['error']['name'] == BLOCKED:
|
||||
error['error']['censor'] = self.message_to_txo(
|
||||
txo_message.error.blocked.channel, tx_map
|
||||
)
|
||||
return error
|
||||
|
||||
tx = tx_map.get(txo_message.tx_hash)
|
||||
if not tx:
|
||||
return
|
||||
txo = tx.outputs[txo_message.nout]
|
||||
if txo_message.WhichOneof('meta') == 'claim':
|
||||
claim = txo_message.claim
|
||||
txo.meta = {
|
||||
@@ -134,7 +164,7 @@ class Outputs:
|
||||
if total is not None:
|
||||
page.total = total
|
||||
if blocked is not None:
|
||||
blocked.to_message(page)
|
||||
blocked.to_message(page, extra_txo_rows)
|
||||
for row in txo_rows:
|
||||
cls.row_to_message(row, page.txos.add(), extra_txo_rows)
|
||||
for row in extra_txo_rows:
|
||||
@@ -146,9 +176,12 @@ class Outputs:
|
||||
if isinstance(txo, Exception):
|
||||
txo_message.error.text = txo.args[0]
|
||||
if isinstance(txo, ValueError):
|
||||
txo_message.error.code = txo_message.error.INVALID
|
||||
txo_message.error.code = ErrorMessage.INVALID
|
||||
elif isinstance(txo, LookupError):
|
||||
txo_message.error.code = txo_message.error.NOT_FOUND
|
||||
txo_message.error.code = ErrorMessage.NOT_FOUND
|
||||
elif isinstance(txo, ResolveCensoredError):
|
||||
txo_message.error.code = ErrorMessage.BLOCKED
|
||||
set_reference(txo_message.error.blocked.channel, txo.censor_hash, extra_txo_rows)
|
||||
return
|
||||
txo_message.tx_hash = txo['txo_hash'][:32]
|
||||
txo_message.nout, = struct.unpack('<I', txo['txo_hash'][32:])
|
||||
@@ -171,20 +204,5 @@ class Outputs:
|
||||
txo_message.claim.trending_mixed = txo['trending_mixed']
|
||||
txo_message.claim.trending_local = txo['trending_local']
|
||||
txo_message.claim.trending_global = txo['trending_global']
|
||||
cls.set_reference(txo_message, 'channel', txo['channel_hash'], extra_txo_rows)
|
||||
cls.set_reference(txo_message, 'repost', txo['reposted_claim_hash'], extra_txo_rows)
|
||||
|
||||
@staticmethod
|
||||
def set_blocked(message, blocked):
|
||||
message.blocked_total = blocked.total
|
||||
|
||||
@staticmethod
|
||||
def set_reference(message, attr, claim_hash, rows):
|
||||
if claim_hash:
|
||||
for txo in rows:
|
||||
if claim_hash == txo['claim_hash']:
|
||||
reference = getattr(message.claim, attr)
|
||||
reference.tx_hash = txo['txo_hash'][:32]
|
||||
reference.nout = struct.unpack('<I', txo['txo_hash'][32:])[0]
|
||||
reference.height = txo['height']
|
||||
break
|
||||
set_reference(txo_message.claim.channel, txo['channel_hash'], extra_txo_rows)
|
||||
set_reference(txo_message.claim.repost, txo['reposted_claim_hash'], extra_txo_rows)
|
||||
@@ -19,7 +19,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='result.proto',
|
||||
package='pb',
|
||||
syntax='proto3',
|
||||
serialized_pb=_b('\n\x0cresult.proto\x12\x02pb\"\x97\x01\n\x07Outputs\x12\x18\n\x04txos\x18\x01 \x03(\x0b\x32\n.pb.Output\x12\x1e\n\nextra_txos\x18\x02 \x03(\x0b\x32\n.pb.Output\x12\r\n\x05total\x18\x03 \x01(\r\x12\x0e\n\x06offset\x18\x04 \x01(\r\x12\x1c\n\x07\x62locked\x18\x05 \x03(\x0b\x32\x0b.pb.Blocked\x12\x15\n\rblocked_total\x18\x06 \x01(\r\"{\n\x06Output\x12\x0f\n\x07tx_hash\x18\x01 \x01(\x0c\x12\x0c\n\x04nout\x18\x02 \x01(\r\x12\x0e\n\x06height\x18\x03 \x01(\r\x12\x1e\n\x05\x63laim\x18\x07 \x01(\x0b\x32\r.pb.ClaimMetaH\x00\x12\x1a\n\x05\x65rror\x18\x0f \x01(\x0b\x32\t.pb.ErrorH\x00\x42\x06\n\x04meta\"\xaf\x03\n\tClaimMeta\x12\x1b\n\x07\x63hannel\x18\x01 \x01(\x0b\x32\n.pb.Output\x12\x1a\n\x06repost\x18\x02 \x01(\x0b\x32\n.pb.Output\x12\x11\n\tshort_url\x18\x03 \x01(\t\x12\x15\n\rcanonical_url\x18\x04 \x01(\t\x12\x16\n\x0eis_controlling\x18\x05 \x01(\x08\x12\x18\n\x10take_over_height\x18\x06 \x01(\r\x12\x17\n\x0f\x63reation_height\x18\x07 \x01(\r\x12\x19\n\x11\x61\x63tivation_height\x18\x08 \x01(\r\x12\x19\n\x11\x65xpiration_height\x18\t \x01(\r\x12\x19\n\x11\x63laims_in_channel\x18\n \x01(\r\x12\x10\n\x08reposted\x18\x0b \x01(\r\x12\x18\n\x10\x65\x66\x66\x65\x63tive_amount\x18\x14 \x01(\x04\x12\x16\n\x0esupport_amount\x18\x15 \x01(\x04\x12\x16\n\x0etrending_group\x18\x16 \x01(\r\x12\x16\n\x0etrending_mixed\x18\x17 \x01(\x02\x12\x16\n\x0etrending_local\x18\x18 \x01(\x02\x12\x17\n\x0ftrending_global\x18\x19 \x01(\x02\"\x94\x01\n\x05\x45rror\x12\x1c\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x0e.pb.Error.Code\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x1c\n\x07\x62locked\x18\x03 \x01(\x0b\x32\x0b.pb.Blocked\"A\n\x04\x43ode\x12\x10\n\x0cUNKNOWN_CODE\x10\x00\x12\r\n\tNOT_FOUND\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\x0b\n\x07\x42LOCKED\x10\x03\".\n\x07\x42locked\x12\r\n\x05\x63ount\x18\x01 \x01(\r\x12\x14\n\x0c\x63hannel_hash\x18\x02 \x01(\x0c\x62\x06proto3')
|
||||
serialized_pb=_b('\n\x0cresult.proto\x12\x02pb\"\x97\x01\n\x07Outputs\x12\x18\n\x04txos\x18\x01 \x03(\x0b\x32\n.pb.Output\x12\x1e\n\nextra_txos\x18\x02 \x03(\x0b\x32\n.pb.Output\x12\r\n\x05total\x18\x03 \x01(\r\x12\x0e\n\x06offset\x18\x04 \x01(\r\x12\x1c\n\x07\x62locked\x18\x05 \x03(\x0b\x32\x0b.pb.Blocked\x12\x15\n\rblocked_total\x18\x06 \x01(\r\"{\n\x06Output\x12\x0f\n\x07tx_hash\x18\x01 \x01(\x0c\x12\x0c\n\x04nout\x18\x02 \x01(\r\x12\x0e\n\x06height\x18\x03 \x01(\r\x12\x1e\n\x05\x63laim\x18\x07 \x01(\x0b\x32\r.pb.ClaimMetaH\x00\x12\x1a\n\x05\x65rror\x18\x0f \x01(\x0b\x32\t.pb.ErrorH\x00\x42\x06\n\x04meta\"\xaf\x03\n\tClaimMeta\x12\x1b\n\x07\x63hannel\x18\x01 \x01(\x0b\x32\n.pb.Output\x12\x1a\n\x06repost\x18\x02 \x01(\x0b\x32\n.pb.Output\x12\x11\n\tshort_url\x18\x03 \x01(\t\x12\x15\n\rcanonical_url\x18\x04 \x01(\t\x12\x16\n\x0eis_controlling\x18\x05 \x01(\x08\x12\x18\n\x10take_over_height\x18\x06 \x01(\r\x12\x17\n\x0f\x63reation_height\x18\x07 \x01(\r\x12\x19\n\x11\x61\x63tivation_height\x18\x08 \x01(\r\x12\x19\n\x11\x65xpiration_height\x18\t \x01(\r\x12\x19\n\x11\x63laims_in_channel\x18\n \x01(\r\x12\x10\n\x08reposted\x18\x0b \x01(\r\x12\x18\n\x10\x65\x66\x66\x65\x63tive_amount\x18\x14 \x01(\x04\x12\x16\n\x0esupport_amount\x18\x15 \x01(\x04\x12\x16\n\x0etrending_group\x18\x16 \x01(\r\x12\x16\n\x0etrending_mixed\x18\x17 \x01(\x02\x12\x16\n\x0etrending_local\x18\x18 \x01(\x02\x12\x17\n\x0ftrending_global\x18\x19 \x01(\x02\"\x94\x01\n\x05\x45rror\x12\x1c\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x0e.pb.Error.Code\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x1c\n\x07\x62locked\x18\x03 \x01(\x0b\x32\x0b.pb.Blocked\"A\n\x04\x43ode\x12\x10\n\x0cUNKNOWN_CODE\x10\x00\x12\r\n\tNOT_FOUND\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\x0b\n\x07\x42LOCKED\x10\x03\"5\n\x07\x42locked\x12\r\n\x05\x63ount\x18\x01 \x01(\r\x12\x1b\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\n.pb.Outputb\x06proto3')
|
||||
)
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
@@ -388,9 +388,9 @@ _BLOCKED = _descriptor.Descriptor(
|
||||
is_extension=False, extension_scope=None,
|
||||
options=None),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='channel_hash', full_name='pb.Blocked.channel_hash', index=1,
|
||||
number=2, type=12, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b(""),
|
||||
name='channel', full_name='pb.Blocked.channel', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=None),
|
||||
@@ -407,7 +407,7 @@ _BLOCKED = _descriptor.Descriptor(
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=884,
|
||||
serialized_end=930,
|
||||
serialized_end=937,
|
||||
)
|
||||
|
||||
_OUTPUTS.fields_by_name['txos'].message_type = _OUTPUT
|
||||
@@ -426,6 +426,7 @@ _CLAIMMETA.fields_by_name['repost'].message_type = _OUTPUT
|
||||
_ERROR.fields_by_name['code'].enum_type = _ERROR_CODE
|
||||
_ERROR.fields_by_name['blocked'].message_type = _BLOCKED
|
||||
_ERROR_CODE.containing_type = _ERROR
|
||||
_BLOCKED.fields_by_name['channel'].message_type = _OUTPUT
|
||||
DESCRIPTOR.message_types_by_name['Outputs'] = _OUTPUTS
|
||||
DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT
|
||||
DESCRIPTOR.message_types_by_name['ClaimMeta'] = _CLAIMMETA
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ def _create_url_regex():
|
||||
# see https://spec.lbry.com/ and test_url.py
|
||||
invalid_names_regex = \
|
||||
r"[^=&#:$@%?;\"/\\<>%{}|^~`\[\]" \
|
||||
r"\u0000-\u0008\u000b-\u000c\u000e-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]+"
|
||||
r"\u0000-\u0020\uD800-\uDFFF\uFFFE-\uFFFF]+"
|
||||
|
||||
def _named(name, regex):
|
||||
return "(?P<" + name + ">" + regex + ")"
|
||||
|
||||
@@ -77,7 +77,7 @@ class StreamManager:
|
||||
self.resume_saving_task: Optional[asyncio.Task] = None
|
||||
self.re_reflect_task: Optional[asyncio.Task] = None
|
||||
self.update_stream_finished_futs: typing.List[asyncio.Future] = []
|
||||
self.running_reflector_uploads: typing.List[asyncio.Task] = []
|
||||
self.running_reflector_uploads: typing.Dict[str, asyncio.Task] = {}
|
||||
self.started = asyncio.Event(loop=self.loop)
|
||||
|
||||
async def _update_content_claim(self, stream: ManagedStream):
|
||||
@@ -185,10 +185,10 @@ class StreamManager:
|
||||
batch = []
|
||||
while sd_hashes:
|
||||
stream = self.streams[sd_hashes.pop()]
|
||||
if self.blob_manager.is_blob_verified(stream.sd_hash) and stream.blobs_completed:
|
||||
if not stream.fully_reflected.is_set():
|
||||
host, port = random.choice(self.config.reflector_servers)
|
||||
batch.append(stream.upload_to_reflector(host, port))
|
||||
if self.blob_manager.is_blob_verified(stream.sd_hash) and stream.blobs_completed and \
|
||||
stream.sd_hash not in self.running_reflector_uploads and not \
|
||||
stream.fully_reflected.is_set():
|
||||
batch.append(self.reflect_stream(stream))
|
||||
if len(batch) >= self.config.concurrent_reflector_uploads:
|
||||
await asyncio.gather(*batch, loop=self.loop)
|
||||
batch = []
|
||||
@@ -212,26 +212,37 @@ class StreamManager:
|
||||
while self.update_stream_finished_futs:
|
||||
self.update_stream_finished_futs.pop().cancel()
|
||||
while self.running_reflector_uploads:
|
||||
self.running_reflector_uploads.pop().cancel()
|
||||
_, t = self.running_reflector_uploads.popitem()
|
||||
t.cancel()
|
||||
self.started.clear()
|
||||
log.info("finished stopping the stream manager")
|
||||
|
||||
def reflect_stream(self, stream: ManagedStream, server: Optional[str] = None,
|
||||
port: Optional[int] = None) -> asyncio.Task:
|
||||
if not server or not port:
|
||||
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))
|
||||
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
|
||||
self.running_reflector_uploads.pop(stream.sd_hash)
|
||||
)
|
||||
return task
|
||||
|
||||
async def create_stream(self, file_path: str, key: Optional[bytes] = None,
|
||||
iv_generator: Optional[typing.Generator[bytes, None, None]] = None) -> ManagedStream:
|
||||
stream = await ManagedStream.create(self.loop, self.config, self.blob_manager, file_path, key, iv_generator)
|
||||
self.streams[stream.sd_hash] = stream
|
||||
self.storage.content_claim_callbacks[stream.stream_hash] = lambda: self._update_content_claim(stream)
|
||||
if self.config.reflect_streams and self.config.reflector_servers:
|
||||
host, port = random.choice(self.config.reflector_servers)
|
||||
task = self.loop.create_task(stream.upload_to_reflector(host, port))
|
||||
self.running_reflector_uploads.append(task)
|
||||
task.add_done_callback(
|
||||
lambda _: None
|
||||
if task not in self.running_reflector_uploads else self.running_reflector_uploads.remove(task)
|
||||
)
|
||||
self.reflect_stream(stream)
|
||||
return stream
|
||||
|
||||
async def delete_stream(self, stream: ManagedStream, delete_file: Optional[bool] = False):
|
||||
if stream.sd_hash in self.running_reflector_uploads:
|
||||
self.running_reflector_uploads[stream.sd_hash].cancel()
|
||||
stream.stop_tasks()
|
||||
if stream.sd_hash in self.streams:
|
||||
del self.streams[stream.sd_hash]
|
||||
|
||||
@@ -555,6 +555,12 @@ class CommandTestCase(IntegrationTestCase):
|
||||
async def claim_list(self, *args, **kwargs):
|
||||
return (await self.out(self.daemon.jsonrpc_claim_list(*args, **kwargs)))['items']
|
||||
|
||||
async def stream_list(self, *args, **kwargs):
|
||||
return (await self.out(self.daemon.jsonrpc_stream_list(*args, **kwargs)))['items']
|
||||
|
||||
async def channel_list(self, *args, **kwargs):
|
||||
return (await self.out(self.daemon.jsonrpc_channel_list(*args, **kwargs)))['items']
|
||||
|
||||
@staticmethod
|
||||
def get_claim_id(tx):
|
||||
return tx['outputs'][0]['claim_id']
|
||||
|
||||
+17
-10
@@ -134,16 +134,20 @@ def constraints_to_sql(constraints, joiner=' AND ', prepend_key=''):
|
||||
col, op = col[:-len('__not_like')], 'NOT LIKE'
|
||||
elif key.endswith('__in') or key.endswith('__not_in'):
|
||||
if key.endswith('__in'):
|
||||
col, op = col[:-len('__in')], 'IN'
|
||||
col, op, one_val_op = col[:-len('__in')], 'IN', '='
|
||||
else:
|
||||
col, op = col[:-len('__not_in')], 'NOT IN'
|
||||
col, op, one_val_op = col[:-len('__not_in')], 'NOT IN', '!='
|
||||
if constraint:
|
||||
if isinstance(constraint, (list, set, tuple)):
|
||||
keys = []
|
||||
for i, val in enumerate(constraint):
|
||||
keys.append(f':{key}{tag}_{i}')
|
||||
values[f'{key}{tag}_{i}'] = val
|
||||
sql.append(f'{col} {op} ({", ".join(keys)})')
|
||||
if len(constraint) == 1:
|
||||
values[f'{key}{tag}'] = next(iter(constraint))
|
||||
sql.append(f'{col} {one_val_op} :{key}{tag}')
|
||||
else:
|
||||
keys = []
|
||||
for i, val in enumerate(constraint):
|
||||
keys.append(f':{key}{tag}_{i}')
|
||||
values[f'{key}{tag}_{i}'] = val
|
||||
sql.append(f'{col} {op} ({", ".join(keys)})')
|
||||
elif isinstance(constraint, str):
|
||||
sql.append(f'{col} {op} ({constraint})')
|
||||
else:
|
||||
@@ -631,6 +635,7 @@ class Database(SQLiteMixin):
|
||||
return txos
|
||||
|
||||
async def get_txo_count(self, **constraints):
|
||||
constraints.pop('resolve', None)
|
||||
constraints.pop('wallet', None)
|
||||
constraints.pop('offset', None)
|
||||
constraints.pop('limit', None)
|
||||
@@ -738,9 +743,11 @@ class Database(SQLiteMixin):
|
||||
|
||||
@staticmethod
|
||||
def constrain_claims(constraints):
|
||||
claim_type = constraints.pop('claim_type', None)
|
||||
if claim_type is not None:
|
||||
constraints['txo_type'] = TXO_TYPES[claim_type]
|
||||
claim_types = constraints.pop('claim_type', None)
|
||||
if isinstance(claim_types, str) and claim_types:
|
||||
claim_types = [claim_types]
|
||||
if isinstance(claim_types, list) and claim_types:
|
||||
constraints['txo_type__in'] = [TXO_TYPES[ct] for ct in claim_types]
|
||||
else:
|
||||
constraints['txo_type__in'] = CLAIM_TYPES
|
||||
|
||||
|
||||
+36
-13
@@ -12,7 +12,7 @@ from binascii import hexlify, unhexlify
|
||||
from typing import Dict, Tuple, Type, Iterable, List, Optional, DefaultDict
|
||||
|
||||
import pylru
|
||||
from lbry.schema.result import Outputs
|
||||
from lbry.schema.result import Outputs, INVALID, NOT_FOUND
|
||||
from lbry.schema.url import URL
|
||||
from lbry.crypto.hash import hash160, double_sha256, sha256
|
||||
from lbry.crypto.base58 import Base58
|
||||
@@ -630,7 +630,8 @@ class Ledger(metaclass=LedgerRegistry):
|
||||
raise asyncio.TimeoutError('Timed out waiting for transaction.')
|
||||
|
||||
async def _inflate_outputs(self, query, accounts) -> Tuple[List[Output], dict, int, int]:
|
||||
outputs = Outputs.from_base64(await query)
|
||||
encoded_outputs = await query
|
||||
outputs = Outputs.from_base64(encoded_outputs or b'') # TODO: why is the server returning None?
|
||||
txs = []
|
||||
if len(outputs.txs) > 0:
|
||||
txs: List[Transaction] = await asyncio.gather(*(
|
||||
@@ -661,13 +662,13 @@ class Ledger(metaclass=LedgerRegistry):
|
||||
assert len(urls) == len(txos), "Mismatch between urls requested for resolve and responses received."
|
||||
result = {}
|
||||
for url, txo in zip(urls, txos):
|
||||
if txo and URL.parse(url).has_stream_in_channel:
|
||||
if not txo.channel or not txo.is_signed_by(txo.channel, self):
|
||||
txo = None
|
||||
if txo:
|
||||
result[url] = txo
|
||||
if isinstance(txo, Output) and URL.parse(url).has_stream_in_channel:
|
||||
if not txo.channel or not txo.is_signed_by(txo.channel, self):
|
||||
txo = {'error': {'name': INVALID, 'text': f'{url} has invalid channel signature'}}
|
||||
else:
|
||||
result[url] = {'error': f'{url} did not resolve to a claim'}
|
||||
txo = {'error': {'name': NOT_FOUND, 'text': f'{url} did not resolve to a claim'}}
|
||||
result[url] = txo
|
||||
return result
|
||||
|
||||
async def claim_search(self, accounts, **kwargs) -> Tuple[List[Output], dict, int, int]:
|
||||
@@ -732,20 +733,42 @@ class Ledger(metaclass=LedgerRegistry):
|
||||
def get_purchase_count(self, resolve=False, **constraints):
|
||||
return self.db.get_purchase_count(**constraints)
|
||||
|
||||
def get_claims(self, **constraints):
|
||||
return self.db.get_claims(**constraints)
|
||||
async def _resolve_for_local_results(self, accounts, txos):
|
||||
results = []
|
||||
response = await self.resolve(accounts, [txo.permanent_url for txo in txos])
|
||||
for txo in txos:
|
||||
resolved = response[txo.permanent_url]
|
||||
if isinstance(resolved, Output):
|
||||
results.append(resolved)
|
||||
else:
|
||||
if isinstance(resolved, dict) and 'error' in resolved:
|
||||
txo.meta['error'] = resolved['error']
|
||||
results.append(txo)
|
||||
return results
|
||||
|
||||
async def get_claims(self, resolve=False, **constraints):
|
||||
claims = await self.db.get_claims(**constraints)
|
||||
if resolve:
|
||||
return await self._resolve_for_local_results(constraints.get('accounts', []), claims)
|
||||
return claims
|
||||
|
||||
def get_claim_count(self, **constraints):
|
||||
return self.db.get_claim_count(**constraints)
|
||||
|
||||
def get_streams(self, **constraints):
|
||||
return self.db.get_streams(**constraints)
|
||||
async def get_streams(self, resolve=False, **constraints):
|
||||
streams = await self.db.get_streams(**constraints)
|
||||
if resolve:
|
||||
return await self._resolve_for_local_results(constraints.get('accounts', []), streams)
|
||||
return streams
|
||||
|
||||
def get_stream_count(self, **constraints):
|
||||
return self.db.get_stream_count(**constraints)
|
||||
|
||||
def get_channels(self, **constraints):
|
||||
return self.db.get_channels(**constraints)
|
||||
async def get_channels(self, resolve=False, **constraints):
|
||||
channels = await self.db.get_channels(**constraints)
|
||||
if resolve:
|
||||
return await self._resolve_for_local_results(constraints.get('accounts', []), channels)
|
||||
return channels
|
||||
|
||||
def get_channel_count(self, **constraints):
|
||||
return self.db.get_channel_count(**constraints)
|
||||
|
||||
@@ -87,7 +87,7 @@ class ClientSession(BaseClientSession):
|
||||
async def ensure_session(self):
|
||||
# Handles reconnecting and maintaining a session alive
|
||||
# TODO: change to 'ping' on newer protocol (above 1.2)
|
||||
retry_delay = default_delay = 300.0
|
||||
retry_delay = default_delay = 1.0
|
||||
while True:
|
||||
try:
|
||||
if self.is_closing():
|
||||
@@ -107,6 +107,7 @@ class ClientSession(BaseClientSession):
|
||||
log.debug("Wallet server has an incompatible version, retrying in 1h: %s:%d", *self.server)
|
||||
except (asyncio.TimeoutError, OSError):
|
||||
await self.close()
|
||||
retry_delay = min(60, retry_delay * 2)
|
||||
log.debug("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
||||
try:
|
||||
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
||||
@@ -147,7 +148,7 @@ class ClientSession(BaseClientSession):
|
||||
class Network:
|
||||
|
||||
PROTOCOL_VERSION = __version__
|
||||
MINIMUM_REQUIRED = (0, 54, 0)
|
||||
MINIMUM_REQUIRED = (0, 59, 0)
|
||||
|
||||
def __init__(self, ledger):
|
||||
self.ledger = ledger
|
||||
|
||||
@@ -228,6 +228,7 @@ class BlockchainProcess(asyncio.SubprocessProtocol):
|
||||
|
||||
def process_exited(self):
|
||||
self.stopped.set()
|
||||
self.ready.set()
|
||||
|
||||
|
||||
class BlockchainNode:
|
||||
@@ -315,6 +316,7 @@ class BlockchainNode:
|
||||
BlockchainProcess, *command
|
||||
)
|
||||
await self.protocol.ready.wait()
|
||||
assert not self.protocol.stopped.is_set()
|
||||
|
||||
async def stop(self, cleanup=True):
|
||||
try:
|
||||
|
||||
@@ -40,6 +40,7 @@ from .jsonrpc import Request, JSONRPCConnection, JSONRPCv2, JSONRPC, Batch, Noti
|
||||
from .jsonrpc import RPCError, ProtocolError
|
||||
from .framing import BadMagicError, BadChecksumError, OversizedPayloadError, BitcoinFramer, NewlineFramer
|
||||
from .util import Concurrency
|
||||
from lbry.wallet.server.prometheus import NOTIFICATION_COUNT, RESPONSE_TIMES, REQUEST_ERRORS_COUNT
|
||||
|
||||
|
||||
class Connector:
|
||||
@@ -379,6 +380,7 @@ class RPCSession(SessionBase):
|
||||
def __init__(self, *, framer=None, loop=None, connection=None):
|
||||
super().__init__(framer=framer, loop=loop)
|
||||
self.connection = connection or self.default_connection()
|
||||
self.client_version = 'unknown'
|
||||
|
||||
async def _receive_messages(self):
|
||||
while not self.is_closing():
|
||||
@@ -405,6 +407,7 @@ class RPCSession(SessionBase):
|
||||
await self._task_group.add(self._handle_request(request))
|
||||
|
||||
async def _handle_request(self, request):
|
||||
start = time.perf_counter()
|
||||
try:
|
||||
result = await self.handle_request(request)
|
||||
except (ProtocolError, RPCError) as e:
|
||||
@@ -417,10 +420,18 @@ class RPCSession(SessionBase):
|
||||
'internal server error')
|
||||
if isinstance(request, Request):
|
||||
message = request.send_result(result)
|
||||
RESPONSE_TIMES.labels(
|
||||
method=request.method,
|
||||
version=self.client_version
|
||||
).observe(time.perf_counter() - start)
|
||||
if message:
|
||||
await self._send_message(message)
|
||||
if isinstance(result, Exception):
|
||||
self._bump_errors()
|
||||
REQUEST_ERRORS_COUNT.labels(
|
||||
method=request.method,
|
||||
version=self.client_version
|
||||
).inc()
|
||||
|
||||
def connection_lost(self, exc):
|
||||
# Cancel pending requests and message processing
|
||||
@@ -454,6 +465,7 @@ class RPCSession(SessionBase):
|
||||
async def send_notification(self, method, args=()):
|
||||
"""Send an RPC notification over the network."""
|
||||
message = self.connection.send_notification(Notification(method, args))
|
||||
NOTIFICATION_COUNT.labels(method=method, version=self.client_version).inc()
|
||||
await self._send_message(message)
|
||||
|
||||
def send_batch(self, raise_errors=False):
|
||||
|
||||
@@ -9,6 +9,7 @@ from lbry.wallet.server.daemon import DaemonError
|
||||
from lbry.wallet.server.hash import hash_to_hex_str, HASHX_LEN
|
||||
from lbry.wallet.server.util import chunks, class_logger
|
||||
from lbry.wallet.server.leveldb import FlushData
|
||||
from lbry.wallet.server.prometheus import BLOCK_COUNT, BLOCK_UPDATE_TIMES
|
||||
|
||||
|
||||
class Prefetcher:
|
||||
@@ -163,6 +164,7 @@ class BlockProcessor:
|
||||
# is consistent with self.height
|
||||
self.state_lock = asyncio.Lock()
|
||||
|
||||
self.search_cache = {}
|
||||
async def run_in_thread_with_lock(self, func, *args):
|
||||
# Run in a thread to prevent blocking. Shielded so that
|
||||
# cancellations from shutdown don't lose work - when the task
|
||||
@@ -188,14 +190,17 @@ class BlockProcessor:
|
||||
chain = [self.tip] + [self.coin.header_hash(h) for h in headers[:-1]]
|
||||
|
||||
if hprevs == chain:
|
||||
start = time.time()
|
||||
start = time.perf_counter()
|
||||
await self.run_in_thread_with_lock(self.advance_blocks, blocks)
|
||||
for cache in self.search_cache.values():
|
||||
cache.clear()
|
||||
await self._maybe_flush()
|
||||
processed_time = time.perf_counter() - start
|
||||
BLOCK_COUNT.set(self.height)
|
||||
BLOCK_UPDATE_TIMES.observe(processed_time)
|
||||
if not self.db.first_sync:
|
||||
s = '' if len(blocks) == 1 else 's'
|
||||
self.logger.info('processed {:,d} block{} in {:.1f}s'
|
||||
.format(len(blocks), s,
|
||||
time.time() - start))
|
||||
self.logger.info('processed {:,d} block{} in {:.1f}s'.format(len(blocks), s, processed_time))
|
||||
if self._caught_up_event.is_set():
|
||||
await self.notifications.on_block(self.touched, self.height)
|
||||
self.touched = set()
|
||||
@@ -727,7 +732,6 @@ class LBRYBlockProcessor(BlockProcessor):
|
||||
self.logger.info(f"LbryumX Block Processor - Validating signatures: {self.should_validate_signatures}")
|
||||
self.sql: SQLDB = self.db.sql
|
||||
self.timer = Timer('BlockProcessor')
|
||||
self.search_cache = {}
|
||||
|
||||
def advance_blocks(self, blocks):
|
||||
self.sql.begin()
|
||||
@@ -742,8 +746,6 @@ class LBRYBlockProcessor(BlockProcessor):
|
||||
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')
|
||||
for cache in self.search_cache.values():
|
||||
cache.clear()
|
||||
|
||||
def advance_txs(self, height, txs, header):
|
||||
timer = self.timer.sub_timers['advance_blocks']
|
||||
|
||||
@@ -9,7 +9,7 @@ import aiohttp
|
||||
from lbry.wallet.rpc.jsonrpc import RPCError
|
||||
from lbry.wallet.server.util import hex_to_bytes, class_logger
|
||||
from lbry.wallet.rpc import JSONRPC
|
||||
|
||||
from lbry.wallet.server.prometheus import LBRYCRD_REQUEST_TIMES, LBRYCRD_PENDING_COUNT
|
||||
|
||||
class DaemonError(Exception):
|
||||
"""Raised when the daemon returns an error in its results."""
|
||||
@@ -106,6 +106,7 @@ class Daemon:
|
||||
Handles temporary connection issues. Daemon response errors
|
||||
are raise through DaemonError.
|
||||
"""
|
||||
|
||||
def log_error(error):
|
||||
nonlocal last_error_log, retry
|
||||
now = time.time()
|
||||
@@ -119,8 +120,13 @@ class Daemon:
|
||||
last_error_log = 0
|
||||
data = json.dumps(payload)
|
||||
retry = self.init_retry
|
||||
methods = tuple(
|
||||
[payload['method']] if isinstance(payload, dict) else [request['method'] for request in payload]
|
||||
)
|
||||
while True:
|
||||
try:
|
||||
for method in methods:
|
||||
LBRYCRD_PENDING_COUNT.labels(method=method).inc()
|
||||
result = await self._send_data(data)
|
||||
result = processor(result)
|
||||
if on_good_message:
|
||||
@@ -143,12 +149,17 @@ class Daemon:
|
||||
except WorkQueueFullError:
|
||||
log_error('work queue full.')
|
||||
on_good_message = 'running normally'
|
||||
|
||||
finally:
|
||||
for method in methods:
|
||||
LBRYCRD_PENDING_COUNT.labels(method=method).dec()
|
||||
await asyncio.sleep(retry)
|
||||
retry = max(min(self.max_retry, retry * 2), self.init_retry)
|
||||
|
||||
async def _send_single(self, method, params=None):
|
||||
"""Send a single request to the daemon."""
|
||||
|
||||
start = time.perf_counter()
|
||||
|
||||
def processor(result):
|
||||
err = result['error']
|
||||
if not err:
|
||||
@@ -160,7 +171,9 @@ class Daemon:
|
||||
payload = {'method': method, 'id': next(self.id_counter)}
|
||||
if params:
|
||||
payload['params'] = params
|
||||
return await self._send(payload, processor)
|
||||
result = await self._send(payload, processor)
|
||||
LBRYCRD_REQUEST_TIMES.labels(method=method).observe(time.perf_counter() - start)
|
||||
return result
|
||||
|
||||
async def _send_vector(self, method, params_iterable, replace_errs=False):
|
||||
"""Send several requests of the same method.
|
||||
@@ -168,6 +181,9 @@ class Daemon:
|
||||
The result will be an array of the same length as params_iterable.
|
||||
If replace_errs is true, any item with an error is returned as None,
|
||||
otherwise an exception is raised."""
|
||||
|
||||
start = time.perf_counter()
|
||||
|
||||
def processor(result):
|
||||
errs = [item['error'] for item in result if item['error']]
|
||||
if any(err.get('code') == self.WARMING_UP for err in errs):
|
||||
@@ -178,9 +194,11 @@ class Daemon:
|
||||
|
||||
payload = [{'method': method, 'params': p, 'id': next(self.id_counter)}
|
||||
for p in params_iterable]
|
||||
result = []
|
||||
if payload:
|
||||
return await self._send(payload, processor)
|
||||
return []
|
||||
result = await self._send(payload, processor)
|
||||
LBRYCRD_REQUEST_TIMES.labels(method=method).observe(time.perf_counter()-start)
|
||||
return result
|
||||
|
||||
async def _is_rpc_available(self, method):
|
||||
"""Return whether given RPC method is available in the daemon.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
CLAIM_TYPES = {
|
||||
'stream': 1,
|
||||
'channel': 2,
|
||||
'repost': 3
|
||||
}
|
||||
|
||||
STREAM_TYPES = {
|
||||
|
||||
@@ -8,10 +8,11 @@ from binascii import unhexlify
|
||||
from decimal import Decimal
|
||||
from contextvars import ContextVar
|
||||
from functools import wraps
|
||||
from itertools import chain
|
||||
from dataclasses import dataclass
|
||||
|
||||
from lbry.wallet.database import query, interpolate
|
||||
|
||||
from lbry.error import ResolveCensoredError
|
||||
from lbry.schema.url import URL, normalize_name
|
||||
from lbry.schema.tags import clean_tags
|
||||
from lbry.schema.result import Outputs, Censor
|
||||
@@ -37,7 +38,7 @@ ATTRIBUTE_ARRAY_MAX_LENGTH = 100
|
||||
|
||||
INTEGER_PARAMS = {
|
||||
'height', 'creation_height', 'activation_height', 'expiration_height',
|
||||
'timestamp', 'creation_timestamp', 'release_time', 'fee_amount',
|
||||
'timestamp', 'creation_timestamp', 'duration', 'release_time', 'fee_amount',
|
||||
'tx_position', 'channel_join', 'reposted',
|
||||
'amount', 'effective_amount', 'support_amount',
|
||||
'trending_group', 'trending_mixed',
|
||||
@@ -265,7 +266,7 @@ def claims_query(cols, for_count=False, **constraints) -> Tuple[str, Dict]:
|
||||
else:
|
||||
constraints['claim.claim_id__like'] = f'{claim_id[:40]}%'
|
||||
elif 'claim_ids' in constraints:
|
||||
constraints['claim.claim_id__in'] = constraints.pop('claim_ids')
|
||||
constraints['claim.claim_id__in'] = set(constraints.pop('claim_ids'))
|
||||
|
||||
if 'reposted_claim_id' in constraints:
|
||||
constraints['claim.reposted_claim_hash'] = unhexlify(constraints.pop('reposted_claim_id'))[::-1]
|
||||
@@ -281,15 +282,15 @@ def claims_query(cols, for_count=False, **constraints) -> Tuple[str, Dict]:
|
||||
if 'channel_ids' in constraints:
|
||||
channel_ids = constraints.pop('channel_ids')
|
||||
if channel_ids:
|
||||
constraints['claim.channel_hash__in'] = [
|
||||
constraints['claim.channel_hash__in'] = {
|
||||
unhexlify(cid)[::-1] for cid in channel_ids
|
||||
]
|
||||
}
|
||||
if 'not_channel_ids' in constraints:
|
||||
not_channel_ids = constraints.pop('not_channel_ids')
|
||||
if not_channel_ids:
|
||||
not_channel_ids_binary = [
|
||||
not_channel_ids_binary = {
|
||||
unhexlify(ncid)[::-1] for ncid in not_channel_ids
|
||||
]
|
||||
}
|
||||
if constraints.get('has_channel_signature', False):
|
||||
constraints['claim.channel_hash__not_in'] = not_channel_ids_binary
|
||||
else:
|
||||
@@ -319,13 +320,13 @@ def claims_query(cols, for_count=False, **constraints) -> Tuple[str, Dict]:
|
||||
if 'stream_types' in constraints:
|
||||
stream_types = constraints.pop('stream_types')
|
||||
if stream_types:
|
||||
constraints['claim.stream_type__in'] = [
|
||||
constraints['claim.stream_type__in'] = {
|
||||
STREAM_TYPES[stream_type] for stream_type in stream_types
|
||||
]
|
||||
}
|
||||
if 'media_types' in constraints:
|
||||
media_types = constraints.pop('media_types')
|
||||
if media_types:
|
||||
constraints['claim.media_type__in'] = media_types
|
||||
constraints['claim.media_type__in'] = set(media_types)
|
||||
|
||||
if 'fee_currency' in constraints:
|
||||
constraints['claim.fee_currency'] = constraints.pop('fee_currency').lower()
|
||||
@@ -388,9 +389,13 @@ def search_claims(censor: Censor, **constraints) -> List:
|
||||
)
|
||||
|
||||
|
||||
def _get_referenced_rows(censor: Censor, txo_rows: List[dict]):
|
||||
def _get_referenced_rows(txo_rows: List[dict], censor_channels: List[bytes]):
|
||||
censor = ctx.get().get_resolve_censor()
|
||||
repost_hashes = set(filter(None, map(itemgetter('reposted_claim_hash'), txo_rows)))
|
||||
channel_hashes = set(filter(None, map(itemgetter('channel_hash'), txo_rows)))
|
||||
channel_hashes = set(chain(
|
||||
filter(None, map(itemgetter('channel_hash'), txo_rows)),
|
||||
censor_channels
|
||||
))
|
||||
|
||||
reposted_txos = []
|
||||
if repost_hashes:
|
||||
@@ -404,7 +409,6 @@ def _get_referenced_rows(censor: Censor, txo_rows: List[dict]):
|
||||
# channels must come first for client side inflation to work properly
|
||||
return channel_txos + reposted_txos
|
||||
|
||||
|
||||
@measure
|
||||
def search(constraints) -> Tuple[List, List, int, int, Censor]:
|
||||
assert set(constraints).issubset(SEARCH_PARAMS), \
|
||||
@@ -414,12 +418,10 @@ def search(constraints) -> Tuple[List, List, int, int, Censor]:
|
||||
total = count_claims(**constraints)
|
||||
constraints['offset'] = abs(constraints.get('offset', 0))
|
||||
constraints['limit'] = min(abs(constraints.get('limit', 10)), 50)
|
||||
if 'order_by' not in constraints:
|
||||
constraints['order_by'] = ["claim_hash"]
|
||||
context = ctx.get()
|
||||
search_censor = context.get_search_censor()
|
||||
txo_rows = search_claims(search_censor, **constraints)
|
||||
extra_txo_rows = _get_referenced_rows(context.get_resolve_censor(), txo_rows)
|
||||
extra_txo_rows = _get_referenced_rows(txo_rows, search_censor.censored.keys())
|
||||
return txo_rows, extra_txo_rows, constraints['offset'], total, search_censor
|
||||
|
||||
|
||||
@@ -427,7 +429,8 @@ def search(constraints) -> Tuple[List, List, int, int, Censor]:
|
||||
def resolve(urls) -> Tuple[List, List]:
|
||||
txo_rows = [resolve_url(raw_url) for raw_url in urls]
|
||||
extra_txo_rows = _get_referenced_rows(
|
||||
ctx.get().get_resolve_censor(), [r for r in txo_rows if isinstance(r, dict)]
|
||||
[txo for txo in txo_rows if isinstance(txo, dict)],
|
||||
[txo.censor_hash for txo in txo_rows if isinstance(txo, ResolveCensoredError)]
|
||||
)
|
||||
return txo_rows, extra_txo_rows
|
||||
|
||||
@@ -452,6 +455,8 @@ def resolve_url(raw_url):
|
||||
matches = search_claims(censor, **query, limit=1)
|
||||
if matches:
|
||||
channel = matches[0]
|
||||
elif censor.censored:
|
||||
return ResolveCensoredError(raw_url, next(iter(censor.censored)))
|
||||
else:
|
||||
return LookupError(f'Could not find channel in "{raw_url}".')
|
||||
|
||||
@@ -470,8 +475,10 @@ def resolve_url(raw_url):
|
||||
matches = search_claims(censor, **query, limit=1)
|
||||
if matches:
|
||||
return matches[0]
|
||||
elif censor.censored:
|
||||
return ResolveCensoredError(raw_url, next(iter(censor.censored)))
|
||||
else:
|
||||
return LookupError(f'Could not find stream in "{raw_url}".')
|
||||
return LookupError(f'Could not find claim at "{raw_url}".')
|
||||
|
||||
return channel
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from . import zscore
|
||||
from . import ar
|
||||
|
||||
|
||||
TRENDING_ALGORITHMS = {
|
||||
'zscore': zscore,
|
||||
'ar': ar
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
import copy
|
||||
import math
|
||||
import time
|
||||
|
||||
# Half life in blocks
|
||||
HALF_LIFE = 134
|
||||
|
||||
# Decay coefficient per block
|
||||
DECAY = 0.5**(1.0/HALF_LIFE)
|
||||
|
||||
# How frequently to write trending values to the db
|
||||
SAVE_INTERVAL = 10
|
||||
|
||||
# Renormalisation interval
|
||||
RENORM_INTERVAL = 1000
|
||||
|
||||
# Assertion
|
||||
assert RENORM_INTERVAL % SAVE_INTERVAL == 0
|
||||
|
||||
# Decay coefficient per renormalisation interval
|
||||
DECAY_PER_RENORM = DECAY**(RENORM_INTERVAL)
|
||||
|
||||
# Log trending calculations?
|
||||
TRENDING_LOG = True
|
||||
|
||||
|
||||
def install(connection):
|
||||
"""
|
||||
Install the AR trending algorithm.
|
||||
"""
|
||||
check_trending_values(connection)
|
||||
|
||||
if TRENDING_LOG:
|
||||
f = open("trending_ar.log", "a")
|
||||
f.close()
|
||||
|
||||
# Stub
|
||||
CREATE_TREND_TABLE = ""
|
||||
|
||||
|
||||
def check_trending_values(connection):
|
||||
"""
|
||||
If the trending values appear to be based on the zscore algorithm,
|
||||
reset them. This will allow resyncing from a standard snapshot.
|
||||
"""
|
||||
c = connection.cursor()
|
||||
needs_reset = False
|
||||
for row in c.execute("SELECT COUNT(*) num FROM claim WHERE trending_global <> 0;"):
|
||||
if row[0] != 0:
|
||||
needs_reset = True
|
||||
break
|
||||
|
||||
if needs_reset:
|
||||
print("Resetting some columns. This might take a while...", flush=True, end="")
|
||||
c.execute(""" BEGIN;
|
||||
UPDATE claim SET trending_group = 0;
|
||||
UPDATE claim SET trending_mixed = 0;
|
||||
UPDATE claim SET trending_global = 0;
|
||||
UPDATE claim SET trending_local = 0;
|
||||
COMMIT;""")
|
||||
print("done.")
|
||||
|
||||
|
||||
def spike_height(trending_score, x, x_old, time_boost=1.0):
|
||||
"""
|
||||
Compute the size of a trending spike.
|
||||
"""
|
||||
|
||||
# Change in softened amount
|
||||
change_in_softened_amount = x**0.25 - x_old**0.25
|
||||
|
||||
# Softened change in amount
|
||||
delta = x - x_old
|
||||
softened_change_in_amount = abs(delta)**0.25
|
||||
|
||||
# Softened change in amount counts more for minnows
|
||||
if delta > 0.0:
|
||||
if trending_score >= 0.0:
|
||||
multiplier = 0.1/((trending_score/time_boost + softened_change_in_amount) + 1.0)
|
||||
softened_change_in_amount *= multiplier
|
||||
else:
|
||||
softened_change_in_amount *= -1.0
|
||||
|
||||
return time_boost*(softened_change_in_amount + change_in_softened_amount)
|
||||
|
||||
|
||||
def get_time_boost(height):
|
||||
"""
|
||||
Return the time boost at a given height.
|
||||
"""
|
||||
return 1.0/DECAY**(height % RENORM_INTERVAL)
|
||||
|
||||
|
||||
def trending_log(s):
|
||||
"""
|
||||
Log a string.
|
||||
"""
|
||||
if TRENDING_LOG:
|
||||
fout = open("trending_ar.log", "a")
|
||||
fout.write(s)
|
||||
fout.flush()
|
||||
fout.close()
|
||||
|
||||
class TrendingData:
|
||||
"""
|
||||
An object of this class holds trending data
|
||||
"""
|
||||
def __init__(self):
|
||||
self.claims = {}
|
||||
|
||||
# Have all claims been read from db yet?
|
||||
self.initialised = False
|
||||
|
||||
def insert_claim_from_load(self, claim_hash, trending_score, total_amount):
|
||||
assert not self.initialised
|
||||
self.claims[claim_hash] = {"trending_score": trending_score,
|
||||
"total_amount": total_amount,
|
||||
"changed": False}
|
||||
|
||||
|
||||
def update_claim(self, claim_hash, total_amount, time_boost=1.0):
|
||||
"""
|
||||
Update trending data for a claim, given its new total amount.
|
||||
"""
|
||||
assert self.initialised
|
||||
|
||||
# Extract existing total amount and trending score
|
||||
# or use starting values if the claim is new
|
||||
if claim_hash in self.claims:
|
||||
old_state = copy.deepcopy(self.claims[claim_hash])
|
||||
else:
|
||||
old_state = {"trending_score": 0.0,
|
||||
"total_amount": 0.0,
|
||||
"changed": False}
|
||||
|
||||
# Calculate LBC change
|
||||
change = total_amount - old_state["total_amount"]
|
||||
|
||||
# Modify data if there was an LBC change
|
||||
if change != 0.0:
|
||||
spike = spike_height(old_state["trending_score"],
|
||||
total_amount,
|
||||
old_state["total_amount"],
|
||||
time_boost)
|
||||
trending_score = old_state["trending_score"] + spike
|
||||
self.claims[claim_hash] = {"total_amount": total_amount,
|
||||
"trending_score": trending_score,
|
||||
"changed": True}
|
||||
|
||||
|
||||
|
||||
def test_trending():
|
||||
"""
|
||||
Quick trending test for something receiving 10 LBC per block
|
||||
"""
|
||||
data = TrendingData()
|
||||
data.insert_claim_from_load("abc", 10.0, 1.0)
|
||||
data.initialised = True
|
||||
|
||||
for height in range(1, 5000):
|
||||
|
||||
if height % RENORM_INTERVAL == 0:
|
||||
data.claims["abc"]["trending_score"] *= DECAY_PER_RENORM
|
||||
|
||||
time_boost = get_time_boost(height)
|
||||
data.update_claim("abc", data.claims["abc"]["total_amount"] + 10.0,
|
||||
time_boost=time_boost)
|
||||
|
||||
|
||||
print(str(height) + " " + str(time_boost) + " " \
|
||||
+ str(data.claims["abc"]["trending_score"]))
|
||||
|
||||
|
||||
|
||||
# One global instance
|
||||
# pylint: disable=C0103
|
||||
trending_data = TrendingData()
|
||||
|
||||
def run(db, height, final_height, recalculate_claim_hashes):
|
||||
|
||||
if height < final_height - 5*HALF_LIFE:
|
||||
trending_log("Skipping AR trending at block {h}.\n".format(h=height))
|
||||
return
|
||||
|
||||
start = time.time()
|
||||
|
||||
trending_log("Calculating AR trending at block {h}.\n".format(h=height))
|
||||
trending_log(" Length of trending data = {l}.\n"\
|
||||
.format(l=len(trending_data.claims)))
|
||||
|
||||
# Renormalise trending scores and mark all as having changed
|
||||
if height % RENORM_INTERVAL == 0:
|
||||
trending_log(" Renormalising trending scores...")
|
||||
|
||||
keys = trending_data.claims.keys()
|
||||
for key in keys:
|
||||
if trending_data.claims[key]["trending_score"] != 0.0:
|
||||
trending_data.claims[key]["trending_score"] *= DECAY_PER_RENORM
|
||||
trending_data.claims[key]["changed"] = True
|
||||
|
||||
# Tiny becomes zero
|
||||
if abs(trending_data.claims[key]["trending_score"]) < 1E-9:
|
||||
trending_data.claims[key]["trending_score"] = 0.0
|
||||
|
||||
trending_log("done.\n")
|
||||
|
||||
|
||||
# Regular message.
|
||||
trending_log(" Reading total_amounts from db and updating"\
|
||||
+ " trending scores in RAM...")
|
||||
|
||||
# Get the value of the time boost
|
||||
time_boost = get_time_boost(height)
|
||||
|
||||
# Update claims from db
|
||||
if not trending_data.initialised:
|
||||
# On fresh launch
|
||||
for row in db.execute("""
|
||||
SELECT claim_hash, trending_mixed,
|
||||
(amount + support_amount)
|
||||
AS total_amount
|
||||
FROM claim;
|
||||
"""):
|
||||
trending_data.insert_claim_from_load(row[0], row[1], 1E-8*row[2])
|
||||
trending_data.initialised = True
|
||||
else:
|
||||
for row in db.execute(f"""
|
||||
SELECT claim_hash,
|
||||
(amount + support_amount)
|
||||
AS total_amount
|
||||
FROM claim
|
||||
WHERE claim_hash IN
|
||||
({','.join('?' for _ in recalculate_claim_hashes)});
|
||||
""", recalculate_claim_hashes):
|
||||
trending_data.update_claim(row[0], 1E-8*row[1], time_boost)
|
||||
|
||||
trending_log("done.\n")
|
||||
|
||||
|
||||
# Write trending scores to DB
|
||||
if height % SAVE_INTERVAL == 0:
|
||||
|
||||
trending_log(" Writing trending scores to db...")
|
||||
|
||||
the_list = []
|
||||
keys = trending_data.claims.keys()
|
||||
for key in keys:
|
||||
if trending_data.claims[key]["changed"]:
|
||||
the_list.append((trending_data.claims[key]["trending_score"],
|
||||
key))
|
||||
trending_data.claims[key]["changed"] = False
|
||||
|
||||
trending_log("{n} scores to write...".format(n=len(the_list)))
|
||||
|
||||
db.executemany("UPDATE claim SET trending_mixed=? WHERE claim_hash=?;",
|
||||
the_list)
|
||||
|
||||
trending_log("done.\n")
|
||||
|
||||
trending_log("Trending operations took {time} seconds.\n\n"\
|
||||
.format(time=time.time() - start))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_trending()
|
||||
@@ -52,11 +52,12 @@ class ZScore:
|
||||
return cls(), cls.step, cls.finalize
|
||||
|
||||
|
||||
def register_trending_functions(connection):
|
||||
def install(connection):
|
||||
connection.createaggregatefunction("zscore", ZScore.factory, 1)
|
||||
connection.cursor().execute(CREATE_TREND_TABLE)
|
||||
|
||||
|
||||
def calculate_trending(db, height, final_height):
|
||||
def run(db, height, final_height, affected_claims):
|
||||
# don't start tracking until we're at the end of initial sync
|
||||
if height < (final_height - (TRENDING_WINDOW * TRENDING_DATA_POINTS)):
|
||||
return
|
||||
@@ -17,9 +17,7 @@ from lbry.wallet import Ledger, RegTestLedger
|
||||
from lbry.wallet.transaction import Transaction, Output
|
||||
from lbry.wallet.server.db.canonical import register_canonical_functions
|
||||
from lbry.wallet.server.db.full_text_search import update_full_text_search, CREATE_FULL_TEXT_SEARCH, first_sync_finished
|
||||
from lbry.wallet.server.db.trending import (
|
||||
CREATE_TREND_TABLE, calculate_trending, register_trending_functions
|
||||
)
|
||||
from lbry.wallet.server.db.trending import TRENDING_ALGORITHMS
|
||||
|
||||
from .common import CLAIM_TYPES, STREAM_TYPES, COMMON_TAGS
|
||||
|
||||
@@ -65,6 +63,7 @@ class SQLDB:
|
||||
media_type text,
|
||||
fee_amount integer default 0,
|
||||
fee_currency text,
|
||||
duration integer,
|
||||
|
||||
-- reposts
|
||||
reposted_claim_hash bytes,
|
||||
@@ -95,6 +94,7 @@ class SQLDB:
|
||||
create index if not exists claim_txo_hash_idx on claim (txo_hash);
|
||||
create index if not exists claim_activation_height_idx on claim (activation_height, claim_hash);
|
||||
create index if not exists claim_expiration_height_idx on claim (expiration_height);
|
||||
create index if not exists claim_reposted_claim_hash_idx on claim (reposted_claim_hash);
|
||||
"""
|
||||
|
||||
CREATE_SUPPORT_TABLE = """
|
||||
@@ -142,6 +142,10 @@ class SQLDB:
|
||||
create unique index if not exists claim_type_effective_amount_idx on claim (claim_type, effective_amount, claim_hash);
|
||||
|
||||
create unique index if not exists channel_hash_release_time_idx on claim (channel_hash, release_time, claim_hash);
|
||||
create unique index if not exists channel_hash_trending_idx on claim (channel_hash, trending_global, trending_mixed, claim_hash);
|
||||
create unique index if not exists channel_hash_trending_idx on claim (channel_hash, effective_amount, claim_hash);
|
||||
|
||||
create unique index if not exists filter_stream_duration_idx on claim (duration, trending_global, trending_mixed, claim_hash);
|
||||
|
||||
-- TODO: verify that all indexes below are used
|
||||
create index if not exists claim_height_normalized_idx on claim (height, normalized asc);
|
||||
@@ -165,14 +169,14 @@ class SQLDB:
|
||||
|
||||
CREATE_TABLES_QUERY = (
|
||||
CREATE_CLAIM_TABLE +
|
||||
CREATE_TREND_TABLE +
|
||||
CREATE_FULL_TEXT_SEARCH +
|
||||
CREATE_SUPPORT_TABLE +
|
||||
CREATE_CLAIMTRIE_TABLE +
|
||||
CREATE_TAG_TABLE
|
||||
)
|
||||
|
||||
def __init__(self, main, path: str, blocking_channels: list, filtering_channels: list):
|
||||
def __init__(
|
||||
self, main, path: str, blocking_channels: list, filtering_channels: list, trending: list):
|
||||
self.main = main
|
||||
self._db_path = path
|
||||
self.db = None
|
||||
@@ -190,6 +194,7 @@ class SQLDB:
|
||||
self.filtering_channel_hashes = {
|
||||
unhexlify(channel_id)[::-1] for channel_id in filtering_channels if channel_id
|
||||
}
|
||||
self.trending = trending
|
||||
|
||||
def open(self):
|
||||
self.db = apsw.Connection(
|
||||
@@ -208,13 +213,14 @@ class SQLDB:
|
||||
self.execute(self.PRAGMAS)
|
||||
self.execute(self.CREATE_TABLES_QUERY)
|
||||
register_canonical_functions(self.db)
|
||||
register_trending_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.update_blocked_and_filtered_claims()
|
||||
for algorithm in self.trending:
|
||||
algorithm.install(self.db)
|
||||
|
||||
def close(self):
|
||||
if self.db is not None:
|
||||
@@ -236,10 +242,10 @@ class SQLDB:
|
||||
streams, channels = {}, {}
|
||||
if channel_hashes:
|
||||
sql = query(
|
||||
"SELECT claim.channel_hash, claim.reposted_claim_hash, reposted.claim_type "
|
||||
"FROM claim JOIN claim AS reposted ON (reposted.claim_hash=claim.reposted_claim_hash)", **{
|
||||
'claim.reposted_claim_hash__is_not_null': 1,
|
||||
'claim.channel_hash__in': channel_hashes
|
||||
"SELECT repost.channel_hash, repost.reposted_claim_hash, target.claim_type "
|
||||
"FROM claim as repost JOIN claim AS target ON (target.claim_hash=repost.reposted_claim_hash)", **{
|
||||
'repost.reposted_claim_hash__is_not_null': 1,
|
||||
'repost.channel_hash__in': channel_hashes
|
||||
}
|
||||
)
|
||||
for blocked_claim in self.execute(*sql):
|
||||
@@ -318,6 +324,7 @@ class SQLDB:
|
||||
'title': None,
|
||||
'description': None,
|
||||
'author': None,
|
||||
'duration': None,
|
||||
'claim_type': None,
|
||||
'stream_type': None,
|
||||
'media_type': None,
|
||||
@@ -341,6 +348,10 @@ class SQLDB:
|
||||
claim_record['title'] = claim.stream.title
|
||||
claim_record['description'] = claim.stream.description
|
||||
claim_record['author'] = claim.stream.author
|
||||
if claim.stream.video and claim.stream.video.duration:
|
||||
claim_record['duration'] = claim.stream.video.duration
|
||||
if claim.stream.audio and claim.stream.audio.duration:
|
||||
claim_record['duration'] = claim.stream.audio.duration
|
||||
if claim.stream.release_time:
|
||||
claim_record['release_time'] = claim.stream.release_time
|
||||
if claim.stream.has_fee:
|
||||
@@ -350,6 +361,7 @@ class SQLDB:
|
||||
if isinstance(fee.amount, Decimal):
|
||||
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
|
||||
elif claim.is_channel:
|
||||
claim_record['claim_type'] = CLAIM_TYPES['channel']
|
||||
@@ -374,12 +386,12 @@ class SQLDB:
|
||||
INSERT OR IGNORE INTO claim (
|
||||
claim_hash, claim_id, claim_name, normalized, txo_hash, tx_position, amount,
|
||||
claim_type, media_type, stream_type, timestamp, creation_timestamp,
|
||||
fee_currency, fee_amount, title, description, author, height, reposted_claim_hash,
|
||||
fee_currency, fee_amount, title, description, author, duration, height, reposted_claim_hash,
|
||||
creation_height, release_time, activation_height, expiration_height, short_url)
|
||||
VALUES (
|
||||
:claim_hash, :claim_id, :claim_name, :normalized, :txo_hash, :tx_position, :amount,
|
||||
:claim_type, :media_type, :stream_type, :timestamp, :timestamp,
|
||||
:fee_currency, :fee_amount, :title, :description, :author, :height, :reposted_claim_hash, :height,
|
||||
:fee_currency, :fee_amount, :title, :description, :author, :duration, :height, :reposted_claim_hash, :height,
|
||||
CASE WHEN :release_time IS NOT NULL THEN :release_time ELSE :timestamp END,
|
||||
CASE WHEN :normalized NOT IN (SELECT normalized FROM claimtrie) THEN :height END,
|
||||
CASE WHEN :height >= 137181 THEN :height+2102400 ELSE :height+262974 END,
|
||||
@@ -397,7 +409,7 @@ class SQLDB:
|
||||
txo_hash=:txo_hash, tx_position=:tx_position, amount=:amount, height=:height,
|
||||
claim_type=:claim_type, media_type=:media_type, stream_type=:stream_type,
|
||||
timestamp=:timestamp, fee_amount=:fee_amount, fee_currency=:fee_currency,
|
||||
title=:title, description=:description, author=:author, reposted_claim_hash=:reposted_claim_hash,
|
||||
title=:title, duration=:duration, description=:description, author=:author, reposted_claim_hash=:reposted_claim_hash,
|
||||
release_time=CASE WHEN :release_time IS NOT NULL THEN :release_time ELSE release_time END
|
||||
WHERE claim_hash=:claim_hash;
|
||||
""", claims)
|
||||
@@ -834,7 +846,8 @@ class SQLDB:
|
||||
update_claims, delete_claim_hashes, affected_channels, forward_timer=True)
|
||||
r(self.insert_supports, insert_supports)
|
||||
r(self.update_claimtrie, height, recalculate_claim_hashes, deleted_claim_names, forward_timer=True)
|
||||
r(calculate_trending, self.db.cursor(), height, daemon_height)
|
||||
for algorithm in self.trending:
|
||||
r(algorithm.run, self.db.cursor(), height, daemon_height, recalculate_claim_hashes)
|
||||
if not self._fts_synced and self.main.first_sync and height == daemon_height:
|
||||
r(first_sync_finished, self.db.cursor())
|
||||
self._fts_synced = True
|
||||
@@ -845,11 +858,15 @@ class LBRYLevelDB(LevelDB):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
path = os.path.join(self.env.db_dir, 'claims.db')
|
||||
# space separated list of channel URIs used for filtering bad content
|
||||
trending = []
|
||||
for algorithm_name in set(self.env.default('TRENDING_ALGORITHMS', 'zscore').split(' ')):
|
||||
if algorithm_name in TRENDING_ALGORITHMS:
|
||||
trending.append(TRENDING_ALGORITHMS[algorithm_name])
|
||||
self.sql = SQLDB(
|
||||
self, path,
|
||||
self.env.default('BLOCKING_CHANNEL_IDS', '').split(' '),
|
||||
self.env.default('FILTERING_CHANNEL_IDS', '').split(' '),
|
||||
trending
|
||||
)
|
||||
|
||||
def close(self):
|
||||
|
||||
@@ -1,20 +1,56 @@
|
||||
import os
|
||||
from aiohttp import web
|
||||
from prometheus_client import Counter, Info, generate_latest as prom_generate_latest
|
||||
from prometheus_client import Counter, Info, generate_latest as prom_generate_latest, Histogram, Gauge
|
||||
from lbry import __version__ as version
|
||||
from lbry.build_info import BUILD, COMMIT_HASH
|
||||
from lbry.build_info import BUILD, COMMIT_HASH, DOCKER_TAG
|
||||
from lbry.wallet.server import util
|
||||
import lbry.wallet.server.version as wallet_server_version
|
||||
|
||||
NAMESPACE = "wallet_server"
|
||||
|
||||
CPU_COUNT = f"{os.cpu_count()}"
|
||||
VERSION_INFO = Info('build', 'Wallet server build info (e.g. version, commit hash)', namespace=NAMESPACE)
|
||||
VERSION_INFO.info({
|
||||
'build': BUILD,
|
||||
"commit": COMMIT_HASH,
|
||||
"docker_tag": DOCKER_TAG,
|
||||
'version': version,
|
||||
"min_version": util.version_string(wallet_server_version.PROTOCOL_MIN),
|
||||
"cpu_count": CPU_COUNT
|
||||
})
|
||||
REQUESTS_COUNT = Counter("requests_count", "Number of requests received", namespace=NAMESPACE, labelnames=("method",))
|
||||
SESSIONS_COUNT = Gauge("session_count", "Number of connected client sessions", namespace=NAMESPACE,
|
||||
labelnames=("version", ))
|
||||
REQUESTS_COUNT = Counter("requests_count", "Number of requests received", namespace=NAMESPACE,
|
||||
labelnames=("method", "version"))
|
||||
RESPONSE_TIMES = Histogram("response_time", "Response times", namespace=NAMESPACE, labelnames=("method", "version"))
|
||||
NOTIFICATION_COUNT = Counter("notification", "Number of notifications sent (for subscriptions)",
|
||||
namespace=NAMESPACE, labelnames=("method", "version"))
|
||||
REQUEST_ERRORS_COUNT = Counter("request_error", "Number of requests that returned errors", namespace=NAMESPACE,
|
||||
labelnames=("method", "version"))
|
||||
SQLITE_INTERRUPT_COUNT = Counter("interrupt", "Number of interrupted queries", namespace=NAMESPACE)
|
||||
SQLITE_OPERATIONAL_ERROR_COUNT = Counter(
|
||||
"operational_error", "Number of queries that raised operational errors", namespace=NAMESPACE
|
||||
)
|
||||
SQLITE_INTERNAL_ERROR_COUNT = Counter(
|
||||
"internal_error", "Number of queries raising unexpected errors", namespace=NAMESPACE
|
||||
)
|
||||
SQLITE_EXECUTOR_TIMES = Histogram("executor_time", "SQLite executor times", namespace=NAMESPACE)
|
||||
SQLITE_PENDING_COUNT = Gauge(
|
||||
"pending_queries_count", "Number of pending and running sqlite queries", namespace=NAMESPACE
|
||||
)
|
||||
LBRYCRD_REQUEST_TIMES = Histogram(
|
||||
"lbrycrd_request", "lbrycrd requests count", namespace=NAMESPACE, labelnames=("method",)
|
||||
)
|
||||
LBRYCRD_PENDING_COUNT = Gauge(
|
||||
"lbrycrd_pending_count", "Number of lbrycrd rpcs that are in flight", namespace=NAMESPACE, labelnames=("method",)
|
||||
)
|
||||
CLIENT_VERSIONS = Counter(
|
||||
"clients", "Number of connections received per client version",
|
||||
namespace=NAMESPACE, labelnames=("version",)
|
||||
)
|
||||
BLOCK_COUNT = Gauge(
|
||||
"block_count", "Number of processed blocks", namespace=NAMESPACE
|
||||
)
|
||||
BLOCK_UPDATE_TIMES = Histogram("block_time", "Block update times", namespace=NAMESPACE)
|
||||
|
||||
|
||||
class PrometheusServer:
|
||||
|
||||
@@ -27,7 +27,9 @@ from lbry.wallet.server.db.writer import LBRYLevelDB
|
||||
from lbry.wallet.server.db import reader
|
||||
from lbry.wallet.server.websocket import AdminWebSocket
|
||||
from lbry.wallet.server.metrics import ServerLoadData, APICallMetrics
|
||||
from lbry.wallet.server.prometheus import REQUESTS_COUNT
|
||||
from lbry.wallet.server.prometheus import REQUESTS_COUNT, SQLITE_INTERRUPT_COUNT, SQLITE_INTERNAL_ERROR_COUNT
|
||||
from lbry.wallet.server.prometheus import SQLITE_OPERATIONAL_ERROR_COUNT, SQLITE_EXECUTOR_TIMES, SESSIONS_COUNT
|
||||
from lbry.wallet.server.prometheus import SQLITE_PENDING_COUNT, CLIENT_VERSIONS
|
||||
import lbry.wallet.server.version as VERSION
|
||||
|
||||
from lbry.wallet.rpc import (
|
||||
@@ -142,13 +144,6 @@ class SessionManager:
|
||||
|
||||
self.session_event = Event()
|
||||
|
||||
# Set up the RPC request handlers
|
||||
cmds = ('add_peer daemon_url disconnect getinfo groups log peers '
|
||||
'query reorg sessions stop'.split())
|
||||
LocalRPC.request_handlers.update(
|
||||
{cmd: getattr(self, 'rpc_' + cmd) for cmd in cmds}
|
||||
)
|
||||
|
||||
async def _start_server(self, kind, *args, **kw_args):
|
||||
loop = asyncio.get_event_loop()
|
||||
if kind == 'RPC':
|
||||
@@ -331,7 +326,7 @@ class SessionManager:
|
||||
return [(session.session_id,
|
||||
session.flags(),
|
||||
session.peer_address_str(for_log=for_log),
|
||||
session.client,
|
||||
session.client_version,
|
||||
session.protocol_version_string(),
|
||||
session.count_pending_items(),
|
||||
session.txs_sent,
|
||||
@@ -635,7 +630,6 @@ class SessionBase(RPCSession):
|
||||
self.kind = kind # 'RPC', 'TCP' etc.
|
||||
self.env = session_mgr.env
|
||||
self.coin = self.env.coin
|
||||
self.client = 'unknown'
|
||||
self.anon_logs = self.env.anon_logs
|
||||
self.txs_sent = 0
|
||||
self.log_me = False
|
||||
@@ -679,13 +673,16 @@ class SessionBase(RPCSession):
|
||||
context = {'conn_id': f'{self.session_id}'}
|
||||
self.logger = util.ConnectionLogger(self.logger, context)
|
||||
self.group = self.session_mgr.add_session(self)
|
||||
self.logger.info(f'{self.kind} {self.peer_address_str()}, '
|
||||
SESSIONS_COUNT.labels(version=self.client_version).inc()
|
||||
peer_addr_str = self.peer_address_str()
|
||||
self.logger.info(f'{self.kind} {peer_addr_str}, '
|
||||
f'{self.session_mgr.session_count():,d} total')
|
||||
|
||||
def connection_lost(self, exc):
|
||||
"""Handle client disconnection."""
|
||||
super().connection_lost(exc)
|
||||
self.session_mgr.remove_session(self)
|
||||
SESSIONS_COUNT.labels(version=self.client_version).dec()
|
||||
msg = ''
|
||||
if not self._can_send.is_set():
|
||||
msg += ' whilst paused'
|
||||
@@ -709,9 +706,10 @@ class SessionBase(RPCSession):
|
||||
"""Handle an incoming request. ElectrumX doesn't receive
|
||||
notifications from client sessions.
|
||||
"""
|
||||
REQUESTS_COUNT.labels(method=request.method).inc()
|
||||
REQUESTS_COUNT.labels(method=request.method, version=self.client_version).inc()
|
||||
if isinstance(request, Request):
|
||||
handler = self.request_handlers.get(request.method)
|
||||
handler = partial(handler, self)
|
||||
else:
|
||||
handler = None
|
||||
coro = handler_invocation(handler, request)()
|
||||
@@ -785,16 +783,56 @@ class LBRYElectrumX(SessionBase):
|
||||
session_mgr: LBRYSessionManager
|
||||
version = lbry.__version__
|
||||
|
||||
@classmethod
|
||||
def initialize_request_handlers(cls):
|
||||
cls.request_handlers.update({
|
||||
'blockchain.block.get_chunk': cls.block_get_chunk,
|
||||
'blockchain.block.get_header': cls.block_get_header,
|
||||
'blockchain.estimatefee': cls.estimatefee,
|
||||
'blockchain.relayfee': cls.relayfee,
|
||||
'blockchain.scripthash.get_balance': cls.scripthash_get_balance,
|
||||
'blockchain.scripthash.get_history': cls.scripthash_get_history,
|
||||
'blockchain.scripthash.get_mempool': cls.scripthash_get_mempool,
|
||||
'blockchain.scripthash.listunspent': cls.scripthash_listunspent,
|
||||
'blockchain.scripthash.subscribe': cls.scripthash_subscribe,
|
||||
'blockchain.transaction.broadcast': cls.transaction_broadcast,
|
||||
'blockchain.transaction.get': cls.transaction_get,
|
||||
'blockchain.transaction.get_merkle': cls.transaction_merkle,
|
||||
'server.add_peer': cls.add_peer,
|
||||
'server.banner': cls.banner,
|
||||
'server.donation_address': cls.donation_address,
|
||||
'server.features': cls.server_features_async,
|
||||
'server.peers.subscribe': cls.peers_subscribe,
|
||||
'server.version': cls.server_version,
|
||||
'blockchain.transaction.get_height': cls.transaction_get_height,
|
||||
'blockchain.claimtrie.search': cls.claimtrie_search,
|
||||
'blockchain.claimtrie.resolve': cls.claimtrie_resolve,
|
||||
'blockchain.claimtrie.getclaimsbyids': cls.claimtrie_getclaimsbyids,
|
||||
'blockchain.block.get_server_height': cls.get_server_height,
|
||||
'mempool.get_fee_histogram': cls.mempool_compact_histogram,
|
||||
'blockchain.block.headers': cls.block_headers,
|
||||
'server.ping': cls.ping,
|
||||
'blockchain.headers.subscribe': cls.headers_subscribe_False,
|
||||
'blockchain.address.get_balance': cls.address_get_balance,
|
||||
'blockchain.address.get_history': cls.address_get_history,
|
||||
'blockchain.address.get_mempool': cls.address_get_mempool,
|
||||
'blockchain.address.listunspent': cls.address_listunspent,
|
||||
'blockchain.address.subscribe': cls.address_subscribe,
|
||||
'blockchain.address.unsubscribe': cls.address_unsubscribe,
|
||||
})
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
if not LBRYElectrumX.request_handlers:
|
||||
LBRYElectrumX.initialize_request_handlers()
|
||||
self.subscribe_headers = False
|
||||
self.subscribe_headers_raw = False
|
||||
self.connection.max_response_size = self.env.max_send
|
||||
self.hashX_subs = {}
|
||||
self.sv_seen = False
|
||||
self.mempool_statuses = {}
|
||||
self.set_request_handlers(self.PROTOCOL_MIN)
|
||||
# fixme: this is a rebase hack, we need to go through ChainState instead later
|
||||
self.protocol_tuple = self.PROTOCOL_MIN
|
||||
|
||||
self.daemon = self.session_mgr.daemon
|
||||
self.bp: LBRYBlockProcessor = self.session_mgr.bp
|
||||
self.db: LBRYLevelDB = self.bp.db
|
||||
@@ -841,7 +879,12 @@ class LBRYElectrumX(SessionBase):
|
||||
"""
|
||||
if height_changed and self.subscribe_headers:
|
||||
args = (await self.subscribe_headers_result(), )
|
||||
await self.send_notification('blockchain.headers.subscribe', args)
|
||||
try:
|
||||
await self.send_notification('blockchain.headers.subscribe', args)
|
||||
except asyncio.TimeoutError:
|
||||
self.logger.info("timeout sending headers notification to %s", self.peer_address_str(for_log=True))
|
||||
self.abort()
|
||||
return
|
||||
|
||||
touched = touched.intersection(self.hashX_subs)
|
||||
if touched or (height_changed and self.mempool_statuses):
|
||||
@@ -869,7 +912,13 @@ class LBRYElectrumX(SessionBase):
|
||||
method = 'blockchain.scripthash.subscribe'
|
||||
else:
|
||||
method = 'blockchain.address.subscribe'
|
||||
await self.send_notification(method, (alias, status))
|
||||
|
||||
try:
|
||||
await self.send_notification(method, (alias, status))
|
||||
except asyncio.TimeoutError:
|
||||
self.logger.info("timeout sending address notification to %s", self.peer_address_str(for_log=True))
|
||||
self.abort()
|
||||
return
|
||||
|
||||
if changed:
|
||||
es = '' if len(changed) == 1 else 'es'
|
||||
@@ -888,6 +937,7 @@ class LBRYElectrumX(SessionBase):
|
||||
async def run_in_executor(self, query_name, func, kwargs):
|
||||
start = time.perf_counter()
|
||||
try:
|
||||
SQLITE_PENDING_COUNT.inc()
|
||||
result = await asyncio.get_running_loop().run_in_executor(
|
||||
self.session_mgr.query_executor, func, kwargs
|
||||
)
|
||||
@@ -896,23 +946,28 @@ class LBRYElectrumX(SessionBase):
|
||||
except reader.SQLiteInterruptedError as error:
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
metrics.query_interrupt(start, error.metrics)
|
||||
SQLITE_INTERRUPT_COUNT.inc()
|
||||
raise RPCError(JSONRPC.QUERY_TIMEOUT, 'sqlite query timed out')
|
||||
except reader.SQLiteOperationalError as error:
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
metrics.query_error(start, error.metrics)
|
||||
SQLITE_OPERATIONAL_ERROR_COUNT.inc()
|
||||
raise RPCError(JSONRPC.INTERNAL_ERROR, 'query failed to execute')
|
||||
except Exception:
|
||||
log.exception("dear devs, please handle this exception better")
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
metrics.query_error(start, {})
|
||||
SQLITE_INTERNAL_ERROR_COUNT.inc()
|
||||
raise RPCError(JSONRPC.INTERNAL_ERROR, 'unknown server error')
|
||||
|
||||
if self.env.track_metrics:
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
(result, metrics_data) = result
|
||||
metrics.query_response(start, metrics_data)
|
||||
|
||||
return base64.b64encode(result).decode()
|
||||
else:
|
||||
if self.env.track_metrics:
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
(result, metrics_data) = result
|
||||
metrics.query_response(start, metrics_data)
|
||||
return base64.b64encode(result).decode()
|
||||
finally:
|
||||
SQLITE_PENDING_COUNT.dec()
|
||||
SQLITE_EXECUTOR_TIMES.observe(time.perf_counter() - start)
|
||||
|
||||
async def run_and_cache_query(self, query_name, function, kwargs):
|
||||
metrics = self.get_metrics_or_placeholder_for_api(query_name)
|
||||
@@ -935,6 +990,9 @@ class LBRYElectrumX(SessionBase):
|
||||
metrics.cache_response()
|
||||
return cache_item.result
|
||||
|
||||
async def mempool_compact_histogram(self):
|
||||
return self.mempool.compact_fee_histogram()
|
||||
|
||||
async def claimtrie_search(self, **kwargs):
|
||||
if kwargs:
|
||||
return await self.run_and_cache_query('search', reader.search_to_bytes, kwargs)
|
||||
@@ -1358,6 +1416,7 @@ class LBRYElectrumX(SessionBase):
|
||||
client_name: a string identifying the client
|
||||
protocol_version: the protocol version spoken by the client
|
||||
"""
|
||||
|
||||
if self.sv_seen and self.protocol_tuple >= (1, 4):
|
||||
raise RPCError(BAD_REQUEST, f'server.version already sent')
|
||||
self.sv_seen = True
|
||||
@@ -1369,7 +1428,11 @@ class LBRYElectrumX(SessionBase):
|
||||
self.close_after_send = True
|
||||
raise RPCError(BAD_REQUEST,
|
||||
f'unsupported client: {client_name}')
|
||||
self.client = client_name[:17]
|
||||
if self.client_version != client_name[:17]:
|
||||
SESSIONS_COUNT.labels(version=self.client_version).dec()
|
||||
self.client_version = client_name[:17]
|
||||
SESSIONS_COUNT.labels(version=self.client_version).inc()
|
||||
CLIENT_VERSIONS.labels(version=self.client_version).inc()
|
||||
|
||||
# Find the highest common protocol version. Disconnect if
|
||||
# that protocol version in unsupported.
|
||||
@@ -1384,8 +1447,7 @@ class LBRYElectrumX(SessionBase):
|
||||
self.close_after_send = True
|
||||
raise RPCError(BAD_REQUEST,
|
||||
f'unsupported protocol version: {protocol_version}')
|
||||
self.set_request_handlers(ptuple)
|
||||
|
||||
self.protocol_tuple = ptuple
|
||||
return self.version, self.protocol_version_string()
|
||||
|
||||
async def transaction_broadcast(self, raw_tx):
|
||||
@@ -1479,45 +1541,6 @@ class LBRYElectrumX(SessionBase):
|
||||
else:
|
||||
return tx_hash
|
||||
|
||||
def set_request_handlers(self, ptuple):
|
||||
self.protocol_tuple = ptuple
|
||||
handlers = {
|
||||
'blockchain.block.get_chunk': self.block_get_chunk,
|
||||
'blockchain.block.get_header': self.block_get_header,
|
||||
'blockchain.estimatefee': self.estimatefee,
|
||||
'blockchain.relayfee': self.relayfee,
|
||||
'blockchain.scripthash.get_balance': self.scripthash_get_balance,
|
||||
'blockchain.scripthash.get_history': self.scripthash_get_history,
|
||||
'blockchain.scripthash.get_mempool': self.scripthash_get_mempool,
|
||||
'blockchain.scripthash.listunspent': self.scripthash_listunspent,
|
||||
'blockchain.scripthash.subscribe': self.scripthash_subscribe,
|
||||
'blockchain.transaction.broadcast': self.transaction_broadcast,
|
||||
'blockchain.transaction.get': self.transaction_get,
|
||||
'blockchain.transaction.get_merkle': self.transaction_merkle,
|
||||
'server.add_peer': self.add_peer,
|
||||
'server.banner': self.banner,
|
||||
'server.donation_address': self.donation_address,
|
||||
'server.features': self.server_features_async,
|
||||
'server.peers.subscribe': self.peers_subscribe,
|
||||
'server.version': self.server_version,
|
||||
'blockchain.transaction.get_height': self.transaction_get_height,
|
||||
'blockchain.claimtrie.search': self.claimtrie_search,
|
||||
'blockchain.claimtrie.resolve': self.claimtrie_resolve,
|
||||
'blockchain.claimtrie.getclaimsbyids': self.claimtrie_getclaimsbyids,
|
||||
'blockchain.block.get_server_height': self.get_server_height,
|
||||
'mempool.get_fee_histogram': self.mempool.compact_fee_histogram,
|
||||
'blockchain.block.headers': self.block_headers,
|
||||
'server.ping': self.ping,
|
||||
'blockchain.headers.subscribe': self.headers_subscribe_False,
|
||||
'blockchain.address.get_balance': self.address_get_balance,
|
||||
'blockchain.address.get_history': self.address_get_history,
|
||||
'blockchain.address.get_mempool': self.address_get_mempool,
|
||||
'blockchain.address.listunspent': self.address_listunspent,
|
||||
'blockchain.address.subscribe': self.address_subscribe,
|
||||
'blockchain.address.unsubscribe': self.address_unsubscribe,
|
||||
}
|
||||
self.request_handlers = handlers
|
||||
|
||||
|
||||
class LocalRPC(SessionBase):
|
||||
"""A local TCP RPC server session."""
|
||||
|
||||
@@ -74,12 +74,10 @@ class Wallet:
|
||||
self.storage = storage or WalletStorage()
|
||||
self.preferences = TimestampedPreferences(preferences or {})
|
||||
self.encryption_password = None
|
||||
self.id = self.get_id()
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
if self.storage.path:
|
||||
return os.path.basename(self.storage.path)
|
||||
return self.name
|
||||
def get_id(self):
|
||||
return os.path.basename(self.storage.path) if self.storage.path else self.name
|
||||
|
||||
def add_account(self, account: 'Account'):
|
||||
self.accounts.append(account)
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import platform
|
||||
import sys
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
import lbry.wallet # needed to make the following line work (it's a bug):
|
||||
from lbry.conf import TranscodeConfig
|
||||
from lbry.file_analysis import VideoFileAnalyzer
|
||||
|
||||
|
||||
def enable_logging():
|
||||
root = logging.getLogger()
|
||||
root.setLevel(logging.DEBUG)
|
||||
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter('%(message)s') # %(asctime)s - %(levelname)s -
|
||||
handler.setFormatter(formatter)
|
||||
root.addHandler(handler)
|
||||
|
||||
|
||||
async def process_video(analyzer, video_file):
|
||||
try:
|
||||
await analyzer.verify_or_repair(True, False, video_file)
|
||||
print("No concerns. Ship it!")
|
||||
except FileNotFoundError as e:
|
||||
print(str(e))
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
transcode = input("Would you like to make a repaired clone now? [y/N] ")
|
||||
if transcode == "y":
|
||||
try:
|
||||
new_video_file = await analyzer.verify_or_repair(True, True, video_file)
|
||||
print("Successfully created ", new_video_file)
|
||||
except Exception as e:
|
||||
print("Unable to complete the transcode. Message: ", str(e))
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: check_video.py <path to video file>", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
enable_logging()
|
||||
|
||||
video_file = sys.argv[1]
|
||||
conf = TranscodeConfig()
|
||||
analyzer = VideoFileAnalyzer(conf)
|
||||
if sys.version_info < (3, 8) and platform.system() == "Windows":
|
||||
# TODO: remove after we move to requiring Python 3.8
|
||||
asyncio.set_event_loop(asyncio.ProactorEventLoop())
|
||||
try:
|
||||
asyncio.run(process_video(analyzer, video_file))
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# usage: update_dev_wallet_server.sh <host to update>
|
||||
TARGET_HOST=$1
|
||||
|
||||
SCRIPTS_DIR=`dirname $0`
|
||||
LBRY_DIR=`dirname $SCRIPTS_DIR`
|
||||
|
||||
# build the image
|
||||
docker build -f $LBRY_DIR/docker/Dockerfile.wallet_server -t lbry/wallet-server:development $LBRY_DIR
|
||||
IMAGE=`docker image inspect lbry/wallet-server:development | sed -n "s/^.*Id\":\s*\"sha256:\s*\(\S*\)\".*$/\1/p"`
|
||||
|
||||
# push the image to the server
|
||||
ssh $TARGET_HOST docker image prune --force
|
||||
docker save $IMAGE | ssh $TARGET_HOST docker load
|
||||
ssh $TARGET_HOST docker tag $IMAGE lbry/wallet-server:development
|
||||
|
||||
# restart the wallet server
|
||||
ssh $TARGET_HOST docker-compose down
|
||||
ssh $TARGET_HOST WALLET_SERVER_TAG="development" docker-compose up -d
|
||||
+6
-2
@@ -124,7 +124,11 @@ def release(args):
|
||||
|
||||
current_version = Version.from_content(version_file)
|
||||
print(f'Current Version: {current_version}')
|
||||
new_version = current_version.increment(args.action)
|
||||
|
||||
if args.action == 'current':
|
||||
new_version = current_version
|
||||
else:
|
||||
new_version = current_version.increment(args.action)
|
||||
print(f' New Version: {new_version}')
|
||||
|
||||
previous_release = repo.release_from_tag(args.start_tag or current_version.tag)
|
||||
@@ -241,7 +245,7 @@ def main():
|
||||
parser.add_argument("--confirm", default=False, action="store_true",
|
||||
help="without this flag, it will only print what it will do but will not actually do it")
|
||||
parser.add_argument("--start-tag", help="custom starting tag for changelog generation")
|
||||
parser.add_argument("action", choices=['test', 'major', 'minor', 'micro'])
|
||||
parser.add_argument("action", choices=['test', 'current', 'major', 'minor', 'micro'])
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.action == "test":
|
||||
|
||||
@@ -12,7 +12,7 @@ async def main():
|
||||
try:
|
||||
hostname = sys.argv[1]
|
||||
except IndexError:
|
||||
hostname = 'spv1.lbry.com'
|
||||
hostname = 'spv11.lbry.com'
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
client = ClientSession(network=None, server=(hostname, 50001))
|
||||
|
||||
@@ -32,6 +32,7 @@ disable=
|
||||
too-many-branches,
|
||||
too-many-arguments,
|
||||
too-many-statements,
|
||||
too-many-nested-blocks,
|
||||
too-many-public-methods,
|
||||
too-many-instance-attributes,
|
||||
protected-access,
|
||||
|
||||
@@ -40,7 +40,7 @@ setup(
|
||||
'colorama==0.3.7',
|
||||
'distro==1.4.0',
|
||||
'base58==1.0.0',
|
||||
'cffi==1.12.1',
|
||||
'cffi==1.13.2',
|
||||
'cryptography==2.5',
|
||||
'protobuf==3.6.1',
|
||||
'msgpack==0.6.1',
|
||||
|
||||
@@ -309,12 +309,14 @@ class ClaimSearchCommand(ClaimTestCase):
|
||||
octet = await self.stream_create()
|
||||
video = await self.stream_create('chrome', file_path=self.video_file_name)
|
||||
image = await self.stream_create('blank-image', data=self.image_data, suffix='.png')
|
||||
repost = await self.stream_repost(self.get_claim_id(image))
|
||||
channel = await self.channel_create()
|
||||
unknown = self.sout(tx)
|
||||
|
||||
# claim_type
|
||||
await self.assertFindsClaims([image, video, octet, unknown], claim_type='stream')
|
||||
await self.assertFindsClaims([channel], claim_type='channel')
|
||||
await self.assertFindsClaims([repost], claim_type='repost')
|
||||
|
||||
# stream_type
|
||||
await self.assertFindsClaims([octet, unknown], stream_types=['binary'])
|
||||
@@ -322,12 +324,19 @@ class ClaimSearchCommand(ClaimTestCase):
|
||||
await self.assertFindsClaims([image], stream_types=['image'])
|
||||
await self.assertFindsClaims([image, video], stream_types=['video', 'image'])
|
||||
|
||||
# stream_type
|
||||
# media_type
|
||||
await self.assertFindsClaims([octet, unknown], media_types=['application/octet-stream'])
|
||||
await self.assertFindsClaims([video], media_types=['video/mp4'])
|
||||
await self.assertFindsClaims([image], media_types=['image/png'])
|
||||
await self.assertFindsClaims([image, video], media_types=['video/mp4', 'image/png'])
|
||||
|
||||
# duration
|
||||
await self.assertFindsClaim(video, duration='>14')
|
||||
await self.assertFindsClaim(video, duration='<16')
|
||||
await self.assertFindsClaim(video, duration=15)
|
||||
await self.assertFindsClaims([], duration='>100')
|
||||
await self.assertFindsClaims([], duration='<14')
|
||||
|
||||
async def test_search_by_text(self):
|
||||
chan1_id = self.get_claim_id(await self.channel_create('@SatoshiNakamoto'))
|
||||
chan2_id = self.get_claim_id(await self.channel_create('@Bitcoin'))
|
||||
@@ -375,6 +384,96 @@ class ClaimSearchCommand(ClaimTestCase):
|
||||
await self.assertFindsClaims([], text='cloud')
|
||||
|
||||
|
||||
class ClaimCommands(ClaimTestCase):
|
||||
|
||||
async def test_claim_list_type_filtering(self):
|
||||
await self.channel_create()
|
||||
await self.stream_create()
|
||||
|
||||
r = await self.claim_list(claim_type='channel')
|
||||
self.assertEqual(1, len(r))
|
||||
self.assertEqual('channel', r[0]['value_type'])
|
||||
|
||||
r = await self.claim_list(claim_type='stream')
|
||||
self.assertEqual(1, len(r))
|
||||
self.assertEqual('stream', r[0]['value_type'])
|
||||
|
||||
r = await self.claim_list(claim_type=['stream', 'channel'])
|
||||
self.assertEqual(2, len(r))
|
||||
self.assertEqual({'stream', 'channel'}, {c['value_type'] for c in r})
|
||||
|
||||
async def test_claim_stream_channel_list_with_resolve(self):
|
||||
self.assertListEqual([], await self.claim_list(resolve=True))
|
||||
|
||||
await self.channel_create()
|
||||
await self.stream_create()
|
||||
|
||||
r = await self.claim_list()
|
||||
self.assertNotIn('short_url', r[0])
|
||||
self.assertNotIn('short_url', r[1])
|
||||
self.assertNotIn('short_url', (await self.stream_list())[0])
|
||||
self.assertNotIn('short_url', (await self.channel_list())[0])
|
||||
|
||||
r = await self.claim_list(resolve=True)
|
||||
self.assertIn('short_url', r[0])
|
||||
self.assertIn('short_url', r[1])
|
||||
self.assertIn('short_url', (await self.stream_list(resolve=True))[0])
|
||||
self.assertIn('short_url', (await self.channel_list(resolve=True))[0])
|
||||
|
||||
# unconfirmed channel won't resolve
|
||||
channel_tx = await self.daemon.jsonrpc_channel_create('@foo', '1.0')
|
||||
await self.ledger.wait(channel_tx)
|
||||
|
||||
r = await self.claim_list(resolve=True)
|
||||
self.assertEqual('NOT_FOUND', r[0]['meta']['error']['name'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
r = await self.channel_list(resolve=True)
|
||||
self.assertEqual('NOT_FOUND', r[0]['meta']['error']['name'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
|
||||
# confirm it
|
||||
await self.generate(1)
|
||||
await self.ledger.wait(channel_tx, self.blockchain.block_expected)
|
||||
|
||||
# all channel claims resolve
|
||||
r = await self.claim_list(resolve=True)
|
||||
self.assertTrue(r[0]['meta']['is_controlling'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
r = await self.channel_list(resolve=True)
|
||||
self.assertTrue(r[0]['meta']['is_controlling'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
|
||||
# unconfirmed stream won't resolve
|
||||
stream_tx = await self.daemon.jsonrpc_stream_create(
|
||||
'foo', '1.0', file_path=self.create_upload_file(data=b'hi')
|
||||
)
|
||||
await self.ledger.wait(stream_tx)
|
||||
|
||||
r = await self.claim_list(resolve=True)
|
||||
self.assertEqual('NOT_FOUND', r[0]['meta']['error']['name'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
r = await self.stream_list(resolve=True)
|
||||
self.assertEqual('NOT_FOUND', r[0]['meta']['error']['name'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
|
||||
# confirm it
|
||||
await self.generate(1)
|
||||
await self.ledger.wait(stream_tx, self.blockchain.block_expected)
|
||||
|
||||
# all claims resolve
|
||||
r = await self.claim_list(resolve=True)
|
||||
self.assertTrue(r[0]['meta']['is_controlling'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
self.assertTrue(r[2]['meta']['is_controlling'])
|
||||
self.assertTrue(r[3]['meta']['is_controlling'])
|
||||
r = await self.stream_list(resolve=True)
|
||||
self.assertTrue(r[0]['meta']['is_controlling'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
r = await self.channel_list(resolve=True)
|
||||
self.assertTrue(r[0]['meta']['is_controlling'])
|
||||
self.assertTrue(r[1]['meta']['is_controlling'])
|
||||
|
||||
|
||||
class ChannelCommands(CommandTestCase):
|
||||
|
||||
async def test_create_channel_names(self):
|
||||
@@ -756,28 +855,56 @@ class StreamCommands(ClaimTestCase):
|
||||
bad_content_id = self.get_claim_id(
|
||||
await self.stream_create('bad_content', '1.1', channel_name='@some_channel', tags=['bad'])
|
||||
)
|
||||
blocking_channel_id = self.get_claim_id(
|
||||
filtering_channel_id = self.get_claim_id(
|
||||
await self.channel_create('@filtering', '1.0')
|
||||
)
|
||||
self.conductor.spv_node.server.db.sql.filtering_channel_hashes.add(
|
||||
unhexlify(blocking_channel_id)[::-1]
|
||||
unhexlify(filtering_channel_id)[::-1]
|
||||
)
|
||||
await self.stream_repost(bad_content_id, 'filter1', '1.1', channel_name='@filtering')
|
||||
|
||||
# search for blocked content directly
|
||||
result = await self.out(self.daemon.jsonrpc_claim_search(name='bad_content'))
|
||||
blocked = result['blocked']
|
||||
self.assertEqual([], result['items'])
|
||||
self.assertEqual({"channels": {blocking_channel_id: 1}, "total": 1}, result['blocked'])
|
||||
self.assertEqual(1, blocked['total'])
|
||||
self.assertEqual(1, len(blocked['channels']))
|
||||
self.assertEqual(1, blocked['channels'][0]['blocked'])
|
||||
self.assertTrue(blocked['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
|
||||
|
||||
# search channel containing blocked content
|
||||
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel'))
|
||||
blocked = result['blocked']
|
||||
self.assertEqual(1, len(result['items']))
|
||||
self.assertEqual({"channels": {blocking_channel_id: 1}, "total": 1}, result['blocked'])
|
||||
self.assertEqual(1, blocked['total'])
|
||||
self.assertEqual(1, len(blocked['channels']))
|
||||
self.assertEqual(1, blocked['channels'][0]['blocked'])
|
||||
self.assertTrue(blocked['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
|
||||
|
||||
# content was filtered by not_tag before censoring
|
||||
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel', not_tags=["good", "bad"]))
|
||||
self.assertEqual(0, len(result['items']))
|
||||
self.assertEqual({"channels": {}, "total": 0}, result['blocked'])
|
||||
self.assertEqual({"channels": [], "total": 0}, result['blocked'])
|
||||
|
||||
blocking_channel_id = self.get_claim_id(
|
||||
await self.channel_create('@blocking', '1.0')
|
||||
)
|
||||
self.conductor.spv_node.server.db.sql.blocking_channel_hashes.add(
|
||||
unhexlify(blocking_channel_id)[::-1]
|
||||
)
|
||||
|
||||
# filtered content can still be resolved
|
||||
result = await self.out(self.daemon.jsonrpc_resolve('lbry://@some_channel/bad_content'))
|
||||
self.assertEqual(bad_content_id, result['lbry://@some_channel/bad_content']['claim_id'])
|
||||
|
||||
await self.stream_repost(bad_content_id, 'block1', '1.1', channel_name='@blocking')
|
||||
|
||||
# blocked content is not resolveable
|
||||
result = await self.out(self.daemon.jsonrpc_resolve('lbry://@some_channel/bad_content'))
|
||||
error = result['lbry://@some_channel/bad_content']['error']
|
||||
self.assertEqual(error['name'], 'BLOCKED')
|
||||
self.assertTrue(error['text'].startswith("Resolve of 'lbry://@some_channel/bad_content' was censored"))
|
||||
self.assertTrue(error['censor']['short_url'].startswith('lbry://@blocking#'))
|
||||
|
||||
async def test_publish_updates_file_list(self):
|
||||
tx = await self.stream_create(title='created')
|
||||
|
||||
@@ -72,6 +72,7 @@ class BasicTransactionTest(IntegrationTestCase):
|
||||
self.assertIn('error', response['lbry://@bar/foo'])
|
||||
|
||||
# checks for expected format in inexistent URIs
|
||||
response = await self.ledger.resolve([], ['lbry://404', 'lbry://@404'])
|
||||
self.assertEqual('lbry://404 did not resolve to a claim', response['lbry://404']['error'])
|
||||
self.assertEqual('lbry://@404 did not resolve to a claim', response['lbry://@404']['error'])
|
||||
response = await self.ledger.resolve([], ['lbry://404', 'lbry://@404', 'lbry://@404/404'])
|
||||
self.assertEqual('Could not find claim at "lbry://404".', response['lbry://404']['error']['text'])
|
||||
self.assertEqual('Could not find channel in "lbry://@404".', response['lbry://@404']['error']['text'])
|
||||
self.assertEqual('Could not find channel in "lbry://@404/404".', response['lbry://@404/404']['error']['text'])
|
||||
@@ -15,6 +15,7 @@ class BaseResolveTestCase(CommandTestCase):
|
||||
other = (await self.resolve(name))[name]
|
||||
if claim_id is None:
|
||||
self.assertIn('error', other)
|
||||
self.assertEqual(other['error']['name'], 'NOT_FOUND')
|
||||
else:
|
||||
self.assertEqual(claim_id, other['claim_id'])
|
||||
|
||||
@@ -183,7 +184,12 @@ class ResolveCommand(BaseResolveTestCase):
|
||||
# only possible outside a channel
|
||||
response = await self.resolve('lbry://@abc/on-channel-claim')
|
||||
self.assertEqual(response, {
|
||||
'lbry://@abc/on-channel-claim': {'error': 'lbry://@abc/on-channel-claim did not resolve to a claim'}
|
||||
'lbry://@abc/on-channel-claim': {
|
||||
'error': {
|
||||
'name': 'NOT_FOUND',
|
||||
'text': 'Could not find claim at "lbry://@abc/on-channel-claim".',
|
||||
}
|
||||
}
|
||||
})
|
||||
response = (await self.resolve('lbry://on-channel-claim'))['lbry://on-channel-claim']
|
||||
self.assertFalse(response['is_channel_signature_valid'])
|
||||
@@ -257,7 +263,12 @@ class ResolveCommand(BaseResolveTestCase):
|
||||
self.assertFalse(response['bad_example']['is_channel_signature_valid'])
|
||||
response = await self.resolve('@olds/bad_example')
|
||||
self.assertEqual(response, {
|
||||
'@olds/bad_example': {'error': '@olds/bad_example did not resolve to a claim'}
|
||||
'@olds/bad_example': {
|
||||
'error': {
|
||||
'name': 'NOT_FOUND',
|
||||
'text': 'Could not find claim at "@olds/bad_example".',
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -199,8 +199,9 @@ class WalletEncryptionAndSynchronization(CommandTestCase):
|
||||
await self.confirm_tx(sendtxid, self.daemon2.ledger)
|
||||
|
||||
def assertWalletEncrypted(self, wallet_path, encrypted):
|
||||
wallet = json.load(open(wallet_path))
|
||||
self.assertEqual(wallet['accounts'][0]['private_key'][1:4] != 'prv', encrypted)
|
||||
with open(wallet_path) as opened:
|
||||
wallet = json.load(opened)
|
||||
self.assertEqual(wallet['accounts'][0]['private_key'][1:4] != 'prv', encrypted)
|
||||
|
||||
async def test_sync(self):
|
||||
daemon, daemon2 = self.daemon, self.daemon2
|
||||
|
||||
@@ -87,7 +87,10 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
||||
response = await self.resolve('lbry://@spam/hovercraft')
|
||||
self.assertEqual(
|
||||
response['lbry://@spam/hovercraft'],
|
||||
{'error': 'lbry://@spam/hovercraft did not resolve to a claim'}
|
||||
{'error': {
|
||||
'name': 'NOT_FOUND',
|
||||
'text': 'Could not find claim at "lbry://@spam/hovercraft".'
|
||||
}}
|
||||
)
|
||||
|
||||
# After abandoning he just waits for his LBCs to be returned to his account
|
||||
@@ -186,4 +189,10 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
||||
|
||||
# He them checks that the claim doesn't resolve anymore.
|
||||
response = await self.resolve(uri)
|
||||
self.assertEqual(response[uri], {'error': f'{uri} did not resolve to a claim'})
|
||||
self.assertEqual(
|
||||
response[uri],
|
||||
{'error': {
|
||||
'name': 'NOT_FOUND',
|
||||
'text': f'Could not find claim at "{uri}".'
|
||||
}}
|
||||
)
|
||||
@@ -365,7 +365,7 @@ class CommentCommands(CommandTestCase):
|
||||
|
||||
async def test04_comment_abandons(self):
|
||||
rswanson = (await self.channel_create('@RonSwanson'))['outputs'][0]
|
||||
stream = (await self.stream_create('Pawnee Town Hall of Fame by Leslie Knope'))['outputs'][0]
|
||||
stream = (await self.stream_create('Pawnee_Tow_Hall_of_Fame_by_Leslie_Knope'))['outputs'][0]
|
||||
comment = await self.daemon.jsonrpc_comment_create(
|
||||
comment='KNOPE! WHAT DID I TELL YOU ABOUT PUTTING MY INFORMATION UP LIKE THAT',
|
||||
claim_id=stream['claim_id'],
|
||||
@@ -383,7 +383,7 @@ class CommentCommands(CommandTestCase):
|
||||
moth = (await self.channel_create('@InconspicuousMoth'))['outputs'][0]
|
||||
bee = (await self.channel_create('@LazyBumblebee'))['outputs'][0]
|
||||
moth_id = moth['claim_id']
|
||||
stream = await self.stream_create('Cool Lamps to Sit On', channel_id=moth_id)
|
||||
stream = await self.stream_create('Cool_Lamps_to_Sit_On', channel_id=moth_id)
|
||||
claim_id = stream['outputs'][0]['claim_id']
|
||||
|
||||
comment1 = await self.daemon.jsonrpc_comment_create(
|
||||
@@ -440,7 +440,7 @@ class CommentCommands(CommandTestCase):
|
||||
moth = (await self.channel_create('@InconspicuousMoth'))['outputs'][0]
|
||||
bee = (await self.channel_create('@LazyBumblebee'))['outputs'][0]
|
||||
moth_id = moth['claim_id']
|
||||
stream = await self.stream_create('Cool Lamps to Sit On', channel_id=moth_id)
|
||||
stream = await self.stream_create('Cool_Lamps_to_Sit_On', channel_id=moth_id)
|
||||
claim_id = stream['outputs'][0]['claim_id']
|
||||
hidden_comment = await self.daemon.jsonrpc_comment_create(
|
||||
comment='Who on earth would want to sit around on a lamp all day',
|
||||
|
||||
@@ -21,5 +21,5 @@ class SettingsManagement(CommandTestCase):
|
||||
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('server', 50001))
|
||||
|
||||
setting = self.daemon.jsonrpc_settings_clear('lbryum_servers')
|
||||
self.assertEqual(setting['lbryum_servers'][0], ('spv1.lbry.com', 50001))
|
||||
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('spv1.lbry.com', 50001))
|
||||
self.assertEqual(setting['lbryum_servers'][0], ('spv11.lbry.com', 50001))
|
||||
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('spv11.lbry.com', 50001))
|
||||
@@ -0,0 +1,151 @@
|
||||
import logging
|
||||
import pathlib
|
||||
import time
|
||||
|
||||
from ..blockchain.test_claim_commands import ClaimTestCase
|
||||
from lbry.conf import TranscodeConfig
|
||||
from lbry.file_analysis import VideoFileAnalyzer
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MeasureTime:
|
||||
def __init__(self, text):
|
||||
print(text, end="...", flush=True)
|
||||
|
||||
def __enter__(self):
|
||||
self.start = time.perf_counter()
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
end = time.perf_counter()
|
||||
print(f" done in {end - self.start:.6f}s", flush=True)
|
||||
|
||||
|
||||
class TranscodeValidation(ClaimTestCase):
|
||||
|
||||
def make_name(self, name, extension=""):
|
||||
path = pathlib.Path(self.video_file_name)
|
||||
return path.parent / f"{path.stem}_{name}{extension or path.suffix}"
|
||||
|
||||
async def asyncSetUp(self):
|
||||
await super().asyncSetUp()
|
||||
self.conf = TranscodeConfig()
|
||||
self.conf.volume_analysis_time = 0 # disable it as the test file isn't very good here
|
||||
self.analyzer = VideoFileAnalyzer(self.conf)
|
||||
file_ogg = self.make_name("ogg", ".ogg")
|
||||
self.video_file_ogg = str(file_ogg)
|
||||
if not file_ogg.exists():
|
||||
command = f'-i "{self.video_file_name}" -c:v libtheora -q:v 4 -c:a libvorbis -q:a 4 ' \
|
||||
f'-c:s copy -c:d copy "{file_ogg}"'
|
||||
with MeasureTime(f"Creating {file_ogg.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
file_webm = self.make_name("webm", ".webm")
|
||||
self.video_file_webm = str(file_webm)
|
||||
if not file_webm.exists():
|
||||
command = f'-i "{self.video_file_name}" -c:v libvpx-vp9 -crf 36 -b:v 0 -cpu-used 2 ' \
|
||||
f'-c:a libopus -b:a 128k -c:s copy -c:d copy "{file_webm}"'
|
||||
with MeasureTime(f"Creating {file_webm.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
async def test_should_work(self):
|
||||
new_file_name = await self.analyzer.verify_or_repair(True, False, self.video_file_name)
|
||||
self.assertEqual(self.video_file_name, new_file_name)
|
||||
new_file_name = await self.analyzer.verify_or_repair(True, False, self.video_file_ogg)
|
||||
self.assertEqual(self.video_file_ogg, new_file_name)
|
||||
new_file_name = await self.analyzer.verify_or_repair(True, False, self.video_file_webm)
|
||||
self.assertEqual(self.video_file_webm, new_file_name)
|
||||
|
||||
async def test_volume(self):
|
||||
self.conf.volume_analysis_time = 200
|
||||
with self.assertRaisesRegex(Exception, "lower than prime"):
|
||||
await self.analyzer.verify_or_repair(True, False, self.video_file_name)
|
||||
|
||||
async def test_container(self):
|
||||
file_name = self.make_name("bad_container", ".avi")
|
||||
if not file_name.exists():
|
||||
command = f'-i "{self.video_file_name}" -c copy -map 0 "{file_name}"'
|
||||
with MeasureTime(f"Creating {file_name.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
with self.assertRaisesRegex(Exception, "Container format is not in the approved list"):
|
||||
await self.analyzer.verify_or_repair(True, False, file_name)
|
||||
|
||||
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
||||
pathlib.Path(fixed_file).unlink()
|
||||
|
||||
async def test_video_codec(self):
|
||||
file_name = self.make_name("bad_video_codec_1")
|
||||
if not file_name.exists():
|
||||
command = f'-i "{self.video_file_name}" -c copy -map 0 -c:v libx265 -preset superfast "{file_name}"'
|
||||
with MeasureTime(f"Creating {file_name.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
with self.assertRaisesRegex(Exception, "Video codec is not in the approved list"):
|
||||
await self.analyzer.verify_or_repair(True, False, file_name)
|
||||
with self.assertRaisesRegex(Exception, "faststart flag was not used"):
|
||||
await self.analyzer.verify_or_repair(True, False, file_name)
|
||||
|
||||
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
||||
pathlib.Path(fixed_file).unlink()
|
||||
|
||||
async def test_video_format(self):
|
||||
file_name = self.make_name("bad_video_format_1")
|
||||
if not file_name.exists():
|
||||
command = f'-i "{self.video_file_name}" -c copy -map 0 -c:v libx264 ' \
|
||||
f'-vf format=yuv444p "{file_name}"'
|
||||
with MeasureTime(f"Creating {file_name.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
with self.assertRaisesRegex(Exception, "pixel format does not match the approved"):
|
||||
await self.analyzer.verify_or_repair(True, False, file_name)
|
||||
|
||||
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
||||
pathlib.Path(fixed_file).unlink()
|
||||
|
||||
async def test_audio_codec(self):
|
||||
file_name = self.make_name("bad_audio_codec_1", ".mkv")
|
||||
if not file_name.exists():
|
||||
command = f'-i "{self.video_file_name}" -c copy -map 0 -c:a pcm_s16le "{file_name}"'
|
||||
with MeasureTime(f"Creating {file_name.name}"):
|
||||
output, code = await self.analyzer._execute("ffmpeg", command)
|
||||
self.assertEqual(code, 0, output)
|
||||
|
||||
with self.assertRaisesRegex(Exception, "Audio codec is not in the approved list"):
|
||||
await self.analyzer.verify_or_repair(True, False, file_name)
|
||||
|
||||
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
||||
pathlib.Path(fixed_file).unlink()
|
||||
|
||||
async def test_extension_choice(self):
|
||||
|
||||
scan_data = await self.analyzer._get_scan_data(True, self.video_file_name)
|
||||
extension = self.analyzer._get_best_container_extension(scan_data, "")
|
||||
self.assertEqual(extension, pathlib.Path(self.video_file_name).suffix[1:])
|
||||
|
||||
scan_data = await self.analyzer._get_scan_data(True, self.video_file_ogg)
|
||||
extension = self.analyzer._get_best_container_extension(scan_data, "")
|
||||
self.assertEqual(extension, "ogg")
|
||||
|
||||
scan_data = await self.analyzer._get_scan_data(True, self.video_file_webm)
|
||||
extension = self.analyzer._get_best_container_extension(scan_data, "")
|
||||
self.assertEqual(extension, "webm")
|
||||
|
||||
extension = self.analyzer._get_best_container_extension("", "libx264 -crf 23")
|
||||
self.assertEqual("mp4", extension)
|
||||
|
||||
extension = self.analyzer._get_best_container_extension("", "libvpx-vp9 -crf 23")
|
||||
self.assertEqual("webm", extension)
|
||||
|
||||
extension = self.analyzer._get_best_container_extension("", "libtheora")
|
||||
self.assertEqual("ogg", extension)
|
||||
|
||||
async def test_no_ffmpeg(self):
|
||||
self.conf.ffmpeg_folder = "I don't really exist/"
|
||||
with self.assertRaisesRegex(Exception, "Unable to locate"):
|
||||
await self.analyzer.verify_or_repair(True, False, self.video_file_name)
|
||||
@@ -219,6 +219,7 @@ class TestBlobExchange(BlobExchangeTestBase):
|
||||
server_protocol = BlobServerProtocol(self.loop, self.server_blob_manager, self.server.lbrycrd_address)
|
||||
transport = asyncio.Transport(extra={'peername': ('ip', 90)})
|
||||
received_data = BytesIO()
|
||||
transport.is_closing = lambda: received_data.closed
|
||||
transport.write = received_data.write
|
||||
server_protocol.connection_made(transport)
|
||||
blob_request = BlobRequest.make_request_for_blob_hash(blob_hash).serialize()
|
||||
|
||||
@@ -57,10 +57,6 @@ class TestURLParsing(unittest.TestCase):
|
||||
url(f'lbry://@test#{claim_id}/stuff', channel_name='@test', channel_claim_id=claim_id, stream_name='stuff')
|
||||
# unicode regex edges
|
||||
_url = lambda name: url(name, stream_name=name)
|
||||
_url('\u0009')
|
||||
_url('\u000a')
|
||||
_url('\u000d')
|
||||
_url('\u0020')
|
||||
_url('\uD799')
|
||||
_url('\uE000')
|
||||
_url('\uFFFD')
|
||||
@@ -79,6 +75,10 @@ class TestURLParsing(unittest.TestCase):
|
||||
fail("lbry://\uDFFE")
|
||||
fail("lbry://\uFFFF")
|
||||
fail("lbry://;")
|
||||
fail("lbry://no\ttab")
|
||||
fail("lbry://no space")
|
||||
fail("lbry://no\rcr")
|
||||
fail("lbry://no\new\nline")
|
||||
fail("lbry://\"")
|
||||
fail("lbry://\\")
|
||||
fail("lbry:///")
|
||||
|
||||
@@ -10,7 +10,7 @@ from lbry.schema.claim import Claim
|
||||
from lbry.schema.result import Censor
|
||||
from lbry.wallet.server.db import reader, writer
|
||||
from lbry.wallet.server.coin import LBCRegTest
|
||||
from lbry.wallet.server.db.trending import TRENDING_WINDOW
|
||||
from lbry.wallet.server.db.trending import zscore
|
||||
from lbry.wallet.server.db.canonical import FindShortestID
|
||||
from lbry.wallet.server.block_processor import Timer
|
||||
from lbry.wallet.transaction import Transaction, Input, Output
|
||||
@@ -47,7 +47,7 @@ class TestSQLDB(unittest.TestCase):
|
||||
self.daemon_height = 1
|
||||
self.coin = LBCRegTest()
|
||||
db_url = 'file:test_sqldb?mode=memory&cache=shared'
|
||||
self.sql = writer.SQLDB(self, db_url, [], [])
|
||||
self.sql = writer.SQLDB(self, db_url, [], [], [zscore])
|
||||
self.addCleanup(self.sql.close)
|
||||
self.sql.open()
|
||||
reader.initializer(
|
||||
@@ -533,7 +533,7 @@ class TestTrending(TestSQLDB):
|
||||
up_biggly = self.get_stream('Claim E', COIN)
|
||||
claims = advance(1, [up_biggly, up_medium, up_small, no_trend, downwards])
|
||||
for window in range(1, 8):
|
||||
advance(TRENDING_WINDOW * window, [
|
||||
advance(zscore.TRENDING_WINDOW * window, [
|
||||
self.get_support(downwards, (20-window)*COIN),
|
||||
self.get_support(up_small, int(20+(window/10)*COIN)),
|
||||
self.get_support(up_medium, (20+(window*(2 if window == 7 else 1)))*COIN),
|
||||
@@ -549,8 +549,8 @@ class TestTrending(TestSQLDB):
|
||||
def test_edge(self):
|
||||
problematic = self.get_stream('Problem', COIN)
|
||||
self.advance(1, [problematic])
|
||||
self.advance(TRENDING_WINDOW, [self.get_support(problematic, 53000000000)])
|
||||
self.advance(TRENDING_WINDOW * 2, [self.get_support(problematic, 500000000)])
|
||||
self.advance(zscore.TRENDING_WINDOW, [self.get_support(problematic, 53000000000)])
|
||||
self.advance(zscore.TRENDING_WINDOW * 2, [self.get_support(problematic, 500000000)])
|
||||
|
||||
|
||||
class TestContentBlocking(TestSQLDB):
|
||||
@@ -617,7 +617,10 @@ class TestContentBlocking(TestSQLDB):
|
||||
self.assertEqual(1, censor.total)
|
||||
self.assertEqual({blocking_channel.claim_hash: 1}, censor.censored)
|
||||
results, _ = reader.resolve([claim1.claim_name])
|
||||
self.assertEqual('Could not find stream in "claim1".', results[0].args[0])
|
||||
self.assertEqual(
|
||||
f"Resolve of 'claim1' was censored by channel with claim id '{blocking_channel.claim_id}'.",
|
||||
results[0].args[0]
|
||||
)
|
||||
results, _ = reader.resolve([
|
||||
claim2.claim_name, regular_channel.claim_name # claim2 and channel still resolved
|
||||
])
|
||||
@@ -654,8 +657,14 @@ class TestContentBlocking(TestSQLDB):
|
||||
results, _ = reader.resolve([
|
||||
claim2.claim_name, regular_channel.claim_name # claim2 and channel don't resolve
|
||||
])
|
||||
self.assertEqual('Could not find stream in "claim2".', results[0].args[0])
|
||||
self.assertEqual('Could not find channel in "@channel1".', results[1].args[0])
|
||||
self.assertEqual(
|
||||
f"Resolve of 'claim2' was censored by channel with claim id '{blocking_channel.claim_id}'.",
|
||||
results[0].args[0]
|
||||
)
|
||||
self.assertEqual(
|
||||
f"Resolve of '@channel1' was censored by channel with claim id '{blocking_channel.claim_id}'.",
|
||||
results[1].args[0]
|
||||
)
|
||||
results, _ = reader.resolve([claim3.claim_name]) # claim3 still resolved
|
||||
self.assertEqual(claim3.claim_hash, results[0]['claim_hash'])
|
||||
|
||||
|
||||
@@ -98,6 +98,12 @@ class TestQueryBuilder(unittest.TestCase):
|
||||
'txo_name__in0_1': 'def456'
|
||||
})
|
||||
)
|
||||
self.assertTupleEqual(
|
||||
constraints_to_sql({'txo.name__in': {'abc123'}}),
|
||||
('txo.name = :txo_name__in0', {
|
||||
'txo_name__in0': 'abc123',
|
||||
})
|
||||
)
|
||||
self.assertTupleEqual(
|
||||
constraints_to_sql({'txo.age__in': 'SELECT age from ages_table'}),
|
||||
('txo.age IN (SELECT age from ages_table)', {})
|
||||
@@ -118,6 +124,12 @@ class TestQueryBuilder(unittest.TestCase):
|
||||
'txo_name__not_in0_1': 'def456'
|
||||
})
|
||||
)
|
||||
self.assertTupleEqual(
|
||||
constraints_to_sql({'txo.name__not_in': ('abc123',)}),
|
||||
('txo.name != :txo_name__not_in0', {
|
||||
'txo_name__not_in0': 'abc123',
|
||||
})
|
||||
)
|
||||
self.assertTupleEqual(
|
||||
constraints_to_sql({'txo.age__not_in': 'SELECT age from ages_table'}),
|
||||
('txo.age NOT IN (SELECT age from ages_table)', {})
|
||||
|
||||
Reference in new issue
Block a user