light faq cleanup, more needed

This commit is contained in:
Jeremy Kauffman 2017-03-22 19:52:01 -04:00
parent 9b52ad0adf
commit e943623717
14 changed files with 48 additions and 64 deletions

View file

@ -3,16 +3,26 @@ title: How do I see the list of API functions I can call, and how do I call them
category: developer
---
## The LBRY API
The best way to learn how to use the LBRY API is to go through our [quickstart](https://lbry.io/quickstart).
A full list of API calls provided by LBRY is available in [the API documentation](https://lbry.io/api).
If you're new to LBRY, this is probably the API you want.
## The LBRY Blockchain API (lbrycrd)
Ensure that `lbrycrd` is running with the `-server` flag, which enables the JSON-RPC API. Then use one of the following methods to make API calls.
Many (though not all) of the calls are the same as those for bitcoin core, which are
documented [here](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list). To see the full list of API calls, use the `help` API call.
## lbrycrd-cli
### lbrycrd-cli
lbrycrd-cli help
## curl
### curl
curl --user USER:PASSWORD --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "help", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/
@ -22,24 +32,3 @@ documented [here](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_l
- If the command accepts parameters, they can be passed inside the `params` array.
See Also: [important directories](https://lbry.io/faq/lbry-directories).
## Python
Here is an example script to get the documentation for the various API calls.
To use any of the functions displayed, just provide any specified arguments in a dictionary.
import sys
from jsonrpc.proxy import JSONRPCProxy
try:
from lbrynet.conf import API_CONNECTION_STRING
except:
print "You don't have lbrynet installed!"
sys.exit(0)
api = JSONRPCProxy.from_url(API_CONNECTION_STRING)
if not api.is_running():
print api.daemon_status()
else:
for func in api.help():
print "%s:\n%s" % (func, api.help({'function': func}))

View file

@ -1,6 +1,7 @@
---
title: How does LBRY benefit content consumers? Why should I bother caring?
category: LBRY 101
order: 2
---
Do you watch YouTube? Imagine paying a few cents to eliminate all ads. 100% of the payment will go directly to the content creator and theyll still be earning more than YouTube offers, so theyll want to make even more of the content you love.

View file

@ -1,14 +0,0 @@
---
title: How do I specify a web-UI to use?
category: developer
---
If the files for the UI you'd like to use are stored locally on your computer, start LBRY with the `--ui` flag:
lbrynet-daemon --ui=/full/path/to/ui/files/root/folder
Once set with the UI flag, the given UI will be cached by LBRY and used as the default going forward. Also, LBRY will only successfully load a UI if the UI contains a conforming requirements.txt file to specify the required versions of lbrynet and lbryum. [Here](https://github.com/lbryio/lbry-web-ui/blob/master/dist/requirements.txt) is an example requirements.txt file.
To reset your UI to pull from lbryio, or to try a UI still in development, run LBRY with the `--branch` flag:
lbrynet-daemon --branch=master

View file

@ -1,6 +1,6 @@
---
title: What is LBRYs development status right now? Plans for the future?
category: LBRY 101
category: developer
---
LBRY is currently in invite-only beta, with desktop apps for Linux, MacOS, and a pre-release version of Windows. There are approximately 5K active users and hundreds of content creators. The network already hosts big name content like the [feature film *Its A Disaster*](https://lbry.io/news/launch-a-disaster) and videos from [Adult Swims MillionDollarExtreme](https://lbry.io/news/mde-on-lbry). We announce new featured content every Thursday on our [blog](https://lbry.io/news), [Twitter](https://twitter.com/lbryio), and [Facebook](https://www.facebook.com/lbryio).

View file

@ -1,6 +1,6 @@
---
title: Is LBRY Open Source?
category: other
title: Is LBRY open source?
category: developer
---
All of the code we have written for LBRY is open source - even this very website! You can access it on [GitHub](https://github.com/lbryio/).
All of the code we have written for LBRY is open source and MIT licensed - even this very website! You can access it on [GitHub](https://github.com/lbryio/).

View file

@ -1,6 +1,7 @@
---
title: Whats with the name LBRY?
category: LBRY 101
order: 4
---
The very first question of newcomers is often, “How do you pronounce it?” Answer: library.

View file

@ -1,6 +1,6 @@
---
title: How does the company behind LBRY make money?
category: LBRY 101
category: other
---
The LBRY protocol has a built-in digital currency that allows it to function, called LBRY credits. These credits are very similar to bitcoins. Having a built-in digital currency creates an opportunity for a new kind of business that has never existed: [the protocol-first enterprise](https://medium.com/the-coinbase-blog/app-coins-and-the-dawn-of-the-decentralized-business-model-8b8c951e734f#.6mr8znoiu). LBRY Inc. has reserved 10% of all LBRY credits to fund continued development and provide profit for the founders. Since credits only gain value as the use of the protocol grows, the company has an incentive to continue developing this open-source project. And we can do it all without taking a percentage of anyones transactions.

View file

@ -1,6 +1,6 @@
---
title: How does LBRY benefit content creators? Can I make money using LBRY?
category: LBRY 101
category: other
---
In our AMA title, we pitched LBRY as a “community-driven” YouTube alternative that could “save the internet.” Thats a lot of big talk, but what does it mean for the people who care most about the changes happening at YouTube content creators?

View file

@ -1,6 +1,7 @@
---
title: How does LBRY naming work? Why dont you just assign names the same way as internet domains?
category: LBRY 101
order: 5
---
First, since there have been a lot of misconceptions about how LBRY URLs work, **it is absolutely possible to own and control a URL forever**. That is the tl;dr of this post if you don't want to read a bunch of words about how LBRY URLs work.

View file

@ -1,6 +1,7 @@
---
title: What is LBRY exactly is it a protocol, an app, a website, a company?
category: LBRY 101
order: 1
---
LBRY is many components working together. For most users, it will just be a place where they can find great videos, music, ebooks, and more. A vast digital library available on all of your devices.

View file

@ -1,13 +0,0 @@
---
title: Why should I care about LBRY if I cant even use it yet?
category: LBRY 101
---
A lot of people wont care about LBRY until it can deliver them immediate benefits. Thats fair and we understand.
The advantage of getting involved right now is the same as following a local band that youd like to see make it big. You have the opportunity to have very direct contact with our dev team. You can make suggestions and shape the course of LBRY. You can [earn bounties](https://lbry.io/bounty) for helping to build and promote LBRY. You can connect with our truly amazing community of people, like [Javier from Venezuela who says LBRY gave him new hope for life](https://lbry.io/news/day-in-shoes-venezuelan). You can [post your content to the network](https://lbry.io/publish) before it is mainstream and get attention and appreciation from our early adopters not to mention a possible prize of $1000 in LBC.
Or get involved because its rare to get an opportunity to be part of a project that could reshape the fabric of the internet and creative media for years to come.
*Did this FAQ address your concerns? Still think were full of it? Sound off at [reddit.com/r/lbry/](https://www.reddit.com/r/lbry/). Thank you for taking the time to learn about LBRY!*
**Not on LBRY yet?** [Get an invite here](https://lbry.io/get). Just cant wait? If youre a creator, skip our waiting list line for a chance to earn $1,000 in LBRY Credits at the same time. [Learn more here](https://lbry.io/publish).

View file

@ -118,6 +118,7 @@ class Controller
'/why' => '/learn',
'/feedback' => '/learn',
'/faq/when-referral-payouts' => '/faq/referrals',
'/faq/why-care-about-lbry' => '/get',
'/news/meet-the-lbry-founders' => '/team',
'/faq/no-auction-options' => '/faq/naming',
'/join-list' => '/list/subscribe',

View file

@ -79,12 +79,12 @@ class ContentActions extends Actions
if (!$slug)
{
$allPosts = Post::find(static::VIEW_FOLDER_FAQ);
$allPosts = Post::find(static::VIEW_FOLDER_FAQ, Post::SORT_ORD_ASC);
$allCategories = [
'LBRY 101' => 'Intro to LBRY',
'getstarted' => 'Getting Started',
'setup' => 'Installing and Running LBRY',
'LBRY 101' => 'LBRY 101',
'wallet' => 'The LBRY Wallet',
'mining' => 'Mining LBC',
'policy' => 'Policies',
@ -120,7 +120,7 @@ class ContentActions extends Actions
}
catch (PostNotFoundException $e)
{
return NavActions::execute404();
return Controller::redirect('/' . static::SLUG_FAQ);
}
return ['content/faq-post', ['post' => $post]];
}

View file

@ -6,7 +6,8 @@ class PostMalformedException extends Exception {}
class Post
{
const SORT_DATE_DESC = 'sort_date_desc';
const SORT_DATE_DESC = 'sort_date_desc',
SORT_ORD_ASC = 'sort_ord_asc';
protected static $slugMap = [];
protected $slug, $title, $metadata, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category;
@ -80,6 +81,22 @@ class Post
return strcasecmp($b->getDate()->format('Y-m-d'), $a->getDate()->format('Y-m-d'));
});
break;
case static::SORT_ORD_ASC:
usort($posts, function(Post $a, Post $b) {
$aMeta = $a->getMetadata();
$bMeta = $b->getMetadata();
if (!isset($aMeta['order']) && !isset($bMeta['order']))
{
return $a->getTitle() < $b->getTitle() ? -1 : 1;
}
if (isset($aMeta['order']) && isset($bMeta['order']))
{
return $aMeta['order'] < $bMeta['order'] ? -1 : 1;
}
return isset($aMeta['order']) ? -1 : 1;
});
break;
}
}
return $posts;