Compare commits
70
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb6b72b5b2 | ||
|
|
7dc4883bf6 | ||
|
|
ddf43a087c | ||
|
|
a3796248ee | ||
|
|
507f125727 | ||
|
|
7fecb9fcc1 | ||
|
|
f282093d24 | ||
|
|
c00f03cbef | ||
|
|
a0bc2572a8 | ||
|
|
3ea5e3d261 | ||
|
|
668e140978 | ||
|
|
433d05776e | ||
|
|
e024e7dab7 | ||
|
|
16d59fbf66 | ||
|
|
91431922f5 | ||
|
|
ae4e43b466 | ||
|
|
55d55ae0f8 | ||
|
|
0716a22357 | ||
|
|
991331d2c2 | ||
|
|
59246be540 | ||
|
|
cd1a2fc70a | ||
|
|
d7b71a0d1c | ||
|
|
a6905a4e96 | ||
|
|
b4e88a5396 | ||
|
|
cd4034fa64 | ||
|
|
92005ee346 | ||
|
|
99804e5697 | ||
|
|
5986a6a59a | ||
|
|
ecfdbecf2c | ||
|
|
2d91e2dd1b | ||
|
|
0bdc1cf733 | ||
|
|
dc118bdbf5 | ||
|
|
dc54ce1cf0 | ||
|
|
7797f1f42c | ||
|
|
f2833d4a8e | ||
|
|
7d67f6700f | ||
|
|
71d78c40d9 | ||
|
|
15a8675bef | ||
|
|
72aad4a523 | ||
|
|
6fb5915808 | ||
|
|
04bc129c8e | ||
|
|
b09820a315 | ||
|
|
32f64d704d | ||
|
|
0a51e2f652 | ||
|
|
b260fc0624 | ||
|
|
7b11a03e02 | ||
|
|
7963e5bdd4 | ||
|
|
6ad1f91862 | ||
|
|
167587081f | ||
|
|
47da88fe2a | ||
|
|
fed52c65da | ||
|
|
0ec0dea55d | ||
|
|
dac8511d1f | ||
|
|
362c14c83c | ||
|
|
053aad7833 | ||
|
|
026bb01b81 | ||
|
|
e020eb3c13 | ||
|
|
1be0995bbf | ||
|
|
d8b37ed0e6 | ||
|
|
1b56526711 | ||
|
|
707f616224 | ||
|
|
5277050c37 | ||
|
|
698222cf32 | ||
|
|
1c0888e0cf | ||
|
|
39ea483f08 | ||
|
|
6ae0984edf | ||
|
|
d5932ce67c | ||
|
|
777d9f0f83 | ||
|
|
b3ae6ca0d6 | ||
|
|
ebbcb02c87 |
No files matched your search
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
- [lbry/web-daemon](https://github.com/lbryio/web-daemon)
|
|
||||||
- [Node](https://nodejs.org) (version >= 10)
|
- [Node](https://nodejs.org) (version >= 10)
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
@@ -61,4 +60,4 @@ We take security seriously. Please contact [security@lbry.com](mailto:security@l
|
|||||||
[Our PGP key is here](https://keybase.io/lbry/key.asc) if you need it.
|
[Our PGP key is here](https://keybase.io/lbry/key.asc) if you need it.
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
The primary contact for this project is [Paul Anthony Webb](https://github.com/NetOperatorWibby) (paul+github@lbry.com).
|
The primary contact for this project is [Thomas Zarebczan](https://github.com/tzarebczan) (tom+github@lbry.com).
|
||||||
@@ -65,12 +65,12 @@ function syncWithApi(data) { // eslint-disable-line no-unused-vars
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(result => {
|
.then(result => {
|
||||||
switch(true) {
|
switch(true) {
|
||||||
case result.error === "this reward is limited to 1 per person":
|
case result.error === "This reward is limited to 1 per person":
|
||||||
document.querySelector("developer-program").innerHTML =
|
document.querySelector("developer-program").innerHTML =
|
||||||
"<p>You have already claimed this reward. This reward is limited to <strong>ONE</strong> per person. Your enthusiasm is appreciated.</p>";
|
"<p>You have already claimed this reward. This reward is limited to <strong>ONE</strong> per person. Your enthusiasm is appreciated.</p>";
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case result.error:
|
case Boolean(result.error):
|
||||||
document.querySelector("developer-program").innerHTML =
|
document.querySelector("developer-program").innerHTML =
|
||||||
`<p>${result.error}</p>`;
|
`<p>${result.error}</p>`;
|
||||||
return;
|
return;
|
||||||
@@ -85,7 +85,6 @@ function syncWithApi(data) { // eslint-disable-line no-unused-vars
|
|||||||
console.info(data); // eslint-disable-line no-console
|
console.info(data); // eslint-disable-line no-console
|
||||||
document.querySelector("developer-program").innerHTML =
|
document.querySelector("developer-program").innerHTML =
|
||||||
"<p><strong>No success or error was received so the LBRY API might be down.<br/>Please try again later.</strong></p>";
|
"<p><strong>No success or error was received so the LBRY API might be down.<br/>Please try again later.</strong></p>";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ const handleExamples = debounce(event => {
|
|||||||
|
|
||||||
switch(data.action) {
|
switch(data.action) {
|
||||||
case "choose claim":
|
case "choose claim":
|
||||||
fetchMetadata(exampleNumber, data.claimId);
|
fetchMetadata(exampleNumber, `${data.name}#${data.claimId}`);
|
||||||
|
|
||||||
if (document.querySelector(".playground-navigation__example:nth-child(3)").classList.contains("active"))
|
if (document.querySelector(".playground-navigation__example:nth-child(3)").classList.contains("active"))
|
||||||
document.getElementById("fetch-claim-uri").value = event.dataset.name + "#" + event.dataset.claimId;
|
document.getElementById("fetch-claim-uri").value = event.dataset.name + "#" + event.dataset.claimId;
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ export default () => `
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span><a href="https://github.com/lbryio/lbrycrd">lbrycrd</a></span>
|
<span><a href="https://github.com/lbryio/lbrycrd">lbrycrd</a></span>
|
||||||
<span><a href="https://github.com/lbryio/torba">torba</a></span>
|
<span><a href="https://github.com/lbryio/lbry-sdk">SDK</a></span>
|
||||||
<span><a href="https://github.com/lbryio/lbryumx">lbryumx</a></span>
|
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ export default pagePath => {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "/api/blockchain":
|
case "/api/blockchain":
|
||||||
githubUrl = "https://github.com/lbryio/lbrycrd/blob/add_api_docs_scripts/contrib/devtools/generated/api_v1.json";
|
githubUrl = "https://github.com/lbryio/lbrycrd/blob/master/contrib/devtools/generated/api_v1.json";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "/api/sdk":
|
case "/api/sdk":
|
||||||
githubUrl = "https://github.com/lbryio/lbry-sdk/blob/master/lbry/docs/api.json";
|
githubUrl = "https://github.com/lbryio/lbry-sdk/blob/master/docs/api.json";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const links = [
|
|||||||
// title: "Join Our Team"
|
// title: "Join Our Team"
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
href: "https://twitter.com/lbryio",
|
href: "https://twitter.com/LBRYcom",
|
||||||
image: "https://spee.ch/9c38db124b85736adbcca48cdf34877d2110bbcd/GeoShapes.png",
|
image: "https://spee.ch/9c38db124b85736adbcca48cdf34877d2110bbcd/GeoShapes.png",
|
||||||
title: "Twitter"
|
title: "Twitter"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ function navigation() {
|
|||||||
<li
|
<li
|
||||||
class="playground-navigation__example"
|
class="playground-navigation__example"
|
||||||
data-action="playground, example 3"
|
data-action="playground, example 3"
|
||||||
data-description="In the LBRY app, you can financially support your favorite creators by donating LBRY Coin (LBC). In this example, we are donating LBC in your stead."
|
data-description="In the LBRY app, you can financially support your favorite creators by donating LBRY Credits (LBC). In this example, we are donating LBC in your stead."
|
||||||
data-example="3"
|
data-example="3"
|
||||||
data-success="<strong>Kudos</strong> You've just supported a creator with LBC (or, LBRY credits) with our own stash of LBC (you'd use your own IRL). You're basically saying, 'thanks for this great content, please continue!' and that's awesome. You're awesome."
|
data-success="<strong>Kudos</strong> You've just supported a creator with LBC (LBRY Credits) with our own stash of LBC (you'd use your own IRL). You're basically saying, 'thanks for this great content, please continue!' and that's awesome. You're awesome."
|
||||||
>
|
>
|
||||||
<button type="button">Support</button>
|
<button type="button">Support</button>
|
||||||
<span>Support creators on LBRY with a tip, on us!</span>
|
<span>Support creators on LBRY with a tip, on us!</span>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
"/resources/schema": "/spec#metadata",
|
"/resources/schema": "/spec#metadata",
|
||||||
"/resources/signing-claim": "/resources/claim-signing",
|
"/resources/signing-claim": "/resources/claim-signing",
|
||||||
"/resources/uri": "/spec#urls",
|
"/resources/uri": "/spec#urls",
|
||||||
"/resources/video-lbryandroid": "https://spee.ch/e781060bc708247f07afebc02d5f75cfba8e2c4b/video-2018-10-15053403",
|
"/resources/video-lbryandroid": "https://odysee.com/video-2018-10-15053403:e",
|
||||||
"/resources/video-lbrycrd": "https://spee.ch/5803b66dca7707584b36fe6b644f278fc39d1adf/intro-to-LBRYcrd",
|
"/resources/video-lbrycrd": "https://odysee.com/intro-to-LBRYcrd:5",
|
||||||
"/resources/video-lbrydesktop": "https://spee.ch/7da73fc508ffc4ff8b2711e3c3950110430b0c5f/LBRYAppDesign",
|
"/resources/video-lbrydesktop": "https://odysee.com/LBRYAppDesign:7",
|
||||||
"/resources/video-lbrysdk": "https://spee.ch/967f99344308f1e90f0620d91b6c93e4dfb240e0/lbrynet-dev-setup",
|
"/resources/video-lbrysdk": "https://odysee.com/@lbrytech:1/lbrynet-dev-setup:9",
|
||||||
"/specification": "/spec",
|
"/specification": "/spec",
|
||||||
"/tour": "/playground",
|
"/tour": "/playground",
|
||||||
"/whitepaper": "/spec"
|
"/whitepaper": "/spec"
|
||||||
|
|||||||
Vendored
+1
-4
@@ -1,4 +1 @@
|
|||||||
<svg viewBox="0 0 245 240" xmlns="http://www.w3.org/2000/svg" fill="#222">
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>
|
||||||
<path d="M104.4, 103.9c-5.7, 0 -10.2, 5 -10.2, 11.1c0, 6.1 4.6, 11.1 10.2, 11.1c5.7, 0 10.2, -5 10.2, -11.1c0.1, -6.1 -4.5, -11.1 -10.2, -11.1Zm36.5, 0c-5.7, 0 -10.2, 5 -10.2, 11.1c0, 6.1 4.6, 11.1 10.2, 11.1c5.7, 0 10.2, -5 10.2, -11.1c0, -6.1 -4.5, -11.1 -10.2, -11.1Z"/>
|
|
||||||
<path d="M189.5, 20l-134, 0c-11.3, 0 -20.5, 9.2 -20.5, 20.6l0, 135.2c0, 11.4 9.2, 20.6 20.5, 20.6l113.4, 0l-5.3, -18.5l12.8, 11.9l12.1, 11.2l21.5, 19l0, -179.4c0, -11.4 -9.2, -20.6 -20.5, -20.6Zm-38.6, 130.6c0, 0 -3.6, -4.3 -6.6, -8.1c13.1, -3.7 18.1, -11.9 18.1, -11.9c-4.1, 2.7 -8, 4.6 -11.5, 5.9c-5, 2.1 -9.8, 3.5 -14.5, 4.3c-9.6, 1.8 -18.4, 1.3 -25.9, -0.1c-5.7, -1.1 -10.6, -2.7 -14.7, -4.3c-2.3, -0.9 -4.8, -2 -7.3, -3.4c-0.3, -0.2 -0.6, -0.3 -0.9, -0.5c-0.2, -0.1 -0.3, -0.2 -0.4, -0.3c-1.8, -1 -2.8, -1.7 -2.8, -1.7c0, 0 4.8, 8 17.5, 11.8c-3, 3.8 -6.7, 8.3 -6.7, 8.3c-22.1, -0.7 -30.5, -15.2 -30.5, -15.2c0, -32.2 14.4, -58.3 14.4, -58.3c14.4, -10.8 28.1, -10.5 28.1, -10.5l1, 1.2c-18, 5.2 -26.3, 13.1 -26.3, 13.1c0, 0 2.2, -1.2 5.9, -2.9c10.7, -4.7 19.2, -6 22.7, -6.3c0.6, -0.1 1.1, -0.2 1.7, -0.2c6.1, -0.8 13, -1 20.2, -0.2c9.5, 1.1 19.7, 3.9 30.1, 9.6c0, 0 -7.9, -7.5 -24.9, -12.7l1.4, -1.6c0, 0 13.7, -0.3 28.1, 10.5c0, 0 14.4, 26.1 14.4, 58.3c0, 0 -8.5, 14.5 -30.6, 15.2Z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Vendored
+1
-4
@@ -1,4 +1 @@
|
|||||||
<svg viewBox="0 0 245 240" xmlns="http://www.w3.org/2000/svg">
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Reddit</title><path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"/></svg>
|
||||||
<circle cx="122.5" cy="120" r="87.5" fill="#222"/>
|
|
||||||
<path d="M180.833, 120c0, -7.061 -5.731, -12.792 -12.792, -12.792c-3.48, 0 -6.55, 1.33 -8.801, 3.581c-8.699, -6.242 -20.775, -10.336 -34.079, -10.847l5.833, -27.325l18.933, 3.991c0.205, 4.81 4.196, 8.699 9.108, 8.699c5.015, 0 9.108, -4.094 9.108, -9.108c0, -5.015 -4.093, -9.108 -9.108, -9.108c-3.582, 0 -6.652, 2.046 -8.085, 5.117l-21.184, -4.503c-0.614, -0.103 -1.228, 0 -1.74, 0.307c-0.511, 0.307 -0.818, 0.818 -1.023, 1.432l-6.447, 30.498c-13.612, 0.409 -25.79, 4.4 -34.591, 10.847c-2.252, -2.149 -5.424, -3.581 -8.801, -3.581c-7.062, 0 -12.793, 5.731 -12.793, 12.792c0, 5.219 3.071, 9.62 7.573, 11.667c-0.204, 1.228 -0.307, 2.558 -0.307, 3.889c0, 19.649 22.822, 35.511 51.068, 35.511c28.245, 0 51.067, -15.862 51.067, -35.511c0, -1.331 -0.102, -2.559 -0.307, -3.787c4.196, -2.047 7.368, -6.55 7.368, -11.769Zm-87.5, 9.108c0, -5.014 4.094, -9.108 9.109, -9.108c5.014, 0 9.108, 4.094 9.108, 9.108c0, 5.015 -4.094, 9.108 -9.108, 9.108c-5.015, 0 -9.109, -4.093 -9.109, -9.108Zm50.863, 24.05c-6.243, 6.243 -18.114, 6.652 -21.594, 6.652c-3.479, 0 -15.453, -0.512 -21.593, -6.652c-0.921, -0.921 -0.921, -2.456 0, -3.377c0.921, -0.921 2.456, -0.921 3.377, 0c3.889, 3.889 12.281, 5.321 18.319, 5.321c6.038, 0 14.327, -1.432 18.318, -5.321c0.921, -0.921 2.457, -0.921 3.378, 0c0.716, 1.023 0.716, 2.456 -0.205, 3.377Zm-1.638, -14.942c-5.014, 0 -9.108, -4.093 -9.108, -9.108c0, -5.014 4.094, -9.108 9.108, -9.108c5.015, 0 9.109, 4.094 9.109, 9.108c0, 5.015 -4.094, 9.108 -9.109, 9.108Z" fill="#fcfcfc"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -13,6 +13,8 @@ import stringifyObject from "stringify-object";
|
|||||||
|
|
||||||
import messageSlack from "./slack";
|
import messageSlack from "./slack";
|
||||||
import publishMeme from "./publish-meme";
|
import publishMeme from "./publish-meme";
|
||||||
|
import lbrytvAPI from "~helper/lbrytv-sdk";
|
||||||
|
|
||||||
import randomString from "./random-string";
|
import randomString from "./random-string";
|
||||||
import { send } from "~socket";
|
import { send } from "~socket";
|
||||||
import uploadImage from "./upload-image";
|
import uploadImage from "./upload-image";
|
||||||
@@ -76,10 +78,10 @@ export default async(data, socket) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch(true) {
|
switch(resolveMethod) {
|
||||||
// T I P
|
// T I P
|
||||||
// E X A M P L E
|
// E X A M P L E
|
||||||
case resolveMethod === "support_create":
|
case "support_create":
|
||||||
if (!approvedContentIdsForTipping.includes(claimAddress)) {
|
if (!approvedContentIdsForTipping.includes(claimAddress)) {
|
||||||
return send(socket, {
|
return send(socket, {
|
||||||
example: data.example,
|
example: data.example,
|
||||||
@@ -103,7 +105,7 @@ export default async(data, socket) => {
|
|||||||
|
|
||||||
// P U B L I S H
|
// P U B L I S H
|
||||||
// E X A M P L E
|
// E X A M P L E
|
||||||
case resolveMethod === "publish":
|
case "publish":
|
||||||
apiRequestMethod = "PUT";
|
apiRequestMethod = "PUT";
|
||||||
|
|
||||||
// Required for publishing
|
// Required for publishing
|
||||||
@@ -194,10 +196,36 @@ export default async(data, socket) => {
|
|||||||
|
|
||||||
// R E S O L V E
|
// R E S O L V E
|
||||||
// E X A M P L E
|
// E X A M P L E
|
||||||
case resolveMethod === "resolve":
|
case "resolve":
|
||||||
apiRequestMethod = "GET";
|
apiRequestMethod = "GET";
|
||||||
body.uri = claimAddress;
|
body.uri = claimAddress;
|
||||||
|
try {
|
||||||
|
const resolveResponse = await lbrytvAPI.resolve([claimAddress]);
|
||||||
|
|
||||||
|
if (socket) {
|
||||||
|
const renderedCode = prism.highlight(
|
||||||
|
stringifyObject(resolveResponse, { indent: " ", singleQuotes: false }),
|
||||||
|
prism.languages.json,
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
|
||||||
|
return send(socket, {
|
||||||
|
example: data.example,
|
||||||
|
html: raw(`
|
||||||
|
<h3>Response</h3>
|
||||||
|
${explorerNotice}
|
||||||
|
<pre><code class="language-json">${renderedCode}</code></pre>
|
||||||
|
`),
|
||||||
|
message: "show result",
|
||||||
|
selector: `#example${data.example}-result`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch(error) {
|
||||||
|
messageSlack({
|
||||||
|
message: "```" + error + "```",
|
||||||
|
title: "DAEMON ERROR: resolve"
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
"use strict";
|
||||||
|
import messageSlack from "./slack";
|
||||||
|
const request = require("request");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const addSupport = function() {};
|
||||||
|
|
||||||
|
const publish = function() {};
|
||||||
|
|
||||||
|
const resolve = function(urls) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
const options = {
|
||||||
|
method: "POST",
|
||||||
|
url: "https://api.lbry.tv/api/v1/proxy",
|
||||||
|
headers:
|
||||||
|
{
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
method: "resolve",
|
||||||
|
params: { urls: urls }
|
||||||
|
},
|
||||||
|
json: true
|
||||||
|
};
|
||||||
|
|
||||||
|
request(options, function(error, response, daemonResponse) {
|
||||||
|
if (error) {
|
||||||
|
messageSlack({
|
||||||
|
message: "```" + error + "```",
|
||||||
|
title: "DAEMON ERROR: resolve"
|
||||||
|
});
|
||||||
|
return reject(new Error("DAEMON ERROR: resolve"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
||||||
|
messageSlack({
|
||||||
|
message: "```" + daemonResponse.error + "```",
|
||||||
|
title: "DAEMON ERROR: resolve"
|
||||||
|
});
|
||||||
|
return reject(new Error("DAEMON ERROR: resolve"));
|
||||||
|
} else
|
||||||
|
return resolve(daemonResponse.result);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTrending = function() {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
const options = {
|
||||||
|
method: "POST",
|
||||||
|
url: "https://api.lbry.tv/api/v1/proxy",
|
||||||
|
headers:
|
||||||
|
{
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body:
|
||||||
|
{
|
||||||
|
method: "claim_search",
|
||||||
|
params:
|
||||||
|
{
|
||||||
|
page_size: 20,
|
||||||
|
page: 1,
|
||||||
|
no_totals: true,
|
||||||
|
any_tags:
|
||||||
|
["art",
|
||||||
|
"automotive",
|
||||||
|
"blockchain",
|
||||||
|
"comedy",
|
||||||
|
"economics",
|
||||||
|
"education",
|
||||||
|
"gaming",
|
||||||
|
"music",
|
||||||
|
"news",
|
||||||
|
"science",
|
||||||
|
"sports",
|
||||||
|
"technology"],
|
||||||
|
channel_ids: [],
|
||||||
|
not_channel_ids: [],
|
||||||
|
not_tags: ["porn", "nsfw", "mature", "xxx"],
|
||||||
|
order_by: ["trending_group", "trending_mixed"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
json: true
|
||||||
|
};
|
||||||
|
|
||||||
|
request(options, function(error, response, daemonResponse) {
|
||||||
|
if (error) {
|
||||||
|
messageSlack({
|
||||||
|
message: "```" + error + "```",
|
||||||
|
title: "DAEMON ERROR: trending"
|
||||||
|
});
|
||||||
|
return reject(new Error("DAEMON ERROR: trending"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
||||||
|
messageSlack({
|
||||||
|
message: "```" + daemonResponse.error + "```",
|
||||||
|
title: "DAEMON ERROR: trending"
|
||||||
|
});
|
||||||
|
return reject(JSON.stringify(daemonResponse));
|
||||||
|
} else
|
||||||
|
return resolve(daemonResponse.result.items);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
addSupport,
|
||||||
|
publish,
|
||||||
|
resolve,
|
||||||
|
getTrending
|
||||||
|
};
|
||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
// P A C K A G E S
|
// P A C K A G E S
|
||||||
|
|
||||||
import color from "colorette";
|
import * as color from "colorette";
|
||||||
import compress from "fastify-compress";
|
import compress from "fastify-compress";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import fastify from "fastify";
|
import fastify from "fastify";
|
||||||
|
|||||||
+86
-106
@@ -11,6 +11,7 @@ import html from "choo/html";
|
|||||||
|
|
||||||
import apiPage from "~view/api";
|
import apiPage from "~view/api";
|
||||||
import fetchMetadata from "~helper/fetch-metadata";
|
import fetchMetadata from "~helper/fetch-metadata";
|
||||||
|
import lbrytvAPI from "~helper/lbrytv-sdk";
|
||||||
import { generateGitHubFeed } from "~helper/github";
|
import { generateGitHubFeed } from "~helper/github";
|
||||||
import messageSlack from "~helper/slack";
|
import messageSlack from "~helper/slack";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
@@ -117,67 +118,56 @@ export default async(socket, action) => {
|
|||||||
|
|
||||||
function generateContent(exampleNumber, displayTrendingContent) {
|
function generateContent(exampleNumber, displayTrendingContent) {
|
||||||
if (exampleNumber === 1) {
|
if (exampleNumber === 1) {
|
||||||
return getTrendingContent().then(response => {
|
return lbrytvAPI.getTrending()
|
||||||
if (!response || !response.success || response.success !== true || !response.data)
|
.then(response => {
|
||||||
return "";
|
const renderedContentCollection = [];
|
||||||
|
const urlsToResolve = [];
|
||||||
|
|
||||||
const rawContentCollection = [];
|
response.forEach(r => {
|
||||||
const renderedContentCollection = [];
|
urlsToResolve.push(r.canonical_url);
|
||||||
const trendingContentData = response.data;
|
|
||||||
|
|
||||||
for (const data of trendingContentData) {
|
|
||||||
rawContentCollection.push(fetchMetadata({
|
|
||||||
claim: data.url,
|
|
||||||
example: exampleNumber,
|
|
||||||
method: "resolve"
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
Promise.all(rawContentCollection)
|
|
||||||
.then(collection => {
|
|
||||||
for (const part of collection) {
|
|
||||||
if (part && part.value.tags && part.value.tags.includes("mature"))
|
|
||||||
continue;
|
|
||||||
if (part === undefined)
|
|
||||||
continue;
|
|
||||||
try {
|
|
||||||
renderedContentCollection.push(`
|
|
||||||
<section class="playground-content__trend">
|
|
||||||
<figure
|
|
||||||
class="media__thumb"
|
|
||||||
data-action="choose claim"
|
|
||||||
data-claim-id="${part.name}"
|
|
||||||
${part.value.thumbnail.url.length ? `style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})"` : ""}
|
|
||||||
></figure>
|
|
||||||
|
|
||||||
<div class="media__title">
|
|
||||||
${part.value.title}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="media__subtitle">
|
|
||||||
${part.signing_channel ? part.signing_channel.name : "Anon"}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
`);
|
|
||||||
} catch(err) {
|
|
||||||
console.error(err);
|
|
||||||
return; // TODO: Return nice error message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderedContentCollection.push(`
|
|
||||||
<script>
|
|
||||||
document.getElementById("playground-example-description").innerHTML = document.querySelector("[data-action='playground, example 1']").dataset.description
|
|
||||||
</script>
|
|
||||||
`);
|
|
||||||
|
|
||||||
displayTrendingContent(renderedContentCollection.join(""));
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error(error);
|
|
||||||
return null;
|
|
||||||
});
|
});
|
||||||
});
|
lbrytvAPI.resolve(urlsToResolve)
|
||||||
|
.then(resolveResponse => {
|
||||||
|
if (resolveResponse !== null) {
|
||||||
|
const responses = Object.values(resolveResponse);
|
||||||
|
|
||||||
|
for (const r in responses) {
|
||||||
|
const part = responses[r];
|
||||||
|
|
||||||
|
if (part.value && part.value.thumbnail.url) {
|
||||||
|
renderedContentCollection.push(`
|
||||||
|
<section class="playground-content__trend">
|
||||||
|
<figure
|
||||||
|
class="media__thumb"
|
||||||
|
data-action="choose claim"
|
||||||
|
data-claim-id="${part.claim_id}"
|
||||||
|
data-name=${part.name}
|
||||||
|
style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})">
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<div class="media__title">
|
||||||
|
${part.value.title || "Untitled"}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="media__subtitle">
|
||||||
|
${part.signing_channel ? part.signing_channel.name : "Anon"}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
renderedContentCollection.push(`
|
||||||
|
<script>
|
||||||
|
document.getElementById("playground-example-description").innerHTML = document.querySelector("[data-action='playground, example 1']").dataset.description
|
||||||
|
</script>
|
||||||
|
`);
|
||||||
|
displayTrendingContent(renderedContentCollection.join(""));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exampleNumber === 3) {
|
if (exampleNumber === 3) {
|
||||||
@@ -193,50 +183,49 @@ function generateContent(exampleNumber, displayTrendingContent) {
|
|||||||
"minecraft-in-real-life-iron-man#758dd6497cdfc401ae1f25984738d024d47b50af",
|
"minecraft-in-real-life-iron-man#758dd6497cdfc401ae1f25984738d024d47b50af",
|
||||||
"ethan-shows-kyle-warframe-skyvault#8a7401b88d5ed0376d98f16808194d4dcb05b284"
|
"ethan-shows-kyle-warframe-skyvault#8a7401b88d5ed0376d98f16808194d4dcb05b284"
|
||||||
];
|
];
|
||||||
|
|
||||||
const rawContentCollection = [];
|
|
||||||
const renderedContentCollection = [];
|
const renderedContentCollection = [];
|
||||||
|
|
||||||
for (const url of approvedUrls)
|
lbrytvAPI.resolve(approvedUrls)
|
||||||
rawContentCollection.push(fetchMetadata({ claim: url, method: "resolve", example: 1 }));
|
.then(resolveResponse => {
|
||||||
|
if (resolveResponse !== null) {
|
||||||
|
const responses = Object.values(resolveResponse);
|
||||||
|
|
||||||
return Promise.all(rawContentCollection).then(collection => {
|
for (const r in responses) {
|
||||||
for (const part of collection) {
|
const part = responses[r];
|
||||||
if (
|
|
||||||
part &&
|
|
||||||
part.value &&
|
|
||||||
part.value.thumbnail.url
|
|
||||||
) {
|
|
||||||
renderedContentCollection.push(`
|
|
||||||
<section class="playground-content__trend">
|
|
||||||
<figure
|
|
||||||
class="media__thumb"
|
|
||||||
data-action="choose claim"
|
|
||||||
data-claim-id="${part.claim_id}"
|
|
||||||
data-name=${part.name}
|
|
||||||
style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})">
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<div class="media__title">
|
if (part.value && part.value.thumbnail.url) {
|
||||||
${part.value.title}
|
renderedContentCollection.push(`
|
||||||
</div>
|
<section class="playground-content__trend">
|
||||||
|
<figure
|
||||||
|
class="media__thumb"
|
||||||
|
data-action="choose claim"
|
||||||
|
data-claim-id="${part.claim_id}"
|
||||||
|
data-name=${part.name}
|
||||||
|
style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})">
|
||||||
|
</figure>
|
||||||
|
|
||||||
<div class="media__subtitle">
|
<div class="media__title">
|
||||||
${part.signing_channel.name || "Anon"}
|
${part.value.title || "Untitled"}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
`);
|
<div class="media__subtitle">
|
||||||
|
${part.signing_channel ? part.signing_channel.name : "Anon"}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
renderedContentCollection.push(`
|
||||||
|
<script>
|
||||||
renderedContentCollection.push(`
|
document.getElementById("playground-example-description").innerHTML = document.querySelector("[data-action='playground, example 3']").dataset.description
|
||||||
<script>
|
</script>
|
||||||
document.getElementById("playground-example-description").innerHTML = document.querySelector("[data-action='playground, example 3']").dataset.description
|
`);
|
||||||
</script>
|
displayTrendingContent(renderedContentCollection.join(""));
|
||||||
`);
|
})
|
||||||
|
.catch(error => {
|
||||||
displayTrendingContent(renderedContentCollection.join(""));
|
console.error(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,15 +366,6 @@ function getGitHubUserToken(socket) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTrendingContent() {
|
|
||||||
try {
|
|
||||||
const response = await got("https://api.lbry.com/file/list_trending");
|
|
||||||
return JSON.parse(response.body); // eslint-disable-line padding-line-between-statements
|
|
||||||
} catch(error) {
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeImageSourceSecure(url) {
|
function makeImageSourceSecure(url) {
|
||||||
if (!url || !url.length)
|
if (!url || !url.length)
|
||||||
return url;
|
return url;
|
||||||
|
|||||||
+3
-15
@@ -17,12 +17,9 @@ import redirects from "~data/redirects.json";
|
|||||||
|
|
||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
const filePathBlockchain = "/contrib/devtools/generated/api_v1.json";
|
const filePathBlockchain = "/contrib/devtools/generated/api_v1.json";
|
||||||
const filePathSdk = "/lbry/docs/api.json";
|
const filePathSdk = "/docs/api.json";
|
||||||
const rawGitHubBase = "https://raw.githubusercontent.com/lbryio/";
|
const rawGitHubBase = "https://raw.githubusercontent.com/lbryio/";
|
||||||
|
|
||||||
if (!process.env.GITHUB_OAUTH_TOKEN) // No point in rendering this page
|
|
||||||
throw new Error("Missing GitHub token");
|
|
||||||
|
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
auth: `token ${process.env.GITHUB_OAUTH_TOKEN}`
|
auth: `token ${process.env.GITHUB_OAUTH_TOKEN}`
|
||||||
});
|
});
|
||||||
@@ -246,7 +243,7 @@ async function getTags(repositoryName) {
|
|||||||
repo: repositoryName
|
repo: repositoryName
|
||||||
});
|
});
|
||||||
|
|
||||||
const tags = [];
|
const tags = ["master"];
|
||||||
|
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// The versioning in our repos do not make sense so extra
|
// The versioning in our repos do not make sense so extra
|
||||||
@@ -257,16 +254,7 @@ async function getTags(repositoryName) {
|
|||||||
switch(true) {
|
switch(true) {
|
||||||
case repositoryName === "lbry-sdk":
|
case repositoryName === "lbry-sdk":
|
||||||
data.forEach(tag => {
|
data.forEach(tag => {
|
||||||
if (
|
if (tag.name >= "v0.52.0") tags.push(tag.name);
|
||||||
tag.name >= "v0.38.0" &&
|
|
||||||
tag.name !== "v0.38.0rc7" &&
|
|
||||||
tag.name !== "v0.38.0rc6" &&
|
|
||||||
tag.name !== "v0.38.0rc5" &&
|
|
||||||
tag.name !== "v0.38.0rc4" &&
|
|
||||||
tag.name !== "v0.38.0rc3" &&
|
|
||||||
tag.name !== "v0.38.0rc2" &&
|
|
||||||
tag.name !== "v0.38.0rc1"
|
|
||||||
) tags.push(tag.name);
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ export default () => html`
|
|||||||
<section class="community">
|
<section class="community">
|
||||||
<div class="inner-wrap">
|
<div class="inner-wrap">
|
||||||
<h3>Community</h3>
|
<h3>Community</h3>
|
||||||
<p>There's literally <a href="https://spee.ch/@lbrytech/dozens.mp4">12<sup>n</sup></a> of us.</p>
|
<p>There's literally <a href="https://lbry.tv/@lbrytech:1/dozens:e">12n</a> of us.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="//chat.lbry.com" title="LBRY on Discord">Chat</a></li>
|
<li><a href="//chat.lbry.com" title="LBRY on Discord">Chat</a></li>
|
||||||
|
|||||||
+4
-4
@@ -5,7 +5,7 @@ description: Learn how to build your own app via LBRY in this comprehensive guid
|
|||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Want to build something on top of LBRY? This is the place to get started. If this is your first introduction to LBRY, you should read the [Overview](/overview) first. If you would rather build with us, check out our [Contributing Guide](/contribute).
|
Want to build something on top of LBRY? This is the place to get started. If this is your first introduction to LBRY, you should read the [Overview](./overview.md) first. If you would rather build with us, check out our [Contributing Guide](./contribute.md).
|
||||||
|
|
||||||
There are exactly 1,000,006 app ideas that could work on the LBRY network, but it doesn't make sense for _everything_ to be built on it.
|
There are exactly 1,000,006 app ideas that could work on the LBRY network, but it doesn't make sense for _everything_ to be built on it.
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ Unfortunately, most users will want more functionality in an app than typing int
|
|||||||
|
|
||||||
You can build many types of apps. Your app doesn't have to use Electron, nor does it have to be targeted at consumers, use a UI, or even fetch digital content at all! In this section, we'll look into the different types of apps you could build, and the different components needed to build anything you want.
|
You can build many types of apps. Your app doesn't have to use Electron, nor does it have to be targeted at consumers, use a UI, or even fetch digital content at all! In this section, we'll look into the different types of apps you could build, and the different components needed to build anything you want.
|
||||||
|
|
||||||
Most applications will use the [LBRY SDK](#sdk) as a way of accessing and communicating with the LBRY network. A look at the [APIs](/api/sdk) provided by the SDK will help you understand what it can and can't do.
|
Most applications will use the [LBRY SDK](#sdk) as a way of accessing and communicating with the LBRY network. A look at the [APIs](https://lbry.tech/api/sdk) provided by the SDK will help you understand what it can and can't do.
|
||||||
|
|
||||||
Some applications do not need to access content available on the network (e.g. a wallet-only app, or a blockchain visualizer). These applications might use [lbrycrd](#lbrycrd), the full-node blockchain daemon, or [chainquery](#chainquery), which parses blockchain data into SQL.
|
Some applications do not need to access content available on the network (e.g. a wallet-only app, or a blockchain visualizer). These applications might use [lbrycrd](#lbrycrd), the full-node blockchain daemon, or [chainquery](#chainquery), which parses blockchain data into SQL.
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ Regardless of the type of desktop app, you'll want to follow the steps for [usin
|
|||||||
|
|
||||||
The [official LBRY desktop app](https://github.com/lbryio/lbry-desktop) is built with Electron. It is very easy to build with, and allows web developers to easily start creating "native" desktop applications. You can use a plain html document with a `<script>` tag, or build out a large web app. The official desktop app uses [React](https://reactjs.org/).
|
The [official LBRY desktop app](https://github.com/lbryio/lbry-desktop) is built with Electron. It is very easy to build with, and allows web developers to easily start creating "native" desktop applications. You can use a plain html document with a `<script>` tag, or build out a large web app. The official desktop app uses [React](https://reactjs.org/).
|
||||||
|
|
||||||
If you want to write an electron app, check out the [electron-starter project](https://github.com/lbryio/electron-starter) for a bare bones setup that is very similar to how [lbry-desktop](https://github.com/lbryio/lbry-desktop) is structured. It's also a simple way to explore the [SDK API](<(https://https://lbry.tech/api/sdk)>).
|
If you want to write an electron app, check out the [electron-starter project](https://github.com/lbryio/electron-starter) for a bare bones setup that is very similar to how [lbry-desktop](https://github.com/lbryio/lbry-desktop) is structured. It's also a simple way to explore the [SDK API](https://lbry.tech/api/sdk).
|
||||||
|
|
||||||
Check out [this video](https://spee.ch/6/lbry-electron-starter) for a brief overview and guide to get it running. If you just want the source code, go [here](https://github.com/lbryio/electron-starter). Or, if you really really want to see it in action _now_, just paste these commands into your terminal:
|
Check out [this video](https://spee.ch/6/lbry-electron-starter) for a brief overview and guide to get it running. If you just want the source code, go [here](https://github.com/lbryio/electron-starter). Or, if you really really want to see it in action _now_, just paste these commands into your terminal:
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ Once that is downloaded, there are two steps to get it integrated into your app.
|
|||||||
|
|
||||||
First, run `lbrynet start` in the directory you downloaded the SDK. This starts the API server and connects to the LBRY network.
|
First, run `lbrynet start` in the directory you downloaded the SDK. This starts the API server and connects to the LBRY network.
|
||||||
|
|
||||||
Then, use an API wrapper to talk to the SDK or write your own. There are a number of simple [api wrappers](https://lbry.tech/resources/api-wrappers) available in several different languages, created by LBRY community members! These allow you to easily send commands to the SDK in the language of your choice.
|
Then, use an API wrapper to talk to the SDK or write your own. There are a number of simple [API wrappers](https://lbry.tech/resources/api-wrappers) available in several different languages, created by LBRY community members! These allow you to easily send commands to the SDK in the language of your choice.
|
||||||
|
|
||||||
If a wrapper for the language you would like to use doesn't exist, it is still fairly easy to interact with. The SDK provides a JSON-RPC server at `localhost:5279` for interaction. You can call it via `cURL` or the HTTP functionality provided by the language you are using. You can look at an existing wrapper in another language for more detail.
|
If a wrapper for the language you would like to use doesn't exist, it is still fairly easy to interact with. The SDK provides a JSON-RPC server at `localhost:5279` for interaction. You can call it via `cURL` or the HTTP functionality provided by the language you are using. You can look at an existing wrapper in another language for more detail.
|
||||||
|
|
||||||
|
|||||||
+13
-11
@@ -22,25 +22,23 @@ If you want to contribute to LBRY, there's definitely something for you! The fir
|
|||||||
| Component | Language (Toolset) | What Is It | Intro Video
|
| Component | Language (Toolset) | What Is It | Intro Video
|
||||||
--- | --- | --- | ---
|
--- | --- | --- | ---
|
||||||
| [lbrycrd](https://github.com/lbryio/lbrycrd) | C++ | A full node for the LBRY blockchain, including a standalone wallet. Used by miners and some applications. Most consumer applications do not bundle [[lbrycrd]] directly, and instead bundle [[lbry-sdk]]. | [Video](/resources/video-lbrycrd)
|
| [lbrycrd](https://github.com/lbryio/lbrycrd) | C++ | A full node for the LBRY blockchain, including a standalone wallet. Used by miners and some applications. Most consumer applications do not bundle [[lbrycrd]] directly, and instead bundle [[lbry-sdk]]. | [Video](/resources/video-lbrycrd)
|
||||||
| [lbry-sdk](https://github.com/lbryio/lbry-sdk) | Python (asyncio) | A daemon that can be used directly or to develop other applications. Provides convenience [APIs](/api/sdk), bundles an SPV wallet ([[torba]]), and contains an implementation of the LBRY data network. | [Video](/resources/video-lbrysdk)
|
| [lbry-sdk](https://github.com/lbryio/lbry-sdk) | Python (asyncio) | A daemon that can be used directly or to develop other applications. Provides convenience [APIs](/api/sdk), bundles an SPV wallet client and server, and contains an implementation of the LBRY data network. | [Video](/resources/video-lbrysdk)
|
||||||
| [torba](https://github.com/lbryio/lbry-sdk) | Python | An [[SPV]] (Simple Payment Verification) wallet. Bundled with [[lbry-sdk]].
|
| [schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/schema) | Protobuf, Python | Defines the structure of the metadata stored in the LBRY blockchain. | |
|
||||||
| [wallet server](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/wallet/server) | Protobuf, Python | The wallet server used by [[torba]]. | |
|
|
||||||
| [schema](https://github.com/lbryio/lbry-sdk/tree/master/lbry/lbry/schema) | Protobuf, Python | Defines the structure of the metadata stored in the LBRY blockchain. | |
|
|
||||||
|
|
||||||
### Official Applications
|
### Official Applications
|
||||||
| Application | Language (Toolset) | What Is It | Intro Video
|
| Application | Language (Toolset) | What Is It | Intro Video
|
||||||
--- | --- | --- | ---
|
--- | --- | --- | ---
|
||||||
| [lbry-desktop](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactJS, Electron) | A graphical browser for the LBRY network for Windows, macOS, and Linux. [[lbry-desktop]] is built with [[lbry-sdk]]. | [Video](/resources/video-lbrydesktop)
|
| [lbry-desktop](https://github.com/lbryio/lbry-desktop) (and lbry.tv) | JavaScript (ReactJS, Electron) | A desktop browser for the LBRY network for Windows, macOS, and Linux as well as a web interface on lbry.tv. [[lbry-desktop]] is built with [[lbry-sdk]]. | [Video](/resources/video-lbrydesktop)
|
||||||
| [lbry-android](https://github.com/lbryio/lbry-android) | JavaScript (ReactNative), Python (kivy) | A graphical browser for the LBRY network for Android. [[lbry-android]] is built with [[lbry-sdk]]. | [Video](/resources/video-lbryandroid)
|
| [lbry-android](https://github.com/lbryio/lbry-android) | Java | A graphical browser for the LBRY network for Android. [[lbry-android]] uses [[lbry-sdk]] to interact with the network. | [Video](/resources/video-lbryandroid)
|
||||||
|
| [odysee-ios](https://github.com/lbryio/odysee-ios) | Swift | The Odysee IOS app. | |
|
||||||
| [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between [[lbry-desktop]] and [[lbry-android]]. | |
|
| [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between [[lbry-desktop]] and [[lbry-android]]. | |
|
||||||
| [spee.ch](https://github.com/lbryio/spee.ch) | JavaScript (Node, ReactJS, Express) | A web-based host for free LBRY content. Usable directly as a content link dump site or as a customized, standalone install. | |
|
| [lbrytv](https://github.com/lbryio/lbrytv) | Go | An API server for https://lbry.tv and https://odysee.com that reimplements some of the SDK APIs. | |
|
||||||
|
|
||||||
### Websites
|
### Websites
|
||||||
| Domain | Language (Toolset) | What Is It
|
| Domain | Language (Toolset) | What Is It
|
||||||
--- | --- | ---
|
--- | --- | ---
|
||||||
| [lbry.tech](https://github.com/lbryio/lbry.tech) | JavaScript (Node, Choo) | You're on it.
|
| [lbry.tech](https://github.com/lbryio/lbry.tech) | JavaScript (Node, Choo) | You're on it.
|
||||||
| [lbry.com](https://github.com/lbryio/lbry.com) | PHP (vanilla) | A website for LBRY end-users and creators.
|
| [lbry.com](https://github.com/lbryio/lbry.com) | PHP (vanilla) | A website for LBRY end-users and creators.
|
||||||
| [lbry.fund](https://github.com/lbryio/lbry.fund) | HTML | A website for receiving funding from LBRY, Inc.
|
|
||||||
|
|
||||||
### Auxiliary Services and Applications
|
### Auxiliary Services and Applications
|
||||||
| Domain | Language (Toolset) | What Is It
|
| Domain | Language (Toolset) | What Is It
|
||||||
@@ -78,6 +76,10 @@ Most written content, and especially all technical writing, is checked into sour
|
|||||||
1. Search for a quoted phrase of the content you want to change (or use the same technique to identify the folder to create a new document in).
|
1. Search for a quoted phrase of the content you want to change (or use the same technique to identify the folder to create a new document in).
|
||||||
1. Edit the content via the GitHub interface and submit it as a pull request.
|
1. Edit the content via the GitHub interface and submit it as a pull request.
|
||||||
|
|
||||||
|
### Translating
|
||||||
|
|
||||||
|
Translation work is primarily organized through the [LBRY Foundation](https://lbry.org). For the current instructions on participating, see [their article](http://wiki.lbry.org/Translations).
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
If you want to contribute without getting directly into the code, one of the best ways you can contribute is testing.
|
If you want to contribute without getting directly into the code, one of the best ways you can contribute is testing.
|
||||||
@@ -88,7 +90,7 @@ A number of our code bases ([[lbrycrd]], [[lbry-sdk]], all applications, more...
|
|||||||
|
|
||||||
- "Watch" the repo on GitHub. You will receive an email with release notes whenever a release candidate is out and you can [raise an issue](#raising-issues).
|
- "Watch" the repo on GitHub. You will receive an email with release notes whenever a release candidate is out and you can [raise an issue](#raising-issues).
|
||||||
- Join the #early-testing channel in our [chat](https://chat.lbry.com).
|
- Join the #early-testing channel in our [chat](https://chat.lbry.com).
|
||||||
- For the hardcore, run master from source and/or the latest builds from [build.lbry.com](http://build.lbry.com).
|
- For the hardcore, run master from source and/or the latest builds from [build.lbry.io](http://build.lbry.io).
|
||||||
|
|
||||||
Opening well-specified issues against release candidates or master builds is extremely useful in helping us create quality software.
|
Opening well-specified issues against release candidates or master builds is extremely useful in helping us create quality software.
|
||||||
|
|
||||||
@@ -105,7 +107,7 @@ If you're about to raise an issue because you've found a problem with LBRY, or y
|
|||||||
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
|
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
|
||||||
Guidelines for bug reports:
|
Guidelines for bug reports:
|
||||||
|
|
||||||
1. **Identify the correct repo**. See [ecosystem overview](#ecosystem-overview). While it's okay if you get this wrong, it's a big help to us if you get it right.
|
1. **Identify the correct repo**. See [repository overview](#repository-overview). While it's okay if you get this wrong, it's a big help to us if you get it right.
|
||||||
2. **Check if the issue exists**. Please do a quick search to see if the issue has been reported (or fixed), including closed tickets.
|
2. **Check if the issue exists**. Please do a quick search to see if the issue has been reported (or fixed), including closed tickets.
|
||||||
3. **Follow the instructions** - When you open an issue inside of GitHub, each repo contains a template for how to create a good bug report. Santa _loves_ people who follow it.
|
3. **Follow the instructions** - When you open an issue inside of GitHub, each repo contains a template for how to create a good bug report. Santa _loves_ people who follow it.
|
||||||
|
|
||||||
@@ -115,7 +117,7 @@ Well-specified bug reports save developers lots of time and are [appreciated](#a
|
|||||||
|
|
||||||
Feature requests are welcome. Before you submit one be sure to:
|
Feature requests are welcome. Before you submit one be sure to:
|
||||||
|
|
||||||
1. **Identify the correct repo**. See [ecosystem overview](#ecosystem-overview).
|
1. **Identify the correct repo**. See [repository overview](#repository-overview).
|
||||||
2. **Use the Github Issues search** and check the feature hasn't already been requested. Be sure to include closed tickets.
|
2. **Use the Github Issues search** and check the feature hasn't already been requested. Be sure to include closed tickets.
|
||||||
3. **Consider whether it's feasible** for us to tackle this feature in the next 6-12 months. The LBRY team is currently stretched thin just adding basic functionality. If this is a nice to have rather than a need, it is probably more clutter than helpful.
|
3. **Consider whether it's feasible** for us to tackle this feature in the next 6-12 months. The LBRY team is currently stretched thin just adding basic functionality. If this is a nice to have rather than a need, it is probably more clutter than helpful.
|
||||||
4. **Make a strong case** to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible. This means explaining the use case and why it is likely to be common.
|
4. **Make a strong case** to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible. This means explaining the use case and why it is likely to be common.
|
||||||
|
|||||||
@@ -2,12 +2,4 @@
|
|||||||
title: Developer Program
|
title: Developer Program
|
||||||
---
|
---
|
||||||
|
|
||||||
LBRY offers a complimentary 100 LBC to qualified engineers to facilitate exploration, development, and testing.
|
This has been disabled at the request of GitHub. We're exploring alternative mechanisms to validate that you are a developer.
|
||||||
|
|
||||||
To qualify you must:
|
|
||||||
|
|
||||||
- have a GitHub account that is at least 90 days old and
|
|
||||||
- have an active commit history
|
|
||||||
|
|
||||||
### Claim LBC
|
|
||||||
<DeveloperProgram/>
|
|
||||||
@@ -11,7 +11,7 @@ We encourage the submission of changes and additions to this glossary.
|
|||||||
|
|
||||||
### Blob
|
### Blob
|
||||||
|
|
||||||
The smallest unit of data in LBRY. Each blob is referenced by its [blob hash](#blob-hash), a SHA-384 hash of the blob contents. When files are uploaded to LBRY, they are split into blobs, which are then shared with other peers. See [Encoding](/spec#encoding) for more details.
|
The smallest unit of data in LBRY. Each blob is referenced by its [blob hash](#blob-hash), an SHA-384 hash of the blob contents. When files are uploaded to LBRY, they are split into blobs, which are then shared with other peers. See [Encoding](/spec#encoding) for more details.
|
||||||
|
|
||||||
### Blob Exchange Protocol
|
### Blob Exchange Protocol
|
||||||
|
|
||||||
@@ -39,11 +39,11 @@ The sequence number of a block in the blockchain. The first block is at height 0
|
|||||||
|
|
||||||
### Blockchain
|
### Blockchain
|
||||||
|
|
||||||
An open, distributed ledger that records transactions in a verifiable and change-resistant way. The LBRY blockchain serves as an index of the content available on the network, a payment system and record of purchases for priced content, and a source if cryptographic publisher identities.
|
An open, distributed ledger that records transactions in a verifiable and change-resistant way. The LBRY blockchain serves as an index of the content available on the network, a payment system and record of purchases for priced content, and a source of cryptographic publisher identities.
|
||||||
|
|
||||||
### Canonical URL
|
### Canonical URL
|
||||||
|
|
||||||
Similar to the [Short URL](#short-url) but for claims that are signed by channels, both the channel Short URL and claim Short URL are returned (i.e. lbry://@LBRY-Social#d/two#f. A canonical URL will change if the channel is updated, therefore its less permanent than a Short URL which is less permanent than the [Permanent URL](https://spec.lbry.com/#urls).
|
Similar to the [Short URL](#short-url), but will include the channel for but for claims that are signed by channels. The canonical URL is generally the recommend URL to use when linking LBRY URLs or displaying URLs to users. Note that it is rarely possible for the canonical URL to change to a shorter version when a competeting channel or claim is abandoned, but even if this happens, older canonical URLs will still work.
|
||||||
|
|
||||||
### Chainquery
|
### Chainquery
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ A change to the consensus rules such that a block that would have been considere
|
|||||||
|
|
||||||
### Hashrate
|
### Hashrate
|
||||||
|
|
||||||
A measure of mining hardware performance expressed in hashes per second (GH/s). Click [here](https://www.tokens24.com/cryptopedia/basics/bitcoin-hash-rate) for more details.
|
A measure of mining hardware performance expressed in hashes per second (H/s). Click [here](https://www.tokens24.com/cryptopedia/basics/bitcoin-hash-rate) for more details.
|
||||||
|
|
||||||
### LBC
|
### LBC
|
||||||
|
|
||||||
@@ -238,5 +238,5 @@ The fee paid to a miner for including a transaction in a block. Miners are incen
|
|||||||
|
|
||||||
### Wallet
|
### Wallet
|
||||||
|
|
||||||
An application or a service that stores private keys and generates and signs transactions. Wallets do not store LBRY credits themselves (those are recorded as transactions in the global blockchain). "Storing LBC" usually means storing the private keys that control the credits.
|
An application or a service that stores private keys and generates and signs transactions. Wallets do not store LBRY Credits themselves (those are recorded as transactions in the global blockchain). "Storing LBC" usually means storing the private keys that control the credits.
|
||||||
|
|
||||||
@@ -11,8 +11,6 @@ What if anyone in the world could publish digital content, anyone else in the wo
|
|||||||
|
|
||||||
That's a fancy sentence, so here's a plain one: we thought it'd be *damn **cool*** if there was a system that made it easy to discover and distribute as much of the world's information as possible but was owned and controlled by no one.
|
That's a fancy sentence, so here's a plain one: we thought it'd be *damn **cool*** if there was a system that made it easy to discover and distribute as much of the world's information as possible but was owned and controlled by no one.
|
||||||
|
|
||||||
If you agree with us, feel free to join our [Developer Program](/developer-program) and we'll set you up with 100 LBC to get started.
|
|
||||||
|
|
||||||
<sub>^1(#footnote-1)^ In the information theoretic sense, LBRY facilitates distribution of all data, whether it be a video or a spreadsheet.</sub>
|
<sub>^1(#footnote-1)^ In the information theoretic sense, LBRY facilitates distribution of all data, whether it be a video or a spreadsheet.</sub>
|
||||||
|
|
||||||
<sub>^2(#footnote-2)^ Accessible anywhere in the world on any internet-connected device.</sub>
|
<sub>^2(#footnote-2)^ Accessible anywhere in the world on any internet-connected device.</sub>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ While the blockchain is the innovation that makes LBRY _possible_, the [Data Net
|
|||||||
|
|
||||||
At this level:
|
At this level:
|
||||||
|
|
||||||
- [Metadata](/spec#metadata] stored in the blockchain is interpreted and validated.
|
- [Metadata](/spec#metadata) stored in the blockchain is interpreted and validated.
|
||||||
- [Data referenced by metadata](/spec#data) is accessed and distributed via a peer-to-peer network.
|
- [Data referenced by metadata](/spec#data) is accessed and distributed via a peer-to-peer network.
|
||||||
- [Identities](/spec#channels) are created, signed, and validated.
|
- [Identities](/spec#channels) are created, signed, and validated.
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ description: Find the LBRY specification, API documentation, our Contributor's g
|
|||||||
- [Claim Signing](/resources/claim-signing)
|
- [Claim Signing](/resources/claim-signing)
|
||||||
- [Regtest Setup](/resources/regtest-setup)
|
- [Regtest Setup](/resources/regtest-setup)
|
||||||
- [LBRY Android App Build Steps](/resources/android-build)
|
- [LBRY Android App Build Steps](/resources/android-build)
|
||||||
- [Lighthouse (search) API](https://lbryio.github.io/lighthouse)
|
- [Lighthouse (search) API](https://github.com/lbryio/lighthouse)
|
||||||
|
- [Run Your Own Wallet Server](/resources/wallet-server)
|
||||||
@@ -72,7 +72,7 @@ Reilly decodes and combines the claim address, the serialized claim value, and t
|
|||||||
005a001a41080110011a309b70337f51fe9a4481504059b4220ad4f87378d59ecc87bd924c3f0f23da9442b9f75ffc091b65deefe92477a86a31ea2209766964
|
005a001a41080110011a309b70337f51fe9a4481504059b4220ad4f87378d59ecc87bd924c3f0f23da9442b9f75ffc091b65deefe92477a86a31ea2209766964
|
||||||
656f2f6d70342996b9a087c18456402b57cba6085b2a8fcc136d
|
656f2f6d70342996b9a087c18456402b57cba6085b2a8fcc136d
|
||||||
|
|
||||||
Then he takes the sha256 of the combined string, giving:
|
Then he takes the SHA256 of the combined string, giving:
|
||||||
|
|
||||||
dea44974ace1893f304cae4073af06a7a6cbb209f97cf8ad5f322216f044304e
|
dea44974ace1893f304cae4073af06a7a6cbb209f97cf8ad5f322216f044304e
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ You can read more on it [here](https://en.wikipedia.org/wiki/Trie), but for unde
|
|||||||
Each block header holds an extra 256 bits value calculated out of the root node of the claim trie at that block height. It's called `nameclaimroot` and is influenced by all children nodes as we will see next. If a blockchain network peer disagrees that a claim name was accepted or who is the winner of each name, its `nameclaimroot` will differ and the block won't form the same chain as the ones that accepted the official rules. This is the same for the traditional Merkle root, which is the root of the [Merkle tree](https://bitcoin.org/en/glossary/merkle-tree), formed by transactions in a block.
|
Each block header holds an extra 256 bits value calculated out of the root node of the claim trie at that block height. It's called `nameclaimroot` and is influenced by all children nodes as we will see next. If a blockchain network peer disagrees that a claim name was accepted or who is the winner of each name, its `nameclaimroot` will differ and the block won't form the same chain as the ones that accepted the official rules. This is the same for the traditional Merkle root, which is the root of the [Merkle tree](https://bitcoin.org/en/glossary/merkle-tree), formed by transactions in a block.
|
||||||
|
|
||||||
## What's in a leaf?
|
## What's in a leaf?
|
||||||
The leaf currently holds the winner of that name. Its formed by the transaction hash, output number of the claim in that transaction and the height it was accepted.
|
The leaf currently holds the winner of that name. It's formed by the transaction hash, output number of the claim in that transaction and the height it was accepted.
|
||||||
|
|
||||||
### Generating the leaf hash
|
### Generating the leaf hash
|
||||||
So, let's suppose that the winner claim of `mindblown` name was made at transaction output `1` of the transaction hash `67ad533eb2676c9d36bfa100092af5358de747e08ef928c0c54a8b3891c2b76b` and included in the Trie at height `102`.
|
So, let's suppose that the winner claim of `mindblown` name was made at transaction output `1` of the transaction hash `67ad533eb2676c9d36bfa100092af5358de747e08ef928c0c54a8b3891c2b76b` and included in the Trie at height `102`.
|
||||||
1. The transaction hash is converted from [RPC byte order](https://bitcoin.org/en/glossary/rpc-byte-order) to [internal byte order](https://bitcoin.org/en/glossary/internal-byte-order).
|
1. The transaction hash is converted from [RPC byte order](https://bitcoin.org/en/glossary/rpc-byte-order) to [internal byte order](https://bitcoin.org/en/glossary/internal-byte-order).
|
||||||
2. The output number becomes a simple string.
|
2. The output number becomes a simple string.
|
||||||
3. The height becomes a big endian 64 bits value.
|
3. The height becomes a big endian 64 bits value.
|
||||||
4. The node hash is calculated as the double sha-256 hash of the double sha-256 hash of the internal byte order representation of the transaction hash concatenated with the double sha-256 hash of the output number representation concatenated with the double sha-256 hash of the height.
|
4. The node hash is calculated as the double SHA-256 hash of the double SHA-256 hash of the internal byte order representation of the transaction hash concatenated with the double SHA-256 hash of the output number representation concatenated with the double SHA-256 hash of the height.
|
||||||
|
|
||||||
This is better represented in the simple python script below:
|
This is better represented in the simple python script below:
|
||||||
```python
|
```python
|
||||||
@@ -54,8 +54,8 @@ print("leaf hash is {}".format(hexlify(hash_leaf(tx, nout, at_height)[::-1])))
|
|||||||
Let's start with a ClaimTrie holding a single claim.
|
Let's start with a ClaimTrie holding a single claim.
|
||||||
The claim is named `mindblown` and was included at block 102 with the same details as the last section. It's actually a real claim as [you can see in the block explorer](https://explorer.lbry.com/blocks/102). This block has the first claim ever, so the ClaimTrie was the simple case being explained in here.
|
The claim is named `mindblown` and was included at block 102 with the same details as the last section. It's actually a real claim as [you can see in the block explorer](https://explorer.lbry.com/blocks/102). This block has the first claim ever, so the ClaimTrie was the simple case being explained in here.
|
||||||
We start with the leaf hash:
|
We start with the leaf hash:
|
||||||
1. Hash the leaf hash using double sha-256.
|
1. Hash the leaf hash using double SHA-256.
|
||||||
2. For each character of the name (nodes of the trie), the hash of a node is the double sha-256 of the node's character concatenated with the children hash.
|
2. For each character of the name (nodes of the trie), the hash of a node is the double SHA-256 of the node's character concatenated with the children hash.
|
||||||
|
|
||||||
Continuing with the Python script from the last section, this is how to calculate the root of a claim trie holding a single name:
|
Continuing with the Python script from the last section, this is how to calculate the root of a claim trie holding a single name:
|
||||||
```python
|
```python
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ description: How does the LBRY blockchain achieve consensus? This resource page
|
|||||||
|
|
||||||
LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) as a [consensus mechanism](/spec#consensus), the same way that Bitcoin does.
|
LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) as a [consensus mechanism](/spec#consensus), the same way that Bitcoin does.
|
||||||
|
|
||||||
LBRY has differences in hash function, block targeting, and difficult adjustment.
|
LBRY has differences in hash function, block targeting, and difficulty adjustment.
|
||||||
|
|
||||||
### Hash Mechanism
|
### Hash Mechanism
|
||||||
|
|
||||||
@@ -18,4 +18,4 @@ proof = sha256(sha256(left + right)) # concatenate the two halves, and double-s
|
|||||||
|
|
||||||
### Block Targeting & Difficulty Adjustment
|
### Block Targeting & Difficulty Adjustment
|
||||||
|
|
||||||
The targeted time of each Lbry block is 2.5 mintues (150 seconds). More information and links to source code [here](https://lbry.tech/spec#consensus).
|
The targeted time of each LBRY block is 2.5 mintues (150 seconds). More information and links to source code [here](https://lbry.tech/spec#consensus).
|
||||||
@@ -3,7 +3,7 @@ title: SDK Settings
|
|||||||
description: The daemon provided by the LBRY SDK has many settings. This resource lists them all and what they mean. Ready, set, settings!
|
description: The daemon provided by the LBRY SDK has many settings. This resource lists them all and what they mean. Ready, set, settings!
|
||||||
---
|
---
|
||||||
|
|
||||||
This document outlines how to configure SDK daemon settings and what options are available. They can be found on the lbry GitHub repository in [conf.py](https://github.com/lbryio/lbry-sdk/blob/master/lbry/lbry/conf.py).
|
This document outlines how to configure SDK daemon settings and what options are available. They can be found on the lbry GitHub repository in [conf.py](https://github.com/lbryio/lbry-sdk/blob/master/lbry/conf.py).
|
||||||
|
|
||||||
## Daemon settings configuration
|
## Daemon settings configuration
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ The easiest way to configure the settings is by editing the `daemon_settings.yml
|
|||||||
Sample daemon_settings.yml file:
|
Sample daemon_settings.yml file:
|
||||||
```
|
```
|
||||||
tcp_port: 3335
|
tcp_port: 3335
|
||||||
lbryum_servers: ['lbryumx1.lbry.com:50001','lbryumx2.lbry.com:50001']
|
lbryum_servers: ['spv11.lbry.com:50001','spv19.lbry.com:50001']
|
||||||
download_directory: 'c:\lbry\Downloads'
|
download_directory: 'c:\lbry\Downloads'
|
||||||
use_upnp: false
|
use_upnp: false
|
||||||
```
|
```
|
||||||
@@ -33,7 +33,7 @@ Configuration options are organized by their respective areas: Files, Wallet, Ne
|
|||||||
| Setting | Format | Default value | Sample Values | Description |
|
| Setting | Format | Default value | Sample Values | Description |
|
||||||
|-------------------------------|---------|------------------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------|
|
|-------------------------------|---------|------------------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------|
|
||||||
| blockchain_name | string | 'lbrycrd_main' | 'lbrycrd_regtest' | Blockchain network to connect to |
|
| blockchain_name | string | 'lbrycrd_main' | 'lbrycrd_regtest' | Blockchain network to connect to |
|
||||||
| lbryum_servers | list | ['lbryumx1.lbry.com:50001','lbryumx2.lbry.com:50001'] | ["mylbryum.lbry.com:50001] | SPV wallet server address |
|
| lbryum_servers | list | ['spv11.lbry.com:50001','spv19.lbry.com:50001'] | ["mylbryum.lbry.com:50001] | SPV wallet server address(Default servers are spv11-spv19) |
|
||||||
| wallet_dir | string | [varies by OS](https://lbry.com/faq/lbry-directories) | 'c:\lbry\lbryum\' | Wallet data location |
|
| wallet_dir | string | [varies by OS](https://lbry.com/faq/lbry-directories) | 'c:\lbry\lbryum\' | Wallet data location |
|
||||||
| max_key_fee | json | {'currency': 'USD', 'amount': 50.0} | {'currency': 'LBC', 'amount': 5.0} | Max payment allowed for content |
|
| max_key_fee | json | {'currency': 'USD', 'amount': 50.0} | {'currency': 'LBC', 'amount': 5.0} | Max payment allowed for content |
|
||||||
| wallet | string | 'lbryum' | 'lbrycrd' | Choice of wallet software, SPV (lbryum) vs full node (lbrycrd). Currently only lbryum supported |
|
| wallet | string | 'lbryum' | 'lbrycrd' | Choice of wallet software, SPV (lbryum) vs full node (lbrycrd). Currently only lbryum supported |
|
||||||
@@ -66,13 +66,6 @@ Configuration options are organized by their respective areas: Files, Wallet, Ne
|
|||||||
| streaming_get | boolean | false | true | Allow calling localhost:5280/get/claimname requests |
|
| streaming_get | boolean | false | true | Allow calling localhost:5280/get/claimname requests |
|
||||||
| save_files | boolean | true | false | Save files with each download |
|
| save_files | boolean | true | false | Save files with each download |
|
||||||
| save_blobs | boolean | true | false | Save blobs with each download |
|
| save_blobs | boolean | true | false | Save blobs with each download |
|
||||||
### Security
|
|
||||||
|
|
||||||
| Setting | Format | Default value | Sample Values | Description |
|
|
||||||
|----------------|---------|---------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| allowed_origin | string | '' | '*' or localhost | IP address to allow API requests from |
|
|
||||||
| use_auth_http | boolean | false | true | See [authentication instructions](https://github.com/lbryio/lbry-sdk/blob/master/lbrynet/daemon/auth/server.py#L179) for details |
|
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
| Setting | Format | Default value | Sample Values | Description |
|
| Setting | Format | Default value | Sample Values | Description |
|
||||||
|--------------------|---------|---------------|--------------------------------|---------------------------------------------------------------------------------------------------------------|
|
|--------------------|---------|---------------|--------------------------------|---------------------------------------------------------------------------------------------------------------|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ For this example, we will use claim ID `d9317ac7842f88ba442fee749c4f834353c24206
|
|||||||
|
|
||||||
## Parse the Metadata
|
## Parse the Metadata
|
||||||
|
|
||||||
Perform a `getclaimbyid` call to lbrycrd using the claim ID for the claim you want to look up. You should get a response with some parameters. The `value` parameter contains the claim contents as a protobuf-encoded binary string. Decode the value using the protobuf definitions in [lbryio/types](https://github.com/lbryio/types/tree/master/proto). You will get a Claim object.
|
Perform a `getclaimbyid` call to lbrycrd using the claim ID for the claim you want to look up. You should get a response with some parameters. The `value` parameter contains the claim contents as a protobuf-encoded binary string. Decode the value using the protobuf definitions in [lbryio/types](https://github.com/lbryio/types/tree/master/v2/proto). You will get a Claim object.
|
||||||
|
|
||||||
|
|
||||||
## Get the Stream Hash
|
## Get the Stream Hash
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ For this example, we will use claimID `d9317ac7842f88ba442fee749c4f834353c24206`
|
|||||||
|
|
||||||
## Parse the Metadata
|
## Parse the Metadata
|
||||||
|
|
||||||
Perform a `getclaimbyid` call to lbrycrd using the claimID for the claim you want to look up. You should get a response with some parameters. The `value` parameter contains the claim contents as a protobuf-encoded binary string. Decode the value using the protobuf definitions in [lbryio/types](https://github.com/lbryio/types/tree/master/proto). You will get a Claim object.
|
Perform a `getclaimbyid` call to lbrycrd using the claimID for the claim you want to look up. You should get a response with some parameters. The `value` parameter contains the claim contents as a protobuf-encoded binary string. Decode the value using the protobuf definitions in [lbryio/types](https://github.com/lbryio/types/tree/master/v2/proto). You will get a Claim object.
|
||||||
|
|
||||||
|
|
||||||
## Get the SD Hash
|
## Get the SD Hash
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ This document exists to introduce a project to a new visitor. It may also serve
|
|||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
* A single header labeled "Contributing" should appear as an h2
|
* A single header labeled "Contributing" should appear as an h2
|
||||||
* This should be the same message: "Contributions to this project are welcome, encouraged, and compensated. For more details, see [CONTRIBUTING.md](*CONTRIBUTING.md*)”
|
* This should be the same message: "Contributions to this project are welcome, encouraged, and compensated. For more details, see *[CONTRIBUTING.md](CONTRIBUTING.md)*.”
|
||||||
* If CONTRIBUTING.md does not exist in the project, it should link to [https://lbry.com/faq/contributing](https://lbry.com/faq/contributing) (soon to be lbry.tech/contributing)
|
* If CONTRIBUTING.md does not exist in the project, it should link to [https://lbry.com/faq/contributing](https://lbry.com/faq/contributing) (soon to be lbry.tech/contributing)
|
||||||
|
|
||||||
### (Additional Headings)
|
### (Additional Headings)
|
||||||
@@ -101,4 +101,4 @@ A template for issues should exist to guide users in correctly filing them.
|
|||||||
|
|
||||||
## Style and Formatting Notes
|
## Style and Formatting Notes
|
||||||
|
|
||||||
- Rely on autowrap instead of manually breaking up paragraphs with carriage return.
|
- Rely on autowrap instead of manually breaking up paragraphs with a carriage return.
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
# How To Run Your Own Wallet Server
|
||||||
|
|
||||||
|
This guide will walk you through the process of setting up a LBRY wallet server. This involves provisioning a web server and setting up some services (docker, lbrycrd, and the wallet server). At the end, you'll have your own connection to the LBRY network.
|
||||||
|
|
||||||
|
**note:** This is early-stage stuff. You may encounter unexpected issues. Please be patient and don't hesitate to [reach out for help](#get-in-touch).
|
||||||
|
|
||||||
|
|
||||||
|
## Start With A Fresh Server
|
||||||
|
|
||||||
|
We recommend a dual-core server with at least 16GB RAM, 100GB disk, and a fresh Ubuntu 18.04 install. Memory usage is flexible. 32 GB works best, but 16 GB is enough for a few clients.
|
||||||
|
|
||||||
|
Make sure your firewall has ports 9246 and 50001 open. 9246 is the port lbrycrd uses to communicate to other nodes. 50001 is the wallet server RPC port.
|
||||||
|
|
||||||
|
## Install lbrycrd
|
||||||
|
|
||||||
|
### Download and setup
|
||||||
|
Download the [latest release of lbrycrd](https://github.com/lbryio/lbrycrd/releases/latest).
|
||||||
|
|
||||||
|
Then, create a folder on your home directory called `.lbrycrd` and save the following to `.lbrycrd/lbrycrd.conf`:
|
||||||
|
```
|
||||||
|
txindex=1
|
||||||
|
server=1
|
||||||
|
daemon=1
|
||||||
|
rpcuser=lbry
|
||||||
|
rpcpassword=lbry
|
||||||
|
dustrelayfee=0.00000001
|
||||||
|
rpcworkqueue=128
|
||||||
|
```
|
||||||
|
|
||||||
|
Feel free to change the `rpcuser` or `rpcpassword`. If you do, you'll have to update the `DAEMON_URL` variable later on (in the docker-compose.yml file) to match the user/password you chose.
|
||||||
|
|
||||||
|
## Create a service (optional)
|
||||||
|
|
||||||
|
You can run lbrycrdd directly using `./lbrycrdd`. However, we recommend creatinga systemd service to manage the process for you.
|
||||||
|
|
||||||
|
Create a file at `/etc/systemd/system/lbrycrdd.service` with the following contents:
|
||||||
|
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description="LBRYcrd daemon"
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/home/<your_user>/lbrycrdd -datadir="/home/<your_user>/.lbrycrd"
|
||||||
|
User=<your_user>
|
||||||
|
Group=<your_user_group>
|
||||||
|
Restart=on-failure
|
||||||
|
KillMode=process
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run `sudo systemctl daemon-reload`.
|
||||||
|
|
||||||
|
Now you can start and stop lbrycrd with `sudo service lbrycrdd start` and `sudo service lbrycrdd stop`.
|
||||||
|
|
||||||
|
## Set Up Docker
|
||||||
|
|
||||||
|
### Install Docker & Docker Compose
|
||||||
|
```
|
||||||
|
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common && \
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
|
||||||
|
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
|
||||||
|
sudo apt install -y docker-ce docker-ce-cli containerd.io && \
|
||||||
|
sudo systemctl enable docker && sudo systemctl start docker && \
|
||||||
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
sudo usermod -aG docker $USER
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Download our docker-compose.yml
|
||||||
|
|
||||||
|
You can see it [here](https://github.com/lbryio/lbry-sdk/blob/master/docker/docker-compose-wallet-server.yml).
|
||||||
|
```
|
||||||
|
curl -L "https://raw.githubusercontent.com/lbryio/lbry-sdk/master/docker/docker-compose-wallet-server.yml" -o docker-compose.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure the user and password in the `DAEMON_URL` variable (the `lbry@lbry` part) in this docker-compose.yml matches thes user/password in your `~/.lbrycrd/lbrycrd.conf` file.
|
||||||
|
|
||||||
|
## Turn It On
|
||||||
|
|
||||||
|
### Start the servers
|
||||||
|
```
|
||||||
|
docker-compose up --detach
|
||||||
|
```
|
||||||
|
|
||||||
|
### Check that everything worked
|
||||||
|
|
||||||
|
The first time you start the wallet server, it will take a few minutes to download a recent snapshot of the database and extract it. You can follow the progress with
|
||||||
|
|
||||||
|
```
|
||||||
|
docker-compose logs --follow
|
||||||
|
```
|
||||||
|
|
||||||
|
After the wallet server has caught up, it will bind to port 50001 and start responding to requests. You can check if this happened by running
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo netstat -tlpn | grep 50001
|
||||||
|
```
|
||||||
|
|
||||||
|
If there is no output, the port is ont bound yet and the server is still catching up. Check the logs for more info.
|
||||||
|
|
||||||
|
After the wallet server is ready, check that it responds to basic RPC calls:
|
||||||
|
|
||||||
|
```
|
||||||
|
echo '{"id":1,"method":"server.version"}' | timeout 1 curl telnet://localhost:50001
|
||||||
|
```
|
||||||
|
|
||||||
|
You should see a response like `{"jsonrpc": "2.0", "result": ["0.46.1", "0.0"], "id": 1}`. If you do, congratulations! You've set up your own wallet server.
|
||||||
|
|
||||||
|
|
||||||
|
To check Elastic search, there are two commands you can use:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl localhost:9200 # get Elastic status
|
||||||
|
|
||||||
|
curl localhost:9200/claims/_count # check how many claims have been synced to Elastic
|
||||||
|
```
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
### Stopping and Restarting
|
||||||
|
|
||||||
|
Use the usual docker-compose commands (`start`, `stop`, `pause`, etc) to control the servers. Run `docker-compose --help` to see the
|
||||||
|
options.
|
||||||
|
|
||||||
|
|
||||||
|
### Updating
|
||||||
|
|
||||||
|
To update to the latest wallet server release, run the following:
|
||||||
|
```
|
||||||
|
docker pull lbry/wallet-server:latest-release
|
||||||
|
docker-compose down
|
||||||
|
docker-compose up --detach
|
||||||
|
```
|
||||||
|
|
||||||
|
### Resyncing
|
||||||
|
From time to time, we'll release an update that requires recreating one of the databases from scratch. Most of the time we will try to ensure there is an automatic migration, but even then, if you think the server has invalid data you can also try a resync.
|
||||||
|
|
||||||
|
The process is similar to an update, but causes the server to be down for much longer.
|
||||||
|
|
||||||
|
#### Main database
|
||||||
|
Holds the raw blockchain data and takes many hours (can take a day or two) to resync from scratch, so be sure to have a snapshot or try that last.
|
||||||
|
|
||||||
|
```
|
||||||
|
docker pull lbry/wallet-server:latest-release
|
||||||
|
docker-compose down
|
||||||
|
docker volume rm "$(whoami)_wallet_server"
|
||||||
|
WALLET_SERVER_SNAPSHOT_URL= docker-compose up --detach
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Elasticsearch
|
||||||
|
ES does the indexing of claims from the main database. It should take around 30 minutes to resync on a fast machine.
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
docker pull lbry/wallet-server:latest-release
|
||||||
|
docker-compose down
|
||||||
|
docker volume rm "$(whoami)_es01"
|
||||||
|
docker-compose up --detach
|
||||||
|
```
|
||||||
|
|
||||||
|
## Get in touch
|
||||||
|
|
||||||
|
Whether you got to the end without a hiccup or you got stuck along the way, we want to hear from you. [Join our Discord](https://discord.gg/y3W9JuS) to get help, stay updated, and talk to other wallet server operators.
|
||||||
Generated
+10961
File diff suppressed because it is too large.
Load diff
+4
-3
@@ -44,7 +44,8 @@
|
|||||||
"redis": "^2.8.0",
|
"redis": "^2.8.0",
|
||||||
"slack-node": "^0.1.8",
|
"slack-node": "^0.1.8",
|
||||||
"socket.io": "^2.2.0",
|
"socket.io": "^2.2.0",
|
||||||
"stringify-object": "^3.3.0"
|
"stringify-object": "^3.3.0",
|
||||||
|
"request": "latest"
|
||||||
},
|
},
|
||||||
"description": "Documentation for the LBRY protocol and associated projects",
|
"description": "Documentation for the LBRY protocol and associated projects",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -96,12 +97,12 @@
|
|||||||
"format": "eslint . --fix --ignore-pattern '/app/dist/'",
|
"format": "eslint . --fix --ignore-pattern '/app/dist/'",
|
||||||
"postinstall": "link-module-alias",
|
"postinstall": "link-module-alias",
|
||||||
"preinstall": "command -v link-module-alias;link-module-alias clean || true",
|
"preinstall": "command -v link-module-alias;link-module-alias clean || true",
|
||||||
"start": "npm i;npm run css;NODE_ENV=production node index.js",
|
"start": "npm i && npm run css && NODE_ENV=production node index.js",
|
||||||
"test": "run-s test:*",
|
"test": "run-s test:*",
|
||||||
"test:dependencies": "updates --update ./ --exclude prismjs",
|
"test:dependencies": "updates --update ./ --exclude prismjs",
|
||||||
"test:lint": "standardx --verbose | snazzy",
|
"test:lint": "standardx --verbose | snazzy",
|
||||||
"test:sass": "sass-lint --config ./node_modules/@inc/sasslint-config/config.json --verbose --no-exit",
|
"test:sass": "sass-lint --config ./node_modules/@inc/sasslint-config/config.json --verbose --no-exit",
|
||||||
"watch": "npm run css;run-p watch:*",
|
"watch": "npm run css && run-p watch:*",
|
||||||
"watch:sass": "sass --load-path=node_modules --watch app/sass:app/dist --style compressed",
|
"watch:sass": "sass --load-path=node_modules --watch app/sass:app/dist --style compressed",
|
||||||
"watch:server": "NODE_ENV=development nodemon --ignore 'app/dist'"
|
"watch:server": "NODE_ENV=development nodemon --ignore 'app/dist'"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user