Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416c3c16ab | ||
|
|
a11956ece0 | ||
|
|
c4e0c659a7 | ||
|
|
f6ba09b171 | ||
|
|
b827881024 | ||
|
|
89e395b5f4 | ||
|
|
c590954eb9 | ||
|
|
a5af3866fd | ||
|
|
1bef56f030 | ||
|
|
9045737504 | ||
|
|
0e48772c84 | ||
|
|
72690b5cff | ||
|
|
07bae26fd3 | ||
|
|
7b0e4617d3 | ||
|
|
af797296ed | ||
|
|
c826c7da0d | ||
|
|
20af1396b9 | ||
|
|
f567aca532 | ||
|
|
c60b658443 | ||
|
|
fde8c34088 | ||
|
|
deb6a07160 | ||
|
|
0a66e1b24c | ||
|
|
819a551b77 | ||
|
|
5119b71035 | ||
|
|
33945e14d3 | ||
|
|
1d9705fb17 | ||
|
|
1949937b5e | ||
|
|
956e21269e | ||
|
|
ff73418fc1 | ||
|
|
76d40f44d8 | ||
|
|
ab6944b7b0 | ||
|
|
4d741bd200 | ||
|
|
f3a163b382 | ||
|
|
011b7f090f | ||
|
|
4ead92cfbe | ||
|
|
9ee2f30df4 | ||
|
|
4a749f6c38 | ||
|
|
cf924373f6 | ||
|
|
d1f5b25418 | ||
|
|
822f53c888 | ||
|
|
f04c5ee902 | ||
|
|
022d60ec2c | ||
|
|
8fce374cae | ||
|
|
e78e2738ef | ||
|
|
5728493abb | ||
|
|
af1c8ec35c | ||
|
|
cb84abfb88 | ||
|
|
df1e349470 | ||
|
|
357ce881a6 | ||
|
|
aa417f5410 | ||
|
|
0ca29b9518 | ||
|
|
22db04068e | ||
|
|
65e74281e0 | ||
|
|
46d89929ba | ||
|
|
1c941a355b | ||
|
|
0d6248fbeb | ||
|
|
98d4d00f96 | ||
|
|
e2d618f472 | ||
|
|
79d643db6c | ||
|
|
13891330d9 | ||
|
|
6fd0c2bf77 | ||
|
|
b8b42a1fd2 | ||
|
|
fba1b28615 | ||
|
|
98828387e3 | ||
|
|
1c12247b71 | ||
|
|
ee10ebd5d7 | ||
|
|
9937ad6e85 | ||
|
|
60ce393531 | ||
|
|
bc33cad999 | ||
|
|
4261b50d9d | ||
|
|
e2b3141536 | ||
|
|
266aa1b15d | ||
|
|
b57a7475c5 | ||
|
|
8cf48eb5f7 | ||
|
|
35541bbbb9 | ||
|
|
59424a3e73 | ||
|
|
2056888667 | ||
|
|
1e54785742 | ||
|
|
a58ed6f331 | ||
|
|
9a79b71d9f | ||
|
|
e9098887fb | ||
|
|
9e8a3ef7fc | ||
|
|
221585908a | ||
|
|
f4c111f04c | ||
|
|
de12e25450 | ||
|
|
2545ebbece | ||
|
|
14ec6ce43b | ||
|
|
0cac1e65aa | ||
|
|
1e4d57ab83 | ||
|
|
49b42b7e03 | ||
|
|
89c0b5dbdf | ||
|
|
8138675808 | ||
|
|
726129836a | ||
|
|
356b3c85e5 | ||
|
|
1a0680ead9 | ||
|
|
c876d891fa | ||
|
|
a08232f164 | ||
|
|
0f8cf46626 | ||
|
|
95017b5fc8 | ||
|
|
1374d337d8 | ||
|
|
35e7cc685f | ||
|
|
2ac4883bda | ||
|
|
5a7212aebb | ||
|
|
3f39cc2955 | ||
|
|
8a5bfe884a | ||
|
|
046dd53913 | ||
|
|
d2f174635c | ||
|
|
01a760d8f0 | ||
|
|
9215d2c9f9 | ||
|
|
0bb09ae91e | ||
|
|
afeff61268 | ||
|
|
6f5a595975 | ||
|
|
8a69ec062e | ||
|
|
45fb673e49 | ||
|
|
93b5f1809e | ||
|
|
ff05eaae48 | ||
|
|
b48b67ed10 | ||
|
|
3ead6f63b6 | ||
|
|
77235f0ad8 | ||
|
|
f6a80ba929 | ||
|
|
295ceb90d5 | ||
|
|
df41a82b23 | ||
|
|
34500e07c6 | ||
|
|
1e6097e3b2 | ||
|
|
521facedc4 | ||
|
|
de80a2ba97 | ||
|
|
3afd615447 | ||
|
|
87e52bec0a | ||
|
|
b89f04b1f1 | ||
|
|
e4f802e5f4 | ||
|
|
16fc2c456f | ||
|
|
ef7656ae98 | ||
|
|
ad2df4871e | ||
|
|
8d5f50b695 | ||
|
|
bbc056eef0 | ||
|
|
82fd3c632e | ||
|
|
dbae939808 | ||
|
|
c2dcacb0de | ||
|
|
8f45618cd0 | ||
|
|
29a87c850c | ||
|
|
395518ff76 | ||
|
|
08da763327 | ||
|
|
d7ec3c182d | ||
|
|
ffe6418392 | ||
|
|
88adf3ee27 | ||
|
|
f406db85dc | ||
|
|
d5f8af471a | ||
|
|
046459a72d | ||
|
|
49b0f59790 | ||
|
|
71551058ce | ||
|
|
2a9e6473eb | ||
|
|
576ef9c4ed | ||
|
|
4d64fca9de | ||
|
|
8b1307e1ca | ||
|
|
eae4ed7b27 | ||
|
|
6997ea608d | ||
|
|
d97d738880 | ||
|
|
f72b07d0f4 | ||
|
|
b89916a3d7 | ||
|
|
e4aeb66257 | ||
|
|
578f8f4062 | ||
|
|
8fbf82f4ea | ||
|
|
478ae7e657 | ||
|
|
d319761483 | ||
|
|
16fb716872 | ||
|
|
b8d9d097d8 | ||
|
|
ec79a1d0e8 | ||
|
|
31284e0c5e | ||
|
|
8e64b1840d | ||
|
|
dd9bf04e35 | ||
|
|
76a27fdef1 | ||
|
|
f96443515a | ||
|
|
0f1bde2274 | ||
|
|
6fb94e445f | ||
|
|
e02a4e44c0 | ||
|
|
71dc882d5d | ||
|
|
ae4a29d41c | ||
|
|
d27a3b6421 | ||
|
|
03a58cf50a | ||
|
|
f43e370e89 | ||
|
|
45bdb9023a | ||
|
|
6d7aa93157 | ||
|
|
d083910255 | ||
|
|
db3f9af174 | ||
|
|
7d2ad5e4ed | ||
|
|
84d3771984 | ||
|
|
1eebe006ae | ||
|
|
0327ce53a6 | ||
|
|
85442c1d07 | ||
|
|
a6ed51b7a7 | ||
|
|
dc8b4b5252 | ||
|
|
8ca74d3de2 | ||
|
|
1923e6f152 | ||
|
|
0d621e085b | ||
|
|
8749c78622 | ||
|
|
510d88fff1 | ||
|
|
d9460dcd9e | ||
|
|
d0607b6fec | ||
|
|
2481305a1a | ||
|
|
9990889cce | ||
|
|
14f743c493 | ||
|
|
df8fe2e3ef | ||
|
|
906fea972e | ||
|
|
04a82d5c23 | ||
|
|
f2944fd33b | ||
|
|
dcb1e53aba | ||
|
|
a4d8508b40 | ||
|
|
f109aa1f73 | ||
|
|
f09c18539b | ||
|
|
c5aeac6898 | ||
|
|
b81c801f2d | ||
|
|
f3cedf2f44 | ||
|
|
910999e7e4 | ||
|
|
5bceb06fc5 | ||
|
|
cc098f3090 | ||
|
|
a73c5aec27 | ||
|
|
68b29d9529 | ||
|
|
57f069d750 | ||
|
|
67e12bc590 | ||
|
|
ff2a08747b | ||
|
|
3791d22713 | ||
|
|
638ecafb69 | ||
|
|
5176feed81 | ||
|
|
8c63033461 | ||
|
|
8c878f8e25 | ||
|
|
c1c7e30ec9 | ||
|
|
28ae7f81e9 | ||
|
|
71de4d769d | ||
|
|
f502944c5b | ||
|
|
99d21e93f3 | ||
|
|
350e610f15 | ||
|
|
4f208b6b31 | ||
|
|
dcb781a57e | ||
|
|
09db71ae7f | ||
|
|
60dc43340d | ||
|
|
256b10bd7d | ||
|
|
77adcaeb50 | ||
|
|
abf2ca40a2 | ||
|
|
d5183123fa | ||
|
|
8b0d96acba | ||
|
|
66122a45ed | ||
|
|
a2953ac9ac | ||
|
|
c51db5294f | ||
|
|
8cba43bfed | ||
|
|
4b1c7aa6c5 | ||
|
|
14c1e95841 | ||
|
|
4f5a4d9ce0 | ||
|
|
82f2ad21e1 | ||
|
|
8a5b803788 | ||
|
|
86b46ebf19 | ||
|
|
ca999053ae | ||
|
|
8b152f3c96 | ||
|
|
c68bfbdf2e | ||
|
|
7e8180fefc | ||
|
|
305226a3bd | ||
|
|
c8752b03c1 | ||
|
|
8195deebe3 | ||
|
|
88f2156aeb | ||
|
|
b1982a81dc | ||
|
|
18e19213f4 | ||
|
|
6fb67b86f5 | ||
|
|
a4c15769d0 | ||
|
|
894e86d3ee | ||
|
|
9712ef8abf | ||
|
|
908107d24f | ||
|
|
d667efa9de | ||
|
|
e649d7219b | ||
|
|
1f5698ec86 | ||
|
|
15341aa80e | ||
|
|
3f4895bd40 | ||
|
|
103c93a06c | ||
|
|
21f02d3e6d | ||
|
|
9ce93a1da6 | ||
|
|
d0e1468acd | ||
|
|
8a5bb239c5 | ||
|
|
816cde32a9 | ||
|
|
2b514a9df7 | ||
|
|
ef39ba26a0 | ||
|
|
59ca3d3d16 | ||
|
|
80ff60f0aa | ||
|
|
488c2e2f17 | ||
|
|
9e11fc1e99 | ||
|
|
a8b590ecbb | ||
|
|
8ca8591ed6 | ||
|
|
e393314423 | ||
|
|
c54373bd9c | ||
|
|
f459b6833a | ||
|
|
0a6eb76542 | ||
|
|
e6d42b5319 | ||
|
|
0d2804ce55 | ||
|
|
8efdd9d29a | ||
|
|
27c36a4dce | ||
|
|
2f74611844 | ||
|
|
d8265add2d | ||
|
|
01cd02e4c5 | ||
|
|
2b98f85961 | ||
|
|
338d1bd8e7 | ||
|
|
7dedaeeef7 | ||
|
|
54830b8968 | ||
|
|
41b866c1ee | ||
|
|
fe7224e537 | ||
|
|
f5e38f6e23 | ||
|
|
063335377e | ||
|
|
ee6f511126 | ||
|
|
75574486d3 | ||
|
|
03a09f0f42 | ||
|
|
075b3ec3d2 | ||
|
|
3d5aa6a44b | ||
|
|
8350b42c1b | ||
|
|
7061a62e88 | ||
|
|
133fceeee5 | ||
|
|
38331b8918 | ||
|
|
5bbba0b65a | ||
|
|
07a63b2a0a | ||
|
|
9ddc70fc81 | ||
|
|
2b6f5fde13 | ||
|
|
d4b006656d | ||
|
|
b1e70723c7 | ||
|
|
1ec1ad19f8 | ||
|
|
b96b27ed91 | ||
|
|
8b145cb1d8 | ||
|
|
85d7adc0b5 | ||
|
|
d530599b5d | ||
|
|
16215d5b96 | ||
|
|
db685e5807 | ||
|
|
190304344c | ||
|
|
24e8a3c62e | ||
|
|
571b02f381 | ||
|
|
36e3f1b3ec | ||
|
|
564d6bdc5d | ||
|
|
1e2b040f75 | ||
|
|
5876d5c295 | ||
|
|
54e53932bd | ||
|
|
c9b3c2e6aa | ||
|
|
912c102d9a | ||
|
|
2b7cbf9759 | ||
|
|
1cc6b2e31e | ||
|
|
7fa797712a | ||
|
|
636f36ebad | ||
|
|
8e0888b846 | ||
|
|
ce5dd5022b | ||
|
|
4a24cc0095 | ||
|
|
f2bd0edc51 | ||
|
|
756d17bada | ||
|
|
81e061af30 | ||
|
|
a60cd1d475 | ||
|
|
f78323e0fb | ||
|
|
fd6cbe0f6c | ||
|
|
c30e905e19 | ||
|
|
f5650c1b13 | ||
|
|
ecebbc86c6 | ||
|
|
bfeed40bfe | ||
|
|
2ad22d7d19 | ||
|
|
262735c219 | ||
|
|
3abc98acc8 | ||
|
|
eaa8ba814e | ||
|
|
588568752b | ||
|
|
794eac0519 | ||
|
|
b75139662b | ||
|
|
9e24f4ca54 | ||
|
|
1b5281c23e | ||
|
|
be15601a67 | ||
|
|
35cd42bfea | ||
|
|
a30e2daf05 | ||
|
|
adb7edd3b2 | ||
|
|
03e48c0968 | ||
|
|
3ea92c0d6e | ||
|
|
8e43e40810 | ||
|
|
a14b91cdda | ||
|
|
08609e9760 | ||
|
|
ca0a3dbf9e | ||
|
|
9d0b9f0ded | ||
|
|
8911af58cf | ||
|
|
d23920cc61 | ||
|
|
ee353ca776 | ||
|
|
bba4c6e4f4 | ||
|
|
1d126913e9 | ||
|
|
b3afee2f86 | ||
|
|
31983fbb8e | ||
|
|
ba8870823c | ||
|
|
5f1bc01636 | ||
|
|
ffa9e508e9 | ||
|
|
cfb051396a | ||
|
|
397ebe8428 | ||
|
|
2626a28e6d | ||
|
|
fb2d7cbe28 | ||
|
|
874b3faf8c | ||
|
|
a54a11dca0 | ||
|
|
e7beb6b1a7 | ||
|
|
30edd53f3e | ||
|
|
fe446862c2 | ||
|
|
6788e09ae9 | ||
|
|
f0c2d16749 | ||
|
|
9b21bd1a6f | ||
|
|
169ef00b9e | ||
|
|
aa93b94b61 | ||
|
|
d7dadc2f0e | ||
|
|
33ac9eea13 | ||
|
|
9ff41f748e | ||
|
|
9589ac6d02 | ||
|
|
cfa74985e0 | ||
|
|
38ae660a68 | ||
|
|
ca4a07f766 | ||
|
|
9281bdb61b | ||
|
|
80b65ae7e7 | ||
|
|
61a254f580 | ||
|
|
4ba90a727b | ||
|
|
27558ffd89 | ||
|
|
c44de48481 | ||
|
|
a021ddeffd | ||
|
|
cdd25e3b0f | ||
|
|
1286417aec | ||
|
|
fcac4f1488 | ||
|
|
f655fefe52 | ||
|
|
7979f0a683 | ||
|
|
d9df2ead84 | ||
|
|
b07ca20e0e | ||
|
|
3a1cd8985c | ||
|
|
a79be0513b | ||
|
|
569ac502ed | ||
|
|
b86d2e6e73 | ||
|
|
f8d24d3402 | ||
|
|
589768864a | ||
|
|
bd2512c27e | ||
|
|
9e4c1120fa | ||
|
|
4eff0d2660 | ||
|
|
09726876ad | ||
|
|
45c6ad3f6d | ||
|
|
97e4d51c29 | ||
|
|
f134bc264b | ||
|
|
57eb56b92d | ||
|
|
6c68ba1d22 | ||
|
|
cabc58feb4 | ||
|
|
364f95612a | ||
|
|
45669dad33 | ||
|
|
19e326c140 | ||
|
|
e1c0caa357 | ||
|
|
9d3e1af69b | ||
|
|
662f2bff4c | ||
|
|
9a9d37cc50 | ||
|
|
3e4c9f25a8 | ||
|
|
2cb9d5c636 | ||
|
|
a53b60fca4 | ||
|
|
09b77972d9 | ||
|
|
7a8c2fc98b | ||
|
|
355989d6d1 | ||
|
|
08814ad811 | ||
|
|
6a00cf9942 | ||
|
|
e79202de3c | ||
|
|
527e288568 | ||
|
|
ed32d17936 | ||
|
|
3a8e1cd4a5 | ||
|
|
186de045b3 | ||
|
|
feee534829 | ||
|
|
f4bf260cdb | ||
|
|
442138ef36 | ||
|
|
b9b411ec30 | ||
|
|
d72a152195 | ||
|
|
390226d2ef | ||
|
|
a16495d06f | ||
|
|
7092f40701 | ||
|
|
458189366f | ||
|
|
9d772a45d5 | ||
|
|
1c860e8578 | ||
|
|
50fc027289 | ||
|
|
e310601266 | ||
|
|
78fd434686 | ||
|
|
a6de3a9642 | ||
|
|
5ed478ed11 | ||
|
|
b93f9d4c94 | ||
|
|
f4ec20a2e2 | ||
|
|
8bc07fad32 | ||
|
|
612066165a | ||
|
|
b273d58a80 | ||
|
|
b2544139e6 | ||
|
|
367ffdea1f | ||
|
|
4c854dd5a7 | ||
|
|
e96b2f702d | ||
|
|
cff22a8951 | ||
|
|
1b7c5a1373 | ||
|
|
2bd60021aa | ||
|
|
2b8c06bda7 | ||
|
|
c36b4626a9 | ||
|
|
b5f245d9b6 | ||
|
|
899a6f0d4a | ||
|
|
ba5fc2a627 | ||
|
|
9525bd6ca0 | ||
|
|
6c4f6dd59a | ||
|
|
997b573aa4 | ||
|
|
ca67c56222 | ||
|
|
56fc003a96 | ||
|
|
8cb811ca1d | ||
|
|
9e5246c619 | ||
|
|
b2bcf39872 | ||
|
|
0fc864c2d5 | ||
|
|
4b39aad07e | ||
|
|
10c1f8e1cf | ||
|
|
ed880be3e5 | ||
|
|
e5714dc1fc | ||
|
|
1732167af1 | ||
|
|
ee28bbc19b | ||
|
|
345d4f8ab1 | ||
|
|
e745b6c16e | ||
|
|
ee57af8e99 | ||
|
|
700f73e8e9 | ||
|
|
fb6a7442a6 | ||
|
|
b8a3b62f0f | ||
|
|
78b84ba698 | ||
|
|
fdf479241a | ||
|
|
8fcbf48bdf | ||
|
|
268e599423 | ||
|
|
ae8fece9bb | ||
|
|
c91c69540b | ||
|
|
c497385bc7 | ||
|
|
37468cad59 | ||
|
|
5f70ae9923 | ||
|
|
c1b96a36a7 | ||
|
|
5cdda0f3a8 | ||
|
|
f0e1fc1a49 | ||
|
|
77d8c68b13 | ||
|
|
48d7bfd225 | ||
|
|
f60435c878 | ||
|
|
41332f22c3 | ||
|
|
a6ff18c872 | ||
|
|
b90378d739 | ||
|
|
a5a0089daa | ||
|
|
82c71e4255 | ||
|
|
dce5541c3a | ||
|
|
8bbda75865 | ||
|
|
e650562758 | ||
|
|
d3d60071ae | ||
|
|
85503cf92b | ||
|
|
f67b872bd1 | ||
|
|
c497e9884a | ||
|
|
3b021af1bd | ||
|
|
6fe648b9a9 | ||
|
|
03594dab6a | ||
|
|
b830f4c3ca | ||
|
|
28b638f0aa | ||
|
|
4d0ecd1fb4 | ||
|
|
b62c5c57af | ||
|
|
c7b647b1eb | ||
|
|
63563c412c | ||
|
|
9fed3fce3e | ||
|
|
a8f8ff30a2 | ||
|
|
d270e84810 | ||
|
|
0b8c67f2f0 | ||
|
|
2b73d3d109 | ||
|
|
a7838b80c3 | ||
|
|
f2f2a12ea1 | ||
|
|
382ebb55b9 | ||
|
|
c6b32fa946 | ||
|
|
ae0e1bfaef | ||
|
|
aa73cb9bbf | ||
|
|
d60b98236b | ||
|
|
2cd1947ef5 | ||
|
|
e10f1df321 | ||
|
|
2c5fd4aade | ||
|
|
0ce4b9a7de | ||
|
|
44b1178cfe | ||
|
|
7bdcaa6737 | ||
|
|
cab8981716 | ||
|
|
36ad834d43 | ||
|
|
b999abb9ea | ||
|
|
55f5c7491c | ||
|
|
52b7bb0fce | ||
|
|
b19fd8ed85 | ||
|
|
6bdd9c9d78 | ||
|
|
87c210952b | ||
|
|
4b9c3e8409 | ||
|
|
c6f2d8b6fc | ||
|
|
b23481bd21 | ||
|
|
64a626cbb5 | ||
|
|
d4f964ef8e | ||
|
|
7f09405335 | ||
|
|
e37da81dc6 | ||
|
|
febadc5dd6 | ||
|
|
4aea68ecd1 | ||
|
|
6a97f96745 | ||
|
|
3ed03c267a | ||
|
|
c60e17b341 | ||
|
|
689c578081 | ||
|
|
2723a55766 | ||
|
|
d02da2f3a5 | ||
|
|
462fd8bad1 | ||
|
|
75dd93436c | ||
|
|
eebfe2be08 | ||
|
|
3a264c1eec | ||
|
|
9c4dfa7f84 | ||
|
|
d9c21ce37b | ||
|
|
1d84440b74 | ||
|
|
9aa22e1071 | ||
|
|
9cea8d2725 | ||
|
|
944238d542 | ||
|
|
95cbdcb131 | ||
|
|
38b1fb5fba | ||
|
|
fe59ed0105 | ||
|
|
356ab9666f | ||
|
|
0960762694 | ||
|
|
1f4a9cff26 | ||
|
|
a6f97dfbde | ||
|
|
04aa559037 | ||
|
|
a55feee960 | ||
|
|
29c0e3f15f | ||
|
|
b0bc06ae00 | ||
|
|
cdbb34e976 | ||
|
|
5c5b0ace53 | ||
|
|
a879c822c2 | ||
|
|
841d49554c | ||
|
|
0d22b8c23c | ||
|
|
c29b4c476d | ||
|
|
5977f42a7e | ||
|
|
58d2c04b9f | ||
|
|
c45c792657 | ||
|
|
c0e0b4b745 | ||
|
|
aa47f10602 | ||
|
|
9268b6ca13 | ||
|
|
4832526477 | ||
|
|
53e0fe9a69 | ||
|
|
8ed0791b26 | ||
|
|
8a87195f55 | ||
|
|
0b75bb4052 | ||
|
|
543f533a68 | ||
|
|
89f4ec12e9 | ||
|
|
d76758bd1d | ||
|
|
18629c93a2 | ||
|
|
b3f3fdeb1d | ||
|
|
71d99046d1 | ||
|
|
eedc9bf9ed | ||
|
|
94b920ab2a | ||
|
|
873437e6a9 | ||
|
|
57abad2181 | ||
|
|
91d95bd42e | ||
|
|
b102afd68a | ||
|
|
9e55694512 | ||
|
|
00cf8131ec | ||
|
|
026bcd4d4d | ||
|
|
a27f89157e | ||
|
|
9a2e9d68e7 | ||
|
|
c961dd609a | ||
|
|
dabedc17d0 | ||
|
|
e7dcd9216b | ||
|
|
95a22831aa | ||
|
|
ac2fe3476a | ||
|
|
df251def26 | ||
|
|
133a86cd89 | ||
|
|
1a5654d50b | ||
|
|
5b28e77ab5 | ||
|
|
f8c1790558 | ||
|
|
e2537e43b5 | ||
|
|
d4107600a5 | ||
|
|
e996717b60 | ||
|
|
75ddf209e2 | ||
|
|
f5515e5e77 | ||
|
|
1eb375ba80 | ||
|
|
d3a171e638 | ||
|
|
e154c83ffe | ||
|
|
69ad8e384a | ||
|
|
cfeb7b249b | ||
|
|
3a35951b46 | ||
|
|
420ba43d5a | ||
|
|
2a42bda0a0 | ||
|
|
6be95dceab | ||
|
|
a20c060931 | ||
|
|
b0bd0b1fc0 | ||
|
|
746aef474a | ||
|
|
5a2a3727b2 | ||
|
|
40651322d0 | ||
|
|
c2a9027c19 | ||
|
|
25046124c0 | ||
|
|
2f83ebb3b5 | ||
|
|
a03069bf89 | ||
|
|
93555cad3c | ||
|
|
0a2d916931 | ||
|
|
a4519d3add | ||
|
|
67dc297c97 | ||
|
|
7c39e55089 | ||
|
|
3f17dd336b | ||
|
|
10fd654edc | ||
|
|
686eb7b1f0 | ||
|
|
97532fb300 | ||
|
|
e36e4c6354 | ||
|
|
fcc7177a9a | ||
|
|
0f786a8c43 | ||
|
|
184d3a5910 | ||
|
|
9370b1d2fa | ||
|
|
f46550262f | ||
|
|
adec715010 | ||
|
|
1ce5da80d6 | ||
|
|
0ffec82e35 | ||
|
|
32ba594e55 | ||
|
|
feac754925 | ||
|
|
565b095a8d | ||
|
|
5db792e99c | ||
|
|
c9c3585e1e | ||
|
|
4a0d461446 | ||
|
|
630a805c49 | ||
|
|
5eb276655d | ||
|
|
2006ad68ee | ||
|
|
ae56b81a08 | ||
|
|
e2296d4491 | ||
|
|
dd40d2e6ce | ||
|
|
c3cb297205 | ||
|
|
6bb81e4d6f | ||
|
|
c58a1c9ead | ||
|
|
da265198f1 | ||
|
|
1dfc18683d | ||
|
|
9a467f8840 | ||
|
|
aba3ed7ca0 | ||
|
|
22b897db2e | ||
|
|
833ef98ff5 | ||
|
|
43cd9c4100 | ||
|
|
4dee59a49d | ||
|
|
52846a3b24 | ||
|
|
ac0c88768d | ||
|
|
9977a398af | ||
|
|
643998332e | ||
|
|
13444ae6c3 | ||
|
|
05ec13394c | ||
|
|
b7cbe16159 | ||
|
|
f0ecf58752 | ||
|
|
e9fbc875e0 | ||
|
|
99ae39012f | ||
|
|
fbd1b2ec30 | ||
|
|
eb6781481a | ||
|
|
78e4135159 | ||
|
|
54350bcbc4 | ||
|
|
09a32174c8 | ||
|
|
740af0465e | ||
|
|
08f3ecbf25 | ||
|
|
02768a8181 | ||
|
|
c86113b288 | ||
|
|
246cc234c4 | ||
|
|
4e4c4b5f96 | ||
|
|
ca6d5937ba | ||
|
|
ece2db08da |
No files matched your search
@@ -1,74 +0,0 @@
|
||||
<!--
|
||||
Thanks for reporting an issue to LBRY and helping us improve!
|
||||
|
||||
To make it possible for us to help you, please fill out below information carefully.
|
||||
|
||||
Before reporting any issues, please make sure that you're using the latest version.
|
||||
- App: https://github.com/lbryio/lbry-desktop/releases
|
||||
- Daemon: https://github.com/lbryio/lbry/releases
|
||||
|
||||
We are also available on Discord at https://chat.lbry.com
|
||||
-->
|
||||
|
||||
|
||||
## The Issue
|
||||
|
||||
In order to <achieve some value>,
|
||||
as a <type of user>,
|
||||
I want <some functionality>.
|
||||
|
||||
|
||||
### Steps to reproduce
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Expected behaviour
|
||||
Tell us what should happen
|
||||
|
||||
### Actual behaviour
|
||||
Tell us what happens instead
|
||||
|
||||
|
||||
## System Configuration
|
||||
|
||||
<!-- For the app, this info is in the About section at the bottom of the Help page.
|
||||
You can include a screenshot instead of typing it out -->
|
||||
|
||||
<!-- For the daemon, run:
|
||||
curl 'http://localhost:5279' --data '{"method":"version"}'
|
||||
and include the full output -->
|
||||
|
||||
- LBRY Daemon version:
|
||||
- LBRY App version:
|
||||
- LBRY Installation ID:
|
||||
- Operating system:
|
||||
|
||||
|
||||
## Anything Else
|
||||
<!-- Include anything else that does not fit into the above sections -->
|
||||
|
||||
|
||||
## Screenshots
|
||||
<!-- If a screenshot would help explain the bug, please include one or two here -->
|
||||
|
||||
|
||||
|
||||
## Internal Use
|
||||
|
||||
### Acceptance Criteria
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Definition of Done
|
||||
- [ ] Tested against acceptance criteria
|
||||
- [ ] Tested against the assumptions of user story
|
||||
- [ ] The project builds without errors
|
||||
- [ ] Unit tests are written and passing
|
||||
- [ ] Tests on devices/browsers listed in the issue have passed
|
||||
- [ ] QA performed & issues resolved
|
||||
- [ ] Refactoring completed
|
||||
- [ ] Any configuration or build changes documented
|
||||
- [ ] Documentation updated
|
||||
- [ ] Peer Code Review performed
|
||||
@@ -1,38 +0,0 @@
|
||||
## PR Checklist
|
||||
Please check all that apply to this PR using "x":
|
||||
|
||||
- [ ] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
|
||||
- [ ] I have checked that this PR does not introduce a breaking change
|
||||
- [ ] This PR introduces breaking changes and I have provided a detailed explanation below
|
||||
|
||||
|
||||
## PR Type
|
||||
What kind of change does this PR introduce?
|
||||
|
||||
Why is this change necessary?
|
||||
|
||||
<!-- Please check all that apply to this PR using "x". -->
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Feature
|
||||
- [ ] Breaking changes (bugfix or feature that introduces breaking changes)
|
||||
- [ ] Code style update (formatting)
|
||||
- [ ] Refactoring (no functional changes)
|
||||
- [ ] Documentation changes
|
||||
- [ ] Other - Please describe:
|
||||
|
||||
## Fixes
|
||||
|
||||
Issue Number: N/A
|
||||
|
||||
|
||||
## What is the current behavior?
|
||||
|
||||
|
||||
## What is the new behavior?
|
||||
|
||||
|
||||
## Other information
|
||||
|
||||
|
||||
<!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
|
||||
@@ -1,13 +1,2 @@
|
||||
.DS_Store
|
||||
/build
|
||||
/dist
|
||||
/.tox
|
||||
/.idea
|
||||
/.coverage
|
||||
/lbry-venv
|
||||
|
||||
lbrynet.egg-info
|
||||
__pycache__
|
||||
_trial_temp/
|
||||
|
||||
/tests/integration/files
|
||||
/.DS_Store
|
||||
@@ -3,143 +3,143 @@ dist: xenial
|
||||
language: python
|
||||
python: "3.7"
|
||||
|
||||
env:
|
||||
global:
|
||||
# must also be updated in wine_build.sh
|
||||
- TORBA=master
|
||||
|
||||
jobs:
|
||||
include:
|
||||
|
||||
- stage: code quality
|
||||
name: "pylint lbrynet"
|
||||
name: "pylint & mypy"
|
||||
install:
|
||||
- pip install astroid pylint
|
||||
- pip install git+https://github.com/lbryio/torba.git@${TORBA}#egg=torba
|
||||
- pip install -e .
|
||||
script: pylint lbrynet
|
||||
- make install
|
||||
script: make lint
|
||||
|
||||
- stage: test
|
||||
name: "Unit Tests"
|
||||
name: "LBRY Unit Tests"
|
||||
install:
|
||||
- pip install coverage
|
||||
- pip install git+https://github.com/lbryio/torba.git@${TORBA}#egg=torba
|
||||
- pip install -e .
|
||||
- make install
|
||||
script:
|
||||
- HOME=/tmp coverage run -p --source=lbrynet -m unittest discover -vv tests.unit
|
||||
- cd lbry && HOME=/tmp coverage run -p --source=lbry -m unittest discover -vv tests.unit
|
||||
after_success:
|
||||
- coverage combine
|
||||
- coverage combine lbry/
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- name: "Integration Tests"
|
||||
- name: "LBRY Integration Tests"
|
||||
install:
|
||||
- pip install tox-travis coverage
|
||||
- pushd .. && git clone --single-branch --branch ${TORBA} https://github.com/lbryio/torba.git && popd
|
||||
|
||||
script: tox
|
||||
- pip install coverage tox-travis
|
||||
script: cd lbry && tox
|
||||
after_success:
|
||||
- coverage combine tests/
|
||||
- coverage combine lbry
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- &torba-tests
|
||||
name: "Torba Unit Tests"
|
||||
env: TESTTYPE=unit
|
||||
install:
|
||||
- pip install coverage tox-travis
|
||||
script: cd torba && tox
|
||||
after_success:
|
||||
- coverage combine torba/tests
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- <<: *torba-tests
|
||||
name: "Torba Integration Tests"
|
||||
env: TESTTYPE=integration
|
||||
|
||||
- name: "Run Examples"
|
||||
install:
|
||||
- pip install coverage
|
||||
- pip install git+https://github.com/lbryio/torba.git@${TORBA}#egg=torba
|
||||
- pip install -e .
|
||||
- make install
|
||||
script:
|
||||
- HOME=/tmp coverage run -p --source=lbrynet scripts/generate_json_api.py
|
||||
- cd lbry && HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
|
||||
after_success:
|
||||
- coverage combine
|
||||
- coverage combine lbry
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- stage: build
|
||||
name: "Windows"
|
||||
language: generic
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- docker pull lbry/pyinstaller34_32bits:py371
|
||||
script:
|
||||
- python scripts/set_build.py
|
||||
- docker run -v "$(pwd):/src/lbry" lbry/pyinstaller34_32bits:py371 lbry/scripts/wine_build.sh
|
||||
- sudo zip -j dist/lbrynet-windows.zip dist/lbrynet.exe
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: $GITHUB_OAUTH_TOKEN
|
||||
file: dist/lbrynet-windows.zip
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
addons:
|
||||
artifacts:
|
||||
working_dir: dist
|
||||
paths:
|
||||
- lbrynet-windows.zip
|
||||
target_paths:
|
||||
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})
|
||||
|
||||
- &build
|
||||
stage: build
|
||||
name: "Linux"
|
||||
env: OS=linux
|
||||
install:
|
||||
- pip3 install pyinstaller
|
||||
- pip3 install git+https://github.com/lbryio/torba.git@${TORBA}#egg=torba
|
||||
- python3 scripts/set_build.py
|
||||
- pip3 install -e .
|
||||
- pip install pyinstaller awscli
|
||||
- cd torba && pip install -e . && cd ..
|
||||
- cd lbry
|
||||
- python scripts/set_build.py
|
||||
- pip install -e .
|
||||
script:
|
||||
- pyinstaller -F -n lbrynet lbrynet/extras/cli.py
|
||||
- chmod +x dist/lbrynet
|
||||
- zip -j dist/lbrynet-${OS}.zip dist/lbrynet
|
||||
- ./dist/lbrynet --version
|
||||
- pyinstaller -F -n lbrynet lbry/extras/cli.py
|
||||
- cd dist
|
||||
- chmod +x lbrynet
|
||||
- zip -j lbrynet-${OS}.zip lbrynet
|
||||
- shasum -a 256 -b lbrynet-${OS}.zip
|
||||
- ./lbrynet --version
|
||||
after_success:
|
||||
- aws configure set aws_access_key_id $ARTIFACTS_KEY
|
||||
- aws configure set aws_secret_access_key $ARTIFACTS_SECRET
|
||||
- aws configure set region us-east-1
|
||||
- export S3_PATH="daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})"
|
||||
- aws s3 cp lbrynet-${OS}.zip s3://build.lbry.io/${S3_PATH}/lbrynet-${OS}.zip
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: $GITHUB_OAUTH_TOKEN
|
||||
file: dist/lbrynet-${OS}.zip
|
||||
api_key:
|
||||
secure: "unnR+aSJ1937Cl1PyBBZzGuZvV5W5TGcXELhXTgyOeeI6FgO/j80qmbNxJDA7qdFH/hvVicQFWoflhZu2dxN5rYP5BQJW3q3XoOLY3XAc1s1vicFkwqn3TIfdFiJTz+/D9eBUBBhHKeYFxm3M+thvklTLgjKl6fflh14NfGuNTevK9yQke8wewW3f9UmFTo1qNOPF1OsTZRbwua6oQYa59P+KukoPt4Dsu1VtILtTkj7hfEsUL79cjotwO3gkhYftxbl/xeDSZWOt+9Nhb8ZKmQG/uDx4JiTMm5lWRk4QB7pUujZ1CftxCYWz/lJx9nuJpdCOgP624tcHymErNlD+vGLwMTNslcXGYkAJH6xvGyxBJ+Obc8vRVnZbRM26BfH34TcPK1ueRxHSrDUbzMIIUsgcoZAxBuim8uDPp+K7bGqiygzSs2vQfr9U5Jhe9/F8sPdtNctfJZEfgmthNTeVFjyNsGIfIt754uGSfACqM7wDLh6fbKx7M+FHlNyOdvYCrbKUOAYXmTikYIpVDvlaaeMO+N+uW8Rhvm1j+JU7CVwhMavLySaPVc6Dt5OxiMMmxw9mVrjW9bBPjS5AkrS5MOA13T5wapoLzH6+gE92U4HzA6ilMcwRaQPSFnK2JU7tzyt2Wy1PH4MjHowXI2WyICG1x510dD3tX1P/1px8ro="
|
||||
file: lbrynet-${OS}.zip
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
addons:
|
||||
artifacts:
|
||||
working_dir: dist
|
||||
paths:
|
||||
- lbrynet-${OS}.zip
|
||||
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
|
||||
target_paths:
|
||||
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})
|
||||
|
||||
- <<: *build
|
||||
name: "Mac"
|
||||
os: osx
|
||||
osx_image: xcode8.3
|
||||
language: generic
|
||||
language: shell
|
||||
env: OS=mac
|
||||
cache: false
|
||||
before_install:
|
||||
- brew upgrade python || true
|
||||
- brew upgrade python || true
|
||||
- pip3 install --user --upgrade pip virtualenv
|
||||
- /Users/travis/Library/Python/3.7/bin/virtualenv $HOME/venv
|
||||
- source $HOME/venv/bin/activate
|
||||
before_cache:
|
||||
- brew cleanup
|
||||
|
||||
- <<: *build
|
||||
name: "Windows"
|
||||
os: windows
|
||||
language: shell
|
||||
env:
|
||||
- OS=windows
|
||||
- PATH=/c/Python37:/c/Python37/Scripts:/C/Windows/System32/downlevel:$PATH
|
||||
before_install:
|
||||
- choco install python --x86
|
||||
- python -m pip install --upgrade pip
|
||||
- pip install pywin32
|
||||
script:
|
||||
- pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico -F -n lbrynet lbry/extras/cli.py
|
||||
- cd dist
|
||||
- 7z a -tzip lbrynet-windows.zip lbrynet.exe
|
||||
- sha256sum -b lbrynet-windows.zip
|
||||
- ./lbrynet.exe --version
|
||||
- if: tag IS present
|
||||
stage: build
|
||||
name: "Wallet Server Docker Image - Tagged Release"
|
||||
script:
|
||||
- set -e
|
||||
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
|
||||
- travis_retry docker build -t lbry/wallet-server:$TRAVIS_TAG -f scripts/Dockerfile.wallet_server --build-arg TORBA_VERSION=${TORBA} .
|
||||
- travis_retry docker build -t lbry/wallet-server:$TRAVIS_TAG -f lbry/scripts/Dockerfile.wallet_server .
|
||||
- docker push lbry/wallet-server:$TRAVIS_TAG
|
||||
|
||||
- if: tag IS blank AND branch = master AND NOT type IN (pull_request)
|
||||
stage: build
|
||||
name: "Wallet Server Docker Image - Master"
|
||||
script:
|
||||
- set -e
|
||||
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
|
||||
- travis_retry docker build -t lbry/wallet-server:master -f scripts/Dockerfile.wallet_server --build-arg TORBA_VERSION=${TORBA} .
|
||||
- travis_retry docker build -t lbry/wallet-server:master -f lbry/scripts/Dockerfile.wallet_server .
|
||||
- docker push lbry/wallet-server:master
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/venv
|
||||
- $HOME/.cache/pip
|
||||
- $HOME/Library/Caches/pip
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- $TRAVIS_BUILD_DIR/.tox
|
||||
@@ -1,6 +0,0 @@
|
||||
# Add a CHANGELOG entry for app changes
|
||||
has_app_changes = !git.modified_files.grep(/lbrynet/).empty?
|
||||
if !git.modified_files.include?("CHANGELOG.md") && has_app_changes
|
||||
fail("Please include a CHANGELOG entry.")
|
||||
message "See http://keepachangelog.com/en/0.3.0/ for details on good changelog guidelines"
|
||||
end
|
||||
@@ -31,10 +31,12 @@ Assistance installing Python3: https://docs.python-guide.org/starting/install3/o
|
||||
|
||||
### Linux
|
||||
|
||||
On Ubuntu (we recommend 18.04), install the following:
|
||||
On Ubuntu (16.04 minimum, we recommend 18.04), install the following:
|
||||
|
||||
```
|
||||
sudo apt-get install build-essential python3.7 python3.7-dev git python3-venv libssl-dev python-protobuf
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install build-essential python3.7 python3.7-dev git python3.7-venv libssl-dev python-protobuf
|
||||
```
|
||||
|
||||
On Raspbian, you will also need to install `python-pyparsing`.
|
||||
@@ -43,32 +45,61 @@ If you're running another Linux distro, install the equivalent of the above pack
|
||||
|
||||
## Installation
|
||||
|
||||
To install:
|
||||
### Linux/Mac
|
||||
|
||||
To install on Linux/Mac:
|
||||
|
||||
```
|
||||
git clone https://github.com/lbryio/lbry.git
|
||||
cd lbry
|
||||
Clone the repository:
|
||||
$ git clone https://github.com/lbryio/lbry-sdk.git
|
||||
$ cd lbry-sdk
|
||||
|
||||
Creating venv:
|
||||
python -m venv lbry-venv
|
||||
Create a Python virtual environment for lbry-sdk:
|
||||
$ python3.7 -m venv lbry-venv
|
||||
|
||||
Activating lbry-venv on Linux/Mac:
|
||||
source lbry-venv/bin/activate
|
||||
Activating lbry-sdk virtual environment:
|
||||
$ source lbry-venv/bin/activate
|
||||
|
||||
Activating lbry-venv on Windows:
|
||||
lbry-venv\Scripts\activate
|
||||
Make sure you're on Python 3.7+ (as the default Python in virtual environment):
|
||||
$ python --version
|
||||
|
||||
python --version # Python 2 is not supported. Make sure you're on Python 3.7
|
||||
Install packages:
|
||||
$ make install
|
||||
|
||||
pip install -e .
|
||||
If you are on Linux and using PyCharm, generates initial configs:
|
||||
$ make idea
|
||||
```
|
||||
|
||||
To verify your installation, `which lbrynet` should return a path inside of the `lbry-venv` folder created by the `virtualenv` command.
|
||||
To verify your installation, `which lbrynet` should return a path inside of the `lbry-venv` folder created by the `python3.7 -m venv lbry-venv` command.
|
||||
|
||||
### Windows
|
||||
|
||||
To install on Windows:
|
||||
|
||||
```
|
||||
Clone the repository:
|
||||
> git clone https://github.com/lbryio/lbry-sdk.git
|
||||
> cd lbry-sdk
|
||||
|
||||
Create a Python virtual environment for lbry-sdk:
|
||||
> python -m venv lbry-venv
|
||||
|
||||
Activating lbry-sdk virtual environment:
|
||||
> lbry-venv\Scripts\activate
|
||||
|
||||
Install packages:
|
||||
> cd torba
|
||||
> pip install -e .
|
||||
> cd ../lbry
|
||||
> pip install -e .
|
||||
```
|
||||
|
||||
## Run the tests
|
||||
|
||||
To run the unit tests from the repo directory:
|
||||
|
||||
```
|
||||
trial --reactor=asyncio tests.unit
|
||||
python -m unittest discover -s lbry tests.unit
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
install:
|
||||
cd torba && pip install -e .
|
||||
cd lbry && pip install -e .
|
||||
pip install mypy==0.701
|
||||
pip install coverage astroid pylint
|
||||
|
||||
lint:
|
||||
cd lbry && pylint lbry
|
||||
cd torba && pylint --rcfile=setup.cfg torba
|
||||
cd torba && mypy --ignore-missing-imports torba
|
||||
|
||||
test:
|
||||
cd lbry && tox
|
||||
cd torba && tox
|
||||
|
||||
idea:
|
||||
mkdir -p .idea
|
||||
cp -r lbry/scripts/idea/* .idea
|
||||
@@ -1,19 +1,19 @@
|
||||
# <img src="https://raw.githubusercontent.com/lbryio/lbry/master/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [](https://travis-ci.org/lbryio/lbry) [](https://codecov.io/gh/lbryio/lbry)
|
||||
# <img src="https://raw.githubusercontent.com/lbryio/lbry-sdk/master/lbry/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [](https://travis-ci.org/lbryio/lbry-sdk) [](https://codecov.io/gh/lbryio/lbry-sdk)
|
||||
|
||||
LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the [LBRY blockchain](https://github.com/lbryio/lbrycrd) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers.
|
||||
|
||||
LBRY SDK for Python is currently the most full featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components:
|
||||
|
||||
* Built on Python 3.7+ and `asyncio`.
|
||||
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbrynet.dht](https://github.com/lbryio/lbry/tree/master/lbrynet/dht)).
|
||||
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbrynet.blob_exchange](https://github.com/lbryio/lbry/tree/master/lbrynet/blob_exchange)).
|
||||
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbrynet.schema](https://github.com/lbryio/lbry/tree/master/lbrynet/schema)).
|
||||
* Wallet implementation for the LBRY blockchain ([lbrynet.wallet](https://github.com/lbryio/lbry/tree/master/lbrynet/wallet)).
|
||||
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbrynet.extras.daemon](https://github.com/lbryio/lbry/tree/master/lbrynet/extras/daemon)).
|
||||
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/dht)).
|
||||
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/blob_exchange)).
|
||||
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/schema)).
|
||||
* Wallet implementation for the LBRY blockchain ([lbry.wallet](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/wallet)).
|
||||
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbry.extras.daemon](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/extras/daemon)).
|
||||
|
||||
## Installation
|
||||
|
||||
Our [releases page](https://github.com/lbryio/lbry/releases) contains pre-built binaries of the latest release, pre-releases, and past releases for macOS, Debian-based Linux, and Windows. [Automated travis builds](http://build.lbry.io/daemon/) are also available for testing.
|
||||
Our [releases page](https://github.com/lbryio/lbry-sdk/releases) contains pre-built binaries of the latest release, pre-releases, and past releases for macOS, Debian-based Linux, and Windows. [Automated travis builds](http://build.lbry.io/daemon/) are also available for testing.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -53,4 +53,4 @@ The documentation for the API can be found [here](https://lbry.tech/api/sdk).
|
||||
|
||||
Daemon defaults, ports, and other settings are documented [here](https://lbry.tech/resources/daemon-settings).
|
||||
|
||||
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry/blob/master/example_daemon_settings.yml).
|
||||
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry-sdk/blob/master/lbry/example_daemon_settings.yml).
|
||||
@@ -2,6 +2,6 @@
|
||||
.tox
|
||||
__pycache__
|
||||
dist
|
||||
lbrynet.egg-info
|
||||
lbry.egg-info
|
||||
docs
|
||||
tests
|
||||
@@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
/build
|
||||
/dist
|
||||
/.tox
|
||||
/.idea
|
||||
/.coverage
|
||||
/lbry-venv
|
||||
|
||||
lbry.egg-info
|
||||
__pycache__
|
||||
_trial_temp/
|
||||
|
||||
/tests/integration/files
|
||||
@@ -24,7 +24,7 @@ persistent=yes
|
||||
load-plugins=
|
||||
|
||||
# Use multiple processes to speed up Pylint.
|
||||
jobs=1
|
||||
jobs=4
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
@@ -77,8 +77,6 @@ disable=
|
||||
dangerous-default-value,
|
||||
duplicate-code,
|
||||
fixme,
|
||||
global-statement,
|
||||
inherit-non-class,
|
||||
invalid-name,
|
||||
len-as-condition,
|
||||
locally-disabled,
|
||||
@@ -111,13 +109,11 @@ disable=
|
||||
unnecessary-lambda,
|
||||
unused-argument,
|
||||
unused-variable,
|
||||
wildcard-import,
|
||||
wrong-import-order,
|
||||
wrong-import-position,
|
||||
deprecated-lambda,
|
||||
simplifiable-if-statement,
|
||||
unidiomatic-typecheck,
|
||||
global-at-module-level,
|
||||
inconsistent-return-statements,
|
||||
keyword-arg-before-vararg,
|
||||
assignment-from-no-return,
|
||||
@@ -0,0 +1,56 @@
|
||||
# <img src="https://raw.githubusercontent.com/lbryio/lbry-sdk/master/lbry/lbry.png" alt="LBRY" width="48" height="36" /> LBRY SDK [](https://travis-ci.org/lbryio/lbry-sdk) [](https://codecov.io/gh/lbryio/lbry-sdk)
|
||||
|
||||
LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the [LBRY blockchain](https://github.com/lbryio/lbrycrd) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers.
|
||||
|
||||
LBRY SDK for Python is currently the most full featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components:
|
||||
|
||||
* Built on Python 3.7+ and `asyncio`.
|
||||
* Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host ([lbry.dht](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/dht)).
|
||||
* Blob exchange protocol for transferring encrypted blobs of content and negotiating payments ([lbry.blob_exchange](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/blob_exchange)).
|
||||
* Protobuf schema for encoding and decoding metadata stored on the blockchain ([lbry.schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/schema)).
|
||||
* Wallet implementation for the LBRY blockchain ([lbry.wallet](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/wallet)).
|
||||
* Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks ([lbry.extras.daemon](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/extras/daemon)).
|
||||
|
||||
## Installation
|
||||
|
||||
Our [releases page](https://github.com/lbryio/lbry-sdk/releases) contains pre-built binaries of the latest release, pre-releases, and past releases for macOS, Debian-based Linux, and Windows. [Automated travis builds](http://build.lbry.io/daemon/) are also available for testing.
|
||||
|
||||
## Usage
|
||||
|
||||
Run `lbrynet start` to launch the API server.
|
||||
|
||||
By default, `lbrynet` will provide a JSON-RPC server at `http://localhost:5279`. It is easy to interact with via cURL or sane programming languages.
|
||||
|
||||
Our [quickstart guide](https://lbry.tech/playground) provides a simple walkthrough and examples for learning.
|
||||
|
||||
With the daemon running, `lbrynet commands` will show you a list of commands.
|
||||
|
||||
The full API is documented [here](https://lbry.tech/api/sdk).
|
||||
|
||||
## Running from source
|
||||
|
||||
Installing from source is also relatively painless. Full instructions are in [INSTALL.md](INSTALL.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, please check [this](https://lbry.tech/contribute) link.
|
||||
|
||||
## License
|
||||
|
||||
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
|
||||
|
||||
## Security
|
||||
|
||||
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our GPG key is here](https://lbry.com/faq/gpg-key) if you need it.
|
||||
|
||||
## Contact
|
||||
|
||||
The primary contact for this project is [@eukreign](mailto:lex@lbry.com).
|
||||
|
||||
## Additional information and links
|
||||
|
||||
The documentation for the API can be found [here](https://lbry.tech/api/sdk).
|
||||
|
||||
Daemon defaults, ports, and other settings are documented [here](https://lbry.tech/resources/daemon-settings).
|
||||
|
||||
Settings can be configured using a daemon-settings.yml file. An example can be found [here](https://github.com/lbryio/lbry-sdk/blob/master/lbry/example_daemon_settings.yml).
|
||||
@@ -41,10 +41,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get a file",
|
||||
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#ffdbe8f44f285fbc4a352763727abd86d17399c1\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet get astream#ffdbe8f44f285fbc4a352763727abd86d17399c1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#ffdbe8f44f285fbc4a352763727abd86d17399c1\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpf06o5qj4\",\n \"download_path\": \"/tmp/tmpf06o5qj4/tmp6h32p99s\",\n \"file_name\": \"tmp6h32p99s\",\n \"height\": 214,\n \"key\": \"1441a34034b2dbc19094f1c7b164680c\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"016d1a9d18447522cfe3eb8acf4b56a63e7edf2b68fdfdb7869eb7447ab2e61a2d5cdf8199867bda63dd1edc699b7dee31d618198502a11309baff2f6d52104f494ca48ff9e5961c5a00badba23fcfeb010f595fc10a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"e5189cf47e5bdecdef6ec77874410bf7d57ac71ccfb4e6588311a7375c890e513be365538d51068fe97a0c21a8e389e0\",\n \"stream_name\": \"tmp6h32p99s\",\n \"streaming_url\": \"http://localhost:5280/stream/e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"suggested_file_name\": \"tmp6h32p99s\",\n \"timestamp\": 1559011814,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"written_bytes\": 11\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"get\", \"params\": {\"uri\": \"astream#68fde0328b1a267b3815ce974a6329b159619092\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet get astream#68fde0328b1a267b3815ce974a6329b159619092",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"get\", \"params\": {\"uri\": \"astream#68fde0328b1a267b3815ce974a6329b159619092\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\n \"claim_name\": \"astream\",\n \"completed\": true,\n \"confirmations\": 3,\n \"content_fee\": null,\n \"download_directory\": \"/tmp/tmpdym2_jzz\",\n \"download_path\": \"/tmp/tmpdym2_jzz/tmpwc0xotjc\",\n \"file_name\": \"tmpwc0xotjc\",\n \"height\": 214,\n \"key\": \"b362c109c1773e239c7b8046b68baca1\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0127876157202060e91daaf771f57c2b78c254f9cb399c380097dccb958b0a22cddccfb1ff04aa93fa4022c09f2063b86e67ed1b5bc8546dfec3d1faf5c2c75c365722f78c508ba288b1f0cb3913fd391ff1796a1c0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"b2749b74dd58556c9193970be68b3c439dd593e7f117cdbba75d3073307fdfa91e811ff9d3f71336eccefadb9d27effa\",\n \"stream_name\": \"tmpwc0xotjc\",\n \"streaming_url\": \"http://localhost:5280/stream/ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"suggested_file_name\": \"tmpwc0xotjc\",\n \"timestamp\": 1565587608,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"written_bytes\": 11\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -187,7 +187,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "account to use for funding the transaction",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -201,16 +207,22 @@
|
||||
"type": "bool",
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"txid\": \"hash of transaction in hex\",\n \"height\": \"block where transaction was recorded\",\n \"inputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"outputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"total_input\": \"sum of inputs as a decimal\",\n \"total_output\": \"sum of outputs, sans fee, as a decimal\",\n \"total_fee\": \"fee amount\",\n \"hex\": \"entire transaction encoded in hex\"\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Publish a file",
|
||||
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmplnj7g2og\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmplnj7g2og",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmplnj7g2og\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000012889d1e46c544984302aba136dec017885e0586e38b7801486a41905dcd4aa5f010000006a4730440220414a3a00018fc702da22da84e174e2d6e9bd5bcc16d5266cd9dfebc8039fb7c902205a14787a36f74952faee19f4cfb998706c141bffd1e2700941a7ca4e6f1509e1012102a3da85d6f33252605514d4d8be77cc3563e4018cdbdfa5fabb0c8453b49d543effffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706c6e6a3767326f67180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d9b627887a6586daaf55ac395c6826fa372110ced12e01009cf220c9a8a17b7b1b1f1f69e111fda7521e0ccc417e04df6d7576a9148d62b4efdc3423fcd5e5e8d5d414515e06a2f3cc88ace0b46217000000001976a91490b301d61740d27d2f038e9541627e6443378faf88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"msym2SzDUdoUTAXGYttaZ3y6q3zkZ3Rhxw\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011814,\n \"txid\": \"5faad4dc0519a4861480b7386e58e0857801ec6d13ba2a308449546ce4d18928\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mtQXpNQ924yoKNgVCycikXQA9oyBUYnBKL\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cc8839262a966ca7c4855443144ff72dd1cb7be6\",\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#cc8839262a966ca7c4855443144ff72dd1cb7be6\",\n \"timestamp\": null,\n \"txid\": \"3208677665c12658b28081ceb4aedf6bda0518b244c9b1729148302677bda266\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmplnj7g2og\",\n \"sd_hash\": \"d9b627887a6586daaf55ac395c6826fa372110ced12e01009cf220c9a8a17b7b1b1f1f69e111fda7521e0ccc417e04df\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mti43KAeW7RJZxK1zDJVgcYJzUNL3Jqvwv\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3208677665c12658b28081ceb4aedf6bda0518b244c9b1729148302677bda266\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"3208677665c12658b28081ceb4aedf6bda0518b244c9b1729148302677bda266\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpoaodn53k\", \"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/tmpoaodn53k",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"publish\", \"params\": {\"name\": \"a-new-stream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpoaodn53k\", \"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\": \"0100000001982e42647211b173408afa981022eba39ad37dd3af02adbbdbbbeeacf1264e47010000006b483045022100fe0ed627da7753b064ab5f105e1c96e2a9b421bc06507a33cf93fc4aeadd78e40220292679d815306c6cddccc02ddc78afee4244f5c397e97155ce106c805a542939012103624df3c8ad604cf580e3961b92cf2ddcc550b056d68cc59711f98bb2787b8b63ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706f616f646e35336b180b22186170706c69636174696f6e2f6f637465742d73747265616d3230a586f76b0448807ffc4c620d73eba0472e1f9ddf65e25dee0b4fadabb371300aadc9ec6f9df51dc17b5775a8a7a013e96d7576a914deecc1b5bc5a7035d2011bcaf8e8da85f6f42bd188ace0b46217000000001976a914f159d3ab7d8917b22b68fcd95084ba80c59e852c88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n1C7SV6XSvTgHK84pMQ23KZLszCsm53T3Q\",\n \"amount\": \"4.947555\",\n \"confirmations\": 4,\n \"height\": 215,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587608,\n \"txid\": \"474e26f1aceebbdbbbad02afd37dd39aa3eb221098fa8a4073b1117264422e98\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"n1qfvnMjq54N8VZ6Lo9PHJqZnURANLnhuG\",\n \"amount\": \"1.0\",\n \"claim_id\": \"34e0cf03b59adf21fc691267905e92cccbf61867\",\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#34e0cf03b59adf21fc691267905e92cccbf61867\",\n \"timestamp\": null,\n \"txid\": \"b320bd3bc3fd2d17959326f012e188c3cf7a9bc4080acab98aa88fcb896c401b\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpoaodn53k\",\n \"sd_hash\": \"a586f76b0448807ffc4c620d73eba0472e1f9ddf65e25dee0b4fadabb371300aadc9ec6f9df51dc17b5775a8a7a013e9\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n3X6kZcWxner6175XwQ32SwHBTFTMRiw7T\",\n \"amount\": \"3.923448\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"b320bd3bc3fd2d17959326f012e188c3cf7a9bc4080acab98aa88fcb896c401b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.024107\",\n \"total_input\": \"4.947555\",\n \"total_output\": \"4.923448\",\n \"txid\": \"b320bd3bc3fd2d17959326f012e188c3cf7a9bc4080acab98aa88fcb896c401b\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -229,10 +241,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Resolve a claim",
|
||||
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ffdbe8f44f285fbc4a352763727abd86d17399c1\"]}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet resolve astream#ffdbe8f44f285fbc4a352763727abd86d17399c1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#ffdbe8f44f285fbc4a352763727abd86d17399c1\"]}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#ffdbe8f44f285fbc4a352763727abd86d17399c1\": {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#6/astream#f\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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\": 1559011814,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\n \"support_amount\": \"0.0\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"short_url\": \"lbry://astream#f\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#6\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 2,\n \"creation_height\": 209,\n \"creation_timestamp\": 1559011813,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\n \"support_amount\": \"0.0\",\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"short_url\": \"lbry://@channel#6\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#68fde0328b1a267b3815ce974a6329b159619092\"]}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet resolve astream#68fde0328b1a267b3815ce974a6329b159619092",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"resolve\", \"params\": {\"urls\": [\"astream#68fde0328b1a267b3815ce974a6329b159619092\"]}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"astream#68fde0328b1a267b3815ce974a6329b159619092\": {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c/astream#6\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": 1565587608,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1565587607,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"short_url\": \"lbry://@channel#c\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -247,14 +259,14 @@
|
||||
"name": "status",
|
||||
"description": "Get daemon status",
|
||||
"arguments": [],
|
||||
"returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'database': (bool),\n 'dht': (bool),\n 'exchange_rate_manager': (bool),\n 'hash_announcer': (bool),\n 'peer_protocol_server': (bool),\n 'stream_manager': (bool),\n 'upnp': (bool),\n 'wallet': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'stream_manager': {\n 'managed_files': (int) count of files in the stream manager,\n },\n 'upnp': {\n 'aioupnp_version': (str),\n 'redirects': {\n <TCP | UDP>: (int) external_port,\n },\n 'gateway': (str) manufacturer and model,\n 'dht_redirect_set': (bool),\n 'peer_redirect_set': (bool),\n 'external_ip': (str) external ip address,\n }\n }",
|
||||
"returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'database': (bool),\n 'dht': (bool),\n 'exchange_rate_manager': (bool),\n 'hash_announcer': (bool),\n 'peer_protocol_server': (bool),\n 'stream_manager': (bool),\n 'upnp': (bool),\n 'wallet': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n 'connected_servers': (list) [\n {\n 'host': (str) server hostname,\n 'port': (int) server port,\n 'latency': (int) milliseconds\n }\n ],\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n 'connections': {\n 'incoming_bps': {\n <source ip and tcp port>: (int) bytes per second received,\n },\n 'outgoing_bps': {\n <destination ip and tcp port>: (int) bytes per second sent,\n },\n 'total_outgoing_mps': (float) megabytes per second sent,\n 'total_incoming_mps': (float) megabytes per second received,\n 'time': (float) timestamp\n }\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'stream_manager': {\n 'managed_files': (int) count of files in the stream manager,\n },\n 'upnp': {\n 'aioupnp_version': (str),\n 'redirects': {\n <TCP | UDP>: (int) external_port,\n },\n 'gateway': (str) manufacturer and model,\n 'dht_redirect_set': (bool),\n 'peer_redirect_set': (bool),\n 'external_ip': (str) external ip address,\n }\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get status",
|
||||
"curl": "curl -d'{\"method\": \"status\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet status",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"status\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"finished_blobs\": 0\n },\n \"connection_status\": {\n \"code\": \"connected\",\n \"message\": \"No connection problems detected\"\n },\n \"installation_id\": \"7gjXaLg5SLVuajoAqAUmeXpMgtxbFFiP2zKLKZqHjDpFdFijPEYEvBXxrLMocHHcFD\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"blockchain_headers\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"best_blockhash\": \"e03fe663d3d7b14c5608ec36cc0d80639d7dd418b0f4fcadeb8353296b54896e\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"is_encrypted\": false,\n \"is_locked\": false\n }\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blob_manager\": {\n \"connections\": {\n \"incoming_bps\": {},\n \"outgoing_bps\": {},\n \"time\": 701000.371205916,\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\": \"7F6p1BEhFXF8nDAuREvQApa4s4iTVY4FnPAD3Hz9hhhfZGGDixA6otzvVXbuAeKwV\",\n \"is_running\": true,\n \"skipped_components\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"startup_status\": {\n \"blob_manager\": true,\n \"blockchain_headers\": true,\n \"database\": true,\n \"exchange_rate_manager\": true,\n \"stream_manager\": true,\n \"wallet\": true\n },\n \"stream_manager\": {\n \"managed_files\": 0\n },\n \"wallet\": {\n \"best_blockhash\": \"be004973abe18bce798b4cd15ca2b2b684e84833a9b675ef660c214d46dbfecc\",\n \"blocks\": 206,\n \"blocks_behind\": 0,\n \"connected_servers\": [\n {\n \"host\": \"localhost\",\n \"latency\": 0,\n \"port\": 50002\n }\n ],\n \"is_encrypted\": false,\n \"is_locked\": false\n }\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -269,14 +281,14 @@
|
||||
"name": "version",
|
||||
"description": "Get lbrynet API server version information",
|
||||
"arguments": [],
|
||||
"returns": "(dict) Dictionary of lbry version information\n {\n 'build': (str) build type (e.g. \"dev\", \"rc\", \"release\"),\n 'ip': (str) remote ip, if available,\n 'lbrynet_version': (str) lbrynet_version,\n 'lbryum_version': (str) lbryum_version,\n 'lbryschema_version': (str) lbryschema_version,\n 'os_release': (str) os release string\n 'os_system': (str) os name\n 'platform': (str) platform string\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n }",
|
||||
"returns": "(dict) Dictionary of lbry version information\n {\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n 'platform': (str) platform string,\n 'os_release': (str) os release string,\n 'os_system': (str) os name,\n 'lbrynet_version': (str) lbrynet version,\n 'torba_version': (str) torba version,\n 'build': (str) \"dev\" | \"qa\" | \"rc\" | \"release\",\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get version",
|
||||
"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.38.0rc2\",\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.2\"\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.38.7\",\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.4\",\n \"torba_version\": \"0.5.7\"\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -324,10 +336,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Add an account from seed",
|
||||
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\", \"single_key\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account add \"new account\" --seed=\"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\", \"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\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1559011780.6249187,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdnBkyQuCYYRiWPCqBbNSqxZDDKeTUBiht5vDSVmV7P7ttPGxWMiiQKgLHfv2TegdUUJeXkNrVrQWdcTQ3YADKsyaiyQrqg1\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XFDYs4Znwx5q5QimLvZMRG9zVqgktTX6iaAz4tb5Hsjm4XHeqm2Vxzjz4XwgtdtF39REpXRV4E284pkvcubqiYABzSrXiGr\",\n \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\", \"single_key\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account add \"new account\" --seed=\"foil sudden option various minor little coyote dolphin crouch crime belt bread\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_add\", \"params\": {\"account_name\": \"new account\", \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\", \"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\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1565587574.9123697,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdLfCBqeN8479gpUTYTm4KZjau4dYnkvMnquqU1KBPy3ueMmNQtwpPuesYacmYN9cmPSVrmGE2EwSXU5fsJHFKBVBDQ3Eh5i\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Wogz5VJxXTmGFqzPhnwxtsLNBafrD2ikdLAc6Q8maTfmpUpL1Qr4dPKD6a3weHuSGyQLBthZBSFK6efbhw3WnvVVfSaCPM6\",\n \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -346,23 +358,29 @@
|
||||
"type": "int",
|
||||
"description": "Only include transactions with this many confirmed blocks.",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "reserved_subtotals",
|
||||
"type": "bool",
|
||||
"description": "Include detailed reserved balances on claims, tips and supports.",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": "(decimal) amount of lbry credits in wallet",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get default account balance",
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"reserved_subtotals\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account balance",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"7.999876\"\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"reserved_subtotals\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"available\": \"7.999876\",\n \"reserved\": \"0.0\",\n \"reserved_subtotals\": null,\n \"total\": \"7.999876\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Get balance for specific account by id",
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account balance \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"2.0\"\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_balance\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"reserved_subtotals\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account balance \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_balance\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"reserved_subtotals\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"available\": \"2.0\",\n \"reserved\": \"0.0\",\n \"reserved_subtotals\": null,\n \"total\": \"2.0\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -390,7 +408,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\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1559011780.4394753,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdnBkyQuCYYRiWPCqBbNSqxZDDKeTUBiht5vDSVmV7P7ttPGxWMiiQKgLHfv2TegdUUJeXkNrVrQWdcTQ3YADKsyaiyQrqg1\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XFDYs4Znwx5q5QimLvZMRG9zVqgktTX6iaAz4tb5Hsjm4XHeqm2Vxzjz4XwgtdtF39REpXRV4E284pkvcubqiYABzSrXiGr\",\n \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\"\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\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1565587574.7207406,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdLfCBqeN8479gpUTYTm4KZjau4dYnkvMnquqU1KBPy3ueMmNQtwpPuesYacmYN9cmPSVrmGE2EwSXU5fsJHFKBVBDQ3Eh5i\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Wogz5VJxXTmGFqzPhnwxtsLNBafrD2ikdLAc6Q8maTfmpUpL1Qr4dPKD6a3weHuSGyQLBthZBSFK6efbhw3WnvVVfSaCPM6\",\n \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -473,24 +491,24 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Transfer 2 LBC from default account to specific account",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\" --amount=2.0 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001ffa0efb97cc0b1de40104c1efde557888f1d1671c33cf45cf8d4c64407af1747010000006b483045022100f2688e18f3fa85c9efb4cbe14b69ace71439342f24813a7354f259f631ebf382022019db036a72924429eae0c8a74a4069a843ce03943f2ab02eb0f487ac06fd90300121020c2a113a365b5c19849a4b0a970e5d9977b799102e75c6463f9c6e7738a5d289ffffffff0200c2eb0b000000001976a9147a5eb4b44204015136a92a491d80593cdc5d31fe88ac90d7ae2f000000001976a9141891436814e20ce99f77b091edd4cef6d50f1abb88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mu8naFDrK7nHd3a2yCWNEV74A6JmDYsbha\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011812,\n \"txid\": \"4717af0744c6d4f85cf43cc371161d8f8857e5fd1e4c1040deb1c07cb9efa0ff\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mrfzBjhGDZoCmVeyQ32ryiQ6XbsoaH58uA\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhkrXjG9n4C7EJyH4ooDVVTYm2cjzGZcxS\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\" --amount=2.0 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"amount\": \"2.0\", \"everything\": false, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001d5f84e6eef616038f89f66af0d896f60fb28d0ce25785a3a8621da9fd74fecc6010000006a473044022071f23813260351722e31d85103c0d51728603138cd95f28ac471e6e025639b750220171676c27072102f314a70f102e24b68b8cc5e674564d8a2c4cce80ba809ebaa012103958c4d66bdbc04f4550e365b3b0d4060d4a58a35781c405c31f132d52510ee1fffffffff0200c2eb0b000000001976a914cc1a7b81fed46296749fca09ed76da07b3c0294688ac90d7ae2f000000001976a914d0d944552d385c36088c3c274ef4882821dc295088ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mtHro6eY7d3n5JTM8tazct7DDRbJCUH2CX\",\n \"amount\": \"10.0\",\n \"confirmations\": 6,\n \"height\": 201,\n \"is_change\": false,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587606,\n \"txid\": \"c6ec4fd79fda21863a5a7825ced028fb606f890daf669ff8386061ef6e4ef8d5\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mz89sDjvPSJC4EUf8ssQm1wm2MfE5XtJYB\",\n \"amount\": \"2.0\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mzZF7vd3tBgh9u5tZcX2K4e4DipLzxt6d2\",\n \"amount\": \"7.999876\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000124\",\n \"total_input\": \"10.0\",\n \"total_output\": \"9.999876\",\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Spread LBC between multiple addresses",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"from_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\" --from_account=\"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\" --amount=1.5 --outputs=2 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"from_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015b1437e0a48d9f617d74d0526130b55142b9809cfc4768fc524176dd0532f83e000000006a47304402202e9880fa1cda60fbbac822ab39e296b814fbba4490541a4a3e7b23739b83fa0302202b618448620585842149285ee41fa449978e585742156e1bf158aff5e22413fd012102c522a7125129e491b7e86ff1ccf69e3aaab24e30413c8badc0a74e0c469c4d7effffffff03c0687804000000001976a91463447211521da66a083c7aa7cb13ad22a75dcf4488acc0687804000000001976a91463447211521da66a083c7aa7cb13ad22a75dcf4488ac6cb9fa02000000001976a9141a195f71b450e4d6c6a705904ae04c163b40236d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mrfzBjhGDZoCmVeyQ32ryiQ6XbsoaH58uA\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1559011813,\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mpZqBj8pttN7xXQP9FkVfKRSAkGvDd16XD\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mpZqBj8pttN7xXQP9FkVfKRSAkGvDd16XD\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhtxFybjayPc8V4W1AopRw4MiphNA94pHf\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"to_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"from_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --to_account=\"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\" --from_account=\"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\" --amount=1.5 --outputs=2 --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"to_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"from_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"amount\": \"1.5\", \"everything\": false, \"outputs\": 2, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000104c5f5417877270c58790fa0c3bced42a0d8eaab4d21402087b1860606fc9502000000006a47304402201459cd01251fc2750e9c83a3bbdd3de9cb5957e854590ddc47abc553a2f5d6be02203531aea3e6c076e6a08f28522c922eee0052e18fc4e1bf0da24dcdb33a3a43f3012102d231cd354ed3c2b299a7fd1abf77c4ab67d23f5e72739ee5ca26f2dc5737cc6cffffffff03c0687804000000001976a914be409698cb18d21048c6dca40c68fe7c0681c9fd88acc0687804000000001976a914be409698cb18d21048c6dca40c68fe7c0681c9fd88ac6cb9fa02000000001976a914cc1a7b81fed46296749fca09ed76da07b3c0294688ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mz89sDjvPSJC4EUf8ssQm1wm2MfE5XtJYB\",\n \"amount\": \"2.0\",\n \"confirmations\": 1,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1565587607,\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mxrv4B1aGmVMitNA2heEDr62sAGdyYA8ZZ\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mxrv4B1aGmVMitNA2heEDr62sAGdyYA8ZZ\",\n \"amount\": \"0.75\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mz89sDjvPSJC4EUf8ssQm1wm2MfE5XtJYB\",\n \"amount\": \"0.499859\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 2,\n \"timestamp\": null,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000141\",\n \"total_input\": \"2.0\",\n \"total_output\": \"1.999859\",\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Transfer all LBC to a specified account",
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --from_account=\"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\" --everything --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"everything\": true, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000003239376b7923d3c48feee6d78d8a3b6b2539a53fc056941b0d3005b38aa40b1aa000000006a47304402202280f476c6c2e030288d6a914fd0a4f25f77a2412646d2221361cee7842d68280220703aa48ce200adfdb9b45fb05911b196d057c8c6416379d245245f032d91bea0012103aaef7f277b51328287432a89023a34fb96e70fd86bbe9cb0dc7b22024252b9cbffffffff239376b7923d3c48feee6d78d8a3b6b2539a53fc056941b0d3005b38aa40b1aa010000006a47304402201500191033e90af3d0523bcd0dc1bf0a2532b2e72dbf2208ec5f03a1d57f68a2022000ec7b41ff2cf20c4fa189d0c77ecab1482a1fc6f3d38e6161f661d8bb1ad0bd012103aaef7f277b51328287432a89023a34fb96e70fd86bbe9cb0dc7b22024252b9cbffffffff239376b7923d3c48feee6d78d8a3b6b2539a53fc056941b0d3005b38aa40b1aa020000006a47304402203729f79259485bf1f8b02a2e0fd47353792108c7424f8b03f30fba2ebf87796302200aa96711e5724a82c51ae049d3d427436ad4fb14ee5f97de5745249f5ae0623f012103de076de4afb59f23e8e7c3cb0f493a1835c59d684c7546ac93fea7bd1e3d2036ffffffff015027eb0b000000001976a914681c30baec28e2aa8d45a228f2a6af2e0a4fcec188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mpZqBj8pttN7xXQP9FkVfKRSAkGvDd16XD\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1559011813,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mpZqBj8pttN7xXQP9FkVfKRSAkGvDd16XD\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011813,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mhtxFybjayPc8V4W1AopRw4MiphNA94pHf\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1559011813,\n \"txid\": \"aab140aa385b00d3b0416905fc539a53b2b6a3d8786deefe483c3d92b7769323\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mq1SLhoqW2g3qY1eGpcp2r5Xw1Vf19ocP8\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"92dae07b857907a41b24e4c1c2e007ef7b8f3ba3b21b936f5a8cdade2d5bafba\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"92dae07b857907a41b24e4c1c2e007ef7b8f3ba3b21b936f5a8cdade2d5bafba\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_fund\", \"params\": {\"from_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"everything\": true, \"broadcast\": true}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account fund --from_account=\"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\" --everything --broadcast",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_fund\", \"params\": {\"from_account\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"everything\": true, \"broadcast\": true}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000003866aaf7d1a0581f1f35d8b487add49405e83d8b2dcab29ebcd15b2fd2206615e000000006b483045022100a6eb574aa0826f6a2943549835f68e6da03d6fe005f66989f4fdc4b5a87a42af022019269d1ffa052179326fe9ea336ece04a8321eb543a99248126d1f7f3976c7a8012103eae283e24169f92a68ccc2c9aefed407c144af652c3fe5f4f5df95d69b01c427ffffffff866aaf7d1a0581f1f35d8b487add49405e83d8b2dcab29ebcd15b2fd2206615e010000006b483045022100f07f0f7e2174e12dd75d649ffba4291ac5aac9705f0d3498e291c262abed9fa6022004a75bc29cbe593e3156ec5fc162e1ec61fd96e0870ed788de808b0babeb5064012103eae283e24169f92a68ccc2c9aefed407c144af652c3fe5f4f5df95d69b01c427ffffffff866aaf7d1a0581f1f35d8b487add49405e83d8b2dcab29ebcd15b2fd2206615e020000006a47304402207d3881bad363a319b9dc7a95c9e72863cd517460d5d9d537c0cee3a66bdbf58a022024d658e7103fe09b99886c41df404982894a698eaf10fca61e40a18910b78586012102d231cd354ed3c2b299a7fd1abf77c4ab67d23f5e72739ee5ca26f2dc5737cc6cffffffff015027eb0b000000001976a91471fcf6203f6070ab92a123cd4db621933ec98f8588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mxrv4B1aGmVMitNA2heEDr62sAGdyYA8ZZ\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1565587607,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mxrv4B1aGmVMitNA2heEDr62sAGdyYA8ZZ\",\n \"amount\": \"0.75\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587607,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n },\n {\n \"address\": \"mz89sDjvPSJC4EUf8ssQm1wm2MfE5XtJYB\",\n \"amount\": \"0.499859\",\n \"confirmations\": 1,\n \"height\": 208,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 2,\n \"timestamp\": 1565587607,\n \"txid\": \"5e610622fdb215cdeb29abdcb2d8835e4049dd7a488b5df3f181051a7daf6a86\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mqufgoJUGVmpBPShNwTYNrAa34mYcS2BAZ\",\n \"amount\": \"1.999604\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"8031b6e9e96d47669b502810414618430bc3589ffb2e9fd18a130692842909cd\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000255\",\n \"total_input\": \"1.999859\",\n \"total_output\": \"1.999604\",\n \"txid\": \"8031b6e9e96d47669b502810414618430bc3589ffb2e9fd18a130692842909cd\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -530,7 +548,7 @@
|
||||
"curl": "curl -d'{\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_list\", \"params\": {\"include_claims\": false, \"show_seed\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"lbc_regtest\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"mhfojdfZKX5A8gZhQro9JTAV9QfLoQtJXZ\",\n \"is_default\": true,\n \"name\": \"Account #mhfojdfZKX5A8gZhQro9JTAV9QfLoQtJXZ\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WcFH7M2ECDxpFfvKSfXk45guPZKAYR9UmebhVusPrtM3qRwbk1P8caZds6fuJj3LNpL5whsk6hTboszKA4oRRXUdDbxqv7K\",\n \"satoshis\": 1000000000\n }\n ]\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"lbc_regtest\": [\n {\n \"address_generator\": {\n \"change\": {\n \"gap\": 6,\n \"maximum_uses_per_address\": 1\n },\n \"name\": \"deterministic-chain\",\n \"receiving\": {\n \"gap\": 20,\n \"maximum_uses_per_address\": 1\n }\n },\n \"certificates\": 0,\n \"coins\": 10.0,\n \"encrypted\": false,\n \"id\": \"miXe7ZYokTt1eKNnrf1FtgQHoK4fPCkjuR\",\n \"is_default\": true,\n \"name\": \"Account #miXe7ZYokTt1eKNnrf1FtgQHoK4fPCkjuR\",\n \"public_key\": \"tpubD6NzVbkrYhZ4WdMUNwhAxYY17XGDHf8BmBaqLcoX8Ykr879yEy8TpvzeC9GFvjZTfAd7cxF5epgfoBBK63DsdKgHW4aR4WF7aNLpKsx2nM7\",\n \"satoshis\": 1000000000\n }\n ]\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -577,10 +595,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Remove an account",
|
||||
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account remove mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}).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\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1559011780.4394753,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdnBkyQuCYYRiWPCqBbNSqxZDDKeTUBiht5vDSVmV7P7ttPGxWMiiQKgLHfv2TegdUUJeXkNrVrQWdcTQ3YADKsyaiyQrqg1\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XFDYs4Znwx5q5QimLvZMRG9zVqgktTX6iaAz4tb5Hsjm4XHeqm2Vxzjz4XwgtdtF39REpXRV4E284pkvcubqiYABzSrXiGr\",\n \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_remove\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account remove n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_remove\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"}}).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\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1565587574.7207406,\n \"name\": \"generated account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdLfCBqeN8479gpUTYTm4KZjau4dYnkvMnquqU1KBPy3ueMmNQtwpPuesYacmYN9cmPSVrmGE2EwSXU5fsJHFKBVBDQ3Eh5i\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Wogz5VJxXTmGFqzPhnwxtsLNBafrD2ikdLAc6Q8maTfmpUpL1Qr4dPKD6a3weHuSGyQLBthZBSFK6efbhw3WnvVVfSaCPM6\",\n \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -655,10 +673,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Modify maximum number of times a change address can be reused",
|
||||
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account set mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W --change_max_uses=10",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\", \"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\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1559011780.6901715,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdnBkyQuCYYRiWPCqBbNSqxZDDKeTUBiht5vDSVmV7P7ttPGxWMiiQKgLHfv2TegdUUJeXkNrVrQWdcTQ3YADKsyaiyQrqg1\",\n \"public_key\": \"tpubD6NzVbkrYhZ4XFDYs4Znwx5q5QimLvZMRG9zVqgktTX6iaAz4tb5Hsjm4XHeqm2Vxzjz4XwgtdtF39REpXRV4E284pkvcubqiYABzSrXiGr\",\n \"seed\": \"fetch ripple echo rabbit taxi emerge make tape front issue seven pilot\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"account_set\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"default\": false, \"change_max_uses\": 10}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet account set n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn --change_max_uses=10",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"account_set\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\", \"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\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\",\n \"is_default\": false,\n \"ledger\": \"lbc_regtest\",\n \"modified_on\": 1565587575.0091093,\n \"name\": \"new account\",\n \"private_key\": \"tprv8ZgxMBicQKsPdLfCBqeN8479gpUTYTm4KZjau4dYnkvMnquqU1KBPy3ueMmNQtwpPuesYacmYN9cmPSVrmGE2EwSXU5fsJHFKBVBDQ3Eh5i\",\n \"public_key\": \"tpubD6NzVbkrYhZ4Wogz5VJxXTmGFqzPhnwxtsLNBafrD2ikdLAc6Q8maTfmpUpL1Qr4dPKD6a3weHuSGyQLBthZBSFK6efbhw3WnvVVfSaCPM6\",\n \"seed\": \"foil sudden option various minor little coyote dolphin crouch crime belt bread\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -708,9 +726,9 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Check if address is mine",
|
||||
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mztwZDgaFUnDFbtkxN2VLszuoojQMc6tLQ\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address is_mine mztwZDgaFUnDFbtkxN2VLszuoojQMc6tLQ",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mztwZDgaFUnDFbtkxN2VLszuoojQMc6tLQ\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"address_is_mine\", \"params\": {\"address\": \"mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address is_mine mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_is_mine\", \"params\": {\"address\": \"mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
|
||||
}
|
||||
]
|
||||
@@ -745,14 +763,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 \"myK1B8RLzPtaUehDF49F6GzpTNhZJwkuFK\",\n \"mq1SLhoqW2g3qY1eGpcp2r5Xw1Vf19ocP8\",\n \"mr89YuKptsJxtE7izrCoDCdNvLp9KR2EuB\",\n \"n4VUJCJpkWT2Twzhs2dwkSVsVHtDoDkbaH\",\n \"mhkrXjG9n4C7EJyH4ooDVVTYm2cjzGZcxS\",\n \"mnY3oi1Auwp7Cb4CQRGDLoKWwsARVzes45\",\n \"mu8naFDrK7nHd3a2yCWNEV74A6JmDYsbha\",\n \"mnvmas1S7DYha4g7RZeNey87u8nZvVA1xG\",\n \"mxJmDYvcN6kCTos9YRb34jBDmwo14iJmNM\",\n \"mucWfYmDAVZW715d2cite7oc2e8J5PKH4u\",\n \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"mqdCHu4sTh3bZoSTyMwR62i5w3e6U9aBCA\",\n \"mhgGjVVY6kjrAxf2cz1ALfbst6CQhZ72qg\",\n \"n4jxQucHz4BhGRmGSQLakzfwsHd7sN8jwa\",\n \"mztwZDgaFUnDFbtkxN2VLszuoojQMc6tLQ\",\n \"mujvjSMLfTmCxG2gy3ZNpNCFF5A1eF7GuZ\",\n \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"mtQXpNQ924yoKNgVCycikXQA9oyBUYnBKL\",\n \"mxEwCiv67J8e9VcwbEc78yGMYxcZfRejMD\",\n \"mtmdn9t48VsD44K6ABAbdDLU8bodawoM4v\",\n \"mrBf6FXC67KD1pgHSjoarmrJC7oiZiEAnN\",\n \"mmCir7XhwDNvcFyPcbbDjrbumrK7FW11rQ\",\n \"mzuNaFAu7QDBfhv5eUi1qxWqEf4FTSdZiV\",\n \"mym11qGHsvNt3esNGnPZ8xTuQDDdvzVLP4\",\n \"n3H19KHvnn5N6PKbVhZk4PM7kZYWbUW1jG\",\n \"mt1jLmH7uq5x4vnMd2Zqnpm4w7ckkdgDSr\",\n \"muiGAtEmv3D3AvhKxp6pxaiaYstNgkYBeS\"\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mwzLgEMMmoR18v3a9wycimU2HpH1C5zjuC\",\n \"mqufgoJUGVmpBPShNwTYNrAa34mYcS2BAZ\",\n \"mzZF7vd3tBgh9u5tZcX2K4e4DipLzxt6d2\",\n \"mq426NVsa1ktHvAxmzZGjiv6vr8JYkpWBR\",\n \"n19NX4hFThAvep5r78VhPh4rL9syV9WDrP\",\n \"mmP7gjMxMuixG5QWRku97zMaVp2YvmKwkA\",\n \"mtHro6eY7d3n5JTM8tazct7DDRbJCUH2CX\",\n \"mw78ij63SuKiP4PLKDXALWiXGyD5Wzoy9o\",\n \"mnjnSTckKVTLbFLjxWqpyerpHp8kB9vGvJ\",\n \"mrM93XmQAYUDH7Mw8E1JA4FFNgnAf8HR5C\",\n \"n1qfvnMjq54N8VZ6Lo9PHJqZnURANLnhuG\",\n \"my6rN6hjATred59RrMsADDPKjnetgZsUWA\",\n \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN\",\n \"mk9QmTXDuQyUFkMhUvLrtyJhEksBXh1Azm\",\n \"mkHmFi637aQsZiYyjNSxXoBtHT9dyU924g\",\n \"mpQfor4a7VZ6AJkhUdA48pgEci4HoD7yz9\",\n \"mhPFLtT7YzmNfMuQYr4PQXAJdtaTKWRLFy\",\n \"mndiWiLpZa1v3WXtJKm1L9q93NysqCDvTU\",\n \"mucDX1B3gHcx791XgqFZCEbJSQ8pisdw8y\",\n \"mub8LSJ2vtxffDfKb2njq4ggVpDnNwzYBY\",\n \"mhnAE4ok1uVP5mkJaB5pn14Ni84aiX18rw\",\n \"n4HMxe8Q2kV3QKjs6cdixKEHdMHgFwtozB\",\n \"n1JZES3jZNKN93DjLJ6LgkYPmHFuPcZcPD\",\n \"my7Rw5wknudwjZn3obGMMaXPAe6wJcq9JN\",\n \"mqe7hTdNWrqTw2wANj4d5mxKqWBYixqxmL\"\n ]\n}"
|
||||
},
|
||||
{
|
||||
"title": "List addresses in specified account",
|
||||
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address list --account_id=\"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"mmiprM3BwUmzyB7ebMmL6GCE1YFw3TGk5W\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mtptR4d9LBAgrra7xcsYHCRbi2cAn2MZLf\",\n \"mrfzBjhGDZoCmVeyQ32ryiQ6XbsoaH58uA\",\n \"mpZqBj8pttN7xXQP9FkVfKRSAkGvDd16XD\",\n \"mhtxFybjayPc8V4W1AopRw4MiphNA94pHf\",\n \"mp4wnohKv6rBWD4aL8rMEmBDmVgGZRQnc8\",\n \"mn5TqvgEQdHbg2KhxQZ7bHNMZtYVLkVBSV\",\n \"mwF8k177yZy1nms1AP3r3g5WtK5p7XhpRo\",\n \"mkhUFcKjiKhEid5QS573QwL38RAQjCrwY2\",\n \"mwabsSQcxdRxw8QYBWaL81tmu6WSQniAVu\",\n \"mkUfoXesw8P3CuDo4UHBcAAtDTjgUyMXnU\",\n \"mkSkAys8sHRZjRpzYXT9yk7KnwgvagDSRE\",\n \"mskWQ4fPukRpC5fVdqEvaiHtBgujJdRsR8\",\n \"n3d5BjF1h8wGnkBahYrHZoVhb1qg51SB3D\",\n \"n4jzZeestt64jghEGrV4Ad5rUBnVLJhE3U\",\n \"mmWUHYyddFXus5yYJf4Rtpkdv8GpgK9hYT\",\n \"mjv7LQMFR8tGWcTwH5JzWsCUXwRAygbCLu\",\n \"mrSPmWUdBrRHx1nMAUN1J3PnqcRELgga4U\",\n \"mfhy3VFVwCTPshEp7QnUUrhYvh9uBpHhzF\",\n \"mvwGdyxVbSeNvrcdbws42Wuob2ix2FYYq3\",\n \"mwHJKytimnJUQn3R4z3oMvtxFe7bWR8Lhn\",\n \"mnSwZR1JqNNcmaQyvapZwbqLcD8iyTZ279\",\n \"muiVnmmz5DWGtSHyuHcgcM6f7Ho38utTu2\",\n \"n21oZjxk8F4VtaSjQPxzdD9iFj9cNFpjn4\",\n \"n1CPPg4ypsEJtYHnMi3HKEJoLNPkMVgTe9\",\n \"mzFAivojDpyFhZCMRadw6AcJZXUxBbVW8A\",\n \"mxs9r97CSAGCkzCVMcMk3ijT9uaGXQWxDY\"\n ]\n}"
|
||||
"curl": "curl -d'{\"method\": \"address_list\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet address list --account_id=\"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"address_list\", \"params\": {\"account_id\": \"n4S3djVrHvwjSyGvbqsJQRbMxz34ivbEmn\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"mwbmGcWxWP62u8WJL1sabaDUrRWgfvZnDJ\",\n \"n4H8Bq2pqGaMYcLVUB4RnySHuQYHebehYF\",\n \"n17pcmUBzURU1iLPn3gJ2TjkobTRKEkjeg\",\n \"mg4cT3trLybfa1kiKi7pWmAPQiSDRjvqnv\",\n \"mnN6tv9823EM2H2TLs4iKUirbzHRe31Gzn\",\n \"mpoHe8Efc7DMqjj7ZDHR9KmLDDNgUEiEji\",\n \"n16ExP69CXjmrcLGjE4RB6BWnKpnxyJqpa\",\n \"n1kjh2tsLf9s7q1frrqjaBoD42SNe12cJX\",\n \"n1Fa3zdSYy4T7p6348FWVzXxvdU1taWYVU\",\n \"mvZau2hafjNSf2Foit4PTmnFsHEug2aRqs\",\n \"mj4tVqn9EEkbodxvD9WBMms4ZJL5eiKExX\",\n \"mg7MQFATWXeASZSqK7LjXMnbmE5mirtUU6\",\n \"mwzd69pjQGZgC17L5Eth5nHQf468oP82wS\",\n \"mxfbMjeJVDgbTRVNYxGqcMGFoUKdczARmU\",\n \"mxU51ochtL3GwcfvgSuiUEY21EAvctJPJB\",\n \"mvQ1dMX2dJQ2z6rAfwGPoxeokfeRFGUeHC\",\n \"mnQWsVSPR23HNYzA5zsGTq6DYGgyYCVNZE\",\n \"mqDZzEr6tFypg9eMuqBjmcgJTzDARBFp5g\",\n \"mumE7zottnv24kMgZ37Mz5M73g4vpVyaGG\",\n \"mwQLh4tXmAsaowdAjr68UwRmHyT3nCZMaJ\",\n \"msFLpTJ8FoEMNrELSzLahsAFDFmhKhfrSc\",\n \"mz89sDjvPSJC4EUf8ssQm1wm2MfE5XtJYB\",\n \"mrm5Dnn65ByyVkVUntm13xQMAopZNPR6Us\",\n \"mxrv4B1aGmVMitNA2heEDr62sAGdyYA8ZZ\",\n \"mmXPQxvNkdYT8nsgiRAJyH9VitDRVMQk89\",\n \"msea7s76C8FvDW9wQwc2bowo54oZRncMvq\"\n ]\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -774,7 +792,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\": \"mztwZDgaFUnDFbtkxN2VLszuoojQMc6tLQ\"\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN\"\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -824,10 +842,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Delete a blob",
|
||||
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"d087dd83169ac7553c3026d4f47e42a3f673aa6e0220eef7d6867f8d94460080f020e470b8b4d7df4a9d8e6981b0784c\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet blob delete d087dd83169ac7553c3026d4f47e42a3f673aa6e0220eef7d6867f8d94460080f020e470b8b4d7df4a9d8e6981b0784c",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"d087dd83169ac7553c3026d4f47e42a3f673aa6e0220eef7d6867f8d94460080f020e470b8b4d7df4a9d8e6981b0784c\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted d087dd83169ac7553c3026d4f47e42a3f673aa6e0220eef7d6867f8d94460080f020e470b8b4d7df4a9d8e6981b0784c\"\n}"
|
||||
"curl": "curl -d'{\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"fdf95e94ef232c7c2e054d5e306cbedccea2b37fc35c618c3f6ea7d6cc23009acd837b30cd13796d3ef269085fea32f4\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet blob delete fdf95e94ef232c7c2e054d5e306cbedccea2b37fc35c618c3f6ea7d6cc23009acd837b30cd13796d3ef269085fea32f4",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"blob_delete\", \"params\": {\"blob_hash\": \"fdf95e94ef232c7c2e054d5e306cbedccea2b37fc35c618c3f6ea7d6cc23009acd837b30cd13796d3ef269085fea32f4\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": \"Deleted fdf95e94ef232c7c2e054d5e306cbedccea2b37fc35c618c3f6ea7d6cc23009acd837b30cd13796d3ef269085fea32f4\"\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -905,7 +923,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 \"d087dd83169ac7553c3026d4f47e42a3f673aa6e0220eef7d6867f8d94460080f020e470b8b4d7df4a9d8e6981b0784c\",\n \"32340dbf239be75d656c8cc72165bc97b33c7897bcad3e32eda18beae71e63f3be034ed64f2091e46fea657917aa24d8\",\n \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"a76d75a13ff15d946f929115e248dd411996abea4e1f37f73a72ba82fcd39a0dbbb3a3777e767984cd30e9eef2b68312\"\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n \"fdf95e94ef232c7c2e054d5e306cbedccea2b37fc35c618c3f6ea7d6cc23009acd837b30cd13796d3ef269085fea32f4\",\n \"eda7090b2d59beb0d77de489961cb73bbc73bbbb80d2c3c0e5f547b8c07dc0eded9627ce12872ca86a20a51d54ae3c4b\",\n \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"ab5849f4cd7430dcb6dc98ca0146106501878353b1441cd609b568291e7428aa091610fc247e3aee04cd81951f80d19a\"\n ]\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -980,10 +998,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Abandon a channel claim",
|
||||
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel abandon 682bdf7e3ea6564bcf8aebe3cf227544189d1a6d",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000164ddfed624b05a77a72a6f56208a73d73483cd303a81753c9cb1cba30c5f663f000000006b483045022100b8d3305e1e4f4dbf8b6f1627f1d2612f0afb41f91365b1ae11c298c52ae8be0a02202f7a2e45342607900e1a2d46e7b7d54f7cab9cbc85a399a19fa65c1f59b02c450121022f03def56e0d77c0f19e1c8ae315abccbf761e76343f19324fc8d5e4e521716bffffffff0134b7f505000000001976a9143a3d7976ad928fc8579eac779c0cbc7e49a2958d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mkpu8W1mArAiBb6aV5MfGd9Uo9wnhHFSBa\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"8bba7bc7a0d69d1a786de725c54a6ee8ce66b445a06d22345064b6558acec5de\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"8bba7bc7a0d69d1a786de725c54a6ee8ce66b445a06d22345064b6558acec5de\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel abandon cbf954c2782b7cf571f7aa1de960202057618727",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_abandon\", \"params\": {\"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000019613e2232b6676e29e340a54cd53fa9a9dbec95a4ec106fcd545c67a4ec94f79000000006a47304402206ae5b5c2d22eaf29019546873b6da38d7fbaaa85d2093a7f322e635d807796f702205a08ed6e24fdfb00201f591d9fe634b0dd493b464c9b16467ad86e7ea96013c80121033e683269da2ff2bc9c6a05616cf1eb06f3bb9b5e4a32c6f1498518f19a7a1292ffffffff0134b7f505000000001976a91445692384c08e385350a46f067f3a5433463d67c888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 8,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mmqxsTY8u2AoV1hQANgfq7dZQ4MY11eWD8\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"5ada8d9e054ad68005ea1c30d86ba73585a97b6072c46ed73b7f7732866199e1\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"5ada8d9e054ad68005ea1c30d86ba73585a97b6072c46ed73b7f7732866199e1\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1072,7 +1090,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "id of the account to store channel",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -1086,48 +1110,66 @@
|
||||
"type": "bool",
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"txid\": \"hash of transaction in hex\",\n \"height\": \"block where transaction was recorded\",\n \"inputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"outputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"total_input\": \"sum of inputs as a decimal\",\n \"total_output\": \"sum of outputs, sans fee, as a decimal\",\n \"total_fee\": \"fee amount\",\n \"hex\": \"entire transaction encoded in hex\"\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Create a channel claim without metadata",
|
||||
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@channel\", \"bid\": \"1.0\", \"featured\": [], \"tags\": [], \"languages\": [], \"locations\": [], \"preview\": false}}' http://localhost:5279/",
|
||||
"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\": [], \"preview\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000015b1437e0a48d9f617d74d0526130b55142b9809cfc4768fc524176dd0532f83e010000006b483045022100a3a998eda6a968a75a230ceb7712d745273e41c20b0573873ca75973048b37b9022039055db9b97a2517f4a81142a7be9fead9e2866c5946f8fdeeb7cbea93fee634012103382e6fef405ac1e202d4edea0888abfc8a9ec4e2ec499681a78b940d23a4cbaaffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea92686d7576a91497546b4edcb94a6b0fcd8593ed3a942c92ca8d9988acc462a029000000001976a914681c30baec28e2aa8d45a228f2a6af2e0a4fcec188ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhkrXjG9n4C7EJyH4ooDVVTYm2cjzGZcxS\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011813,\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": null,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mq1SLhoqW2g3qY1eGpcp2r5Xw1Vf19ocP8\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\"\n }\n}"
|
||||
"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\": \"010000000104c5f5417877270c58790fa0c3bced42a0d8eaab4d21402087b1860606fc9502010000006a47304402204ced7e0755751c731dce1297d051f95b013871b0b413154932c866cd8b9fc76d0220797632aa02eddb30a8f990879e2380e3389cd27b0d486231af2f2a48c8ceb7060121020ed040533fd5b0e1d1d95abb0f471d7b3592ca27f6bd62630ce0c592d39df90affffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e3046d7576a914a1576d19273d6a725bba8c75d4741f5200ed77ba88acc462a029000000001976a914c72eeaa3cb165e05e17357f1162f072ddbf0312788ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mzZF7vd3tBgh9u5tZcX2K4e4DipLzxt6d2\",\n \"amount\": \"7.999876\",\n \"confirmations\": 2,\n \"height\": 207,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587607,\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": null,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"myg8y3kBaKVSyuUWSmgXN56iY5iyMBXza9\",\n \"amount\": \"6.983769\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.016107\",\n \"total_input\": \"7.999876\",\n \"total_output\": \"7.983769\",\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"title": "Create a channel claim with all metadata",
|
||||
"curl": "curl -d'{\"method\": \"channel_create\", \"params\": {\"name\": \"@bigchannel\", \"bid\": \"1.0\", \"title\": \"Big Channel\", \"description\": \"A channel with lots of videos.\", \"email\": \"creator@smallmedia.com\", \"website_url\": \"http://smallmedia.com\", \"featured\": [], \"tags\": [\"music\", \"art\"], \"languages\": [\"pt-BR\", \"uk\"], \"locations\": [\"BR\", \"UA::Kiyv\"], \"thumbnail_url\": \"http://smallmedia.com/logo.jpg\", \"cover_url\": \"http://smallmedia.com/logo.jpg\", \"preview\": false}}' http://localhost:5279/",
|
||||
"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\", \"preview\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000164ddfed624b05a77a72a6f56208a73d73483cd303a81753c9cb1cba30c5f663f010000006a47304402207c048cfb78f8e2bca9395448ea87ae4d932e9f30fbeef88950490700e22867b7022055d06a29ed14fe51ac059bfb1c87e7e8dda755a8c772cd82d3dd0bb03a7c0d980121023029cb2848043d7fdbbfee2e289e7138e1fda02f479f4fc7c70f6057b4749b15ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004816277e675319fe21d8a1605d7ab8840d0d4c7972252914c58b4883d22501c5185c450737232112d3c1d011d258ea7dbcb8430461d1bd24c28bd92b1882eca41121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9146edf701f9576ecc9350a237341c557039e4fe91988ace221d305000000001976a9144cfde5a37df242b0d4d9d975bc1c6d11243b511b88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mi8yHTnrdinYn2JFHXBsSK4CBex6CtaRFK\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mqdCHu4sTh3bZoSTyMwR62i5w3e6U9aBCA\",\n \"amount\": \"1.0\",\n \"claim_id\": \"9c594079a7dd41fbc8d68011bec5bcdfb0f8dddb\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#9c594079a7dd41fbc8d68011bec5bcdfb0f8dddb\",\n \"timestamp\": null,\n \"txid\": \"60b2c4430178f48b1b4bdda0aaacd66fe1512d0c0e4f16e646a6d178a6a112c9\",\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\": \"3056301006072a8648ce3d020106052b8104000a03420004816277e675319fe21d8a1605d7ab8840d0d4c7972252914c58b4883d22501c5185c450737232112d3c1d011d258ea7dbcb8430461d1bd24c28bd92b1882eca41\",\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\": \"mnY3oi1Auwp7Cb4CQRGDLoKWwsARVzes45\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"60b2c4430178f48b1b4bdda0aaacd66fe1512d0c0e4f16e646a6d178a6a112c9\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"60b2c4430178f48b1b4bdda0aaacd66fe1512d0c0e4f16e646a6d178a6a112c9\"\n }\n}"
|
||||
"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\": \"01000000019613e2232b6676e29e340a54cd53fa9a9dbec95a4ec106fcd545c67a4ec94f79010000006a473044022022a7418c87d93c0ec797848349b95acaa3e50ae740706940934aeab3076564300220297a6c913f43b6c1405b097ce2e98ace59eec82470e63d6cd5a0e59a05076069012103685aa1350bd3454aaa469ad31e54c9d1aa5461fda343a96aca78e773f7a08b19ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a03420004302494206e748d6062dc11249aae7ad32a19928a85720723f6d7938c413daccab152f5577a9506066237a0453531645c4d2be7bdf950cba650e4be5bc61dfa04121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9144b8db34e9113f54c681086797b664b4ed33649e788ace221d305000000001976a914cdd2a5b42610fc0182b882c47aca759dd59e7ece88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n19NX4hFThAvep5r78VhPh4rL9syV9WDrP\",\n \"amount\": \"1.9993355\",\n \"confirmations\": 1,\n \"height\": 210,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mnQSixa4Pxn1udNR8HyBCdjC5TeBaq8TWN\",\n \"amount\": \"1.0\",\n \"claim_id\": \"66dbad60875d8995f9429057d71a5171d7850dec\",\n \"claim_op\": \"create\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@bigchannel\",\n \"normalized_name\": \"@bigchannel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@bigchannel#66dbad60875d8995f9429057d71a5171d7850dec\",\n \"timestamp\": null,\n \"txid\": \"1a11ffa76a74be172696239f26ef267fca420b199c0bf8a9831152b83f86f8e3\",\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\": \"3056301006072a8648ce3d020106052b8104000a03420004302494206e748d6062dc11249aae7ad32a19928a85720723f6d7938c413daccab152f5577a9506066237a0453531645c4d2be7bdf950cba650e4be5bc61dfa04\",\n \"public_key_id\": \"mwx9vaUSKMxVkGCYWdZmxx6P6PF4zPNFMq\",\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\": \"mzHFAQfgBr1QpQr8YSMpJFg54vkhwU2WoB\",\n \"amount\": \"0.9772285\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"1a11ffa76a74be172696239f26ef267fca420b199c0bf8a9831152b83f86f8e3\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.022107\",\n \"total_input\": \"1.9993355\",\n \"total_output\": \"1.9772285\",\n \"txid\": \"1a11ffa76a74be172696239f26ef267fca420b199c0bf8a9831152b83f86f8e3\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "channel_export",
|
||||
"description": "Export serialized channel signing information for a given certificate claim id",
|
||||
"description": "Export channel private key.",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "claim_id",
|
||||
"name": "channel_id",
|
||||
"type": "str",
|
||||
"description": "Claim ID to export information about",
|
||||
"description": "claim id of channel to export",
|
||||
"is_required": true
|
||||
},
|
||||
{
|
||||
"name": "channel_name",
|
||||
"type": "str",
|
||||
"description": "name of channel to export",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "one or more account ids for accounts to look in for channels, defaults to all accounts.",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": "(str) Serialized certificate information",
|
||||
"returns": "(str) serialized channel private key",
|
||||
"examples": []
|
||||
},
|
||||
{
|
||||
"name": "channel_import",
|
||||
"description": "Import serialized channel signing information (to allow signing new claims to the channel)",
|
||||
"description": "Import serialized channel private key (to allow signing new streams to the channel)",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "serialized_certificate_info",
|
||||
"name": "channel_data",
|
||||
"type": "str",
|
||||
"description": "certificate info",
|
||||
"description": "serialized channel, as exported by channel export",
|
||||
"is_required": true
|
||||
}
|
||||
],
|
||||
@@ -1164,14 +1206,14 @@
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your channel claims",
|
||||
"curl": "curl -d'{\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1278,7 +1320,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "id of the account to store channel",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -1299,6 +1347,12 @@
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "replace",
|
||||
"type": "bool",
|
||||
@@ -1310,10 +1364,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Update a channel claim",
|
||||
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet channel update 682bdf7e3ea6564bcf8aebe3cf227544189d1a6d --title=\"New Channel\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"title\": \"New Channel\", \"featured\": [], \"clear_featured\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"new_signing_key\": false, \"preview\": false, \"replace\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000029ace2abc443770abd15bd7d7a0f50d7901aa8b09f3bd921b4631214436836a1e000000006b483045022100ce01d888adf2a629f71342ddb1c127ddd04cea8bcf18c67ccc94a97b2e4798ae02202150f0091d71f69cf5656cd525b789ca5ef38a5416e6995c22a53748b653f0900121022f03def56e0d77c0f19e1c8ae315abccbf761e76343f19324fc8d5e4e521716bffffffffbaaf5b2ddeda8c5a6f931bb2a33b8f7bef07e0c2c1e4241ba40779857be0da92000000006b483045022100f3fdc34c545f2116042ccff330a3af3dc195329bb64e0a4a08dd75beed959b0602205680bab6e19b244670fdb86f86197b9d6028b11a67fcdfa6b91907634c7fe291012102500d97c6528fc25ed450b3ad8e62934e5400cc601941e5a4f8b250c8a88f7a3dffffffff0200e1f50500000000a6b708406368616e6e656c146d1a9d18447522cfe3eb8acf4b56a63e7edf2b684c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268420b4e6577204368616e6e656c6d6d76a91497546b4edcb94a6b0fcd8593ed3a942c92ca8d9988ac6ebeea0b000000001976a9141cc00d6cb1247dee818dda0fca641e7e016c98b888ac00000000\",\n \"inputs\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mq1SLhoqW2g3qY1eGpcp2r5Xw1Vf19ocP8\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1559011813,\n \"txid\": \"92dae07b857907a41b24e4c1c2e007ef7b8f3ba3b21b936f5a8cdade2d5bafba\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": null,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mi8yHTnrdinYn2JFHXBsSK4CBex6CtaRFK\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"channel_update\", \"params\": {\"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"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 cbf954c2782b7cf571f7aa1de960202057618727 --title=\"New Channel\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"channel_update\", \"params\": {\"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"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\": \"01000000022f35356c58ebfbce4884267d041a46b25318eda5a7d8155de2cb9fe53822ea81000000006a47304402206fff2ae3c959730b57e5b003eeb90974bb8d1a6f7056ce590d0959be9430d7520220573010e8bd008d0a9a93bb20716a1eb396eba98700a0342bbca4e6fbe6e8d45d0121033e683269da2ff2bc9c6a05616cf1eb06f3bb9b5e4a32c6f1498518f19a7a1292ffffffffcd0929849206138ad19f2efb9f58c30b431846411028509b66476de9e9b63180000000006a473044022077467b92bb4fb1cc0710155978629591f861971b9004659349c258b6f39d50990220404af1a82bd4739d3e24ade370cd6989ba29b28834fc99b575854e1a223b5838012102d615d7b74f294ccd272353330d31fd5509651c164873a61f53b3fc07300aac3effffffff0200e1f50500000000a6b708406368616e6e656c1427876157202060e91daaf771f57c2b78c254f9cb4c6a00125a0a583056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304420b4e6577204368616e6e656c6d6d76a914a1576d19273d6a725bba8c75d4741f5200ed77ba88ac6ebeea0b000000001976a914d74d96016a44ba6ab6d4b8a64dcc51fb59601b7d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"create\",\n \"confirmations\": 1,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"mqufgoJUGVmpBPShNwTYNrAa34mYcS2BAZ\",\n \"amount\": \"1.999604\",\n \"confirmations\": 1,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 0,\n \"timestamp\": 1565587607,\n \"txid\": \"8031b6e9e96d47669b502810414618430bc3589ffb2e9fd18a130692842909cd\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": -2,\n \"height\": -2,\n \"meta\": {},\n \"name\": \"@channel\",\n \"normalized_name\": \"@channel\",\n \"nout\": 0,\n \"permanent_url\": \"lbry://@channel#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": null,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n {\n \"address\": \"n19NX4hFThAvep5r78VhPh4rL9syV9WDrP\",\n \"amount\": \"1.9993355\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.0002685\",\n \"total_input\": \"2.999604\",\n \"total_output\": \"2.9993355\",\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\"\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1352,14 +1406,14 @@
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ]\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your claims",
|
||||
"curl": "curl -d'{\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet claim list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n }\n ],\n \"page\": 1,\n \"page_size\": 20,\n \"total_items\": 2,\n \"total_pages\": 1\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\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}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1394,25 +1448,49 @@
|
||||
{
|
||||
"name": "channel",
|
||||
"type": "str",
|
||||
"description": "claims signed by this channel (argument is a URL which automatically gets resolved), see --channel_ids if you need to filter by multiple channels at the same time, includes claims with invalid signatures, use in conjunction with --is_channel_signature_valid",
|
||||
"description": "claims signed by this channel (argument is a URL which automatically gets resolved), see --channel_ids if you need to filter by multiple channels at the same time, includes claims with invalid signatures, use in conjunction with --valid_channel_signature",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "channel_ids",
|
||||
"type": "str",
|
||||
"description": "claims signed by any of these channels (arguments must be claim ids of the channels), includes claims with invalid signatures, use in conjunction with --is_channel_signature_valid",
|
||||
"type": "list",
|
||||
"description": "claims signed by any of these channels (arguments must be claim ids of the channels), includes claims with invalid signatures, implies --has_channel_signature, use in conjunction with --valid_channel_signature",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "is_channel_signature_valid",
|
||||
"name": "not_channel_ids",
|
||||
"type": "list",
|
||||
"description": "exclude claims signed by any of these channels (arguments must be claim ids of the channels)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "has_channel_signature",
|
||||
"type": "bool",
|
||||
"description": "only return claims with valid channel signatures",
|
||||
"description": "claims with a channel signature (valid or invalid)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "valid_channel_signature",
|
||||
"type": "bool",
|
||||
"description": "claims with a valid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with valid signatures",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "invalid_channel_signature",
|
||||
"type": "bool",
|
||||
"description": "claims with invalid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with invalid signatures",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "is_controlling",
|
||||
"type": "bool",
|
||||
"description": "only return winning claims of their respective name",
|
||||
"description": "winning claims of their respective name",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "public_key_id",
|
||||
"type": "str",
|
||||
"description": "only return channels having this public key id, this is the same key as used in the wallet file to map channel certificate private keys: {'public_key_id': 'private key'}",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -1499,6 +1577,36 @@
|
||||
"description": "trending value calculated relative to all trending content globally (supports equality constraints)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "claim_type",
|
||||
"type": "str",
|
||||
"description": "filter by 'channel', 'stream' or 'unknown'",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "stream_types",
|
||||
"type": "list",
|
||||
"description": "filter by 'video', 'image', 'document', etc",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "media_types",
|
||||
"type": "list",
|
||||
"description": "filter by 'video/mp4', 'image/png', etc",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "fee_currency",
|
||||
"type": "string",
|
||||
"description": "specify fee currency: LBC, BTC, USD",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "fee_amount",
|
||||
"type": "decimal",
|
||||
"description": "content download fee (supports equality constraints)",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "any_tags",
|
||||
"type": "list",
|
||||
@@ -1567,46 +1675,96 @@
|
||||
},
|
||||
{
|
||||
"name": "order_by",
|
||||
"type": "str",
|
||||
"type": "list",
|
||||
"description": "field to order by, default is descending order, to do an ascending order prepend ^ to the field name, eg. '^amount' available fields: 'name', 'height', 'release_time', 'publish_time', 'amount', 'effective_amount', 'support_amount', 'trending_group', 'trending_mixed', 'trending_local', 'trending_global', 'activation_height'",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "no_totals",
|
||||
"type": "bool",
|
||||
"description": "do not calculate the total number of pages and items in result set (significant performance boost)",
|
||||
"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 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ]\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Search for all claims in channel",
|
||||
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"channel\": \"@channel\", \"channel_ids\": [], \"is_channel_signature_valid\": false, \"is_controlling\": false, \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"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\": {\"channel\": \"@channel\", \"channel_ids\": [], \"is_channel_signature_valid\": false, \"is_controlling\": false, \"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 \"items\": [],\n \"page\": 1,\n \"page_size\": 10,\n \"total_items\": 0,\n \"total_pages\": 0\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"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 \"items\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c/astream#6\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": 1565587608,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1565587607,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"short_url\": \"lbry://@channel#c\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 10,\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\", \"channel_ids\": [], \"is_channel_signature_valid\": false, \"is_controlling\": false, \"any_tags\": [], \"all_tags\": [], \"not_tags\": [], \"any_languages\": [], \"all_languages\": [], \"not_languages\": [], \"any_locations\": [], \"all_locations\": [], \"not_locations\": [], \"order_by\": []}}' http://localhost:5279/",
|
||||
"curl": "curl -d'{\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"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\", \"channel_ids\": [], \"is_channel_signature_valid\": false, \"is_controlling\": false, \"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 \"items\": [],\n \"page\": 1,\n \"page_size\": 10,\n \"total_items\": 0,\n \"total_pages\": 0\n }\n}"
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"claim_search\", \"params\": {\"name\": \"astream\", \"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 \"items\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c/astream#6\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": 1565587608,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263187,\n \"is_controlling\": true,\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"short_url\": \"lbry://astream#6\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"canonical_url\": \"lbry://@channel#c\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\n \"height\": 210,\n \"meta\": {\n \"activation_height\": 209,\n \"claims_in_channel\": 1,\n \"creation_height\": 209,\n \"creation_timestamp\": 1565587607,\n \"effective_amount\": \"1.0\",\n \"expiration_height\": 263183,\n \"is_controlling\": true,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"short_url\": \"lbry://@channel#c\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"page\": 1,\n \"page_size\": 10,\n \"total_items\": 1,\n \"total_pages\": 1\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"comment": {
|
||||
"doc": "Create and list comments.",
|
||||
"doc": "View, create and abandon comments.",
|
||||
"commands": [
|
||||
{
|
||||
"name": "comment_abandon",
|
||||
"description": "Abandon a comment published under your channel identity.",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "comment_id",
|
||||
"type": "str",
|
||||
"description": "The ID of the comment to be deleted.",
|
||||
"is_required": true
|
||||
}
|
||||
],
|
||||
"returns": "(dict) Object with the `comment_id` passed in as the key, and a flag indicating if it was deleted\n {\n <comment_id> (str): {\n \"deleted\": (bool)\n }\n }",
|
||||
"examples": []
|
||||
},
|
||||
{
|
||||
"name": "comment_create",
|
||||
"description": "Create and associate a comment with a claim using your channel identity.",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "parent_comment_id",
|
||||
"type": "int",
|
||||
"name": "comment",
|
||||
"type": "str",
|
||||
"description": "Comment to be made, should be at most 2000 characters.",
|
||||
"is_required": true
|
||||
},
|
||||
{
|
||||
"name": "claim_id",
|
||||
"type": "str",
|
||||
"description": "The ID of the claim to comment on",
|
||||
"is_required": true
|
||||
},
|
||||
{
|
||||
"name": "parent_id",
|
||||
"type": "str",
|
||||
"description": "The ID of a comment to make a response to",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "channel_id",
|
||||
"type": "str",
|
||||
"description": "The ID of the channel you want to post under",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "channel_name",
|
||||
"type": "str",
|
||||
"description": "The channel you want to post as, prepend with a '@'",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "channel_account_id",
|
||||
"type": "str",
|
||||
"description": "one or more account ids for accounts to look in for channel certificates, defaults to all accounts.",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": "(dict) Comment object if successfully made",
|
||||
"returns": "(dict) Comment object if successfully made, (None) otherwise\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n }",
|
||||
"examples": []
|
||||
},
|
||||
{
|
||||
@@ -1614,37 +1772,43 @@
|
||||
"description": "List comments associated with a claim.",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "flat",
|
||||
"type": "bool",
|
||||
"description": "Flag to indicate whether or not you want the replies to be flattened along with the rest of the comments attached to the claim. Off by default",
|
||||
"is_required": false
|
||||
"name": "claim_id",
|
||||
"type": "str",
|
||||
"description": "The claim on which the comment will be made on",
|
||||
"is_required": true
|
||||
},
|
||||
{
|
||||
"name": "parent_comment_id",
|
||||
"type": "int",
|
||||
"description": "The ID of an existing comment to list replies from",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "max_replies_shown",
|
||||
"type": "int",
|
||||
"description": "For every comment that we pull replies from, only retrieve up to this amount. Note: This is not the same as page size.",
|
||||
"name": "parent_id",
|
||||
"type": "str",
|
||||
"description": "CommentId of a specific thread you'd like to see",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"type": "int",
|
||||
"description": "The page you'd like to see in the comment list. The first page is 1, second page is 2, and so on.",
|
||||
"description": "The page you'd like to see in the comment list.",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "page_size",
|
||||
"type": "int",
|
||||
"description": "The amount of comments that you'd like to retrieve in one request",
|
||||
"description": "The amount of comments that you'd like to retrieve",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "include_replies",
|
||||
"type": "bool",
|
||||
"description": "Whether or not you want to include replies in list",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "is_channel_signature_valid",
|
||||
"type": "bool",
|
||||
"description": "Only include comments with valid signatures. [Warning: Paginated total size will not change, even if list reduces]",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": "(dict) Dict containing the following schema:\n {\n \"page\": (int) The page of comments as provided when limiting response to page_size.\n \"page_size\": (int) Number of comments in the given page. -1 if page_size wasn't used\n \"comments\": (list) Contains all the comments (as dicts) as provided by the specified parameters\n }",
|
||||
"returns": "(dict) Containing the list, and information about the paginated content:\n {\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\": \"A List of dict objects representing comments.\"\n [\n {\n \"comment\": (str) The actual string as inputted by the user,\n \"comment_id\": (str) The Comment's unique identifier,\n \"channel_name\": (str) Name of the channel this was posted under, prepended with a '@',\n \"channel_id\": (str) The Channel Claim ID that this comment was posted under,\n \"signature\": (str) The signature of the comment,\n \"channel_url\": (str) Channel's URI in the ClaimTrie,\n \"parent_id\": (str) Comment this is replying to, (None) if this is the root,\n \"timestamp\": (int) The time at which comment was entered into the server at, in nanoseconds.\n },\n ...\n ]\n }",
|
||||
"examples": []
|
||||
}
|
||||
]
|
||||
@@ -1733,9 +1897,9 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Delete a file",
|
||||
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file delete --claim_id=\"ffdbe8f44f285fbc4a352763727abd86d17399c1\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\"}}).json()",
|
||||
"curl": "curl -d'{\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file delete --claim_id=\"68fde0328b1a267b3815ce974a6329b159619092\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_delete\", \"params\": {\"delete_from_download_dir\": false, \"delete_all\": false, \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": true\n}"
|
||||
}
|
||||
]
|
||||
@@ -1842,14 +2006,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 {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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\": \"1441a34034b2dbc19094f1c7b164680c\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"016d1a9d18447522cfe3eb8acf4b56a63e7edf2b68fdfdb7869eb7447ab2e61a2d5cdf8199867bda63dd1edc699b7dee31d618198502a11309baff2f6d52104f494ca48ff9e5961c5a00badba23fcfeb010f595fc10a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"e5189cf47e5bdecdef6ec77874410bf7d57ac71ccfb4e6588311a7375c890e513be365538d51068fe97a0c21a8e389e0\",\n \"stream_name\": \"tmp6h32p99s\",\n \"streaming_url\": \"http://localhost:5280/stream/e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"suggested_file_name\": \"tmp6h32p99s\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"written_bytes\": null\n },\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"e90a079b038cabe2782bc6a5b4f55f4e5febc5a1\",\n \"claim_name\": \"blank-image\",\n \"completed\": true,\n \"confirmations\": -1,\n \"content_fee\": null,\n \"download_directory\": null,\n \"download_path\": null,\n \"file_name\": null,\n \"height\": -1,\n \"key\": \"81146b05970a6504588868483783fb9d\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mhgGjVVY6kjrAxf2cz1ALfbst6CQhZ72qg\",\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\": \"1559011789\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpg0gz6g_3.png\",\n \"sd_hash\": \"a76d75a13ff15d946f929115e248dd411996abea4e1f37f73a72ba82fcd39a0dbbb3a3777e767984cd30e9eef2b68312\",\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\": \"5faad4dc0519a4861480b7386e58e0857801ec6d13ba2a308449546ce4d18928:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"016d1a9d18447522cfe3eb8acf4b56a63e7edf2b688f6d18586c20043e6f4852d49b4ade3732b787c4bf1335d57b0bbd87bdf4720f75eda1765146eb1bf653b82823ec8716d72920fcc8849d3ce0885ff89cb7f1ac0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120Line truncated
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": \"b362c109c1773e239c7b8046b68baca1\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0127876157202060e91daaf771f57c2b78c254f9cb399c380097dccb958b0a22cddccfb1ff04aa93fa4022c09f2063b86e67ed1b5bc8546dfec3d1faf5c2c75c365722f78c508ba288b1f0cb3913fd391ff1796a1c0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"b2749b74dd58556c9193970be68b3c439dd593e7f117cdbba75d3073307fdfa91e811ff9d3f71336eccefadb9d27effa\",\n \"stream_name\": \"tmpwc0xotjc\",\n \"streaming_url\": \"http://localhost:5280/stream/ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"suggested_file_name\": \"tmpwc0xotjc\",\n \"timestamp\": null,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"written_bytes\": 0\n },\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"5cfb92c3e6a80aedee5282c3f64b565bc6965562\",\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\": \"6e4465bcef7cb99a26a29b8d3e016318\",\n \"metadata\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mhPFLtT7YzmNfMuQYr4PQXAJdtaTKWRLFy\",\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\": \"1565587584\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpnkt_49bq.png\",\n \"sd_hash\": \"eda7090b2d59beb0d77de489961cb73bbc73bbbb80d2c3c0e5f547b8c07dc0eded9627ce12872ca86a20a51d54ae3c4b\",\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\": \"474e26f1aceebbdbbbad02afd37dd39aa3eb221098fa8a4073b1117264422e98:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0127876157202060e91daaf771f57c2b78c254f9cb24eda15eb1995dfe4ea874fa93396c62e1fe82612e6b9b786ea0c55166e98e7880da5e3b48ef29ab4d1a9c83f71482c22a4acad548c27a5f5643550d0434f3b00ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85Line truncated
|
||||
},
|
||||
{
|
||||
"title": "List files matching a parameter",
|
||||
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"reverse\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file list --claim_id=\"ffdbe8f44f285fbc4a352763727abd86d17399c1\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"reverse\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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\": \"1441a34034b2dbc19094f1c7b164680c\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"016d1a9d18447522cfe3eb8acf4b56a63e7edf2b68fdfdb7869eb7447ab2e61a2d5cdf8199867bda63dd1edc699b7dee31d618198502a11309baff2f6d52104f494ca48ff9e5961c5a00badba23fcfeb010f595fc10a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"e5189cf47e5bdecdef6ec77874410bf7d57ac71ccfb4e6588311a7375c890e513be365538d51068fe97a0c21a8e389e0\",\n \"stream_name\": \"tmp6h32p99s\",\n \"streaming_url\": \"http://localhost:5280/stream/e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"suggested_file_name\": \"tmp6h32p99s\",\n \"timestamp\": 1559011814,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"written_bytes\": null\n }\n ]\n}"
|
||||
"curl": "curl -d'{\"method\": \"file_list\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"reverse\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file list --claim_id=\"68fde0328b1a267b3815ce974a6329b159619092\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_list\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"reverse\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": \"b362c109c1773e239c7b8046b68baca1\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0127876157202060e91daaf771f57c2b78c254f9cb399c380097dccb958b0a22cddccfb1ff04aa93fa4022c09f2063b86e67ed1b5bc8546dfec3d1faf5c2c75c365722f78c508ba288b1f0cb3913fd391ff1796a1c0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"status\": \"finished\",\n \"stopped\": true,\n \"stream_hash\": \"b2749b74dd58556c9193970be68b3c439dd593e7f117cdbba75d3073307fdfa91e811ff9d3f71336eccefadb9d27effa\",\n \"stream_name\": \"tmpwc0xotjc\",\n \"streaming_url\": \"http://localhost:5280/stream/ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"suggested_file_name\": \"tmpwc0xotjc\",\n \"timestamp\": 1565587608,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"written_bytes\": 0\n }\n ]\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1966,10 +2130,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Save a file to the downloads directory",
|
||||
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file save --sd_hash=\"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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\": \"1441a34034b2dbc19094f1c7b164680c\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"016d1a9d18447522cfe3eb8acf4b56a63e7edf2b68fdfdb7869eb7447ab2e61a2d5cdf8199867bda63dd1edc699b7dee31d618198502a11309baff2f6d52104f494ca48ff9e5961c5a00badba23fcfeb010f595fc10a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"e5189cf47e5bdecdef6ec77874410bf7d57ac71ccfb4e6588311a7375c890e513be365538d51068fe97a0c21a8e389e0\",\n \"stream_name\": \"tmp6h32p99s\",\n \"streaming_url\": \"http://localhost:5280/stream/e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"suggested_file_name\": \"tmp6h32p99s\",\n \"timestamp\": 1559011814,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"written_bytes\": null\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"file_save\", \"params\": {\"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\"}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet file save --sd_hash=\"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"file_save\", \"params\": {\"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\"}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"blobs_completed\": 1,\n \"blobs_in_stream\": 1,\n \"blobs_remaining\": 0,\n \"channel_claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"channel_name\": \"@channel\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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\": \"b362c109c1773e239c7b8046b68baca1\",\n \"metadata\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"mime_type\": \"application/octet-stream\",\n \"nout\": 0,\n \"outpoint\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400:0\",\n \"points_paid\": 0.0,\n \"protobuf\": \"0127876157202060e91daaf771f57c2b78c254f9cb399c380097dccb958b0a22cddccfb1ff04aa93fa4022c09f2063b86e67ed1b5bc8546dfec3d1faf5c2c75c365722f78c508ba288b1f0cb3913fd391ff1796a1c0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"status\": \"running\",\n \"stopped\": false,\n \"stream_hash\": \"b2749b74dd58556c9193970be68b3c439dd593e7f117cdbba75d3073307fdfa91e811ff9d3f71336eccefadb9d27effa\",\n \"stream_name\": \"tmpwc0xotjc\",\n \"streaming_url\": \"http://localhost:5280/stream/ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"suggested_file_name\": \"tmpwc0xotjc\",\n \"timestamp\": 1565587608,\n \"total_bytes\": 16,\n \"total_bytes_lower_bound\": 0,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"written_bytes\": 0\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2052,14 +2216,14 @@
|
||||
"name": "settings_get",
|
||||
"description": "Get daemon settings",
|
||||
"arguments": [],
|
||||
"returns": "(dict) Dictionary of daemon settings\n See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings",
|
||||
"returns": "(dict) Dictionary of daemon settings\n See ADJUSTABLE_SETTINGS in lbry/conf.py for full list of settings",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Get settings",
|
||||
"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 \"comment_server\": \"http://comments.lbry.com:2903/api\",\n \"components_to_skip\": [\n \"dht\",\n \"upnp\",\n \"hash_announcer\",\n \"peer_protocol_server\"\n ],\n \"concurrent_blob_announcers\": 10,\n \"concurrent_reflector_uploads\": 10,\n \"config\": \"/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml\",\n \"data_dir\": \"/tmp/tmpf06o5qj4\",\n \"download_dir\": \"/tmp/tmpf06o5qj4\",\n \"download_timeout\": 30.0,\n \"fixed_peer_delay\": 2.0,\n \"known_dht_nodes\": [],\n \"lbryum_servers\": [\n [\n \"127.0.0.1\",\n 50001\n ]\n ],\n \"max_connections_per_download\": 4,\n \"max_key_fee\": {\n \"amount\": 50.0,\n \"currency\": \"USD\"\n },\n \"network_interface\": \"0.0.0.0\",\n \"node_rpc_timeout\": 5.0,\n \"peer_connect_timeout\": 3.0,\n \"reflect_streams\": true,\n \"reflector_servers\": [\n [\n \"127.0.0.1\",\n 5566\n ]\n ],\n \"s3_headers_depth\": 960,\n \"save_blobs\": true,\n \"save_files\": true,\n \"share_usage_data\": false,\n \"split_buckets_under_index\": 1,\n \"streaming_get\": true,\n \"streaming_server\": \"localhost:5280\",\n \"tcp_port\": 3333,\n \"udp_port\": 4444,\n \"use_upnp\": false,\n \"wallet_dir\": \"/tmp/tmpf06o5qj4\"\n }\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"announce_head_and_sd_only\": true,\n \"api\": \"localhost:5279\",\n \"blob_download_timeout\": 30.0,\n \"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/tmpdym2_jzz\",\n \"download_dir\": \"/tmp/tmpdym2_jzz\",\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/tmpdym2_jzz\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2120,10 +2284,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Abandon a stream claim",
|
||||
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream abandon ffdbe8f44f285fbc4a352763727abd86d17399c1",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000187722414e5e6ebba51fc8e3ffa8992ed28959c6f10693ac35e20e4b571db78fa000000006b483045022100a387d3d1bbd1d7473c3d0285344b4d4fef9cfd2ec54ad3f40b2edd6852068d4802206e81afbd2b2dc48bdf2b89227aaebcf2f2f8448530125beb8cd3ac861f0ee745012102700c310dacc983a7cfe3187c0913373c956fbb5f850a13043c2897f2da825120ffffffff0134b7f505000000001976a914b70f37bc1d9a6cef8d47db72a4267c957193fe7d88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 7,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mxCtBWCjYjg56RoikBbn6GTFdBGBH89NdT\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"715f7493f78217a0a1f15094563adc0e09ea443b748713eea766f8d492f21815\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"715f7493f78217a0a1f15094563adc0e09ea443b748713eea766f8d492f21815\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream abandon 68fde0328b1a267b3815ce974a6329b159619092",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_abandon\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"010000000100540ecab697180928c5f99354fbfa1144c37a811c6c6545863e3233d747a255000000006b483045022100e46cf7452572b43ed2357690679ced0e8715eaf9edd740870e867d35d9dccc1f022008ead1fdb16dac7f7e78c3588e9f27311ac8fa83a19b6e23811a6aeae6105286012102e5f31d1a080e94c45195eb667ca7224c90d6f2351de3c0f069189adbe7dda5d9ffffffff0134b7f505000000001976a91433f438c61fc4e8057a961399d0c623bcb367768e88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mkFfKfSnNuyBsFKynQvBbwdEc1TYFvVUDX\",\n \"amount\": \"0.999893\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 0,\n \"timestamp\": null,\n \"txid\": \"967b9aaf6a56a3f99b42e3eb777721e2c957f9fb3ad7495fb3e72159c5f59cfa\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.000107\",\n \"total_input\": \"1.0\",\n \"total_output\": \"0.999893\",\n \"txid\": \"967b9aaf6a56a3f99b42e3eb777721e2c957f9fb3ad7495fb3e72159c5f59cfa\"\n }\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2286,7 +2450,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "account to use for funding the transaction",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -2300,23 +2470,29 @@
|
||||
"type": "bool",
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"txid\": \"hash of transaction in hex\",\n \"height\": \"block where transaction was recorded\",\n \"inputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"outputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"total_input\": \"sum of inputs as a decimal\",\n \"total_output\": \"sum of outputs, sans fee, as a decimal\",\n \"total_fee\": \"fee amount\",\n \"hex\": \"entire transaction encoded in hex\"\n }",
|
||||
"examples": [
|
||||
{
|
||||
"title": "Create a stream claim without metadata",
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp6h32p99s\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmp6h32p99s",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmp6h32p99s\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"preview\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"01000000019ace2abc443770abd15bd7d7a0f50d7901aa8b09f3bd921b4631214436836a1e010000006b483045022100bcb08cbd4591cafdbd6a45ad159d5d3a1d5b690a45afa00788044f04d8b2959b02202f746fe20222c7502bef41fe052abef118d97df7e0723e04afa13913abdec276012102500d97c6528fc25ed450b3ad8e62934e5400cc601941e5a4f8b250c8a88f7a3dffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e06d7576a914061cbd2df8421ab14497e62baf747461c7c9137b88ac38fb9423000000001976a914c1c932e896b2e8073e6da13a87111deba2b5f97588ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mq1SLhoqW2g3qY1eGpcp2r5Xw1Vf19ocP8\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011813,\n \"txid\": \"1e6a8336442131461b92bdf3098baa01790df5a0d7d75bd1ab703744bc2ace9a\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"timestamp\": null,\n \"txid\": \"ad2d9b984b2a9e923b12f7652dd9a945664f647e9ead8779fd9b240a68301442\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"myBbjcsUMBsTi5aA1Y3FQr3eXZHTkTKjGn\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"ad2d9b984b2a9e923b12f7652dd9a945664f647e9ead8779fd9b240a68301442\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"ad2d9b984b2a9e923b12f7652dd9a945664f647e9ead8779fd9b240a68301442\"\n }\n}"
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpwc0xotjc\", \"tags\": [], \"languages\": [], \"locations\": [], \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create astream 1.0 /tmp/tmpwc0xotjc",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"astream\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpwc0xotjc\", \"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\": \"01000000012f35356c58ebfbce4884267d041a46b25318eda5a7d8155de2cb9fe53822ea81010000006b48304502210098a023fd71f8cb8a91b2251ac34b6c1c92da13426e28f2aeaf74283f2d3a79b60220752526ab6104fbf0d98adb25259f1a423f520ee60419388d52eff6a322e0bf97012102860c0ba9a89d394722e50d15c942a7c13c8a6cb6f24354f5d45f1debadb58bfbffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f26d7576a91415733e667eb7be1146f77b7eab0c5f757d623cc988ac38fb9423000000001976a914fb6300ecc589692a5f3befbac4da77c9fe698cd288ac00000000\",\n \"inputs\": [\n {\n \"address\": \"myg8y3kBaKVSyuUWSmgXN56iY5iyMBXza9\",\n \"amount\": \"6.983769\",\n \"confirmations\": 4,\n \"height\": 209,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587607,\n \"txid\": \"81ea2238e59fcbe25d15d8a7a5ed1853b2461a047d268448cefbeb586c35352f\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"timestamp\": null,\n \"txid\": \"8585fd73e301e58e044581e3f4d2d1195a208e333e8632b75363da2f6ec55ab2\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"n4SAW6U5NeYRqQTdos4cLMgtbWRBFW8X16\",\n \"amount\": \"5.969662\",\n \"confirmations\": -2,\n \"height\": -2,\n \"nout\": 1,\n \"timestamp\": null,\n \"txid\": \"8585fd73e301e58e044581e3f4d2d1195a208e333e8632b75363da2f6ec55ab2\",\n \"type\": \"payment\"\n }\n ],\n \"total_fee\": \"0.014107\",\n \"total_input\": \"6.983769\",\n \"total_output\": \"6.969662\",\n \"txid\": \"8585fd73e301e58e044581e3f4d2d1195a208e333e8632b75363da2f6ec55ab2\"\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/tmpg0gz6g_3.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\": 1559011789, \"channel_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"channel_account_id\": [], \"preview\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpg0gz6g_3.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=1559011789 --channel_id=\"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpg0gz6g_3.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\": 1559011789, \"channel_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"channel_account_id\": [], \"preview\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001421430680a249bfd7987ad9e7e644f6645a9d92d65f7123b929e2a4b989b2dad010000006b483045022100f90b38c9fd9f7b6489a17ca1af70b04b10b544c72b571b85501d465807b8bcbf02205edbc843f9a033d49a95ad1f0846c122cc5858fa3da8feba6efe91c899899225012102b7475e6b3d7641d46a7c7de4e6ba758e1730873b8d3edc388f04ee63df093ac3ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db101016d1a9d18447522cfe3eb8acf4b56a63e7edf2b688f6d18586c20043e6f4852d49b4ade3732b787c4bf1335d57b0bbd87bdf4720f75eda1765146eb1bf653b82823ec8716d72920fcc8849d3ce0885ff89cb7f1ac0ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706730677a36675f332e706e6718632209696d6167652f706e673230a76d75a13ff15d946f929115e248dd411996abea4e1f37f73a72ba82fcd39a0dbbb3a3777e767984cd30e9eef2b68312120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728cdc3b2e7053222080112196f17b363112d0b4907e7bf652c16c5261696179baf4b16065b188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a91417b363112d0b4907e7bf652c16c5261696179baf88acac5e7d1d000000001976a91488b3555c5e06d6049bbe5426b72512f6d568b9e388ac00000000\",\n \"inputs\": [\n {\n \"address\": \"myBbjcsUMBsTi5aA1Y3FQr3eXZHTkTKjGn\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011814,\n \"txid\": \"ad2d9b984b2a9e923b12f7652dd9a945664f647e9ead8779fd9b240a68301442\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhgGjVVY6kjrAxf2cz1ALfbst6CQhZ72qg\",\n \"amount\": \"1.0\",\n \"claim_id\": \"e90a079b038cabe2782bc6a5b4f55f4e5febc5a1\",\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#e90a079b038cabe2782bc6a5b4f55f4e5febc5a1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"5faad4dc0519a4861480b7386e58e0857801ec6d13ba2a308449546ce4d18928\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mhgGjVVY6kjrAxf2cz1ALfbst6CQhZ72qg\",\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\": \"1559011789\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpg0gz6g_3.png\",\n \"sd_hash\": \"a76d75a13ff15d946f929115e248dd411996abea4e1f37f73a72ba82fcd39a0dbbb3a3777e767984cd30e9eef2b68312\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tags\": [\n \"blank\",\n \"art\"\n ],\n Line truncated
|
||||
"curl": "curl -d'{\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpnkt_49bq.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\": 1565587584, \"channel_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream create blank-image 1.0 /tmp/tmpnkt_49bq.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=1565587584 --channel_id=\"cbf954c2782b7cf571f7aa1de960202057618727\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_create\", \"params\": {\"name\": \"blank-image\", \"bid\": \"1.0\", \"file_path\": \"/tmp/tmpnkt_49bq.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\": 1565587584, \"channel_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000001b25ac56e2fda6353b732863e338e205a19d1d2f4e38145048ee501e373fd8585010000006a4730440220205c1cea74188145c8d3200ef2914b5852c8a3b151876c9d9431e9b52e82b3e0022061169e87088e2fd0759d457d0a444a9445d404b64358d5cbac08c5ab950dca6c012103ebc2c0ec16d9e24b5ebcb4bf957ddc9fd7a80376d1cff0d79f5d65e381d7fe42ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db1010127876157202060e91daaf771f57c2b78c254f9cb24eda15eb1995dfe4ea874fa93396c62e1fe82612e6b9b786ea0c55166e98e7880da5e3b48ef29ab4d1a9c83f71482c22a4acad548c27a5f5643550d0434f3b00ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706e6b745f343962712e706e6718632209696d6167652f706e673230eda7090b2d59beb0d77de489961cb73bbc73bbbb80d2c3c0e5f547b8c07dc0eded9627ce12872ca86a20a51d54ae3c4b120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f72672880f1c3ea053222080112196f147b27d1c70b5fb7ff1560d32bfda68507a89a0f214e74e0188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914147b27d1c70b5fb7ff1560d32bfda68507a89a0f88acac5e7d1d000000001976a914d7d23f1f17bdd156052ea8c496a95070157fb6ab88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"n4SAW6U5NeYRqQTdos4cLMgtbWRBFW8X16\",\n \"amount\": \"5.969662\",\n \"confirmations\": 2,\n \"height\": 213,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587608,\n \"txid\": \"8585fd73e301e58e044581e3f4d2d1195a208e333e8632b75363da2f6ec55ab2\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhPFLtT7YzmNfMuQYr4PQXAJdtaTKWRLFy\",\n \"amount\": \"1.0\",\n \"claim_id\": \"5cfb92c3e6a80aedee5282c3f64b565bc6965562\",\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#5cfb92c3e6a80aedee5282c3f64b565bc6965562\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"474e26f1aceebbdbbbad02afd37dd39aa3eb221098fa8a4073b1117264422e98\",\n \"type\": \"claim\",\n \"value\": {\n \"author\": \"Picaso\",\n \"description\": \"A blank PNG that is 5x7.\",\n \"fee\": {\n \"address\": \"mhPFLtT7YzmNfMuQYr4PQXAJdtaTKWRLFy\",\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\": \"1565587584\",\n \"source\": {\n \"hash\": \"6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545\",\n \"media_type\": \"image/png\",\n \"name\": \"tmpnkt_49bq.png\",\n \"sd_hash\": \"eda7090b2d59beb0d77de489961cb73bbc73bbbb80d2c3c0e5f547b8c07dc0eded9627ce12872ca86a20a51d54ae3c4b\",\n \"size\": \"99\"\n },\n \"stream_type\": \"image\",\n \"tagsLine truncated
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2350,14 +2526,14 @@
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n }\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n }\n ]\n}"
|
||||
},
|
||||
{
|
||||
"title": "Paginate your stream claims",
|
||||
"curl": "curl -d'{\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream list --page=1 --page_size=20",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_list\", \"params\": {\"page\": 1, \"page_size\": 20}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"items\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1559011814,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\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 \"items\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 5,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": 1565587608,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\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}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2548,7 +2724,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "account to use for funding the transaction",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -2563,6 +2745,12 @@
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "replace",
|
||||
"type": "bool",
|
||||
@@ -2574,10 +2762,10 @@
|
||||
"examples": [
|
||||
{
|
||||
"title": "Update a stream claim to add channel",
|
||||
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream update ffdbe8f44f285fbc4a352763727abd86d17399c1 --channel_id=\"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\", \"clear_channel\": false, \"channel_account_id\": [], \"preview\": false, \"replace\": false}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"height\": -2,\n \"hex\": \"0100000002421430680a249bfd7987ad9e7e644f6645a9d92d65f7123b929e2a4b989b2dad000000006a4730440220328e1833cbc85f07bb2a3b485a178c8ef50e0e11de1e029a3392cfcf3bf1d27302206a588363e64cb0e361cd6a9fe6f37067611bbe5eb3ed2271a6bb7f24e3fb72b0012102700c310dacc983a7cfe3187c0913373c956fbb5f850a13043c2897f2da825120ffffffffc912a1a678d1a646e6164f0e0c2d51e16fd6acaaa0dd4b1b8bf4780143c4b260010000006b483045022100d31bbf4ac9628ea729d0b4252b36e120c7dafdad9ada4207112423ec7dc748690220153223d7fa389287b7baea11e8c301b8607a602805c9f97c399f2eaa0c54d9f6012103a0263f43ab4d778afd664d54704040b580185511e529011f713976e3f0032647ffffffff0200e1f50500000000fd2301b7076173747265616d14c19973d186bd7a726327354abc5f284ff4e8dbff4ce8016d1a9d18447522cfe3eb8acf4b56a63e7edf2b68fdfdb7869eb7447ab2e61a2d5cdf8199867bda63dd1edc699b7dee31d618198502a11309baff2f6d52104f494ca48ff9e5961c5a00badba23fcfeb010f595fc10a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703668333270393973180b22186170706c69636174696f6e2f6f637465742d73747265616d3230e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e06d6d76a914061cbd2df8421ab14497e62baf747461c7c9137b88ac32a0d205000000001976a914f0d879252e7fcd69f489f40a6e7df12d95b9b5bc88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"timestamp\": 1559011814,\n \"txid\": \"ad2d9b984b2a9e923b12f7652dd9a945664f647e9ead8779fd9b240a68301442\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmp6h32p99s\",\n \"sd_hash\": \"e38f25767c7619948832380b12def270aa244ee0b712020551198b2c587babb08583b7ad928ea08f71e1a6ced74836e0\",\n \"size\": \"11\"\n }\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mnY3oi1Auwp7Cb4CQRGDLoKWwsARVzes45\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1559011813,\n \"txid\": \"60b2c4430178f48b1b4bdda0aaacd66fe1512d0c0e4f16e646a6d178a6a112c9\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mg5Gn2NmJFVpZUU1ScVKf34KXVmJsrxXeu\",\n \"amount\": \"1.0\",\n \"claim_id\": \"ffdbe8f44f285fbc4a352763727abd86d17399c1\",\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#ffdbe8f44f285fbc4a352763727abd86d17399c1\",\n \"signing_channel\": {\n \"address\": \"muK7TZrirA8yHzxFcXa51W7CjxbAho2Zua\",\n \"amount\": \"1.0\",\n \"claim_id\": \"682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\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#682bdf7e3ea6564bcf8aebe3cf227544189d1a6d\",\n \"timestamp\": 1559011813,\n \"txid\": \"3f665f0ca3cbb19c3c75813a30cd8334d7738a20566f2aa7775ab024d6fedd64\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a03420004eeccdcff00c8336c5d616fee009894e5cbbc2bbf9497021aabbde81beaf8e6edf423de4ff094a8d4e7ea87d9469fd7d3b834b80d9b330d2f7a887108c5ea9268\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"fa78db71b5e4205ec33a69106f9c9528ed9289fa3f8efc51baebe6e514247287\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"appLine truncated
|
||||
"curl": "curl -d'{\"method\": \"stream_update\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"clear_channel\": false, \"channel_account_id\": [], \"funding_account_ids\": [], \"preview\": false, \"blocking\": false, \"replace\": false}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet stream update 68fde0328b1a267b3815ce974a6329b159619092 --channel_id=\"cbf954c2782b7cf571f7aa1de960202057618727\"",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"stream_update\", \"params\": {\"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\", \"clear_fee\": false, \"tags\": [], \"clear_tags\": false, \"languages\": [], \"clear_languages\": false, \"locations\": [], \"clear_locations\": false, \"channel_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\", \"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\": \"0100000002b25ac56e2fda6353b732863e338e205a19d1d2f4e38145048ee501e373fd8585000000006a47304402204716abc5afb3bb9479264b8ef8e682afd4d755cc26222aaa6dd4ae5dbc038782022078b7ee55cd5fceaa9051041da83e70ba5a2a775d627d114cf9ca6c2c72ea39be012102e5f31d1a080e94c45195eb667ca7224c90d6f2351de3c0f069189adbe7dda5d9ffffffffe3f8863fb8521183a9f80b9c190b42ca7f26ef269f23962617be746aa7ff111a010000006a47304402204f7b48231ad7c9c88ba4af87e920c792e165c3f3ddcd464c1f7c8999adf01c66022054e274c1378fff338e3dfd147a34a4c769fcfd5ad0fcbb280fafc62c85ebe502012102cf036fe173b3b49a4c8ef6eef8539aa53000002a3d0cab29aa6fbe4a066f0b78ffffffff0200e1f50500000000fd2301b7076173747265616d1492906159b129634a97ce15387b261a8b32e0fd684ce80127876157202060e91daaf771f57c2b78c254f9cb399c380097dccb958b0a22cddccfb1ff04aa93fa4022c09f2063b86e67ed1b5bc8546dfec3d1faf5c2c75c365722f78c508ba288b1f0cb3913fd391ff1796a1c0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70776330786f746a63180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f26d6d76a91415733e667eb7be1146f77b7eab0c5f757d623cc988ac32a0d205000000001976a9149feb153831e4799de0cf2933a4884c5ff7baa53a88ac00000000\",\n \"inputs\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"timestamp\": 1565587608,\n \"txid\": \"8585fd73e301e58e044581e3f4d2d1195a208e333e8632b75363da2f6ec55ab2\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd\",\n \"media_type\": \"application/octet-stream\",\n \"name\": \"tmpwc0xotjc\",\n \"sd_hash\": \"ca7f2e83a2d275e25151463521e893b8812aa0b061ab299fb9877521c0a2ced15927eeca4f50680d8ea5e03ae6b6c3f2\",\n \"size\": \"11\"\n },\n \"stream_type\": \"binary\"\n },\n \"value_type\": \"stream\"\n },\n {\n \"address\": \"mzHFAQfgBr1QpQr8YSMpJFg54vkhwU2WoB\",\n \"amount\": \"0.9772285\",\n \"confirmations\": 3,\n \"height\": 211,\n \"is_change\": true,\n \"is_mine\": true,\n \"nout\": 1,\n \"timestamp\": 1565587607,\n \"txid\": \"1a11ffa76a74be172696239f26ef267fca420b199c0bf8a9831152b83f86f8e3\",\n \"type\": \"payment\"\n }\n ],\n \"outputs\": [\n {\n \"address\": \"mhUNYMksuH5HFj2DUG1DsLAtMMaup1cgqn\",\n \"amount\": \"1.0\",\n \"claim_id\": \"68fde0328b1a267b3815ce974a6329b159619092\",\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#68fde0328b1a267b3815ce974a6329b159619092\",\n \"signing_channel\": {\n \"address\": \"mvE3pR2rH5mP1Hx8UEipnPt3Atp89tXqVw\",\n \"amount\": \"1.0\",\n \"claim_id\": \"cbf954c2782b7cf571f7aa1de960202057618727\",\n \"claim_op\": \"update\",\n \"confirmations\": 4,\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#cbf954c2782b7cf571f7aa1de960202057618727\",\n \"timestamp\": 1565587607,\n \"txid\": \"794fc94e7ac645d5fc06c14e5ac9be9d9afa53cd540a349ee276662b23e21396\",\n \"type\": \"claim\",\n \"value\": {\n \"public_key\": \"3056301006072a8648ce3d020106052b8104000a0342000404b644588c6a32f425fa8c2c3b0404898c79d405d1e90783adcf9a2bdbad505012f1e6be38f7837b69d5f2a1a1959135701780f01fc91c396158c4b1b9b1e304\",\n \"public_key_id\": \"mrPWGtFam2wwv7D1QRgXXrXePLqUGdKaCb\",\n \"title\": \"New Channel\"\n },\n \"value_type\": \"channel\"\n },\n \"timestamp\": null,\n \"txid\": \"55a247d733323e8645656c1c817ac34411fafb5493f9c528091897b6ca0e5400\",\n \"type\": \"claim\",\n \"value\": {\n \"source\": {\n \"hash\": \"fdbd8e75a67f29f701a4e040Line truncated
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2661,7 +2849,13 @@
|
||||
{
|
||||
"name": "account_id",
|
||||
"type": "str",
|
||||
"description": "id of the account to use",
|
||||
"description": "account to use for holding the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "funding_account_ids",
|
||||
"type": "list",
|
||||
"description": "ids of accounts to fund this transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
@@ -2669,6 +2863,12 @@
|
||||
"type": "bool",
|
||||
"description": "do not broadcast the transaction",
|
||||
"is_required": false
|
||||
},
|
||||
{
|
||||
"name": "blocking",
|
||||
"type": "bool",
|
||||
"description": "wait until transaction is in mempool",
|
||||
"is_required": false
|
||||
}
|
||||
],
|
||||
"returns": " {\n \"txid\": \"hash of transaction in hex\",\n \"height\": \"block where transaction was recorded\",\n \"inputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"outputs\": [\n {\n \"txid\": \"hash of transaction in hex\",\n \"nout\": \"position in the transaction\",\n \"height\": \"block where transaction was recorded\",\n \"amount\": \"value of the txo as a decimal\",\n \"address\": \"address of who can spend the txo\",\n \"confirmations\": \"number of confirmed blocks\",\n \"is_change\": \"payment to change address, only available when it can be determined\",\n \"is_mine\": \"payment to one of your accounts, only available when it can be determined\",\n \"type\": \"one of 'claim', 'support' or 'payment'\",\n \"name\": \"when type is 'claim' or 'support', this is the claim name\",\n \"claim_id\": \"when type is 'claim' or 'support', 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 \"signing_channel\": \"for signed claims only, metadata of signing channel\",\n \"is_channel_signature_valid\": \"for signed claims only, whether signature is valid\"\n }\n ],\n \"total_input\": \"sum of inputs as a decimal\",\n \"total_output\": \"sum of outputs, sans fee, as a decimal\",\n \"total_fee\": \"fee amount\",\n \"hex\": \"entire transaction encoded in hex\"\n }",
|
||||
@@ -2773,7 +2973,7 @@
|
||||
"curl": "curl -d'{\"method\": \"transaction_list\", \"params\": {}}' http://localhost:5279/",
|
||||
"lbrynet": "lbrynet transaction list",
|
||||
"python": "requests.post(\"http://localhost:5279\", json={\"method\": \"transaction_list\", \"params\": {}}).json()",
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2019-05-27 22:50\",\n \"fee\": \"-0.000124\",\n \"support_info\": [],\n \"timestamp\": 1559011813,\n \"txid\": \"3ef83205dd764152fc6847fc9c80b94251b5306152d0747d619f8da4e037145b\",\n \"update_info\": [],\n \"value\": \"-2.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-05-27 22:50\",\n \"fee\": \"0.0\",\n \"support_info\": [],\n \"timestamp\": 1559011812,\n \"txid\": \"4717af0744c6d4f85cf43cc371161d8f8857e5fd1e4c1040deb1c07cb9efa0ff\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ]\n}"
|
||||
"output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 1,\n \"date\": \"2019-08-12 01:26\",\n \"fee\": \"-0.000124\",\n \"support_info\": [],\n \"timestamp\": 1565587607,\n \"txid\": \"0295fc060686b1872040214dabead8a042edbcc3a00f79580c27777841f5c504\",\n \"update_info\": [],\n \"value\": \"0.0\"\n },\n {\n \"abandon_info\": [],\n \"claim_info\": [],\n \"confirmations\": 7,\n \"date\": \"2019-08-12 01:26\",\n \"fee\": \"0.0\",\n \"support_info\": [],\n \"timestamp\": 1565587606,\n \"txid\": \"c6ec4fd79fda21863a5a7825ced028fb606f890daf669ff8386061ef6e4ef8d5\",\n \"update_info\": [],\n \"value\": \"10.0\"\n }\n ]\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,4 @@
|
||||
__name__ = "lbry"
|
||||
__version__ = "0.39.2"
|
||||
version = tuple(__version__.split('.'))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from lbrynet.cryptoutils import get_lbry_hash_obj
|
||||
from lbry.cryptoutils import get_lbry_hash_obj
|
||||
|
||||
MAX_BLOB_SIZE = 2 * 2 ** 20
|
||||
|
||||
@@ -10,12 +10,12 @@ from cryptography.hazmat.primitives.ciphers import Cipher, modes
|
||||
from cryptography.hazmat.primitives.ciphers.algorithms import AES
|
||||
from cryptography.hazmat.primitives.padding import PKCS7
|
||||
|
||||
from lbrynet.cryptoutils import backend, get_lbry_hash_obj
|
||||
from lbrynet.error import DownloadCancelledError, InvalidBlobHashError, InvalidDataError
|
||||
from lbry.cryptoutils import backend, get_lbry_hash_obj
|
||||
from lbry.error import DownloadCancelledError, InvalidBlobHashError, InvalidDataError
|
||||
|
||||
from lbrynet.blob import MAX_BLOB_SIZE, blobhash_length
|
||||
from lbrynet.blob.blob_info import BlobInfo
|
||||
from lbrynet.blob.writer import HashBlobWriter
|
||||
from lbry.blob import MAX_BLOB_SIZE, blobhash_length
|
||||
from lbry.blob.blob_info import BlobInfo
|
||||
from lbry.blob.writer import HashBlobWriter
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -71,7 +71,7 @@ class AbstractBlob:
|
||||
'readers'
|
||||
]
|
||||
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
blob_completed_callback: typing.Optional[typing.Callable[['AbstractBlob'], asyncio.Task]] = None,
|
||||
blob_directory: typing.Optional[str] = None):
|
||||
self.loop = loop
|
||||
@@ -175,7 +175,7 @@ class AbstractBlob:
|
||||
|
||||
@classmethod
|
||||
async def create_from_unencrypted(
|
||||
cls, loop: asyncio.BaseEventLoop, blob_dir: typing.Optional[str], key: bytes, iv: bytes,
|
||||
cls, loop: asyncio.AbstractEventLoop, blob_dir: typing.Optional[str], key: bytes, iv: bytes,
|
||||
unencrypted: bytes, blob_num: int,
|
||||
blob_completed_callback: typing.Optional[typing.Callable[['AbstractBlob'], None]] = None) -> BlobInfo:
|
||||
"""
|
||||
@@ -237,7 +237,7 @@ class BlobBuffer(AbstractBlob):
|
||||
"""
|
||||
An in-memory only blob
|
||||
"""
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
blob_completed_callback: typing.Optional[typing.Callable[['AbstractBlob'], asyncio.Task]] = None,
|
||||
blob_directory: typing.Optional[str] = None):
|
||||
self._verified_bytes: typing.Optional[BytesIO] = None
|
||||
@@ -276,7 +276,7 @@ class BlobFile(AbstractBlob):
|
||||
"""
|
||||
A blob existing on the local file system
|
||||
"""
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_hash: str, length: typing.Optional[int] = None,
|
||||
blob_completed_callback: typing.Optional[typing.Callable[['AbstractBlob'], asyncio.Task]] = None,
|
||||
blob_directory: typing.Optional[str] = None):
|
||||
super().__init__(loop, blob_hash, length, blob_completed_callback, blob_directory)
|
||||
@@ -324,7 +324,7 @@ class BlobFile(AbstractBlob):
|
||||
|
||||
@classmethod
|
||||
async def create_from_unencrypted(
|
||||
cls, loop: asyncio.BaseEventLoop, blob_dir: typing.Optional[str], key: bytes, iv: bytes,
|
||||
cls, loop: asyncio.AbstractEventLoop, blob_dir: typing.Optional[str], key: bytes, iv: bytes,
|
||||
unencrypted: bytes, blob_num: int,
|
||||
blob_completed_callback: typing.Optional[typing.Callable[['AbstractBlob'],
|
||||
asyncio.Task]] = None) -> BlobInfo:
|
||||
@@ -2,21 +2,21 @@ import os
|
||||
import typing
|
||||
import asyncio
|
||||
import logging
|
||||
from lbrynet.utils import LRUCache
|
||||
from lbrynet.blob.blob_file import is_valid_blobhash, BlobFile, BlobBuffer, AbstractBlob
|
||||
from lbrynet.stream.descriptor import StreamDescriptor
|
||||
from lbrynet.connection_manager import ConnectionManager
|
||||
from lbry.utils import LRUCache
|
||||
from lbry.blob.blob_file import is_valid_blobhash, BlobFile, BlobBuffer, AbstractBlob
|
||||
from lbry.stream.descriptor import StreamDescriptor
|
||||
from lbry.connection_manager import ConnectionManager
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.dht.protocol.data_store import DictDataStore
|
||||
from lbrynet.extras.daemon.storage import SQLiteStorage
|
||||
from lbry.conf import Config
|
||||
from lbry.dht.protocol.data_store import DictDataStore
|
||||
from lbry.extras.daemon.storage import SQLiteStorage
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BlobManager:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_dir: str, storage: 'SQLiteStorage', config: 'Config',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_dir: str, storage: 'SQLiteStorage', config: 'Config',
|
||||
node_data_store: typing.Optional['DictDataStore'] = None):
|
||||
"""
|
||||
This class stores blobs on the hard disk
|
||||
@@ -69,10 +69,10 @@ class BlobManager:
|
||||
def is_blob_verified(self, blob_hash: str, length: typing.Optional[int] = None) -> bool:
|
||||
if not is_valid_blobhash(blob_hash):
|
||||
raise ValueError(blob_hash)
|
||||
if blob_hash in self.blobs:
|
||||
return self.blobs[blob_hash].get_is_verified()
|
||||
if not os.path.isfile(os.path.join(self.blob_dir, blob_hash)):
|
||||
return False
|
||||
if blob_hash in self.blobs:
|
||||
return self.blobs[blob_hash].get_is_verified()
|
||||
return self._get_blob(blob_hash, length).get_is_verified()
|
||||
|
||||
async def setup(self) -> bool:
|
||||
@@ -86,7 +86,8 @@ class BlobManager:
|
||||
to_add = await self.storage.sync_missing_blobs(in_blobfiles_dir)
|
||||
if to_add:
|
||||
self.completed_blob_hashes.update(to_add)
|
||||
self.connection_manager.start()
|
||||
if self.config.track_bandwidth:
|
||||
self.connection_manager.start()
|
||||
return True
|
||||
|
||||
def stop(self):
|
||||
@@ -2,8 +2,8 @@ import typing
|
||||
import logging
|
||||
import asyncio
|
||||
from io import BytesIO
|
||||
from lbrynet.error import InvalidBlobHashError, InvalidDataError
|
||||
from lbrynet.cryptoutils import get_lbry_hash_obj
|
||||
from lbry.error import InvalidBlobHashError, InvalidDataError
|
||||
from lbry.cryptoutils import get_lbry_hash_obj
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
import asyncio
|
||||
import time
|
||||
import logging
|
||||
import typing
|
||||
import binascii
|
||||
from lbrynet.error import InvalidBlobHashError, InvalidDataError
|
||||
from lbrynet.blob_exchange.serialization import BlobResponse, BlobRequest
|
||||
from lbrynet.utils import cache_concurrent
|
||||
from typing import Optional
|
||||
from lbry.error import InvalidBlobHashError, InvalidDataError
|
||||
from lbry.blob_exchange.serialization import BlobResponse, BlobRequest
|
||||
from lbry.utils import cache_concurrent
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.blob.blob_file import AbstractBlob
|
||||
from lbrynet.blob.writer import HashBlobWriter
|
||||
from lbrynet.connection_manager import ConnectionManager
|
||||
from lbry.blob.blob_file import AbstractBlob
|
||||
from lbry.blob.writer import HashBlobWriter
|
||||
from lbry.connection_manager import ConnectionManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_timeout: typing.Optional[float] = 10,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_timeout: typing.Optional[float] = 10,
|
||||
connection_manager: typing.Optional['ConnectionManager'] = None):
|
||||
self.loop = loop
|
||||
self.peer_port: typing.Optional[int] = None
|
||||
@@ -39,8 +41,6 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
self.peer_address, self.peer_port = addr_info
|
||||
# assert self.peer_address is not None
|
||||
self.connection_manager.received_data(f"{self.peer_address}:{self.peer_port}", len(data))
|
||||
#log.debug("%s:%d -- got %s bytes -- %s bytes on buffer -- %s blob bytes received",
|
||||
# self.peer_address, self.peer_port, len(data), len(self.buf), self._blob_bytes_received)
|
||||
if not self.transport or self.transport.is_closing():
|
||||
log.warning("transport closing, but got more bytes from %s:%i\n%s", self.peer_address, self.peer_port,
|
||||
binascii.hexlify(data))
|
||||
@@ -67,7 +67,8 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
self.blob.set_length(blob_response.length)
|
||||
elif blob_response and not blob_response.error and self.blob.blob_hash != blob_response.blob_hash:
|
||||
# the server started sending a blob we didn't request
|
||||
log.warning("mismatch with self.blob %s", self.blob.blob_hash)
|
||||
log.warning("%s started sending blob we didnt request %s instead of %s", self.peer_address,
|
||||
blob_response.blob_hash, self.blob.blob_hash)
|
||||
return
|
||||
if response.responses:
|
||||
log.debug("got response from %s:%i <- %s", self.peer_address, self.peer_port, response.to_dict())
|
||||
@@ -91,15 +92,16 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
log.error("error downloading blob from %s:%i: %s", self.peer_address, self.peer_port, err)
|
||||
if self._response_fut and not self._response_fut.done():
|
||||
self._response_fut.set_exception(err)
|
||||
except (asyncio.TimeoutError) as err: # TODO: is this needed?
|
||||
except asyncio.TimeoutError as err:
|
||||
log.error("%s downloading blob from %s:%i", str(err), self.peer_address, self.peer_port)
|
||||
if self._response_fut and not self._response_fut.done():
|
||||
self._response_fut.set_exception(err)
|
||||
|
||||
async def _download_blob(self) -> typing.Tuple[int, typing.Optional[asyncio.Transport]]:
|
||||
async def _download_blob(self) -> typing.Tuple[int, Optional['BlobExchangeClientProtocol']]:
|
||||
"""
|
||||
:return: download success (bool), keep connection (bool)
|
||||
:return: download success (bool), connected protocol (BlobExchangeClientProtocol)
|
||||
"""
|
||||
start_time = time.perf_counter()
|
||||
request = BlobRequest.make_request_for_blob_hash(self.blob.blob_hash)
|
||||
blob_hash = self.blob.blob_hash
|
||||
if not self.peer_address:
|
||||
@@ -125,11 +127,16 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
self.peer_port)
|
||||
log.warning(response.to_dict())
|
||||
return self._blob_bytes_received, self.close()
|
||||
elif availability_response.available_blobs and \
|
||||
elif availability_response and availability_response.available_blobs and \
|
||||
availability_response.available_blobs != [self.blob.blob_hash]:
|
||||
log.warning("blob availability response doesn't match our request from %s:%i",
|
||||
self.peer_address, self.peer_port)
|
||||
return self._blob_bytes_received, self.close()
|
||||
elif not availability_response:
|
||||
log.warning("response from %s:%i did not include an availability response (we requested %s)",
|
||||
self.peer_address, self.peer_port, blob_hash)
|
||||
return self._blob_bytes_received, self.close()
|
||||
|
||||
if not price_response or price_response.blob_data_payment_rate != 'RATE_ACCEPTED':
|
||||
log.warning("data rate rejected by %s:%i", self.peer_address, self.peer_port)
|
||||
return self._blob_bytes_received, self.close()
|
||||
@@ -144,12 +151,14 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
return self._blob_bytes_received, self.close()
|
||||
msg = f"downloading {self.blob.blob_hash[:8]} from {self.peer_address}:{self.peer_port}," \
|
||||
f" timeout in {self.peer_timeout}"
|
||||
log.debug(msg)
|
||||
log.info(msg)
|
||||
msg = f"downloaded {self.blob.blob_hash[:8]} from {self.peer_address}:{self.peer_port}"
|
||||
await asyncio.wait_for(self.writer.finished, self.peer_timeout, loop=self.loop)
|
||||
log.info(msg)
|
||||
log.info("%s at %fMB/s", msg,
|
||||
round((float(self._blob_bytes_received) /
|
||||
float(time.perf_counter() - start_time)) / 1000000.0, 2))
|
||||
# await self.blob.finished_writing.wait() not necessary, but a dangerous change. TODO: is it needed?
|
||||
return self._blob_bytes_received, self.transport
|
||||
return self._blob_bytes_received, self
|
||||
except asyncio.TimeoutError:
|
||||
return self._blob_bytes_received, self.close()
|
||||
except (InvalidBlobHashError, InvalidDataError):
|
||||
@@ -170,19 +179,19 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
self.transport = None
|
||||
self.buf = b''
|
||||
|
||||
async def download_blob(self, blob: 'AbstractBlob') -> typing.Tuple[int, typing.Optional[asyncio.Transport]]:
|
||||
async def download_blob(self, blob: 'AbstractBlob') -> typing.Tuple[int, Optional['BlobExchangeClientProtocol']]:
|
||||
self.closed.clear()
|
||||
blob_hash = blob.blob_hash
|
||||
if blob.get_is_verified() or not blob.is_writeable():
|
||||
return 0, self.transport
|
||||
return 0, self
|
||||
try:
|
||||
self._blob_bytes_received = 0
|
||||
self.blob, self.writer = blob, blob.get_blob_writer(self.peer_address, self.peer_port)
|
||||
self._response_fut = asyncio.Future(loop=self.loop)
|
||||
return await self._download_blob()
|
||||
except OSError as e:
|
||||
except OSError:
|
||||
# i'm not sure how to fix this race condition - jack
|
||||
log.warning("race happened downloading %s from %s:%i", blob_hash, self.peer_address, self.peer_port)
|
||||
log.warning("race happened downloading %s from %s:%s", blob_hash, self.peer_address, self.peer_port)
|
||||
# return self._blob_bytes_received, self.transport
|
||||
raise
|
||||
except asyncio.TimeoutError:
|
||||
@@ -215,31 +224,32 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||
|
||||
|
||||
@cache_concurrent
|
||||
async def request_blob(loop: asyncio.BaseEventLoop, blob: 'AbstractBlob', address: str, tcp_port: int,
|
||||
peer_connect_timeout: float, blob_download_timeout: float,
|
||||
connected_transport: asyncio.Transport = None, connection_id: int = 0,
|
||||
connection_manager: typing.Optional['ConnectionManager'] = None)\
|
||||
-> typing.Tuple[int, typing.Optional[asyncio.Transport]]:
|
||||
async def request_blob(loop: asyncio.AbstractEventLoop, blob: Optional['AbstractBlob'], address: str,
|
||||
tcp_port: int, peer_connect_timeout: float, blob_download_timeout: float,
|
||||
connected_protocol: Optional['BlobExchangeClientProtocol'] = None,
|
||||
connection_id: int = 0, connection_manager: Optional['ConnectionManager'] = None)\
|
||||
-> typing.Tuple[int, Optional['BlobExchangeClientProtocol']]:
|
||||
"""
|
||||
Returns [<downloaded blob>, <keep connection>]
|
||||
Returns [<amount of bytes received>, <client protocol if connected>]
|
||||
"""
|
||||
|
||||
protocol = BlobExchangeClientProtocol(
|
||||
loop, blob_download_timeout, connection_manager
|
||||
)
|
||||
if connected_transport and not connected_transport.is_closing():
|
||||
connected_transport.set_protocol(protocol)
|
||||
protocol.transport = connected_transport
|
||||
log.debug("reusing connection for %s:%d", address, tcp_port)
|
||||
protocol = connected_protocol
|
||||
if not connected_protocol or not connected_protocol.transport or connected_protocol.transport.is_closing():
|
||||
connected_protocol = None
|
||||
protocol = BlobExchangeClientProtocol(
|
||||
loop, blob_download_timeout, connection_manager
|
||||
)
|
||||
else:
|
||||
connected_transport = None
|
||||
log.debug("reusing connection for %s:%d", address, tcp_port)
|
||||
try:
|
||||
if not connected_transport:
|
||||
if not connected_protocol:
|
||||
await asyncio.wait_for(loop.create_connection(lambda: protocol, address, tcp_port),
|
||||
peer_connect_timeout, loop=loop)
|
||||
if blob.get_is_verified() or not blob.is_writeable():
|
||||
connected_protocol = protocol
|
||||
if blob is None or blob.get_is_verified() or not blob.is_writeable():
|
||||
# blob is None happens when we are just opening a connection
|
||||
# file exists but not verified means someone is writing right now, give it time, come back later
|
||||
return 0, connected_transport
|
||||
return await protocol.download_blob(blob)
|
||||
return 0, connected_protocol
|
||||
return await connected_protocol.download_blob(blob)
|
||||
except (asyncio.TimeoutError, ConnectionRefusedError, ConnectionAbortedError, OSError):
|
||||
return 0, None
|
||||
@@ -1,14 +1,15 @@
|
||||
import asyncio
|
||||
import typing
|
||||
import logging
|
||||
from lbrynet.utils import cache_concurrent
|
||||
from lbrynet.blob_exchange.client import request_blob
|
||||
from lbry.utils import cache_concurrent
|
||||
from lbry.blob_exchange.client import request_blob
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.dht.node import Node
|
||||
from lbrynet.dht.peer import KademliaPeer
|
||||
from lbrynet.blob.blob_manager import BlobManager
|
||||
from lbrynet.blob.blob_file import AbstractBlob
|
||||
from lbry.conf import Config
|
||||
from lbry.dht.node import Node
|
||||
from lbry.dht.peer import KademliaPeer
|
||||
from lbry.blob.blob_manager import BlobManager
|
||||
from lbry.blob.blob_file import AbstractBlob
|
||||
from lbry.blob_exchange.client import BlobExchangeClientProtocol
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -16,7 +17,7 @@ log = logging.getLogger(__name__)
|
||||
class BlobDownloader:
|
||||
BAN_FACTOR = 2.0 # fixme: when connection manager gets implemented, move it out from here
|
||||
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, config: 'Config', blob_manager: 'BlobManager',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, config: 'Config', blob_manager: 'BlobManager',
|
||||
peer_queue: asyncio.Queue):
|
||||
self.loop = loop
|
||||
self.config = config
|
||||
@@ -26,35 +27,38 @@ class BlobDownloader:
|
||||
self.ignored: typing.Dict['KademliaPeer', int] = {}
|
||||
self.scores: typing.Dict['KademliaPeer', int] = {}
|
||||
self.failures: typing.Dict['KademliaPeer', int] = {}
|
||||
self.connections: typing.Dict['KademliaPeer', asyncio.Transport] = {}
|
||||
self.connection_failures: typing.List['KademliaPeer'] = []
|
||||
self.connections: typing.Dict['KademliaPeer', 'BlobExchangeClientProtocol'] = {}
|
||||
self.is_running = asyncio.Event(loop=self.loop)
|
||||
|
||||
def should_race_continue(self, blob: 'AbstractBlob'):
|
||||
if len(self.active_connections) >= self.config.max_connections_per_download:
|
||||
max_probes = self.config.max_connections_per_download * (1 if self.connections else 10)
|
||||
if len(self.active_connections) >= max_probes:
|
||||
return False
|
||||
return not (blob.get_is_verified() or not blob.is_writeable())
|
||||
|
||||
async def request_blob_from_peer(self, blob: 'AbstractBlob', peer: 'KademliaPeer', connection_id: int = 0):
|
||||
async def request_blob_from_peer(self, blob: 'AbstractBlob', peer: 'KademliaPeer', connection_id: int = 0,
|
||||
just_probe: bool = False):
|
||||
if blob.get_is_verified():
|
||||
return
|
||||
transport = self.connections.get(peer)
|
||||
start = self.loop.time()
|
||||
bytes_received, transport = await request_blob(
|
||||
self.loop, blob, peer.address, peer.tcp_port, self.config.peer_connect_timeout,
|
||||
self.config.blob_download_timeout, connected_transport=transport, connection_id=connection_id,
|
||||
connection_manager=self.blob_manager.connection_manager
|
||||
|
||||
bytes_received, protocol = await request_blob(
|
||||
self.loop, blob if not just_probe else None, peer.address, peer.tcp_port, self.config.peer_connect_timeout,
|
||||
self.config.blob_download_timeout, connected_protocol=self.connections.get(peer),
|
||||
connection_id=connection_id, connection_manager=self.blob_manager.connection_manager
|
||||
)
|
||||
if not transport and peer not in self.ignored:
|
||||
if not bytes_received and not protocol and peer not in self.connection_failures:
|
||||
self.connection_failures.append(peer)
|
||||
if not protocol and peer not in self.ignored:
|
||||
self.ignored[peer] = self.loop.time()
|
||||
log.debug("drop peer %s:%i", peer.address, peer.tcp_port)
|
||||
self.failures[peer] = self.failures.get(peer, 0) + 1
|
||||
if peer in self.connections:
|
||||
del self.connections[peer]
|
||||
elif transport:
|
||||
elif protocol:
|
||||
log.debug("keep peer %s:%i", peer.address, peer.tcp_port)
|
||||
self.failures[peer] = 0
|
||||
self.connections[peer] = transport
|
||||
self.connections[peer] = protocol
|
||||
elapsed = self.loop.time() - start
|
||||
self.scores[peer] = bytes_received / elapsed if bytes_received and elapsed else 1
|
||||
|
||||
@@ -91,16 +95,18 @@ class BlobDownloader:
|
||||
if batch:
|
||||
self.peer_queue.put_nowait(list(batch))
|
||||
log.debug(
|
||||
"running, %d peers, %d ignored, %d active",
|
||||
len(batch), len(self.ignored), len(self.active_connections)
|
||||
"running, %d peers, %d ignored, %d active, %s connections",
|
||||
len(batch), len(self.ignored), len(self.active_connections), len(self.connections)
|
||||
)
|
||||
for peer in sorted(batch, key=lambda peer: self.scores.get(peer, 0), reverse=True):
|
||||
if peer in self.ignored or peer in self.active_connections:
|
||||
continue
|
||||
if not self.should_race_continue(blob):
|
||||
break
|
||||
if peer not in self.active_connections and peer not in self.ignored:
|
||||
log.debug("request %s from %s:%i", blob_hash[:8], peer.address, peer.tcp_port)
|
||||
t = self.loop.create_task(self.request_blob_from_peer(blob, peer, connection_id))
|
||||
self.active_connections[peer] = t
|
||||
log.debug("request %s from %s:%i", blob_hash[:8], peer.address, peer.tcp_port)
|
||||
just_probe = len(self.connections) == 0
|
||||
t = self.loop.create_task(self.request_blob_from_peer(blob, peer, connection_id, just_probe))
|
||||
self.active_connections[peer] = t
|
||||
await self.new_peer_or_finished()
|
||||
self.cleanup_active()
|
||||
log.debug("downloaded %s", blob_hash[:8])
|
||||
@@ -109,11 +115,12 @@ class BlobDownloader:
|
||||
blob.close()
|
||||
|
||||
def close(self):
|
||||
self.connection_failures.clear()
|
||||
self.scores.clear()
|
||||
self.ignored.clear()
|
||||
self.is_running.clear()
|
||||
for transport in self.connections.values():
|
||||
transport.close()
|
||||
for protocol in self.connections.values():
|
||||
protocol.close()
|
||||
|
||||
|
||||
async def download_blob(loop, config: 'Config', blob_manager: 'BlobManager', node: 'Node',
|
||||
@@ -3,34 +3,65 @@ import binascii
|
||||
import logging
|
||||
import typing
|
||||
from json.decoder import JSONDecodeError
|
||||
from lbrynet.blob_exchange.serialization import BlobResponse, BlobRequest, blob_response_types
|
||||
from lbrynet.blob_exchange.serialization import BlobAvailabilityResponse, BlobPriceResponse, BlobDownloadResponse, \
|
||||
from lbry.blob_exchange.serialization import BlobResponse, BlobRequest, blob_response_types
|
||||
from lbry.blob_exchange.serialization import BlobAvailabilityResponse, BlobPriceResponse, BlobDownloadResponse, \
|
||||
BlobPaymentAddressResponse
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.blob.blob_manager import BlobManager
|
||||
from lbry.blob.blob_manager import BlobManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# a standard request will be 295 bytes
|
||||
MAX_REQUEST_SIZE = 1200
|
||||
|
||||
|
||||
class BlobServerProtocol(asyncio.Protocol):
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_manager: 'BlobManager', lbrycrd_address: str):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_manager: 'BlobManager', lbrycrd_address: str,
|
||||
idle_timeout: float = 30.0, transfer_timeout: float = 60.0):
|
||||
self.loop = loop
|
||||
self.blob_manager = blob_manager
|
||||
self.server_task: asyncio.Task = None
|
||||
self.idle_timeout = idle_timeout
|
||||
self.transfer_timeout = transfer_timeout
|
||||
self.server_task: typing.Optional[asyncio.Task] = None
|
||||
self.started_listening = asyncio.Event(loop=self.loop)
|
||||
self.buf = b''
|
||||
self.transport = None
|
||||
self.transport: typing.Optional[asyncio.Transport] = None
|
||||
self.lbrycrd_address = lbrycrd_address
|
||||
self.peer_address_and_port: typing.Optional[str] = None
|
||||
self.started_transfer = asyncio.Event(loop=self.loop)
|
||||
self.transfer_finished = asyncio.Event(loop=self.loop)
|
||||
self.close_on_idle_task: typing.Optional[asyncio.Task] = None
|
||||
|
||||
async def close_on_idle(self):
|
||||
while self.transport:
|
||||
try:
|
||||
await asyncio.wait_for(self.started_transfer.wait(), self.idle_timeout, loop=self.loop)
|
||||
except asyncio.TimeoutError:
|
||||
log.debug("closing idle connection from %s", self.peer_address_and_port)
|
||||
return self.close()
|
||||
self.started_transfer.clear()
|
||||
await self.transfer_finished.wait()
|
||||
self.transfer_finished.clear()
|
||||
|
||||
def close(self):
|
||||
if self.transport:
|
||||
self.transport.close()
|
||||
|
||||
def connection_made(self, transport):
|
||||
self.transport = transport
|
||||
self.close_on_idle_task = self.loop.create_task(self.close_on_idle())
|
||||
self.peer_address_and_port = "%s:%i" % self.transport.get_extra_info('peername')
|
||||
self.blob_manager.connection_manager.connection_received(self.peer_address_and_port)
|
||||
log.debug("received connection from %s", self.peer_address_and_port)
|
||||
|
||||
def connection_lost(self, exc: typing.Optional[Exception]) -> None:
|
||||
log.debug("lost connection from %s", self.peer_address_and_port)
|
||||
self.blob_manager.connection_manager.incoming_connection_lost(self.peer_address_and_port)
|
||||
self.transport = None
|
||||
if self.close_on_idle_task and not self.close_on_idle_task.done():
|
||||
self.close_on_idle_task.cancel()
|
||||
self.close_on_idle_task = None
|
||||
|
||||
def send_response(self, responses: typing.List[blob_response_types]):
|
||||
to_send = []
|
||||
@@ -65,20 +96,30 @@ class BlobServerProtocol(asyncio.Protocol):
|
||||
incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length}
|
||||
responses.append(BlobDownloadResponse(incoming_blob=incoming_blob))
|
||||
self.send_response(responses)
|
||||
log.debug("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port)
|
||||
bh = blob.blob_hash[:8]
|
||||
log.debug("send %s to %s:%i", bh, peer_address, peer_port)
|
||||
self.started_transfer.set()
|
||||
try:
|
||||
sent = await blob.sendfile(self)
|
||||
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError):
|
||||
if self.transport:
|
||||
self.transport.close()
|
||||
return
|
||||
log.info("sent %s (%i bytes) to %s:%i", blob.blob_hash[:8], sent, peer_address, peer_port)
|
||||
sent = await asyncio.wait_for(blob.sendfile(self), self.transfer_timeout, loop=self.loop)
|
||||
self.blob_manager.connection_manager.sent_data(self.peer_address_and_port, sent)
|
||||
log.info("sent %s (%i bytes) to %s:%i", bh, sent, peer_address, peer_port)
|
||||
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError, asyncio.TimeoutError) as err:
|
||||
if isinstance(err, asyncio.TimeoutError):
|
||||
log.debug("timed out sending blob %s to %s", bh, peer_address)
|
||||
else:
|
||||
log.debug("stopped sending %s to %s:%i", bh, peer_address, peer_port)
|
||||
self.close()
|
||||
finally:
|
||||
self.transfer_finished.set()
|
||||
if responses:
|
||||
self.send_response(responses)
|
||||
# self.transport.close()
|
||||
|
||||
def data_received(self, data):
|
||||
request = None
|
||||
if len(self.buf) + len(data or b'') >= MAX_REQUEST_SIZE:
|
||||
log.warning("request from %s is too large", self.peer_address_and_port)
|
||||
self.close()
|
||||
return
|
||||
if data:
|
||||
self.blob_manager.connection_manager.received_data(self.peer_address_and_port, len(data))
|
||||
message, separator, remainder = data.rpartition(b'}')
|
||||
@@ -89,26 +130,28 @@ class BlobServerProtocol(asyncio.Protocol):
|
||||
request = BlobRequest.deserialize(self.buf + data)
|
||||
self.buf = remainder
|
||||
except JSONDecodeError:
|
||||
addr = self.transport.get_extra_info('peername')
|
||||
peer_address, peer_port = addr
|
||||
log.error("failed to decode blob request from %s:%i (%i bytes): %s", peer_address, peer_port,
|
||||
len(data), '' if not data else binascii.hexlify(data).decode())
|
||||
if not request:
|
||||
addr = self.transport.get_extra_info('peername')
|
||||
peer_address, peer_port = addr
|
||||
log.warning("failed to decode blob request from %s:%i", peer_address, peer_port)
|
||||
self.transport.close()
|
||||
log.error("request from %s is not valid json (%i bytes): %s", self.peer_address_and_port,
|
||||
len(self.buf + data), '' if not data else binascii.hexlify(self.buf + data).decode())
|
||||
self.close()
|
||||
return
|
||||
if not request.requests:
|
||||
log.error("failed to decode request from %s (%i bytes): %s", self.peer_address_and_port,
|
||||
len(self.buf + data), '' if not data else binascii.hexlify(self.buf + data).decode())
|
||||
self.close()
|
||||
return
|
||||
self.loop.create_task(self.handle_request(request))
|
||||
|
||||
|
||||
class BlobServer:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, blob_manager: 'BlobManager', lbrycrd_address: str):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, blob_manager: 'BlobManager', lbrycrd_address: str,
|
||||
idle_timeout: float = 30.0, transfer_timeout: float = 60.0):
|
||||
self.loop = loop
|
||||
self.blob_manager = blob_manager
|
||||
self.server_task: typing.Optional[asyncio.Task] = None
|
||||
self.started_listening = asyncio.Event(loop=self.loop)
|
||||
self.lbrycrd_address = lbrycrd_address
|
||||
self.idle_timeout = idle_timeout
|
||||
self.transfer_timeout = transfer_timeout
|
||||
self.server_protocol_class = BlobServerProtocol
|
||||
|
||||
def start_server(self, port: int, interface: typing.Optional[str] = '0.0.0.0'):
|
||||
@@ -117,7 +160,8 @@ class BlobServer:
|
||||
|
||||
async def _start_server():
|
||||
server = await self.loop.create_server(
|
||||
lambda: self.server_protocol_class(self.loop, self.blob_manager, self.lbrycrd_address),
|
||||
lambda: self.server_protocol_class(self.loop, self.blob_manager, self.lbrycrd_address,
|
||||
self.idle_timeout, self.transfer_timeout),
|
||||
interface, port
|
||||
)
|
||||
self.started_listening.set()
|
||||
@@ -7,8 +7,9 @@ import yaml
|
||||
from argparse import ArgumentParser
|
||||
from contextlib import contextmanager
|
||||
from appdirs import user_data_dir, user_config_dir
|
||||
from lbrynet.error import InvalidCurrencyError
|
||||
from lbrynet.dht import constants
|
||||
from lbry.error import InvalidCurrencyError
|
||||
from lbry.dht import constants
|
||||
from torba.client.coinselection import STRATEGIES
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -21,9 +22,6 @@ CURRENCIES = {
|
||||
'LBC': {'type': 'crypto'},
|
||||
'USD': {'type': 'fiat'},
|
||||
}
|
||||
HEADERS_FILE_SHA256_CHECKSUM = (
|
||||
366295, 'b0c8197153a33ccbc52fb81a279588b6015b68b7726f73f6a2b81f7e25bfe4b9'
|
||||
)
|
||||
|
||||
|
||||
class Setting(typing.Generic[T]):
|
||||
@@ -192,6 +190,21 @@ class MaxKeyFee(Setting[dict]):
|
||||
)
|
||||
|
||||
|
||||
class StringChoice(String):
|
||||
def __init__(self, doc: str, valid_values: typing.List[str], default: str, *args, **kwargs):
|
||||
super().__init__(doc, default, *args, **kwargs)
|
||||
if not valid_values:
|
||||
raise ValueError("No valid values provided")
|
||||
if default not in valid_values:
|
||||
raise ValueError(f"Default value must be one of: {', '.join(valid_values)}")
|
||||
self.valid_values = valid_values
|
||||
|
||||
def validate(self, val):
|
||||
super().validate(val)
|
||||
if val not in self.valid_values:
|
||||
raise ValueError(f"Setting '{self.name}' value must be one of: {', '.join(self.valid_values)}")
|
||||
|
||||
|
||||
class ListSetting(Setting[list]):
|
||||
|
||||
def validate(self, val):
|
||||
@@ -346,6 +359,9 @@ class ConfigFileAccess:
|
||||
del self.data[key]
|
||||
|
||||
|
||||
TBC = typing.TypeVar('TBC', bound='BaseConfig')
|
||||
|
||||
|
||||
class BaseConfig:
|
||||
|
||||
config = Path("Path to configuration file.", metavar='FILE')
|
||||
@@ -402,7 +418,7 @@ class BaseConfig:
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def create_from_arguments(cls, args):
|
||||
def create_from_arguments(cls, args) -> TBC:
|
||||
conf = cls()
|
||||
conf.set_arguments(args)
|
||||
conf.set_environment()
|
||||
@@ -529,9 +545,15 @@ class Config(CLIConfig):
|
||||
('reflector.lbry.com', 5566)
|
||||
])
|
||||
lbryum_servers = Servers("SPV wallet servers", [
|
||||
('lbryumx1.lbry.com', 50001), # US EAST
|
||||
('lbryumx2.lbry.com', 50001), # US EAST
|
||||
('lbryumx4.lbry.com', 50001) #EU
|
||||
('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),
|
||||
])
|
||||
known_dht_nodes = Servers("Known nodes for bootstrapping connection to the DHT", [
|
||||
('lbrynet1.lbry.com', 4444), # US EAST
|
||||
@@ -554,14 +576,18 @@ class Config(CLIConfig):
|
||||
"Whether to share usage stats and diagnostic info with LBRY.", True,
|
||||
previous_names=['upload_log', 'upload_log', 'share_debug_info']
|
||||
)
|
||||
track_bandwidth = Toggle("Track bandwidth usage", True)
|
||||
|
||||
# media server
|
||||
|
||||
streaming_server = String('Host name and port to serve streaming media over range requests',
|
||||
'localhost:5280', metavar='HOST:PORT')
|
||||
streaming_get = Toggle("Enable the /get endpoint for the streaming media server. "
|
||||
"Disable to prevent new streams from being added.", True)
|
||||
|
||||
coin_selection_strategy = StringChoice(
|
||||
"Strategy to use when selecting UTXOs for a transaction",
|
||||
STRATEGIES, "standard")
|
||||
|
||||
@property
|
||||
def streaming_host(self):
|
||||
return self.streaming_server.split(':')[0]
|
||||
@@ -595,7 +621,7 @@ class Config(CLIConfig):
|
||||
|
||||
|
||||
def get_windows_directories() -> typing.Tuple[str, str, str]:
|
||||
from lbrynet.winpaths import get_path, FOLDERID, UserHandle
|
||||
from lbry.winpaths import get_path, FOLDERID, UserHandle
|
||||
|
||||
download_dir = get_path(FOLDERID.Downloads, UserHandle.current)
|
||||
|
||||
@@ -19,7 +19,9 @@ class ConnectionManager:
|
||||
self.outgoing_connected: typing.Set[str] = set()
|
||||
self.outgoing: typing.DefaultDict[str, int] = collections.defaultdict(int)
|
||||
self._status = {}
|
||||
|
||||
self._total_sent = 0
|
||||
self._total_received = 0
|
||||
self._running = False
|
||||
self._task: typing.Optional[asyncio.Task] = None
|
||||
|
||||
@property
|
||||
@@ -27,33 +29,37 @@ class ConnectionManager:
|
||||
return self._status
|
||||
|
||||
def sent_data(self, host_and_port: str, size: int):
|
||||
self.outgoing[host_and_port] += size
|
||||
if self._running:
|
||||
self.outgoing[host_and_port] += size
|
||||
|
||||
def received_data(self, host_and_port: str, size: int):
|
||||
self.incoming[host_and_port] += size
|
||||
if self._running:
|
||||
self.incoming[host_and_port] += size
|
||||
|
||||
def connection_made(self, host_and_port: str):
|
||||
self.outgoing_connected.add(host_and_port)
|
||||
if self._running:
|
||||
self.outgoing_connected.add(host_and_port)
|
||||
|
||||
def connection_received(self, host_and_port: str):
|
||||
# self.incoming_connected.add(host_and_port)
|
||||
pass
|
||||
|
||||
def outgoing_connection_lost(self, host_and_port: str):
|
||||
if host_and_port in self.outgoing_connected:
|
||||
if self._running and host_and_port in self.outgoing_connected:
|
||||
self.outgoing_connected.remove(host_and_port)
|
||||
|
||||
def incoming_connection_lost(self, host_and_port: str):
|
||||
if host_and_port in self.incoming_connected:
|
||||
if self._running and host_and_port in self.incoming_connected:
|
||||
self.incoming_connected.remove(host_and_port)
|
||||
|
||||
async def _update(self):
|
||||
|
||||
self._status = {
|
||||
'incoming_bps': {},
|
||||
'outgoing_bps': {},
|
||||
'total_incoming_mbs': 0.0,
|
||||
'total_outgoing_mbs': 0.0,
|
||||
'total_sent': self._total_sent,
|
||||
'total_received': self._total_received,
|
||||
'time': self.loop.time()
|
||||
}
|
||||
|
||||
@@ -73,6 +79,9 @@ class ConnectionManager:
|
||||
) / (now - last)) / 1000000.0
|
||||
self._status['total_incoming_mbs'] = int(sum(list(self._status['incoming_bps'].values())
|
||||
) / (now - last)) / 1000000.0
|
||||
self._total_sent += sum(list(self._status['outgoing_bps'].values()))
|
||||
self._total_received += sum(list(self._status['incoming_bps'].values()))
|
||||
|
||||
self._status['time'] = now
|
||||
|
||||
def stop(self):
|
||||
@@ -84,7 +93,9 @@ class ConnectionManager:
|
||||
self.incoming.clear()
|
||||
self.incoming_connected.clear()
|
||||
self._status.clear()
|
||||
self._running = False
|
||||
|
||||
def start(self):
|
||||
self.stop()
|
||||
self._running = True
|
||||
self._task = self.loop.create_task(self._update())
|
||||
@@ -2,14 +2,14 @@ import asyncio
|
||||
import typing
|
||||
import logging
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.dht.node import Node
|
||||
from lbrynet.extras.daemon.storage import SQLiteStorage
|
||||
from lbry.dht.node import Node
|
||||
from lbry.extras.daemon.storage import SQLiteStorage
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BlobAnnouncer:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, node: 'Node', storage: 'SQLiteStorage'):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, node: 'Node', storage: 'SQLiteStorage'):
|
||||
self.loop = loop
|
||||
self.node = node
|
||||
self.storage = storage
|
||||
@@ -18,11 +18,10 @@ data_expiration = 86400 # 24 hours
|
||||
token_secret_refresh_interval = 300 # 5 minutes
|
||||
maybe_ping_delay = 300 # 5 minutes
|
||||
check_refresh_interval = refresh_interval / 5
|
||||
max_datagram_size = 8192 # 8 KB
|
||||
rpc_id_length = 20
|
||||
protocol_version = 1
|
||||
bottom_out_limit = 3
|
||||
msg_size_limit = max_datagram_size - 26
|
||||
msg_size_limit = 1400
|
||||
|
||||
|
||||
def digest(data: bytes) -> bytes:
|
||||
@@ -2,21 +2,21 @@ import logging
|
||||
import asyncio
|
||||
import typing
|
||||
import binascii
|
||||
from lbrynet.utils import resolve_host
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.protocol.distance import Distance
|
||||
from lbrynet.dht.protocol.iterative_find import IterativeNodeFinder, IterativeValueFinder
|
||||
from lbrynet.dht.protocol.protocol import KademliaProtocol
|
||||
from lbrynet.dht.peer import KademliaPeer
|
||||
from lbry.utils import resolve_host
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.protocol.distance import Distance
|
||||
from lbry.dht.protocol.iterative_find import IterativeNodeFinder, IterativeValueFinder
|
||||
from lbry.dht.protocol.protocol import KademliaProtocol
|
||||
from lbry.dht.peer import KademliaPeer
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.dht.peer import PeerManager
|
||||
from lbry.dht.peer import PeerManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Node:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager', node_id: bytes, udp_port: int,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', node_id: bytes, udp_port: int,
|
||||
internal_udp_port: int, peer_port: int, external_ip: str, rpc_timeout: float = constants.rpc_timeout,
|
||||
split_buckets_under_index: int = constants.split_buckets_under_index):
|
||||
self.loop = loop
|
||||
@@ -208,8 +208,36 @@ class Node:
|
||||
task.cancel()
|
||||
|
||||
async def _value_producer(self, blob_hash: str, result_queue: asyncio.Queue):
|
||||
async def ping(_peer):
|
||||
try:
|
||||
await self.protocol.get_rpc_peer(_peer).ping()
|
||||
result_queue.put_nowait([_peer])
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
|
||||
async for results in self.get_iterative_value_finder(binascii.unhexlify(blob_hash.encode())):
|
||||
result_queue.put_nowait(results)
|
||||
to_put = []
|
||||
for peer in results:
|
||||
if peer.address == self.protocol.external_ip and self.protocol.peer_port == peer.tcp_port:
|
||||
continue
|
||||
is_good = self.protocol.peer_manager.peer_is_good(peer)
|
||||
if is_good:
|
||||
to_put.append(peer)
|
||||
elif is_good is None:
|
||||
udp_port_to_try = 4444
|
||||
if 3400 > peer.tcp_port > 3332:
|
||||
if not peer.udp_port:
|
||||
udp_port_to_try = (peer.tcp_port - 3333) + 4444
|
||||
elif 4500 > peer.tcp_port > 4443:
|
||||
if not peer.udp_port:
|
||||
udp_port_to_try = peer.tcp_port
|
||||
if not peer.udp_port:
|
||||
peer.update_udp_port(udp_port_to_try)
|
||||
self.loop.create_task(ping(peer))
|
||||
else:
|
||||
log.debug("skip bad peer %s:%i for %s", peer.address, peer.tcp_port, blob_hash)
|
||||
if to_put:
|
||||
result_queue.put_nowait(to_put)
|
||||
|
||||
def accumulate_peers(self, search_queue: asyncio.Queue,
|
||||
peer_queue: typing.Optional[asyncio.Queue] = None) -> typing.Tuple[
|
||||
@@ -5,8 +5,8 @@ import ipaddress
|
||||
from binascii import hexlify
|
||||
from functools import lru_cache
|
||||
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.serialization.datagram import make_compact_address, make_compact_ip, decode_compact_address
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.serialization.datagram import make_compact_address, make_compact_ip, decode_compact_address
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -20,7 +20,7 @@ def is_valid_ipv4(address):
|
||||
|
||||
|
||||
class PeerManager:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop):
|
||||
self._loop = loop
|
||||
self._rpc_failures: typing.Dict[
|
||||
typing.Tuple[str, int], typing.Tuple[typing.Optional[float], typing.Optional[float]]
|
||||
@@ -61,7 +61,7 @@ class PeerManager:
|
||||
self._node_tokens[node_id] = (now, token)
|
||||
|
||||
def get_node_token(self, node_id: bytes) -> typing.Optional[bytes]:
|
||||
ts, token = self._node_tokens.get(node_id, (None, None))
|
||||
ts, token = self._node_tokens.get(node_id, (0, None))
|
||||
if ts and ts > self._loop.time() - constants.token_secret_refresh_interval:
|
||||
return token
|
||||
|
||||
@@ -148,7 +148,7 @@ class KademliaPeer:
|
||||
'protocol_version',
|
||||
]
|
||||
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, address: str, node_id: typing.Optional[bytes] = None,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, address: str, node_id: typing.Optional[bytes] = None,
|
||||
udp_port: typing.Optional[int] = None, tcp_port: typing.Optional[int] = None):
|
||||
if node_id is not None:
|
||||
if not len(node_id) == constants.hash_length:
|
||||
@@ -1,13 +1,13 @@
|
||||
import asyncio
|
||||
import typing
|
||||
|
||||
from lbrynet.dht import constants
|
||||
from lbry.dht import constants
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.dht.peer import KademliaPeer, PeerManager
|
||||
from lbry.dht.peer import KademliaPeer, PeerManager
|
||||
|
||||
|
||||
class DictDataStore:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager'):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager'):
|
||||
# Dictionary format:
|
||||
# { <key>: [(<contact>, <age>), ...] }
|
||||
self._data_store: typing.Dict[bytes, typing.List[typing.Tuple['KademliaPeer', float]]] = {}
|
||||
@@ -1,4 +1,4 @@
|
||||
from lbrynet.dht import constants
|
||||
from lbry.dht import constants
|
||||
|
||||
|
||||
class Distance:
|
||||
@@ -4,15 +4,15 @@ from itertools import chain
|
||||
|
||||
import typing
|
||||
import logging
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.error import RemoteException, TransportNotConnected
|
||||
from lbrynet.dht.protocol.distance import Distance
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.error import RemoteException, TransportNotConnected
|
||||
from lbry.dht.protocol.distance import Distance
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from lbrynet.dht.protocol.routing_table import TreeRoutingTable
|
||||
from lbrynet.dht.protocol.protocol import KademliaProtocol
|
||||
from lbrynet.dht.peer import PeerManager, KademliaPeer
|
||||
from lbry.dht.protocol.routing_table import TreeRoutingTable
|
||||
from lbry.dht.protocol.protocol import KademliaProtocol
|
||||
from lbry.dht.peer import PeerManager, KademliaPeer
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -70,7 +70,7 @@ def get_shortlist(routing_table: 'TreeRoutingTable', key: bytes,
|
||||
|
||||
|
||||
class IterativeFinder:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
|
||||
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
|
||||
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
|
||||
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
|
||||
@@ -254,7 +254,7 @@ class IterativeFinder:
|
||||
|
||||
|
||||
class IterativeNodeFinder(IterativeFinder):
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
|
||||
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
|
||||
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
|
||||
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
|
||||
@@ -305,7 +305,7 @@ class IterativeNodeFinder(IterativeFinder):
|
||||
|
||||
|
||||
class IterativeValueFinder(IterativeFinder):
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
|
||||
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
|
||||
bottom_out_limit: typing.Optional[int] = 2, max_results: typing.Optional[int] = constants.k,
|
||||
exclude: typing.Optional[typing.List[typing.Tuple[str, int]]] = None,
|
||||
@@ -5,18 +5,19 @@ import hashlib
|
||||
import asyncio
|
||||
import typing
|
||||
import binascii
|
||||
import random
|
||||
from asyncio.protocols import DatagramProtocol
|
||||
from asyncio.transports import DatagramTransport
|
||||
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.serialization.datagram import decode_datagram, ErrorDatagram, ResponseDatagram, RequestDatagram
|
||||
from lbrynet.dht.serialization.datagram import RESPONSE_TYPE, ERROR_TYPE
|
||||
from lbrynet.dht.error import RemoteException, TransportNotConnected
|
||||
from lbrynet.dht.protocol.routing_table import TreeRoutingTable
|
||||
from lbrynet.dht.protocol.data_store import DictDataStore
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.serialization.datagram import decode_datagram, ErrorDatagram, ResponseDatagram, RequestDatagram
|
||||
from lbry.dht.serialization.datagram import RESPONSE_TYPE, ERROR_TYPE, PAGE_KEY
|
||||
from lbry.dht.error import RemoteException, TransportNotConnected
|
||||
from lbry.dht.protocol.routing_table import TreeRoutingTable
|
||||
from lbry.dht.protocol.data_store import DictDataStore
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.dht.peer import PeerManager, KademliaPeer
|
||||
from lbry.dht.peer import PeerManager, KademliaPeer
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,7 +29,7 @@ old_protocol_errors = {
|
||||
|
||||
|
||||
class KademliaRPC:
|
||||
def __init__(self, protocol: 'KademliaProtocol', loop: asyncio.BaseEventLoop, peer_port: int = 3333):
|
||||
def __init__(self, protocol: 'KademliaProtocol', loop: asyncio.AbstractEventLoop, peer_port: int = 3333):
|
||||
self.protocol = protocol
|
||||
self.loop = loop
|
||||
self.peer_port = peer_port
|
||||
@@ -67,19 +68,23 @@ class KademliaRPC:
|
||||
|
||||
contacts = self.protocol.routing_table.find_close_peers(key, sender_node_id=rpc_contact.node_id)
|
||||
contact_triples = []
|
||||
for contact in contacts:
|
||||
for contact in contacts[:constants.k * 2]:
|
||||
contact_triples.append((contact.node_id, contact.address, contact.udp_port))
|
||||
return contact_triples
|
||||
|
||||
def find_value(self, rpc_contact: 'KademliaPeer', key: bytes):
|
||||
def find_value(self, rpc_contact: 'KademliaPeer', key: bytes, page: int = 0):
|
||||
page = page if page > 0 else 0
|
||||
|
||||
if len(key) != constants.hash_length:
|
||||
raise ValueError("invalid blob_exchange hash length: %i" % len(key))
|
||||
|
||||
response = {
|
||||
b'token': self.make_token(rpc_contact.compact_ip()),
|
||||
b'contacts': self.find_node(rpc_contact, key)
|
||||
}
|
||||
|
||||
if not page:
|
||||
response[b'contacts'] = self.find_node(rpc_contact, key)[:constants.k]
|
||||
|
||||
if self.protocol.protocol_version:
|
||||
response[b'protocolVersion'] = self.protocol.protocol_version
|
||||
|
||||
@@ -92,8 +97,14 @@ class KademliaRPC:
|
||||
# if we don't have k storing peers to return and we have this hash locally, include our contact information
|
||||
if len(peers) < constants.k and binascii.hexlify(key).decode() in self.protocol.data_store.completed_blobs:
|
||||
peers.append(self.compact_address())
|
||||
if peers:
|
||||
response[key] = peers
|
||||
if not peers:
|
||||
response[PAGE_KEY] = 0
|
||||
else:
|
||||
response[PAGE_KEY] = (len(peers) // (constants.k + 1)) + 1 # how many pages of peers we have for the blob
|
||||
if len(peers) > constants.k:
|
||||
random.Random(self.protocol.node_id).shuffle(peers)
|
||||
if page * constants.k < len(peers):
|
||||
response[key] = peers[page * constants.k:page * constants.k + constants.k]
|
||||
return response
|
||||
|
||||
def refresh_token(self): # TODO: this needs to be called periodically
|
||||
@@ -121,7 +132,7 @@ class RemoteKademliaRPC:
|
||||
Encapsulates RPC calls to remote Peers
|
||||
"""
|
||||
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_tracker: 'PeerManager', protocol: 'KademliaProtocol',
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_tracker: 'PeerManager', protocol: 'KademliaProtocol',
|
||||
peer: 'KademliaPeer'):
|
||||
self.loop = loop
|
||||
self.peer_tracker = peer_tracker
|
||||
@@ -166,7 +177,7 @@ class RemoteKademliaRPC:
|
||||
)
|
||||
return [(node_id, address.decode(), udp_port) for node_id, address, udp_port in response.response]
|
||||
|
||||
async def find_value(self, key: bytes) -> typing.Union[typing.Dict]:
|
||||
async def find_value(self, key: bytes, page: int = 0) -> typing.Union[typing.Dict]:
|
||||
"""
|
||||
:return: {
|
||||
b'token': <token bytes>,
|
||||
@@ -177,14 +188,14 @@ class RemoteKademliaRPC:
|
||||
if len(key) != constants.hash_bits // 8:
|
||||
raise ValueError(f"invalid length of find value key: {len(key)}")
|
||||
response = await self.protocol.send_request(
|
||||
self.peer, RequestDatagram.make_find_value(self.protocol.node_id, key)
|
||||
self.peer, RequestDatagram.make_find_value(self.protocol.node_id, key, page=page)
|
||||
)
|
||||
self.peer_tracker.update_token(self.peer.node_id, response.response[b'token'])
|
||||
return response.response
|
||||
|
||||
|
||||
class PingQueue:
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, protocol: 'KademliaProtocol'):
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, protocol: 'KademliaProtocol'):
|
||||
self._loop = loop
|
||||
self._protocol = protocol
|
||||
self._pending_contacts: typing.Dict['KademliaPeer', float] = {}
|
||||
@@ -247,7 +258,7 @@ class PingQueue:
|
||||
|
||||
|
||||
class KademliaProtocol(DatagramProtocol):
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager', node_id: bytes, external_ip: str,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', node_id: bytes, external_ip: str,
|
||||
udp_port: int, peer_port: int, rpc_timeout: float = constants.rpc_timeout,
|
||||
split_buckets_under_index: int = constants.split_buckets_under_index):
|
||||
self.peer_manager = peer_manager
|
||||
@@ -406,24 +417,25 @@ class KademliaProtocol(DatagramProtocol):
|
||||
raise AttributeError('Invalid method: %s' % message.method.decode())
|
||||
if message.args and isinstance(message.args[-1], dict) and b'protocolVersion' in message.args[-1]:
|
||||
# args don't need reformatting
|
||||
a, kw = tuple(message.args[:-1]), message.args[-1]
|
||||
args, kw = tuple(message.args[:-1]), message.args[-1]
|
||||
else:
|
||||
a, kw = self._migrate_incoming_rpc_args(sender_contact, message.method, *message.args)
|
||||
args, kw = self._migrate_incoming_rpc_args(sender_contact, message.method, *message.args)
|
||||
log.debug("%s:%i RECV CALL %s %s:%i", self.external_ip, self.udp_port, message.method.decode(),
|
||||
sender_contact.address, sender_contact.udp_port)
|
||||
|
||||
if method == b'ping':
|
||||
result = self.node_rpc.ping()
|
||||
elif method == b'store':
|
||||
blob_hash, token, port, original_publisher_id, age = a
|
||||
blob_hash, token, port, original_publisher_id, age = args[:5]
|
||||
result = self.node_rpc.store(sender_contact, blob_hash, token, port)
|
||||
elif method == b'findNode':
|
||||
key, = a
|
||||
result = self.node_rpc.find_node(sender_contact, key)
|
||||
else:
|
||||
assert method == b'findValue'
|
||||
key, = a
|
||||
result = self.node_rpc.find_value(sender_contact, key)
|
||||
key = args[0]
|
||||
page = kw.get(PAGE_KEY, 0)
|
||||
if method == b'findNode':
|
||||
result = self.node_rpc.find_node(sender_contact, key)
|
||||
else:
|
||||
assert method == b'findValue'
|
||||
result = self.node_rpc.find_value(sender_contact, key, page)
|
||||
|
||||
self.send_response(
|
||||
sender_contact, ResponseDatagram(RESPONSE_TYPE, message.rpc_id, self.node_id, result),
|
||||
@@ -569,15 +581,18 @@ class KademliaProtocol(DatagramProtocol):
|
||||
def send_error(self, peer: 'KademliaPeer', error: ErrorDatagram):
|
||||
self._send(peer, error)
|
||||
|
||||
def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram,
|
||||
ErrorDatagram]):
|
||||
def _send(self, peer: 'KademliaPeer', message: typing.Union[RequestDatagram, ResponseDatagram, ErrorDatagram]):
|
||||
if not self.transport or self.transport.is_closing():
|
||||
raise TransportNotConnected()
|
||||
|
||||
data = message.bencode()
|
||||
if len(data) > constants.msg_size_limit:
|
||||
log.exception("unexpected: %i vs %i", len(data), constants.msg_size_limit)
|
||||
raise ValueError()
|
||||
log.warning("cannot send datagram larger than %i bytes (packet is %i bytes)",
|
||||
constants.msg_size_limit, len(data))
|
||||
log.debug("Packet is too large to send: %s", binascii.hexlify(data[:3500]).decode())
|
||||
raise ValueError(
|
||||
f"cannot send datagram larger than {constants.msg_size_limit} bytes (packet is {len(data)} bytes)"
|
||||
)
|
||||
if isinstance(message, (RequestDatagram, ResponseDatagram)):
|
||||
assert message.node_id == self.node_id, message
|
||||
if isinstance(message, RequestDatagram):
|
||||
@@ -642,12 +657,12 @@ class KademliaProtocol(DatagramProtocol):
|
||||
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)
|
||||
except ValueError as err:
|
||||
log.error("Unexpected response: %s" % err)
|
||||
except Exception as err:
|
||||
except RemoteException as err:
|
||||
if 'Invalid token' in str(err):
|
||||
self.peer_manager.clear_token(peer.node_id)
|
||||
try:
|
||||
return await __store()
|
||||
except:
|
||||
except (ValueError, asyncio.TimeoutError, RemoteException):
|
||||
return peer.node_id, False
|
||||
else:
|
||||
log.exception("Unexpected error while storing blob_hash")
|
||||
@@ -4,10 +4,10 @@ import logging
|
||||
import typing
|
||||
import itertools
|
||||
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.protocol.distance import Distance
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.protocol.distance import Distance
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.dht.peer import KademliaPeer, PeerManager
|
||||
from lbry.dht.peer import KademliaPeer, PeerManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -163,7 +163,7 @@ class TreeRoutingTable:
|
||||
that paper.
|
||||
"""
|
||||
|
||||
def __init__(self, loop: asyncio.BaseEventLoop, peer_manager: 'PeerManager', parent_node_id: bytes,
|
||||
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager', parent_node_id: bytes,
|
||||
split_buckets_under_index: int = constants.split_buckets_under_index):
|
||||
self._loop = loop
|
||||
self._peer_manager = peer_manager
|
||||
@@ -1,5 +1,5 @@
|
||||
import typing
|
||||
from lbrynet.dht.error import DecodeError
|
||||
from lbry.dht.error import DecodeError
|
||||
|
||||
|
||||
def _bencode(data: typing.Union[int, bytes, bytearray, str, list, tuple, dict]) -> bytes:
|
||||
@@ -63,7 +63,7 @@ def bencode(data: typing.Dict) -> bytes:
|
||||
|
||||
|
||||
def bdecode(data: bytes, allow_non_dict_return: typing.Optional[bool] = False) -> typing.Dict:
|
||||
assert type(data) == bytes, DecodeError(f"invalid data type: {str(type(data))}")
|
||||
assert isinstance(data, bytes), DecodeError(f"invalid data type: {str(type(data))}")
|
||||
|
||||
if len(data) == 0:
|
||||
raise DecodeError('Cannot decode empty string')
|
||||
@@ -1,12 +1,15 @@
|
||||
import typing
|
||||
from functools import reduce
|
||||
from lbrynet.dht import constants
|
||||
from lbrynet.dht.serialization.bencoding import bencode, bdecode
|
||||
from lbry.dht import constants
|
||||
from lbry.dht.serialization.bencoding import bencode, bdecode
|
||||
|
||||
REQUEST_TYPE = 0
|
||||
RESPONSE_TYPE = 1
|
||||
ERROR_TYPE = 2
|
||||
|
||||
# bencode representation of argument keys
|
||||
PAGE_KEY = b'p'
|
||||
|
||||
|
||||
class KademliaDatagramBase:
|
||||
"""
|
||||
@@ -91,11 +94,13 @@ class RequestDatagram(KademliaDatagramBase):
|
||||
|
||||
@classmethod
|
||||
def make_find_value(cls, from_node_id: bytes, key: bytes,
|
||||
rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
|
||||
rpc_id: typing.Optional[bytes] = None, page: int = 0) -> 'RequestDatagram':
|
||||
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
|
||||
if len(key) != constants.hash_bits // 8:
|
||||
raise ValueError(f"invalid key length: {len(key)}")
|
||||
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'findValue', [key])
|
||||
if page < 0:
|
||||
raise ValueError(f"cannot request a negative page ({page})")
|
||||
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'findValue', [key, {PAGE_KEY: page}])
|
||||
|
||||
|
||||
class ResponseDatagram(KademliaDatagramBase):
|
||||
@@ -12,12 +12,12 @@ from docopt import docopt
|
||||
import aiohttp
|
||||
from aiohttp.web import GracefulExit
|
||||
|
||||
from lbrynet import __name__ as lbrynet_name, __version__ as lbrynet_version
|
||||
from lbrynet.extras.daemon.loggly_handler import get_loggly_handler
|
||||
from lbrynet.conf import Config, CLIConfig
|
||||
from lbrynet.extras.daemon.Daemon import Daemon
|
||||
from lbry import __version__ as lbrynet_version
|
||||
from lbry.extras.daemon.loggly_handler import get_loggly_handler
|
||||
from lbry.conf import Config, CLIConfig
|
||||
from lbry.extras.daemon.Daemon import Daemon
|
||||
|
||||
log = logging.getLogger(lbrynet_name)
|
||||
log = logging.getLogger('lbry')
|
||||
log.addHandler(logging.NullHandler())
|
||||
|
||||
|
||||
@@ -221,6 +221,61 @@ def ensure_directory_exists(path: str):
|
||||
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def run_daemon(args: list, conf: Config):
|
||||
default_formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(name)s:%(lineno)d: %(message)s")
|
||||
file_handler = logging.handlers.RotatingFileHandler(
|
||||
conf.log_file_path, maxBytes=2097152, backupCount=5
|
||||
)
|
||||
file_handler.setFormatter(default_formatter)
|
||||
log.addHandler(file_handler)
|
||||
logging.getLogger('torba').addHandler(file_handler)
|
||||
|
||||
if not args.quiet:
|
||||
handler = logging.StreamHandler()
|
||||
handler.setFormatter(default_formatter)
|
||||
log.addHandler(handler)
|
||||
logging.getLogger('torba').addHandler(handler)
|
||||
logging.getLogger('torba').setLevel(logging.INFO)
|
||||
|
||||
logging.getLogger('aioupnp').setLevel(logging.WARNING)
|
||||
logging.getLogger('aiohttp').setLevel(logging.CRITICAL)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
if args.verbose:
|
||||
log.setLevel(logging.DEBUG)
|
||||
loop.set_debug(True)
|
||||
else:
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
if conf.share_usage_data:
|
||||
loggly_handler = get_loggly_handler()
|
||||
loggly_handler.setLevel(logging.ERROR)
|
||||
log.addHandler(loggly_handler)
|
||||
|
||||
daemon = Daemon(conf)
|
||||
|
||||
def __exit():
|
||||
raise GracefulExit()
|
||||
|
||||
try:
|
||||
loop.add_signal_handler(signal.SIGINT, __exit)
|
||||
loop.add_signal_handler(signal.SIGTERM, __exit)
|
||||
except NotImplementedError:
|
||||
pass # Not implemented on Windows
|
||||
|
||||
try:
|
||||
loop.run_until_complete(daemon.start())
|
||||
loop.run_forever()
|
||||
except (GracefulExit, KeyboardInterrupt, asyncio.CancelledError):
|
||||
pass
|
||||
finally:
|
||||
loop.run_until_complete(daemon.stop())
|
||||
|
||||
if hasattr(loop, 'shutdown_asyncgens'):
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
argv = argv or sys.argv[1:]
|
||||
parser = get_argument_parser()
|
||||
@@ -231,89 +286,27 @@ def main(argv=None):
|
||||
ensure_directory_exists(directory)
|
||||
|
||||
if args.cli_version:
|
||||
print(f"{lbrynet_name} {lbrynet_version}")
|
||||
return 0
|
||||
|
||||
print(f"lbrynet {lbrynet_version}")
|
||||
elif args.command == 'start':
|
||||
|
||||
if args.help:
|
||||
args.start_parser.print_help()
|
||||
return 0
|
||||
|
||||
default_formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(name)s:%(lineno)d: %(message)s")
|
||||
file_handler = logging.handlers.RotatingFileHandler(
|
||||
conf.log_file_path, maxBytes=2097152, backupCount=5
|
||||
)
|
||||
file_handler.setFormatter(default_formatter)
|
||||
log.addHandler(file_handler)
|
||||
logging.getLogger('torba').addHandler(file_handler)
|
||||
|
||||
if not args.quiet:
|
||||
handler = logging.StreamHandler()
|
||||
handler.setFormatter(default_formatter)
|
||||
log.addHandler(handler)
|
||||
logging.getLogger('torba').addHandler(handler)
|
||||
logging.getLogger('torba').setLevel(logging.INFO)
|
||||
|
||||
logging.getLogger('aioupnp').setLevel(logging.WARNING)
|
||||
logging.getLogger('aiohttp').setLevel(logging.CRITICAL)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
if args.verbose:
|
||||
log.setLevel(logging.DEBUG)
|
||||
loop.set_debug(True)
|
||||
else:
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
if conf.share_usage_data:
|
||||
loggly_handler = get_loggly_handler()
|
||||
loggly_handler.setLevel(logging.ERROR)
|
||||
log.addHandler(loggly_handler)
|
||||
|
||||
daemon = Daemon(conf)
|
||||
started = False
|
||||
def __exit():
|
||||
if started:
|
||||
daemon.stop_event.set()
|
||||
else:
|
||||
raise GracefulExit()
|
||||
try:
|
||||
loop.add_signal_handler(signal.SIGINT, __exit)
|
||||
loop.add_signal_handler(signal.SIGTERM, __exit)
|
||||
except NotImplementedError:
|
||||
pass # Not implemented on Windows
|
||||
try:
|
||||
loop.run_until_complete(daemon.start())
|
||||
started = True
|
||||
loop.run_until_complete(daemon.stop_event.wait())
|
||||
except (GracefulExit, KeyboardInterrupt):
|
||||
pass
|
||||
finally:
|
||||
loop.run_until_complete(daemon.stop())
|
||||
if hasattr(loop, 'shutdown_asyncgens'):
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
|
||||
run_daemon(args, conf)
|
||||
elif args.command is not None:
|
||||
|
||||
doc = args.doc
|
||||
api_method_name = args.api_method_name
|
||||
if args.replaced_by:
|
||||
print(f"{args.api_method_name} is deprecated, using {args.replaced_by['api_method_name']}.")
|
||||
doc = args.replaced_by['doc']
|
||||
api_method_name = args.replaced_by['api_method_name']
|
||||
|
||||
if args.help:
|
||||
print(doc)
|
||||
else:
|
||||
parsed = docopt(doc, command_args)
|
||||
params = set_kwargs(parsed)
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(execute_command(conf, api_method_name, params))
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(execute_command(conf, api_method_name, params))
|
||||
elif args.group is not None:
|
||||
args.group_parser.print_help()
|
||||
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
import logging
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.extras.daemon.ComponentManager import ComponentManager
|
||||
from lbry.conf import Config
|
||||
from lbry.extras.daemon.ComponentManager import ComponentManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -16,7 +16,7 @@ class ComponentType(type):
|
||||
|
||||
class Component(metaclass=ComponentType):
|
||||
"""
|
||||
lbrynet-daemon component helper
|
||||
lbry-daemon component helper
|
||||
|
||||
Inheriting classes will be automatically registered with the ComponentManager and must implement setup and stop
|
||||
methods
|
||||
@@ -56,7 +56,8 @@ class Component(metaclass=ComponentType):
|
||||
self._running = True
|
||||
return result
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
log.info("Cancelled setup of %s component", self.__class__.__name__)
|
||||
raise
|
||||
except Exception as err:
|
||||
log.exception("Error setting up %s", self.component_name or self.__class__.__name__)
|
||||
raise err
|
||||
@@ -67,7 +68,8 @@ class Component(metaclass=ComponentType):
|
||||
self._running = False
|
||||
return result
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
log.info("Cancelled stop of %s component", self.__class__.__name__)
|
||||
raise
|
||||
except Exception as err:
|
||||
log.exception("Error stopping %s", self.__class__.__name__)
|
||||
raise err
|
||||
@@ -1,8 +1,8 @@
|
||||
import logging
|
||||
import asyncio
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.error import ComponentStartConditionNotMet
|
||||
from lbrynet.dht.peer import PeerManager
|
||||
from lbry.conf import Config
|
||||
from lbry.error import ComponentStartConditionNotMet
|
||||
from lbry.dht.peer import PeerManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -163,3 +163,6 @@ class ComponentManager:
|
||||
if component.component_name == component_name:
|
||||
return component.component
|
||||
raise NameError(component_name)
|
||||
|
||||
def has_component(self, component_name):
|
||||
return any(component for component in self.components if component_name == component.component_name)
|
||||
@@ -1,30 +1,27 @@
|
||||
import hashlib
|
||||
import os
|
||||
import asyncio
|
||||
import logging
|
||||
import math
|
||||
import binascii
|
||||
import typing
|
||||
from hashlib import sha256
|
||||
from types import SimpleNamespace
|
||||
import base58
|
||||
|
||||
from aioupnp import __version__ as aioupnp_version
|
||||
from aioupnp.upnp import UPnP
|
||||
from aioupnp.fault import UPnPError
|
||||
|
||||
from lbrynet import utils
|
||||
from lbrynet.conf import HEADERS_FILE_SHA256_CHECKSUM
|
||||
from lbrynet.dht.node import Node
|
||||
from lbrynet.dht.blob_announcer import BlobAnnouncer
|
||||
from lbrynet.blob.blob_manager import BlobManager
|
||||
from lbrynet.blob_exchange.server import BlobServer
|
||||
from lbrynet.stream.stream_manager import StreamManager
|
||||
from lbrynet.extras.daemon.Component import Component
|
||||
from lbrynet.extras.daemon.exchange_rate_manager import ExchangeRateManager
|
||||
from lbrynet.extras.daemon.storage import SQLiteStorage
|
||||
from lbrynet.wallet import LbryWalletManager
|
||||
from lbrynet.wallet import Network
|
||||
|
||||
from lbry import utils
|
||||
from lbry.dht.node import Node
|
||||
from lbry.dht.blob_announcer import BlobAnnouncer
|
||||
from lbry.blob.blob_manager import BlobManager
|
||||
from lbry.blob_exchange.server import BlobServer
|
||||
from lbry.stream.stream_manager import StreamManager
|
||||
from lbry.extras.daemon.Component import Component
|
||||
from lbry.extras.daemon.exchange_rate_manager import ExchangeRateManager
|
||||
from lbry.extras.daemon.storage import SQLiteStorage
|
||||
from lbry.wallet import LbryWalletManager
|
||||
from lbry.wallet.header import Headers
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -42,14 +39,6 @@ UPNP_COMPONENT = "upnp"
|
||||
EXCHANGE_RATE_MANAGER_COMPONENT = "exchange_rate_manager"
|
||||
|
||||
|
||||
async def gather_dict(tasks: dict):
|
||||
async def wait_value(key, value):
|
||||
return key, await value
|
||||
return dict(await asyncio.gather(*(
|
||||
wait_value(*kv) for kv in tasks.items()
|
||||
)))
|
||||
|
||||
|
||||
class DatabaseComponent(Component):
|
||||
component_name = DATABASE_COMPONENT
|
||||
|
||||
@@ -90,7 +79,7 @@ class DatabaseComponent(Component):
|
||||
'Your database is revision %i, expected %i' %
|
||||
(old_revision, self.get_current_db_revision()))
|
||||
if old_revision < self.get_current_db_revision():
|
||||
from lbrynet.extras.daemon.migrator import dbmigrator
|
||||
from lbry.extras.daemon.migrator import dbmigrator
|
||||
log.info("Upgrading your databases (revision %i to %i)", old_revision, self.get_current_db_revision())
|
||||
await asyncio.get_event_loop().run_in_executor(
|
||||
None, dbmigrator.migrate_db, self.conf, old_revision, self.get_current_db_revision()
|
||||
@@ -108,115 +97,103 @@ class DatabaseComponent(Component):
|
||||
self.storage = None
|
||||
|
||||
|
||||
HEADERS_URL = "https://headers.lbry.io/blockchain_headers_latest"
|
||||
HEADER_SIZE = 112
|
||||
|
||||
|
||||
class HeadersComponent(Component):
|
||||
component_name = HEADERS_COMPONENT
|
||||
HEADERS_URL = "https://headers.lbry.io/blockchain_headers_latest"
|
||||
CHECKPOINT = ('100b33ca3d0b86a48f0d6d6f30458a130ecb89d5affefe4afccb134d5a40f4c2', 600_000)
|
||||
|
||||
def __init__(self, component_manager):
|
||||
super().__init__(component_manager)
|
||||
self.headers_dir = os.path.join(self.conf.wallet_dir, 'lbc_mainnet')
|
||||
self.headers_file = os.path.join(self.headers_dir, 'headers')
|
||||
self.old_file = os.path.join(self.conf.wallet_dir, 'blockchain_headers')
|
||||
self._downloading_headers = None
|
||||
self.headers = Headers(self.headers_file)
|
||||
self.is_downloading_headers = False
|
||||
self._headers_progress_percent = 0
|
||||
|
||||
@property
|
||||
def component(self):
|
||||
return self
|
||||
|
||||
async def get_status(self):
|
||||
return {} if not self._downloading_headers else {
|
||||
'downloading_headers': self._downloading_headers,
|
||||
'download_progress': self._headers_progress_percent
|
||||
}
|
||||
def _round_progress(self, local_height, remote_height):
|
||||
return min(max(math.ceil(float(local_height) / float(remote_height) * 100), 0), 100)
|
||||
|
||||
async def get_status(self) -> dict:
|
||||
progress = None
|
||||
if self.is_downloading_headers:
|
||||
progress = self._headers_progress_percent
|
||||
elif self.component_manager.has_component(WALLET_COMPONENT):
|
||||
wallet_manager = self.component_manager.get_component(WALLET_COMPONENT)
|
||||
if wallet_manager and wallet_manager.ledger.network.remote_height > 0:
|
||||
local_height = wallet_manager.ledger.headers.height
|
||||
remote_height = wallet_manager.ledger.network.remote_height
|
||||
progress = self._round_progress(local_height, remote_height)
|
||||
return {
|
||||
'downloading_headers': True,
|
||||
'download_progress': progress
|
||||
} if progress is not None and progress < 100 else {}
|
||||
|
||||
async def fetch_headers_from_s3(self):
|
||||
local_header_size = self.local_header_file_size()
|
||||
resume_header = {"Range": f"bytes={local_header_size}-"}
|
||||
async with utils.aiohttp_request('get', HEADERS_URL, headers=resume_header) as response:
|
||||
if response.status == 406 or response.content_length < HEADER_SIZE: # our file is bigger
|
||||
async with utils.aiohttp_request('get', self.HEADERS_URL, headers=resume_header) as response:
|
||||
if response.status == 406 or response.content_length < self.headers.header_size: # our file is bigger
|
||||
log.warning("s3 is more out of date than we are")
|
||||
return
|
||||
if response.content_length % HEADER_SIZE != 0:
|
||||
final_size_after_download = response.content_length + local_header_size
|
||||
if final_size_after_download % self.headers.header_size != 0:
|
||||
log.warning("s3 appears to have corrupted header")
|
||||
return
|
||||
final_size_after_download = response.content_length + local_header_size
|
||||
write_mode = "wb"
|
||||
if local_header_size > 0:
|
||||
log.info("Resuming download of %i bytes from s3", response.content_length)
|
||||
write_mode = "a+b"
|
||||
with open(self.headers_file, write_mode) as fd:
|
||||
while True:
|
||||
chunk = await response.content.read(512)
|
||||
if not chunk:
|
||||
break
|
||||
fd.write(chunk)
|
||||
self._headers_progress_percent = math.ceil(
|
||||
float(fd.tell()) / float(final_size_after_download) * 100
|
||||
while not response.content.at_eof():
|
||||
local_header_size += fd.write(await response.content.readany())
|
||||
self._headers_progress_percent = self._round_progress(
|
||||
local_header_size, final_size_after_download
|
||||
)
|
||||
log.info("fetched headers from s3, now verifying integrity after download.")
|
||||
self._check_header_file_integrity()
|
||||
|
||||
def local_header_file_height(self):
|
||||
return max((self.local_header_file_size() / HEADER_SIZE) - 1, 0)
|
||||
|
||||
def local_header_file_size(self):
|
||||
def local_header_file_size(self) -> int:
|
||||
if os.path.isfile(self.headers_file):
|
||||
return os.stat(self.headers_file).st_size
|
||||
return 0
|
||||
|
||||
async def get_remote_height(self):
|
||||
ledger = SimpleNamespace()
|
||||
ledger.config = {
|
||||
'default_servers': self.conf.lbryum_servers,
|
||||
'data_path': self.conf.wallet_dir
|
||||
}
|
||||
net = Network(ledger)
|
||||
first_connection = net.on_connected.first
|
||||
asyncio.ensure_future(net.start())
|
||||
await first_connection
|
||||
remote_height = await net.get_server_height()
|
||||
await net.stop()
|
||||
return remote_height
|
||||
async def get_downloadable_header_height(self) -> typing.Optional[int]:
|
||||
async with utils.aiohttp_request('HEAD', self.HEADERS_URL) as response:
|
||||
if response.status != 200:
|
||||
log.warning("Header download error, unexpected response code: %s", response.status)
|
||||
return -1
|
||||
return response.content_length // self.headers.header_size
|
||||
|
||||
async def should_download_headers_from_s3(self):
|
||||
async def should_download_headers_from_s3(self) -> bool:
|
||||
if self.conf.blockchain_name != "lbrycrd_main":
|
||||
return False
|
||||
self._check_header_file_integrity()
|
||||
s3_headers_depth = self.conf.s3_headers_depth
|
||||
if not s3_headers_depth:
|
||||
return False
|
||||
local_height = self.local_header_file_height()
|
||||
remote_height = await self.get_remote_height()
|
||||
log.info("remote height: %i, local height: %i", remote_height, local_height)
|
||||
if remote_height > (local_height + s3_headers_depth):
|
||||
return True
|
||||
|
||||
local_height = self.local_header_file_size() // self.headers.header_size
|
||||
remote_height = await self.get_downloadable_header_height()
|
||||
if remote_height is not None:
|
||||
log.info("remote height: %i, local height: %i", remote_height, local_height)
|
||||
if remote_height > (local_height + s3_headers_depth):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _check_header_file_integrity(self):
|
||||
# TODO: temporary workaround for usability. move to txlbryum and check headers instead of file integrity
|
||||
if self.conf.blockchain_name != "lbrycrd_main":
|
||||
return
|
||||
hashsum = sha256()
|
||||
checksum_height, checksum = HEADERS_FILE_SHA256_CHECKSUM
|
||||
checksum_length_in_bytes = checksum_height * HEADER_SIZE
|
||||
if self.local_header_file_size() < checksum_length_in_bytes:
|
||||
return
|
||||
with open(self.headers_file, "rb") as headers_file:
|
||||
hashsum.update(headers_file.read(checksum_length_in_bytes))
|
||||
current_checksum = hashsum.hexdigest()
|
||||
if current_checksum != checksum:
|
||||
msg = f"Expected checksum {checksum}, got {current_checksum}"
|
||||
log.warning("Wallet file corrupted, checksum mismatch. " + msg)
|
||||
log.warning("Deleting header file so it can be downloaded again.")
|
||||
os.unlink(self.headers_file)
|
||||
elif (self.local_header_file_size() % HEADER_SIZE) != 0:
|
||||
log.warning("Header file is good up to checkpoint height, but incomplete. Truncating to checkpoint.")
|
||||
with open(self.headers_file, "rb+") as headers_file:
|
||||
headers_file.truncate(checksum_length_in_bytes)
|
||||
def verify_checkpoint(self):
|
||||
expected_hash, at_height = self.CHECKPOINT
|
||||
if self.local_header_file_size() // self.headers.header_size < at_height:
|
||||
return False
|
||||
hash = hashlib.sha256()
|
||||
chunk_size = self.headers.header_size * 1000
|
||||
with open(self.headers_file, 'rb') as header_file:
|
||||
data = header_file.read(chunk_size)
|
||||
while data and header_file.tell() <= at_height * self.headers.header_size:
|
||||
hash.update(data)
|
||||
data = header_file.read(chunk_size)
|
||||
return hash.hexdigest() == expected_hash
|
||||
|
||||
async def start(self):
|
||||
if not os.path.exists(self.headers_dir):
|
||||
@@ -224,15 +201,23 @@ class HeadersComponent(Component):
|
||||
if os.path.exists(self.old_file):
|
||||
log.warning("Moving old headers from %s to %s.", self.old_file, self.headers_file)
|
||||
os.rename(self.old_file, self.headers_file)
|
||||
self._downloading_headers = await self.should_download_headers_from_s3()
|
||||
if self._downloading_headers:
|
||||
try:
|
||||
await self.fetch_headers_from_s3()
|
||||
except Exception as err:
|
||||
log.error("failed to fetch headers from s3: %s", err)
|
||||
finally:
|
||||
self._downloading_headers = False
|
||||
|
||||
try:
|
||||
if await self.should_download_headers_from_s3():
|
||||
self.is_downloading_headers = True
|
||||
await self.fetch_headers_from_s3()
|
||||
except Exception as err:
|
||||
log.error("failed to fetch headers from s3: %s", err)
|
||||
finally:
|
||||
self.is_downloading_headers = False
|
||||
# fixme: workaround, this should happen before download but happens after because headers.connect fail
|
||||
if not self.verify_checkpoint():
|
||||
log.info("Checkpoint failed, verifying headers using slower method.")
|
||||
await self.headers.open()
|
||||
await self.headers.repair()
|
||||
await self.headers.close()
|
||||
else:
|
||||
log.info("Header checkpoint verified.")
|
||||
async def stop(self):
|
||||
pass
|
||||
|
||||
@@ -244,18 +229,25 @@ class WalletComponent(Component):
|
||||
def __init__(self, component_manager):
|
||||
super().__init__(component_manager)
|
||||
self.wallet_manager = None
|
||||
self._started = False
|
||||
|
||||
@property
|
||||
def component(self):
|
||||
return self.wallet_manager
|
||||
|
||||
async def get_status(self):
|
||||
if self.wallet_manager and self._started:
|
||||
if self.wallet_manager and self.wallet_manager.ledger.network.remote_height:
|
||||
local_height = self.wallet_manager.ledger.headers.height
|
||||
remote_height = await self.wallet_manager.ledger.network.get_server_height()
|
||||
remote_height = self.wallet_manager.ledger.network.remote_height
|
||||
best_hash = self.wallet_manager.get_best_blockhash()
|
||||
server = self.wallet_manager.ledger.network.client.server
|
||||
return {
|
||||
'connected_servers': [
|
||||
{
|
||||
'host': server[0],
|
||||
'port': server[1],
|
||||
'latency': 0 # TODO: use real latency
|
||||
}
|
||||
],
|
||||
'blocks': max(local_height, 0),
|
||||
'blocks_behind': max(remote_height - local_height, 0),
|
||||
'best_blockhash': best_hash,
|
||||
@@ -266,7 +258,6 @@ class WalletComponent(Component):
|
||||
async def start(self):
|
||||
log.info("Starting torba wallet")
|
||||
self.wallet_manager = await LbryWalletManager.from_lbrynet_config(self.conf)
|
||||
self._started = True
|
||||
await self.wallet_manager.start()
|
||||
|
||||
async def stop(self):
|
||||
@@ -318,8 +309,7 @@ class DHTComponent(Component):
|
||||
|
||||
def __init__(self, component_manager):
|
||||
super().__init__(component_manager)
|
||||
self.dht_node: Node = None
|
||||
self.upnp_component = None
|
||||
self.dht_node: typing.Optional[Node] = None
|
||||
self.external_udp_port = None
|
||||
self.external_peer_port = None
|
||||
|
||||
@@ -345,10 +335,10 @@ class DHTComponent(Component):
|
||||
|
||||
async def start(self):
|
||||
log.info("start the dht")
|
||||
self.upnp_component = self.component_manager.get_component(UPNP_COMPONENT)
|
||||
self.external_peer_port = self.upnp_component.upnp_redirects.get("TCP", self.conf.tcp_port)
|
||||
self.external_udp_port = self.upnp_component.upnp_redirects.get("UDP", self.conf.udp_port)
|
||||
external_ip = self.upnp_component.external_ip
|
||||
upnp_component = self.component_manager.get_component(UPNP_COMPONENT)
|
||||
self.external_peer_port = upnp_component.upnp_redirects.get("TCP", self.conf.tcp_port)
|
||||
self.external_udp_port = upnp_component.upnp_redirects.get("UDP", self.conf.udp_port)
|
||||
external_ip = upnp_component.external_ip
|
||||
if not external_ip:
|
||||
log.warning("UPnP component failed to get external ip")
|
||||
external_ip = await utils.get_external_ip()
|
||||
@@ -356,7 +346,7 @@ class DHTComponent(Component):
|
||||
log.warning("failed to get external ip")
|
||||
|
||||
self.dht_node = Node(
|
||||
asyncio.get_event_loop(),
|
||||
self.component_manager.loop,
|
||||
self.component_manager.peer_manager,
|
||||
node_id=self.get_node_id(),
|
||||
internal_udp_port=self.conf.udp_port,
|
||||
@@ -381,7 +371,7 @@ class HashAnnouncerComponent(Component):
|
||||
|
||||
def __init__(self, component_manager):
|
||||
super().__init__(component_manager)
|
||||
self.hash_announcer: BlobAnnouncer = None
|
||||
self.hash_announcer: typing.Optional[BlobAnnouncer] = None
|
||||
|
||||
@property
|
||||
def component(self) -> typing.Optional[BlobAnnouncer]:
|
||||
@@ -390,7 +380,7 @@ class HashAnnouncerComponent(Component):
|
||||
async def start(self):
|
||||
storage = self.component_manager.get_component(DATABASE_COMPONENT)
|
||||
dht_node = self.component_manager.get_component(DHT_COMPONENT)
|
||||
self.hash_announcer = BlobAnnouncer(asyncio.get_event_loop(), dht_node, storage)
|
||||
self.hash_announcer = BlobAnnouncer(self.component_manager.loop, dht_node, storage)
|
||||
self.hash_announcer.start(self.conf.concurrent_blob_announcers)
|
||||
log.info("Started blob announcer")
|
||||
|
||||
@@ -427,10 +417,8 @@ class StreamManagerComponent(Component):
|
||||
blob_manager = self.component_manager.get_component(BLOB_COMPONENT)
|
||||
storage = self.component_manager.get_component(DATABASE_COMPONENT)
|
||||
wallet = self.component_manager.get_component(WALLET_COMPONENT)
|
||||
try:
|
||||
node = self.component_manager.get_component(DHT_COMPONENT)
|
||||
except NameError:
|
||||
node = None
|
||||
node = self.component_manager.get_component(DHT_COMPONENT)\
|
||||
if self.component_manager.has_component(DHT_COMPONENT) else None
|
||||
log.info('Starting the file manager')
|
||||
loop = asyncio.get_event_loop()
|
||||
self.stream_manager = StreamManager(
|
||||
@@ -479,9 +467,9 @@ class UPnPComponent(Component):
|
||||
self._int_peer_port = self.conf.tcp_port
|
||||
self._int_dht_node_port = self.conf.udp_port
|
||||
self.use_upnp = self.conf.use_upnp
|
||||
self.upnp = None
|
||||
self.upnp: typing.Optional[UPnP] = None
|
||||
self.upnp_redirects = {}
|
||||
self.external_ip = None
|
||||
self.external_ip: typing.Optional[str] = None
|
||||
self._maintain_redirects_task = None
|
||||
|
||||
@property
|
||||
@@ -498,9 +486,11 @@ class UPnPComponent(Component):
|
||||
# setup the gateway if necessary
|
||||
if not self.upnp:
|
||||
try:
|
||||
self.upnp = await UPnP.discover()
|
||||
self.upnp = await UPnP.discover(loop=self.component_manager.loop)
|
||||
log.info("found upnp gateway: %s", self.upnp.gateway.manufacturer_string)
|
||||
except Exception as err:
|
||||
if isinstance(err, asyncio.CancelledError):
|
||||
raise
|
||||
log.warning("upnp discovery failed: %s", err)
|
||||
self.upnp = None
|
||||
|
||||
@@ -511,52 +501,59 @@ class UPnPComponent(Component):
|
||||
external_ip = await self.upnp.get_external_ip()
|
||||
if external_ip != "0.0.0.0" and not self.external_ip:
|
||||
log.info("got external ip from UPnP: %s", external_ip)
|
||||
except (asyncio.TimeoutError, UPnPError):
|
||||
except (asyncio.TimeoutError, UPnPError, NotImplementedError):
|
||||
pass
|
||||
|
||||
if external_ip == "0.0.0.0" or not external_ip:
|
||||
if external_ip == "0.0.0.0" or (external_ip and external_ip.startswith("192.")):
|
||||
log.warning("unable to get external ip from UPnP, checking lbry.com fallback")
|
||||
external_ip = await utils.get_external_ip()
|
||||
if self.external_ip and self.external_ip != external_ip:
|
||||
log.info("external ip changed from %s to %s", self.external_ip, external_ip)
|
||||
self.external_ip = external_ip
|
||||
assert self.external_ip is not None # TODO: handle going/starting offline
|
||||
if external_ip:
|
||||
self.external_ip = external_ip
|
||||
# assert self.external_ip is not None # TODO: handle going/starting offline
|
||||
|
||||
if not self.upnp_redirects and self.upnp: # setup missing redirects
|
||||
try:
|
||||
log.info("add UPnP port mappings")
|
||||
d = {}
|
||||
if PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components:
|
||||
d["TCP"] = self.upnp.get_next_mapping(self._int_peer_port, "TCP", "LBRY peer port")
|
||||
if DHT_COMPONENT not in self.component_manager.skip_components:
|
||||
d["UDP"] = self.upnp.get_next_mapping(self._int_dht_node_port, "UDP", "LBRY DHT port")
|
||||
upnp_redirects = await gather_dict(d)
|
||||
log.info("add UPnP port mappings")
|
||||
upnp_redirects = {}
|
||||
if PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components:
|
||||
try:
|
||||
upnp_redirects["TCP"] = await self.upnp.get_next_mapping(
|
||||
self._int_peer_port, "TCP", "LBRY peer port", self._int_peer_port
|
||||
)
|
||||
except (UPnPError, asyncio.TimeoutError, NotImplementedError):
|
||||
pass
|
||||
if DHT_COMPONENT not in self.component_manager.skip_components:
|
||||
try:
|
||||
upnp_redirects["UDP"] = await self.upnp.get_next_mapping(
|
||||
self._int_dht_node_port, "UDP", "LBRY DHT port", self._int_dht_node_port
|
||||
)
|
||||
except (UPnPError, asyncio.TimeoutError, NotImplementedError):
|
||||
pass
|
||||
if upnp_redirects:
|
||||
log.info("set up redirects: %s", upnp_redirects)
|
||||
self.upnp_redirects.update(upnp_redirects)
|
||||
except (asyncio.TimeoutError, UPnPError):
|
||||
self.upnp = None
|
||||
return
|
||||
elif self.upnp: # check existing redirects are still active
|
||||
found = set()
|
||||
mappings = await self.upnp.get_redirects()
|
||||
for mapping in mappings:
|
||||
proto = mapping['NewProtocol']
|
||||
if proto in self.upnp_redirects and mapping['NewExternalPort'] == self.upnp_redirects[proto]:
|
||||
if mapping['NewInternalClient'] == self.upnp.lan_address:
|
||||
proto = mapping.protocol
|
||||
if proto in self.upnp_redirects and mapping.external_port == self.upnp_redirects[proto]:
|
||||
if mapping.lan_address == self.upnp.lan_address:
|
||||
found.add(proto)
|
||||
if 'UDP' not in found and DHT_COMPONENT not in self.component_manager.skip_components:
|
||||
try:
|
||||
udp_port = await self.upnp.get_next_mapping(self._int_dht_node_port, "UDP", "LBRY DHT port")
|
||||
self.upnp_redirects['UDP'] = udp_port
|
||||
log.info("refreshed upnp redirect for dht port: %i", udp_port)
|
||||
except (asyncio.TimeoutError, UPnPError):
|
||||
except (asyncio.TimeoutError, UPnPError, NotImplementedError):
|
||||
del self.upnp_redirects['UDP']
|
||||
if 'TCP' not in found and PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components:
|
||||
try:
|
||||
tcp_port = await self.upnp.get_next_mapping(self._int_peer_port, "TCP", "LBRY peer port")
|
||||
self.upnp_redirects['TCP'] = tcp_port
|
||||
log.info("refreshed upnp redirect for peer port: %i", tcp_port)
|
||||
except (asyncio.TimeoutError, UPnPError):
|
||||
except (asyncio.TimeoutError, UPnPError, NotImplementedError):
|
||||
del self.upnp_redirects['TCP']
|
||||
if ('TCP' in self.upnp_redirects
|
||||
and PEER_PROTOCOL_SERVER_COMPONENT not in self.component_manager.skip_components) and (
|
||||
@@ -574,7 +571,7 @@ class UPnPComponent(Component):
|
||||
if self.upnp:
|
||||
if not self.upnp_redirects and not all([x in self.component_manager.skip_components for x in
|
||||
(DHT_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT)]):
|
||||
log.error("failed to setup upnp, debugging infomation: %s", self.upnp.zipped_debugging_info)
|
||||
log.error("failed to setup upnp")
|
||||
else:
|
||||
success = True
|
||||
if self.upnp_redirects:
|
||||
@@ -585,13 +582,16 @@ class UPnPComponent(Component):
|
||||
await self.component_manager.analytics_manager.send_upnp_setup_success_fail(
|
||||
success, await self.get_status()
|
||||
)
|
||||
self._maintain_redirects_task = asyncio.create_task(self._repeatedly_maintain_redirects(now=False))
|
||||
self._maintain_redirects_task = self.component_manager.loop.create_task(
|
||||
self._repeatedly_maintain_redirects(now=False)
|
||||
)
|
||||
|
||||
async def stop(self):
|
||||
if self.upnp_redirects:
|
||||
log.info("Removing upnp redirects: %s", self.upnp_redirects)
|
||||
await asyncio.wait([
|
||||
self.upnp.delete_port_mapping(port, protocol) for protocol, port in self.upnp_redirects.items()
|
||||
])
|
||||
], loop=self.component_manager.loop)
|
||||
if self._maintain_redirects_task and not self._maintain_redirects_task.done():
|
||||
self._maintain_redirects_task.cancel()
|
||||
|
||||
@@ -19,38 +19,38 @@ from google.protobuf.message import DecodeError
|
||||
from torba.client.wallet import Wallet
|
||||
from torba.client.baseaccount import SingleKey, HierarchicalDeterministic
|
||||
|
||||
from lbrynet import utils
|
||||
from lbrynet.conf import Config, Setting
|
||||
from lbrynet.blob.blob_file import is_valid_blobhash, BlobBuffer
|
||||
from lbrynet.blob_exchange.downloader import download_blob
|
||||
from lbrynet.error import DownloadSDTimeout, ComponentsNotStarted
|
||||
from lbrynet.error import NullFundsError, NegativeFundsError, ComponentStartConditionNotMet
|
||||
from lbrynet.extras import system_info
|
||||
from lbrynet.extras.daemon import analytics
|
||||
from lbrynet.extras.daemon.Components import WALLET_COMPONENT, DATABASE_COMPONENT, DHT_COMPONENT, BLOB_COMPONENT
|
||||
from lbrynet.extras.daemon.Components import STREAM_MANAGER_COMPONENT
|
||||
from lbrynet.extras.daemon.Components import EXCHANGE_RATE_MANAGER_COMPONENT, UPNP_COMPONENT
|
||||
from lbrynet.extras.daemon.ComponentManager import RequiredCondition
|
||||
from lbrynet.extras.daemon.ComponentManager import ComponentManager
|
||||
from lbrynet.extras.daemon.json_response_encoder import JSONResponseEncoder
|
||||
from lbrynet.extras.daemon.comment_client import jsonrpc_post, sign_comment
|
||||
from lbrynet.extras.daemon.undecorated import undecorated
|
||||
from lbrynet.wallet.transaction import Transaction, Output, Input
|
||||
from lbrynet.wallet.account import Account as LBCAccount
|
||||
from lbrynet.wallet.dewies import dewies_to_lbc, lbc_to_dewies
|
||||
from lbrynet.schema.claim import Claim
|
||||
from lbrynet.schema.url import URL
|
||||
from lbry import utils
|
||||
from lbry.conf import Config, Setting
|
||||
from lbry.blob.blob_file import is_valid_blobhash, BlobBuffer
|
||||
from lbry.blob_exchange.downloader import download_blob
|
||||
from lbry.error import DownloadSDTimeout, ComponentsNotStarted
|
||||
from lbry.error import NullFundsError, NegativeFundsError, ComponentStartConditionNotMet
|
||||
from lbry.extras import system_info
|
||||
from lbry.extras.daemon import analytics
|
||||
from lbry.extras.daemon.Components import WALLET_COMPONENT, DATABASE_COMPONENT, DHT_COMPONENT, BLOB_COMPONENT
|
||||
from lbry.extras.daemon.Components import STREAM_MANAGER_COMPONENT
|
||||
from lbry.extras.daemon.Components import EXCHANGE_RATE_MANAGER_COMPONENT, UPNP_COMPONENT
|
||||
from lbry.extras.daemon.ComponentManager import RequiredCondition
|
||||
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.wallet.transaction import Transaction, Output, Input
|
||||
from lbry.wallet.account import Account as LBCAccount
|
||||
from lbry.wallet.dewies import dewies_to_lbc, lbc_to_dewies
|
||||
from lbry.schema.claim import Claim
|
||||
from lbry.schema.url import URL
|
||||
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.blob.blob_manager import BlobManager
|
||||
from lbrynet.dht.node import Node
|
||||
from lbrynet.extras.daemon.Components import UPnPComponent
|
||||
from lbrynet.extras.daemon.exchange_rate_manager import ExchangeRateManager
|
||||
from lbrynet.extras.daemon.storage import SQLiteStorage
|
||||
from lbrynet.wallet.manager import LbryWalletManager
|
||||
from lbrynet.wallet.ledger import MainNetLedger
|
||||
from lbrynet.stream.stream_manager import StreamManager
|
||||
from lbry.blob.blob_manager import BlobManager
|
||||
from lbry.dht.node import Node
|
||||
from lbry.extras.daemon.Components import UPnPComponent
|
||||
from lbry.extras.daemon.exchange_rate_manager import ExchangeRateManager
|
||||
from lbry.extras.daemon.storage import SQLiteStorage
|
||||
from lbry.wallet.manager import LbryWalletManager
|
||||
from lbry.wallet.ledger import MainNetLedger
|
||||
from lbry.stream.stream_manager import StreamManager
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -272,7 +272,6 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
)
|
||||
self.component_startup_task = None
|
||||
self._connection_status: typing.Tuple[float, bool] = [self.component_manager.loop.time(), False]
|
||||
self.stop_event = asyncio.Event()
|
||||
|
||||
logging.getLogger('aiohttp.access').setLevel(logging.WARN)
|
||||
rpc_app = web.Application()
|
||||
@@ -414,17 +413,20 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
try:
|
||||
rpc_site = web.TCPSite(self.rpc_runner, self.conf.api_host, self.conf.api_port, shutdown_timeout=.5)
|
||||
await rpc_site.start()
|
||||
log.info('lbrynet API listening on TCP %s:%i', *rpc_site._server.sockets[0].getsockname()[:2])
|
||||
log.info('RPC server listening on TCP %s:%i', *rpc_site._server.sockets[0].getsockname()[:2])
|
||||
except OSError as e:
|
||||
log.error('RPC server failed to bind TCP %s:%i', self.conf.api_host, self.conf.api_port)
|
||||
await self.analytics_manager.send_server_startup_error(str(e))
|
||||
raise SystemExit()
|
||||
|
||||
try:
|
||||
streaming_site = web.TCPSite(self.streaming_runner, self.conf.streaming_host, self.conf.streaming_port,
|
||||
shutdown_timeout=.5)
|
||||
await streaming_site.start()
|
||||
log.info('lbrynet media server listening on TCP %s:%i',
|
||||
*streaming_site._server.sockets[0].getsockname()[:2])
|
||||
log.info('media server listening on TCP %s:%i', *streaming_site._server.sockets[0].getsockname()[:2])
|
||||
|
||||
except OSError as e:
|
||||
log.error('lbrynet API failed to bind TCP %s for listening. Daemon is already running or this port is '
|
||||
'already in use by another application.', self.conf.api)
|
||||
log.error('media server failed to bind TCP %s:%i', self.conf.streaming_host, self.conf.streaming_port)
|
||||
await self.analytics_manager.send_server_startup_error(str(e))
|
||||
raise SystemExit()
|
||||
|
||||
@@ -433,10 +435,11 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
except asyncio.CancelledError:
|
||||
log.info("shutting down before finished starting")
|
||||
await self.analytics_manager.send_server_startup_error("shutting down before finished starting")
|
||||
await self.stop()
|
||||
raise
|
||||
except Exception as e:
|
||||
await self.analytics_manager.send_server_startup_error(str(e))
|
||||
log.exception('Failed to start lbrynet-daemon')
|
||||
log.exception('Failed to start lbrynet')
|
||||
raise SystemExit()
|
||||
|
||||
await self.analytics_manager.send_server_startup_success()
|
||||
|
||||
@@ -512,6 +515,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
log.warning("http code during /stream range request: %s", err)
|
||||
raise err
|
||||
except asyncio.CancelledError:
|
||||
# if not excepted here, it would bubble up the error to the console. every time you closed
|
||||
# a running tab, you'd get this error in the console
|
||||
log.debug("/stream range request cancelled")
|
||||
except Exception:
|
||||
log.exception("error handling /stream range request")
|
||||
@@ -692,8 +697,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
Returns:
|
||||
(string) Shutdown message
|
||||
"""
|
||||
|
||||
def shutdown():
|
||||
raise web.GracefulExit()
|
||||
|
||||
log.info("Shutting down lbrynet daemon")
|
||||
self.stop_event.set()
|
||||
asyncio.get_event_loop().call_later(0, shutdown)
|
||||
return "Shutting down"
|
||||
|
||||
async def jsonrpc_status(self):
|
||||
@@ -738,6 +747,13 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
'best_blockhash': (str) block hash of most recent block,
|
||||
'is_encrypted': (bool),
|
||||
'is_locked': (bool),
|
||||
'connected_servers': (list) [
|
||||
{
|
||||
'host': (str) server hostname,
|
||||
'port': (int) server port,
|
||||
'latency': (int) milliseconds
|
||||
}
|
||||
],
|
||||
},
|
||||
'dht': {
|
||||
'node_id': (str) lbry dht node id - hex encoded,
|
||||
@@ -961,7 +977,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns:
|
||||
(dict) Dictionary of daemon settings
|
||||
See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings
|
||||
See ADJUSTABLE_SETTINGS in lbry/conf.py for full list of settings
|
||||
"""
|
||||
return self.conf.settings_dict
|
||||
|
||||
@@ -1018,25 +1034,27 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
return self.wallet_manager.get_detailed_accounts(**kwargs)
|
||||
|
||||
@requires("wallet")
|
||||
async def jsonrpc_account_balance(self, account_id=None, confirmations=0):
|
||||
async def jsonrpc_account_balance(self, account_id=None, confirmations=0, reserved_subtotals=False):
|
||||
"""
|
||||
Return the balance of an account
|
||||
|
||||
Usage:
|
||||
account_balance [<account_id>] [<address> | --address=<address>]
|
||||
[<confirmations> | --confirmations=<confirmations>] [--reserved_subtotals]
|
||||
|
||||
Options:
|
||||
--account_id=<account_id> : (str) If provided only the balance for this
|
||||
account will be given. Otherwise default account.
|
||||
--confirmations=<confirmations> : (int) Only include transactions with this many
|
||||
confirmed blocks.
|
||||
--reserved_subtotals : (bool) Include detailed reserved balances on
|
||||
claims, tips and supports.
|
||||
|
||||
Returns:
|
||||
(decimal) amount of lbry credits in wallet
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
dewies = await account.get_balance(confirmations=confirmations)
|
||||
return dewies_to_lbc(dewies)
|
||||
return await account.get_granular_balances(confirmations=confirmations, reserved_subtotals=reserved_subtotals)
|
||||
|
||||
@requires("wallet")
|
||||
async def jsonrpc_account_add(
|
||||
@@ -1444,7 +1462,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
(bool) true, if address is associated with current wallet
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
match = await self.ledger.db.get_address(address=address, account=account)
|
||||
match = await self.ledger.db.get_address(address=address, accounts=[account])
|
||||
if match is not None:
|
||||
return True
|
||||
return False
|
||||
@@ -1685,12 +1703,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
account.get_claims,
|
||||
account.get_claim_count,
|
||||
page, page_size
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
claims = account.get_claims
|
||||
claim_count = account.get_claim_count
|
||||
else:
|
||||
claims = self.ledger.get_claims
|
||||
claim_count = self.ledger.get_claim_count
|
||||
return maybe_paginate(claims, claim_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_claim_search(self, **kwargs):
|
||||
@@ -1703,8 +1723,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Usage:
|
||||
claim_search [<name> | --name=<name>] [--claim_id=<claim_id>] [--txid=<txid>] [--nout=<nout>]
|
||||
[--channel=<channel> | --channel_ids=<channel_ids>...]
|
||||
[--valid_channel_signatures] [--invalid_channel_signatures]
|
||||
[--channel=<channel> | --channel_ids=<channel_ids>... --not_channel_ids=<not_channel_ids>...]
|
||||
[--has_channel_signature] [--valid_channel_signature | --invalid_channel_signature]
|
||||
[--is_controlling] [--release_time=<release_time>] [--public_key_id=<public_key_id>]
|
||||
[--timestamp=<timestamp>] [--creation_timestamp=<creation_timestamp>]
|
||||
[--height=<height>] [--creation_height=<creation_height>]
|
||||
@@ -1714,6 +1734,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--trending_mixed=<trending_mixed>] [--trending_local=<trending_local>]
|
||||
[--trending_global=<trending_global]
|
||||
[--claim_type=<claim_type>] [--stream_types=<stream_types>...] [--media_types=<media_types>...]
|
||||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>]
|
||||
[--any_tags=<any_tags>...] [--all_tags=<all_tags>...] [--not_tags=<not_tags>...]
|
||||
[--any_languages=<any_languages>...] [--all_languages=<all_languages>...]
|
||||
[--not_languages=<not_languages>...]
|
||||
@@ -1731,14 +1752,22 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
see --channel_ids if you need to filter by
|
||||
multiple channels at the same time,
|
||||
includes claims with invalid signatures,
|
||||
use in conjunction with --valid_channel_signatures
|
||||
--channel_ids=<channel_ids> : (str) claims signed by any of these channels
|
||||
use in conjunction with --valid_channel_signature
|
||||
--channel_ids=<channel_ids> : (list) claims signed by any of these channels
|
||||
(arguments must be claim ids of the channels),
|
||||
includes claims with invalid signatures,
|
||||
use in conjunction with --valid_channel_signatures
|
||||
--valid_channel_signatures : (bool) only return claims with valid channel signatures
|
||||
--invalid_channel_signatures : (bool) only return claims with invalid channel signatures
|
||||
--is_controlling : (bool) only return winning claims of their respective name
|
||||
implies --has_channel_signature,
|
||||
use in conjunction with --valid_channel_signature
|
||||
--not_channel_ids=<not_channel_ids>: (list) exclude claims signed by any of these channels
|
||||
(arguments must be claim ids of the channels)
|
||||
--has_channel_signature : (bool) claims with a channel signature (valid or invalid)
|
||||
--valid_channel_signature : (bool) claims with a valid channel signature or no signature,
|
||||
use in conjunction with --has_channel_signature to
|
||||
only get claims with valid signatures
|
||||
--invalid_channel_signature : (bool) claims with invalid channel signature or no signature,
|
||||
use in conjunction with --has_channel_signature to
|
||||
only get claims with invalid signatures
|
||||
--is_controlling : (bool) winning claims of their respective name
|
||||
--public_key_id=<public_key_id> : (str) only return channels having this public key id, this is
|
||||
the same key as used in the wallet file to map
|
||||
channel certificate private keys: {'public_key_id': 'private key'}
|
||||
@@ -1784,6 +1813,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--claim_type=<claim_type> : (str) filter by 'channel', 'stream' or 'unknown'
|
||||
--stream_types=<stream_types> : (list) filter by 'video', 'image', 'document', etc
|
||||
--media_types=<media_types> : (list) filter by 'video/mp4', 'image/png', etc
|
||||
--fee_currency=<fee_currency> : (string) specify fee currency: LBC, BTC, USD
|
||||
--fee_amount=<fee_amount> : (decimal) content download fee (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
|
||||
@@ -1795,27 +1826,29 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--not_locations=<not_locations> : (list) find claims not containing any of these locations
|
||||
--page=<page> : (int) page to return during paginating
|
||||
--page_size=<page_size> : (int) number of items on page during pagination
|
||||
--order_by=<order_by> : (str) field to order by, default is descending order, to do an
|
||||
--order_by=<order_by> : (list) field to order by, default is descending order, to do an
|
||||
ascending order prepend ^ to the field name, eg. '^amount'
|
||||
available fields: 'name', 'height', 'release_time',
|
||||
'publish_time', 'amount', 'effective_amount',
|
||||
'support_amount', 'trending_group', 'trending_mixed',
|
||||
'trending_local', 'trending_global', 'activation_height'
|
||||
--no_totals : (bool) do not calculate the total number of pages and items in result set
|
||||
(significant performance boost)
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
if kwargs.pop('valid_channel_signatures', False):
|
||||
if kwargs.pop('valid_channel_signature', False):
|
||||
kwargs['signature_valid'] = 1
|
||||
if kwargs.pop('invalid_channel_signatures', False):
|
||||
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', 10)), 50)
|
||||
kwargs.update({'offset': page_size * (page_num-1), 'limit': page_size})
|
||||
txos, offset, total = await self.ledger.claim_search(**kwargs)
|
||||
return {
|
||||
"items": txos, "page": page_num, "page_size": page_size,
|
||||
"total_pages": int((total + (page_size-1)) / page_size),
|
||||
"total_items": total
|
||||
}
|
||||
result = {"items": txos, "page": page_num, "page_size": page_size}
|
||||
if not kwargs.pop('no_totals', False):
|
||||
result['total_pages'] = int((total + (page_size-1)) / page_size)
|
||||
result['total_items'] = total
|
||||
return result
|
||||
|
||||
CHANNEL_DOC = """
|
||||
Create, update, abandon and list your channel claims.
|
||||
@@ -1828,7 +1861,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||
async def jsonrpc_channel_create(
|
||||
self, name, bid, allow_duplicate_name=False, account_id=None, claim_address=None,
|
||||
preview=False, **kwargs):
|
||||
funding_account_ids=None, preview=False, blocking=False, **kwargs):
|
||||
"""
|
||||
Create a new channel by generating a channel private key and establishing an '@' prefixed claim.
|
||||
|
||||
@@ -1839,7 +1872,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--website_url=<website_url>] [--featured=<featured>...]
|
||||
[--tags=<tags>...] [--languages=<languages>...] [--locations=<locations>...]
|
||||
[--thumbnail_url=<thumbnail_url>] [--cover_url=<cover_url>]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--preview]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
[--preview] [--blocking]
|
||||
|
||||
Options:
|
||||
--name=<name> : (str) name of the channel prefixed with '@'
|
||||
@@ -1892,14 +1927,17 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
--thumbnail_url=<thumbnail_url>: (str) thumbnail url
|
||||
--cover_url=<cover_url> : (str) url of cover image
|
||||
--account_id=<account_id> : (str) id of the account to store channel
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--claim_address=<claim_address>: (str) address where the channel is sent to, if not specified
|
||||
it will be determined automatically from the account
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
funding_accounts = self.get_accounts_or_all(funding_account_ids)
|
||||
self.valid_channel_name_or_error(name)
|
||||
amount = self.get_dewies_or_error('bid', bid, positive_value=True)
|
||||
claim_address = await self.get_receiving_address(claim_address, account)
|
||||
@@ -1915,16 +1953,16 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
claim = Claim()
|
||||
claim.channel.update(**kwargs)
|
||||
tx = await Transaction.claim_create(
|
||||
name, claim, amount, claim_address, [account], account
|
||||
name, claim, amount, claim_address, funding_accounts, funding_accounts[0]
|
||||
)
|
||||
txo = tx.outputs[0]
|
||||
txo.generate_channel_private_key()
|
||||
|
||||
if not preview:
|
||||
await tx.sign([account])
|
||||
await account.ledger.broadcast(tx)
|
||||
await tx.sign(funding_accounts)
|
||||
account.add_channel_private_key(txo.private_key)
|
||||
self.default_wallet.save()
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||
tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||
)])
|
||||
@@ -1937,7 +1975,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||
async def jsonrpc_channel_update(
|
||||
self, claim_id, bid=None, account_id=None, claim_address=None,
|
||||
new_signing_key=False, preview=False, replace=False, **kwargs):
|
||||
funding_account_ids=None, new_signing_key=False, preview=False,
|
||||
blocking=False, replace=False, **kwargs):
|
||||
"""
|
||||
Update an existing channel claim.
|
||||
|
||||
@@ -1951,7 +1990,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--locations=<locations>...] [--clear_locations]
|
||||
[--thumbnail_url=<thumbnail_url>] [--cover_url=<cover_url>]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--new_signing_key]
|
||||
[--preview] [--replace]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
[--preview] [--blocking] [--replace]
|
||||
|
||||
Options:
|
||||
--claim_id=<claim_id> : (str) claim_id of the channel to update
|
||||
@@ -2006,10 +2046,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--clear_locations : (bool) clear existing locations (prior to adding new ones)
|
||||
--thumbnail_url=<thumbnail_url>: (str) thumbnail url
|
||||
--cover_url=<cover_url> : (str) url of cover image
|
||||
--account_id=<account_id> : (str) id of the account to store channel
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--claim_address=<claim_address>: (str) address where the channel is sent
|
||||
--new_signing_key : (bool) generate a new signing key, will invalidate all previous publishes
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
--replace : (bool) instead of modifying specific values on
|
||||
the channel, this will clear all existing values
|
||||
and only save passed in values, useful for form
|
||||
@@ -2018,6 +2060,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
funding_accounts = self.get_accounts_or_all(funding_account_ids)
|
||||
|
||||
existing_channels = await account.get_claims(claim_id=claim_id)
|
||||
if len(existing_channels) != 1:
|
||||
@@ -2047,7 +2090,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
claim = Claim.from_bytes(old_txo.claim.to_bytes())
|
||||
claim.channel.update(**kwargs)
|
||||
tx = await Transaction.claim_update(
|
||||
old_txo, claim, amount, claim_address, [account], account
|
||||
old_txo, claim, amount, claim_address, funding_accounts, funding_accounts[0]
|
||||
)
|
||||
new_txo = tx.outputs[0]
|
||||
|
||||
@@ -2059,10 +2102,10 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
new_txo.script.generate()
|
||||
|
||||
if not preview:
|
||||
await tx.sign([account])
|
||||
await account.ledger.broadcast(tx)
|
||||
await tx.sign(funding_accounts)
|
||||
account.add_channel_private_key(new_txo.private_key)
|
||||
self.default_wallet.save()
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
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)
|
||||
)])
|
||||
@@ -2112,10 +2155,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
)
|
||||
|
||||
if not preview:
|
||||
await account.ledger.broadcast(tx)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
if blocking:
|
||||
await account.ledger.wait(tx)
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -2137,12 +2178,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
account.get_channels,
|
||||
account.get_channel_count,
|
||||
page, page_size
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
channels = account.get_channels
|
||||
channel_count = account.get_channel_count
|
||||
else:
|
||||
channels = self.ledger.get_channels
|
||||
channel_count = self.ledger.get_channel_count
|
||||
return maybe_paginate(channels, channel_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_channel_export(self, channel_id=None, channel_name=None, account_id=None):
|
||||
@@ -2228,7 +2271,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>]
|
||||
[--channel_id=<channel_id> | --channel_name=<channel_name>]
|
||||
[--channel_account_id=<channel_account_id>...]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--preview]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
[--preview] [--blocking]
|
||||
|
||||
Options:
|
||||
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
|
||||
@@ -2295,10 +2340,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--channel_name=<channel_name> : (str) name of publisher channel
|
||||
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
--account_id=<account_id> : (str) account to use for funding the transaction
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--claim_address=<claim_address>: (str) address where the claim is sent to, if not specified
|
||||
it will be determined automatically from the account
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
@@ -2325,7 +2372,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
async def jsonrpc_stream_create(
|
||||
self, name, bid, file_path, allow_duplicate_name=False,
|
||||
channel_id=None, channel_name=None, channel_account_id=None,
|
||||
account_id=None, claim_address=None, preview=False, **kwargs):
|
||||
account_id=None, claim_address=None, funding_account_ids=None,
|
||||
preview=False, blocking=False, **kwargs):
|
||||
"""
|
||||
Make a new stream claim and announce the associated file to lbrynet.
|
||||
|
||||
@@ -2339,7 +2387,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>]
|
||||
[--channel_id=<channel_id> | --channel_name=<channel_name>]
|
||||
[--channel_account_id=<channel_account_id>...]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--preview]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
[--preview] [--blocking]
|
||||
|
||||
Options:
|
||||
--name=<name> : (str) name of the content (can only consist of a-z A-Z 0-9 and -(dash))
|
||||
@@ -2408,15 +2458,18 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--channel_name=<channel_name> : (str) name of the publisher channel
|
||||
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
--account_id=<account_id> : (str) account to use for funding the transaction
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--claim_address=<claim_address>: (str) address where the claim is sent to, if not specified
|
||||
it will be determined automatically from the account
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
self.valid_stream_name_or_error(name)
|
||||
account = self.get_account_or_default(account_id)
|
||||
funding_accounts = self.get_accounts_or_all(funding_account_ids)
|
||||
channel = await self.get_channel_or_none(channel_account_id, channel_id, channel_name, for_signing=True)
|
||||
amount = self.get_dewies_or_error('bid', bid, positive_value=True)
|
||||
claim_address = await self.get_receiving_address(claim_address, account)
|
||||
@@ -2433,7 +2486,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
claim = Claim()
|
||||
claim.stream.update(file_path=file_path, sd_hash='0'*96, **kwargs)
|
||||
tx = await Transaction.claim_create(
|
||||
name, claim, amount, claim_address, [account], account, channel
|
||||
name, claim, amount, claim_address, funding_accounts, funding_accounts[0], channel
|
||||
)
|
||||
new_txo = tx.outputs[0]
|
||||
|
||||
@@ -2445,10 +2498,10 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if channel:
|
||||
new_txo.sign(channel)
|
||||
await tx.sign([account])
|
||||
await tx.sign(funding_accounts)
|
||||
|
||||
if not preview:
|
||||
await account.ledger.broadcast(tx)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||
tx, new_txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||
)])
|
||||
@@ -2464,8 +2517,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
async def jsonrpc_stream_update(
|
||||
self, claim_id, bid=None, file_path=None,
|
||||
channel_id=None, channel_name=None, channel_account_id=None, clear_channel=False,
|
||||
account_id=None, claim_address=None,
|
||||
preview=False, replace=False, **kwargs):
|
||||
account_id=None, claim_address=None, funding_account_ids=None,
|
||||
preview=False, blocking=False, replace=False, **kwargs):
|
||||
"""
|
||||
Update an existing stream claim and if a new file is provided announce it to lbrynet.
|
||||
|
||||
@@ -2483,7 +2536,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--channel_id=<channel_id> | --channel_name=<channel_name> | --clear_channel]
|
||||
[--channel_account_id=<channel_account_id>...]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>]
|
||||
[--preview] [--replace]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
[--preview] [--blocking] [--replace]
|
||||
|
||||
Options:
|
||||
--claim_id=<claim_id> : (str) id of the stream claim to update
|
||||
@@ -2558,10 +2612,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
--clear_channel : (bool) remove channel signature
|
||||
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
--account_id=<account_id> : (str) account to use for funding the transaction
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--claim_address=<claim_address>: (str) address where the claim is sent to, if not specified
|
||||
it will be determined automatically from the account
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
--replace : (bool) instead of modifying specific values on
|
||||
the stream, this will clear all existing values
|
||||
and only save passed in values, useful for form
|
||||
@@ -2570,6 +2626,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
funding_accounts = self.get_accounts_or_all(funding_account_ids)
|
||||
|
||||
existing_claims = await account.get_claims(claim_id=claim_id)
|
||||
if len(existing_claims) != 1:
|
||||
@@ -2598,8 +2655,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
elif old_txo.claim.is_signed and not clear_channel and not replace:
|
||||
channel = old_txo.channel
|
||||
|
||||
if 'fee_address' in kwargs:
|
||||
self.valid_address_or_error(kwargs['fee_address'])
|
||||
fee_address = self.get_fee_address(kwargs, claim_address)
|
||||
if fee_address:
|
||||
kwargs['fee_address'] = fee_address
|
||||
|
||||
if replace:
|
||||
claim = Claim()
|
||||
@@ -2616,7 +2674,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
claim = Claim.from_bytes(old_txo.claim.to_bytes())
|
||||
claim.stream.update(file_path=file_path, **kwargs)
|
||||
tx = await Transaction.claim_update(
|
||||
old_txo, claim, amount, claim_address, [account], account, channel
|
||||
old_txo, claim, amount, claim_address, funding_accounts, funding_accounts[0], channel
|
||||
)
|
||||
new_txo = tx.outputs[0]
|
||||
|
||||
@@ -2636,10 +2694,10 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
if channel:
|
||||
new_txo.sign(channel)
|
||||
await tx.sign([account])
|
||||
await tx.sign(funding_accounts)
|
||||
|
||||
if not preview:
|
||||
await account.ledger.broadcast(tx)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
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)
|
||||
)])
|
||||
@@ -2654,7 +2712,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||
async def jsonrpc_stream_abandon(
|
||||
self, claim_id=None, txid=None, nout=None, account_id=None,
|
||||
preview=False, blocking=True):
|
||||
preview=False, blocking=False):
|
||||
"""
|
||||
Abandon one of my stream claims.
|
||||
|
||||
@@ -2691,10 +2749,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
)
|
||||
|
||||
if not preview:
|
||||
await account.ledger.broadcast(tx)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
if blocking:
|
||||
await account.ledger.wait(tx)
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
|
||||
@@ -2716,12 +2772,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
account.get_streams,
|
||||
account.get_stream_count,
|
||||
page, page_size
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
streams = account.get_streams
|
||||
stream_count = account.get_stream_count
|
||||
else:
|
||||
streams = self.ledger.get_streams
|
||||
stream_count = self.ledger.get_stream_count
|
||||
return maybe_paginate(streams, stream_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT, BLOB_COMPONENT,
|
||||
DHT_COMPONENT, DATABASE_COMPONENT,
|
||||
@@ -2747,37 +2805,43 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
"""
|
||||
|
||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||
async def jsonrpc_support_create(self, claim_id, amount, tip=False, account_id=None, preview=False):
|
||||
async def jsonrpc_support_create(
|
||||
self, claim_id, amount, tip=False, account_id=None, funding_account_ids=None,
|
||||
preview=False, blocking=False):
|
||||
"""
|
||||
Create a support or a tip for name claim.
|
||||
|
||||
Usage:
|
||||
support_create (<claim_id> | --claim_id=<claim_id>) (<amount> | --amount=<amount>)
|
||||
[--tip] [--account_id=<account_id>] [--preview]
|
||||
[--tip] [--account_id=<account_id>] [--preview] [--blocking]
|
||||
[--funding_account_ids=<funding_account_ids>...]
|
||||
|
||||
Options:
|
||||
--claim_id=<claim_id> : (str) claim_id of the claim to support
|
||||
--amount=<amount> : (decimal) amount of support
|
||||
--tip : (bool) send support to claim owner, default: false.
|
||||
--account_id=<account_id> : (str) id of the account to use
|
||||
--account_id=<account_id> : (str) account to use for holding the transaction
|
||||
--funding_account_ids=<funding_account_ids>: (list) ids of accounts to fund this transaction
|
||||
--preview : (bool) do not broadcast the transaction
|
||||
--blocking : (bool) wait until transaction is in mempool
|
||||
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
funding_accounts = self.get_accounts_or_all(funding_account_ids)
|
||||
amount = self.get_dewies_or_error("amount", amount)
|
||||
claim = await self.ledger.get_claim_by_claim_id(claim_id)
|
||||
claim_address = claim.get_address(self.ledger)
|
||||
if not tip:
|
||||
account = self.get_account_or_default(account_id)
|
||||
claim_address = await account.receiving.get_or_create_usable_address()
|
||||
|
||||
tx = await Transaction.support(
|
||||
claim.claim_name, claim_id, amount, claim_address, [account], account
|
||||
claim.claim_name, claim_id, amount, claim_address, funding_accounts, funding_accounts[0]
|
||||
)
|
||||
|
||||
if not preview:
|
||||
await tx.sign([account])
|
||||
await account.ledger.broadcast(tx)
|
||||
await tx.sign(funding_accounts)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.storage.save_supports({claim_id: [{
|
||||
'txid': tx.id,
|
||||
'nout': tx.position,
|
||||
@@ -2787,7 +2851,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
}]})
|
||||
await self.analytics_manager.send_claim_action('new_support')
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
return tx
|
||||
|
||||
@@ -2807,17 +2871,19 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
account.get_supports,
|
||||
account.get_support_count,
|
||||
page, page_size
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
supports = account.get_supports
|
||||
support_count = account.get_support_count
|
||||
else:
|
||||
supports = self.ledger.get_supports
|
||||
support_count = self.ledger.get_support_count
|
||||
return maybe_paginate(supports, support_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||
async def jsonrpc_support_abandon(
|
||||
self, claim_id=None, txid=None, nout=None, keep=None,
|
||||
account_id=None, preview=False, blocking=True):
|
||||
account_id=None, preview=False, blocking=False):
|
||||
"""
|
||||
Abandon supports, including tips, of a specific claim, optionally
|
||||
keeping some amount as supports.
|
||||
@@ -2837,12 +2903,18 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Transaction}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
funding_accounts = [account]
|
||||
get_supports = account.get_supports
|
||||
else:
|
||||
funding_accounts = self.ledger.accounts
|
||||
get_supports = self.ledger.get_supports
|
||||
|
||||
if txid is not None and nout is not None:
|
||||
supports = await account.get_supports(**{'txo.txid': txid, 'txo.position': nout})
|
||||
supports = await get_supports(**{'txo.txid': txid, 'txo.position': nout})
|
||||
elif claim_id is not None:
|
||||
supports = await account.get_supports(claim_id=claim_id)
|
||||
supports = await get_supports(claim_id=claim_id)
|
||||
else:
|
||||
raise Exception('Must specify claim_id, or txid and nout')
|
||||
|
||||
@@ -2863,16 +2935,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
]
|
||||
|
||||
tx = await Transaction.create(
|
||||
[Input.spend(txo) for txo in supports], outputs, [account], account
|
||||
[Input.spend(txo) for txo in supports], outputs, funding_accounts, funding_accounts[0]
|
||||
)
|
||||
|
||||
if not preview:
|
||||
await account.ledger.broadcast(tx)
|
||||
await self.broadcast_or_release(tx, blocking)
|
||||
await self.analytics_manager.send_claim_action('abandon')
|
||||
if blocking:
|
||||
await account.ledger.wait(tx)
|
||||
else:
|
||||
await account.ledger.release_tx(tx)
|
||||
await self.ledger.release_tx(tx)
|
||||
|
||||
return tx
|
||||
|
||||
@@ -2940,12 +3010,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
}
|
||||
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
self.wallet_manager.get_history,
|
||||
self.ledger.db.get_transaction_count,
|
||||
page, page_size, account=account
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
transactions = account.get_transaction_history
|
||||
transaction_count = account.get_transaction_history_count
|
||||
else:
|
||||
transactions = self.ledger.get_transaction_history
|
||||
transaction_count = self.ledger.get_transaction_history_count
|
||||
return maybe_paginate(transactions, transaction_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
def jsonrpc_transaction_show(self, txid):
|
||||
@@ -2982,12 +3054,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
|
||||
Returns: {Paginated[Output]}
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
return maybe_paginate(
|
||||
account.get_utxos,
|
||||
account.get_utxo_count,
|
||||
page, page_size
|
||||
)
|
||||
if account_id:
|
||||
account = self.get_account_or_error(account_id)
|
||||
utxos = account.get_utxos
|
||||
utxo_count = account.get_utxo_count
|
||||
else:
|
||||
utxos = self.ledger.get_utxos
|
||||
utxo_count = self.ledger.get_utxo_count
|
||||
return maybe_paginate(utxos, utxo_count, page, page_size)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
def jsonrpc_utxo_release(self, account_id=None):
|
||||
@@ -3095,9 +3169,10 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
else:
|
||||
search_bottom_out_limit = 4
|
||||
peers = []
|
||||
async for new_peers in self.dht_node.get_iterative_value_finder(unhexlify(blob_hash.encode()), max_results=1,
|
||||
bottom_out_limit=search_bottom_out_limit):
|
||||
peers.extend(new_peers)
|
||||
peer_q = asyncio.Queue(loop=self.component_manager.loop)
|
||||
await self.dht_node._value_producer(blob_hash, peer_q)
|
||||
while not peer_q.empty():
|
||||
peers.extend(peer_q.get_nowait())
|
||||
results = [
|
||||
{
|
||||
"node_id": hexlify(peer.node_id).decode(),
|
||||
@@ -3340,11 +3415,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
return result
|
||||
|
||||
COMMENT_DOC = """
|
||||
Create and list comments.
|
||||
View, create and abandon comments.
|
||||
"""
|
||||
|
||||
async def jsonrpc_comment_list(self, claim_id: str, parent_id: str = None,
|
||||
page=1, page_size=50, include_replies=True):
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_comment_list(self, claim_id, parent_id=None, page=1, page_size=50,
|
||||
include_replies=True, is_channel_signature_valid=False):
|
||||
"""
|
||||
List comments associated with a claim.
|
||||
|
||||
@@ -3352,17 +3428,17 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
comment_list (<claim_id> | --claim_id=<claim_id>)
|
||||
[(--page=<page> --page_size=<page_size>)]
|
||||
[--parent_id=<parent_id>] [--include_replies]
|
||||
[--is_channel_signature_valid]
|
||||
|
||||
Options:
|
||||
--claim_id=<claim_id> : (str) The claim on which the comment will be made on
|
||||
--include_replies : (bool) Flag to indicate whether or not you want the
|
||||
replies to be included with the response or not
|
||||
--parent_id=<parent_id> : (int)
|
||||
|
||||
--page=<page> : (int) The page you'd like to see in the comment list.
|
||||
The first page is 1, second page is 2, and so on.
|
||||
--page_size=<page_size> : (int) The amount of comments that you'd like to
|
||||
retrieve in one request
|
||||
--claim_id=<claim_id> : (str) The claim on which the comment will be made on
|
||||
--parent_id=<parent_id> : (str) CommentId of a specific thread you'd like to see
|
||||
--page=<page> : (int) The page you'd like to see in the comment list.
|
||||
--page_size=<page_size> : (int) The amount of comments that you'd like to retrieve
|
||||
--include_replies : (bool) Whether or not you want to include replies in list
|
||||
--is_channel_signature_valid : (bool) Only include comments with valid signatures.
|
||||
[Warning: Paginated total size will not change, even
|
||||
if list reduces]
|
||||
|
||||
Returns:
|
||||
(dict) Containing the list, and information about the paginated content:
|
||||
@@ -3387,7 +3463,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
]
|
||||
}
|
||||
"""
|
||||
return await jsonrpc_post(
|
||||
result = await comment_client.jsonrpc_post(
|
||||
self.conf.comment_server,
|
||||
"get_claim_comments",
|
||||
claim_id=claim_id,
|
||||
@@ -3396,10 +3472,26 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
page_size=page_size,
|
||||
top_level=not include_replies
|
||||
)
|
||||
for comment in result.get('items', []):
|
||||
channel_url = comment.get('channel_url')
|
||||
if not channel_url:
|
||||
continue
|
||||
resolve_response = await self.resolve([channel_url])
|
||||
if isinstance(resolve_response[channel_url], Output):
|
||||
comment['is_channel_signature_valid'] = comment_client.is_comment_signed_by_channel(
|
||||
comment, resolve_response[channel_url]
|
||||
)
|
||||
else:
|
||||
comment['is_channel_signature_valid'] = False
|
||||
if is_channel_signature_valid:
|
||||
result['items'] = [
|
||||
c for c in result.get('items', []) if c.get('is_channel_signature_valid', False)
|
||||
]
|
||||
return result
|
||||
|
||||
async def jsonrpc_comment_create(
|
||||
self, claim_id: str, comment: str, parent_id: str = None,
|
||||
channel_account_id=None, channel_name: str = None, channel_id: str = None) -> dict:
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_comment_create(self, claim_id, comment, parent_id=None, channel_account_id=None,
|
||||
channel_name=None, channel_id=None):
|
||||
"""
|
||||
Create and associate a comment with a claim using your channel identity.
|
||||
|
||||
@@ -3411,13 +3503,13 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
[--channel_account_id=<channel_account_id>...]
|
||||
|
||||
Options:
|
||||
--comment=<comment> : (str) Comment to be made, should be at most 2000 characters.
|
||||
--claim_id=<claim_id> : (str) The ID of the claim on which the comment should be made on
|
||||
--parent_id=<parent_id> : (str) The ID of a comment to make a response to
|
||||
--channel_id=<channel_id> : (str) The ID of the channel you want to post under
|
||||
--channel_name=<channel_name>: (str) The channel you want to post as, prepend with a '@'
|
||||
--channel_account_id=<channel_account_id>: (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
--comment=<comment> : (str) Comment to be made, should be at most 2000 characters.
|
||||
--claim_id=<claim_id> : (str) The ID of the claim to comment on
|
||||
--parent_id=<parent_id> : (str) The ID of a comment to make a response to
|
||||
--channel_id=<channel_id> : (str) The ID of the channel you want to post under
|
||||
--channel_name=<channel_name> : (str) The channel you want to post as, prepend with a '@'
|
||||
--channel_account_id=<channel_account_id> : (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
|
||||
Returns:
|
||||
(dict) Comment object if successfully made, (None) otherwise
|
||||
@@ -3425,31 +3517,71 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||
"comment": (str) The actual string as inputted by the user,
|
||||
"comment_id": (str) The Comment's unique identifier,
|
||||
"channel_name": (str) Name of the channel this was posted under, prepended with a '@',
|
||||
"channel_id": (str) The Channel Claim ID that this comeent was posted under,
|
||||
"channel_id": (str) The Channel Claim ID that this comment was posted under,
|
||||
"signature": (str) The signature of the comment,
|
||||
"channel_url": (str) Channel's URI in the ClaimTrie,
|
||||
"parent_id": (str) Comment this is replying to, (None) if this is the root,
|
||||
"timestamp": (int) The time at which comment was entered into the server at, in nanoseconds.
|
||||
}
|
||||
"""
|
||||
comment = {
|
||||
comment_body = {
|
||||
'comment': comment,
|
||||
'claim_id': claim_id,
|
||||
'parent_id': parent_id,
|
||||
}
|
||||
channel = await self.get_channel_or_none(channel_account_id, channel_id, channel_name, for_signing=True)
|
||||
if channel:
|
||||
comment.update({
|
||||
comment_body.update({
|
||||
'channel_id': channel.claim_id,
|
||||
'channel_name': channel.claim_name,
|
||||
'signature': sign_comment(
|
||||
channel_name=channel_name,
|
||||
channel_id=channel_id,
|
||||
comment=comment,
|
||||
salt=time.time_ns()
|
||||
)
|
||||
})
|
||||
return await jsonrpc_post(self.conf.comment_server, 'create_comment', **comment)
|
||||
comment_client.sign_comment(comment_body, channel)
|
||||
response = await comment_client.jsonrpc_post(self.conf.comment_server, 'create_comment', comment_body)
|
||||
if 'signature' in response:
|
||||
response['is_claim_signature_valid'] = comment_client.is_comment_signed_by_channel(response, channel)
|
||||
return response
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
async def jsonrpc_comment_abandon(self, comment_id):
|
||||
"""
|
||||
Abandon a comment published under your channel identity.
|
||||
|
||||
Usage:
|
||||
comment_abandon (<comment_id> | --comment_id=<comment_id>)
|
||||
|
||||
Options:
|
||||
--comment_id=<comment_id> : (str) The ID of the comment to be deleted.
|
||||
|
||||
Returns:
|
||||
(dict) Object with the `comment_id` passed in as the key, and a flag indicating if it was deleted
|
||||
{
|
||||
<comment_id> (str): {
|
||||
"deleted": (bool)
|
||||
}
|
||||
}
|
||||
"""
|
||||
abandon_comment_body = {'comment_id': comment_id}
|
||||
channel = await comment_client.jsonrpc_post(
|
||||
self.conf.comment_server, 'get_channel_from_comment_id', comment_id=comment_id
|
||||
)
|
||||
if 'error' in channel:
|
||||
return {comment_id: {'deleted': False}}
|
||||
channel = await self.get_channel_or_none(None, **channel)
|
||||
abandon_comment_body.update({
|
||||
'channel_id': channel.claim_id,
|
||||
'channel_name': channel.claim_name,
|
||||
})
|
||||
comment_client.sign_comment(abandon_comment_body, channel, abandon=True)
|
||||
return await comment_client.jsonrpc_post(self.conf.comment_server, 'delete_comment', abandon_comment_body)
|
||||
|
||||
async def broadcast_or_release(self, tx, blocking=False):
|
||||
try:
|
||||
await self.ledger.broadcast(tx)
|
||||
if blocking:
|
||||
await self.ledger.wait(tx)
|
||||
except:
|
||||
await self.ledger.release_tx(tx)
|
||||
raise
|
||||
|
||||
def valid_address_or_error(self, address):
|
||||
try:
|
||||
@@ -0,0 +1 @@
|
||||
from lbry.extras.daemon import Components # register Component classes
|
||||
@@ -3,9 +3,9 @@ import collections
|
||||
import logging
|
||||
import aiohttp
|
||||
import typing
|
||||
from lbrynet import utils
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.extras import system_info
|
||||
from lbry import utils
|
||||
from lbry.conf import Config
|
||||
from lbry.extras import system_info
|
||||
|
||||
ANALYTICS_ENDPOINT = 'https://api.segment.io/v1'
|
||||
ANALYTICS_TOKEN = 'Ax5LZzR1o3q3Z3WjATASDwR5rKyHH0qOIRIbLmMXn2H='
|
||||
@@ -44,19 +44,22 @@ def _event_properties(installation_id: str, session_id: str,
|
||||
|
||||
def _download_properties(conf: Config, external_ip: str, resolve_duration: float,
|
||||
total_duration: typing.Optional[float], download_id: str, name: str,
|
||||
outpoint: str, active_peer_count: int, tried_peers_count: int,
|
||||
outpoint: str, active_peer_count: typing.Optional[int],
|
||||
tried_peers_count: typing.Optional[int], connection_failures_count: typing.Optional[int],
|
||||
added_fixed_peers: bool, fixed_peer_delay: float, sd_hash: str,
|
||||
sd_download_duration: typing.Optional[float] = None,
|
||||
head_blob_hash: typing.Optional[str] = None,
|
||||
head_blob_length: typing.Optional[int] = None,
|
||||
head_blob_download_duration: typing.Optional[float] = None,
|
||||
error: typing.Optional[str] = None) -> typing.Dict:
|
||||
error: typing.Optional[str] = None, error_msg: typing.Optional[str] = None,
|
||||
wallet_server: typing.Optional[str] = None) -> typing.Dict:
|
||||
return {
|
||||
"external_ip": external_ip,
|
||||
"download_id": download_id,
|
||||
"total_duration": round(total_duration, 4),
|
||||
"resolve_duration": None if not resolve_duration else round(resolve_duration, 4),
|
||||
"error": error,
|
||||
"error_message": error_msg,
|
||||
'name': name,
|
||||
"outpoint": outpoint,
|
||||
|
||||
@@ -74,7 +77,10 @@ def _download_properties(conf: Config, external_ip: str, resolve_duration: float
|
||||
|
||||
"head_blob_hash": head_blob_hash,
|
||||
"head_blob_length": head_blob_length,
|
||||
"head_blob_duration": None if not head_blob_download_duration else round(head_blob_download_duration, 4)
|
||||
"head_blob_duration": None if not head_blob_download_duration else round(head_blob_download_duration, 4),
|
||||
|
||||
"connection_failures_count": connection_failures_count,
|
||||
"wallet_server": wallet_server
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +105,6 @@ def _make_context(platform):
|
||||
|
||||
|
||||
class AnalyticsManager:
|
||||
|
||||
def __init__(self, conf: Config, installation_id: str, session_id: str):
|
||||
self.conf = conf
|
||||
self.cookies = {}
|
||||
@@ -110,7 +115,7 @@ class AnalyticsManager:
|
||||
self.context = _make_context(system_info.get_platform())
|
||||
self.installation_id = installation_id
|
||||
self.session_id = session_id
|
||||
self.task: asyncio.Task = None
|
||||
self.task: typing.Optional[asyncio.Task] = None
|
||||
self.external_ip: typing.Optional[str] = None
|
||||
|
||||
@property
|
||||
@@ -172,18 +177,24 @@ class AnalyticsManager:
|
||||
|
||||
async def send_time_to_first_bytes(self, resolve_duration: typing.Optional[float],
|
||||
total_duration: typing.Optional[float], download_id: str,
|
||||
name: str, outpoint: str, found_peers_count: int,
|
||||
tried_peers_count: int, added_fixed_peers: bool,
|
||||
name: str, outpoint: typing.Optional[str],
|
||||
found_peers_count: typing.Optional[int],
|
||||
tried_peers_count: typing.Optional[int],
|
||||
connection_failures_count: typing.Optional[int],
|
||||
added_fixed_peers: bool,
|
||||
fixed_peers_delay: float, sd_hash: str,
|
||||
sd_download_duration: typing.Optional[float] = None,
|
||||
head_blob_hash: typing.Optional[str] = None,
|
||||
head_blob_length: typing.Optional[int] = None,
|
||||
head_blob_duration: typing.Optional[int] = None,
|
||||
error: typing.Optional[str] = None):
|
||||
error: typing.Optional[str] = None,
|
||||
error_msg: typing.Optional[str] = None,
|
||||
wallet_server: typing.Optional[str] = None):
|
||||
await self.track(self._event(TIME_TO_FIRST_BYTES, _download_properties(
|
||||
self.conf, self.external_ip, resolve_duration, total_duration, download_id, name, outpoint,
|
||||
found_peers_count, tried_peers_count, added_fixed_peers, fixed_peers_delay, sd_hash,
|
||||
sd_download_duration, head_blob_hash, head_blob_length, head_blob_duration, error
|
||||
found_peers_count, tried_peers_count, connection_failures_count, added_fixed_peers, fixed_peers_delay,
|
||||
sd_hash, sd_download_duration, head_blob_hash, head_blob_length, head_blob_duration, error, error_msg,
|
||||
wallet_server
|
||||
)))
|
||||
|
||||
async def send_download_finished(self, download_id, name, sd_hash):
|
||||
@@ -1,5 +1,5 @@
|
||||
from lbrynet.conf import Config
|
||||
from lbrynet.extras.cli import execute_command
|
||||
from lbry.conf import Config
|
||||
from lbry.extras.cli import execute_command
|
||||
|
||||
|
||||
def daemon_rpc(conf: Config, method: str, **kwargs):
|
||||
@@ -0,0 +1,67 @@
|
||||
import logging
|
||||
import time
|
||||
import hashlib
|
||||
import binascii
|
||||
|
||||
from lbry import utils
|
||||
import ecdsa
|
||||
from torba.client.hash import sha256
|
||||
from lbry.wallet.transaction import Output
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_encoded_signature(signature):
|
||||
signature = signature.encode() if type(signature) is str else signature
|
||||
r = int(signature[:int(len(signature) / 2)], 16)
|
||||
s = int(signature[int(len(signature) / 2):], 16)
|
||||
return ecdsa.util.sigencode_der(r, s, len(signature) * 4)
|
||||
|
||||
|
||||
def cid2hash(claim_id: str) -> bytes:
|
||||
return binascii.unhexlify(claim_id.encode())[::-1]
|
||||
|
||||
|
||||
def is_comment_signed_by_channel(comment: dict, channel: Output, abandon=False):
|
||||
if type(channel) is Output:
|
||||
try:
|
||||
signing_field = comment['comment_id'] if abandon else comment['comment']
|
||||
pieces = [
|
||||
comment['signing_ts'].encode(),
|
||||
cid2hash(comment['channel_id']),
|
||||
signing_field.encode()
|
||||
]
|
||||
return Output.is_signature_valid(
|
||||
get_encoded_signature(comment['signature']),
|
||||
sha256(b''.join(pieces)),
|
||||
channel.claim.channel.public_key_bytes
|
||||
)
|
||||
except KeyError:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def sign_comment(comment: dict, channel: Output, abandon=False):
|
||||
timestamp = str(int(time.time()))
|
||||
signing_field = comment['comment_id'] if abandon else comment['comment']
|
||||
pieces = [timestamp.encode(), channel.claim_hash, signing_field.encode()]
|
||||
digest = sha256(b''.join(pieces))
|
||||
signature = channel.private_key.sign_digest_deterministic(digest, hashfunc=hashlib.sha256)
|
||||
comment.update({
|
||||
'signature': binascii.hexlify(signature).decode(),
|
||||
'signing_ts': timestamp
|
||||
})
|
||||
|
||||
|
||||
async def jsonrpc_post(url: str, method: str, params: dict = None, **kwargs) -> any:
|
||||
params = params or {}
|
||||
params.update(kwargs)
|
||||
json_body = {'jsonrpc': '2.0', 'id': None, 'method': method, 'params': params}
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
async with utils.aiohttp_request('POST', url, json=json_body, headers=headers) as response:
|
||||
try:
|
||||
result = await response.json()
|
||||
return result['result'] if 'result' in result else result
|
||||
except Exception as cte:
|
||||
log.exception('Unable to decode response from server: %s', cte)
|
||||
return await response.text()
|
||||
@@ -4,8 +4,8 @@ import logging
|
||||
import json
|
||||
from decimal import Decimal
|
||||
|
||||
from lbrynet.error import InvalidExchangeRateResponse, CurrencyConversionError
|
||||
from lbrynet.utils import aiohttp_request
|
||||
from lbry.error import InvalidExchangeRateResponse, CurrencyConversionError
|
||||
from lbry.utils import aiohttp_request
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -6,11 +6,11 @@ from json import JSONEncoder
|
||||
|
||||
from google.protobuf.message import DecodeError
|
||||
|
||||
from lbrynet.schema.claim import Claim
|
||||
from lbrynet.wallet.ledger import MainNetLedger, Account
|
||||
from lbrynet.wallet.transaction import Transaction, Output
|
||||
from lbrynet.wallet.dewies import dewies_to_lbc
|
||||
from lbrynet.stream.managed_stream import ManagedStream
|
||||
from lbry.schema.claim import Claim
|
||||
from lbry.wallet.ledger import MainNetLedger, Account
|
||||
from lbry.wallet.transaction import Transaction, Output
|
||||
from lbry.wallet.dewies import dewies_to_lbc
|
||||
from lbry.stream.managed_stream import ManagedStream
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||