+
-
-
-// E X P O R T
+ ${createApiContent(response)}
+
+
+
+`);
+ */
module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => {
/*
@@ -51,6 +65,7 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res
+
// H E L P E R S
function createApiContent(apiDetails) {
@@ -99,9 +114,10 @@ function createApiSidebar(apiDetails) {
function parseApiFile(urlSlug) {
let apiFileLink;
- if (!urlSlug || urlSlug === "api" || urlSlug === "protocol") apiFileLink = process.env.NODE_ENV === "development" ?
+ //checks below are related to rate limits, both URLs should return the same content
+ if (urlSlug === "sdk") apiFileLink = process.env.NODE_ENV === "development" ?
"https://rawgit.com/lbryio/lbry/master/docs/api.json" :
- "https://cdn.rawgit.com/lbryio/lbry/5b3103e4/docs/api.json"
+ "https://cdn.rawgit.com/lbryio/lbry/master/docs/api.json"
;
if (urlSlug === "blockchain") apiFileLink = process.env.NODE_ENV === "development" ?
@@ -109,7 +125,7 @@ function parseApiFile(urlSlug) {
"https://cdn.rawgit.com/lbryio/lbrycrd/add_api_docs_scripts/contrib/devtools/generated/api_v1.json"
;
- if (!apiFileLink) return; // TODO: Error handling
+ if (!apiFileLink) return Promise.reject(new Error("Failed to fetch API docs")); // TODO: Error handling
return fetch(apiFileLink).then(() => fetch(apiFileLink, {
cache: "no-cache" // forces a conditional request
diff --git a/app/views/home.js b/app/views/home.js
index cd60c28..b64e3ed 100644
--- a/app/views/home.js
+++ b/app/views/home.js
@@ -1,34 +1,8 @@
"use strict";
-
-
-// P A C K A G E
-
import html from "choo/html";
-
-// V A R I A B L E
-
import linkGrid from "../components/link-grid";
-
-
-// E X P O R T
-
-const featureLinks = linkGrid([
- {
- description: "Learn how LBRY works with 3 easy examples",
- destination: "/playground",
- label: "Jump into Playground",
- title: "New to LBRY?"
- },
- {
- description: "Help make LBRY better!",
- destination: "/contribute",
- label: "Explore our repos",
- title: "Want to contribute?"
- }
-]);
-
module.exports = exports = () => html`
@@ -41,7 +15,20 @@ module.exports = exports = () => html`
- ${featureLinks}
+ ${linkGrid([
+ {
+ description: "Learn how LBRY works with 3 easy examples",
+ destination: "/tour",
+ label: "Take the Tour",
+ title: "New to LBRY?"
+ },
+ {
+ description: "Help make LBRY better!",
+ destination: "/contribute",
+ label: "Explore our repos",
+ title: "Want to contribute?"
+ }
+ ])}
diff --git a/documents/resources.md b/documents/resources.md
index 8afbc25..8b46dca 100644
--- a/documents/resources.md
+++ b/documents/resources.md
@@ -6,14 +6,14 @@ title: Resources
## Additional Resources
+- [LBRY URIs](/resources/uri)
+- [LBRY Claim Metadata Schema](/resources/schema)
+- [LBRY Merkle Claim Trie](/resources/claimtrie)
+- [LBRY Consensus Algorithm](/resources/consensus)
- [Download Overview](/resources/download-overview)
-- [Lighthouse API](https://lbryio.github.io/lighthouse)
-- [Merkle Claim Trie](/resources/claimtrie)
-- [LBRY Claimtrie](/resources/lbry-claimtrie)
-- [The LBRY Proof of Work (POW) Algorithm](/resources/pow)
-- [Regtest Setup](/resources/regtest-setup)
-- [Schema](/resources/schema)
- [Signing a claim](/resources/signing-claim)
-- [URI](/resources/uri)
- [API Wrappers](/resources/api-wrappers)
- [LBRY Daemon Settings](/resources/daemon-settings)
+- [Claim Signing](/resources/signing-claim)
+- [Regtest Setup](/resources/regtest-setup)
+- [Lighthouse (search) API](https://lbryio.github.io/lighthouse)
diff --git a/documents/resources/signing-claim.md b/documents/resources/claim-signing.md
similarity index 100%
rename from documents/resources/signing-claim.md
rename to documents/resources/claim-signing.md
diff --git a/documents/resources/pow.md b/documents/resources/consensus.md
similarity index 51%
rename from documents/resources/pow.md
rename to documents/resources/consensus.md
index cee5d8e..9e357d2 100644
--- a/documents/resources/pow.md
+++ b/documents/resources/consensus.md
@@ -1,9 +1,10 @@
-# The LBRY Proof of Work (POW) Algorithm
+# LBRY Consensus Algorithm
-LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) the same way that Bitcoin does. The
-only difference is the hash function. LBRY uses a slightly different algorithm that achieves the same ends but slightly delayed the development of a GPU miner and gave early adopters a chance to mine without specialized hardware.
+LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) as a consensus mechanism, the same way that Bitcoin does.
-LBRY's algorithm is
+LBRY has differences in hash function, block targeting, and difficult adjustment.
+
+### Hash Mechanism
```python
intermediate = sha512(sha256(sha256(data))) # compute the sha512() of the double-sha256() of the data
@@ -12,8 +13,10 @@ right = ripemd(intermediate[len(intermediate)/2:]) # and the right half
proof = sha256(sha256(left + right)) # concatenate the two halves, and double-sha256() it again
```
-For comparison, Bitcoin's algorithm is...
+### Block Targeting
-```python
-proof = sha256(sha256(data))
-```
+_PR this_.
+
+### Difficulty Adjustment
+
+_PR this_.
diff --git a/documents/resources/schema.md b/documents/resources/schema.md
index d7c946d..f755268 100644
--- a/documents/resources/schema.md
+++ b/documents/resources/schema.md
@@ -1,4 +1,4 @@
-# Schema
+# LBRY Claim Metadata Schema
The schema defines the structure of the data that is stored in claims in the LBRY blockchain. It has several goals:
@@ -25,7 +25,7 @@ message Claim {
certificateType = 2;
}
required ClaimType claimType = 2;
-
+
optional Stream stream = 3;
optional Certificate certificate = 4;
optional Signature publisherSignature = 5;
@@ -46,7 +46,7 @@ message Stream {
_0_0_1 = 1;
}
required Version version = 1;
-
+
required Metadata metadata = 2;
required Source source = 3;
}
@@ -72,7 +72,7 @@ message Metadata {
en = 1;
}
required Language language = 2;
-
+
required string title = 3;
required string description = 4;
required string author = 5;
@@ -80,7 +80,7 @@ message Metadata {
required bool nsfw = 7;
optional Fee fee = 8;
-
+
optional string thumbnail = 9;
optional string preview = 10;
optional string licenseUrl = 11;
@@ -159,7 +159,7 @@ message Certificate {
_0_0_1 = 1;
}
required Version version = 1;
-
+
required KeyType keyType = 2;
required bytes publicKey = 4;
}
@@ -177,7 +177,7 @@ message Signature {
_0_0_1 = 1;
}
required Version version = 1;
-
+
required KeyType signatureType = 2;
required bytes signature = 3;
required bytes certificateId = 4;