bash styling change + other fixes

This commit is contained in:
Jeremy Kauffman 2017-02-27 16:03:48 -05:00
parent 4f17304fd2
commit 0a9467326a
7 changed files with 50 additions and 95 deletions

View file

@ -2,7 +2,7 @@
lbry.quickstartForm('#form-new-publish-reward', "<?php echo $apiUrl ?>");
<?php js_end() ?>
<form method="POST" action="/quickstart/auth" class="form-inset" id="form-new-publish-reward">
<h4 style="margin-top: 0">Receive Credits for Publish</h4>
<h4 style="margin-top: 0">Publishing Reward</h4>
<div class="notice notice-error spacer1 <?php echo isset($error) && $error ? '' : 'hide' ?>"><?php echo $error ?? null ?></div>
<div class="notice notice-success spacer1 hide"></div>
<div class="form-row">

View file

@ -9,7 +9,7 @@
To verify the LBRY daemon is running correctly, let's try looking up a name:
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"resolve_name","params":{"name":"what"}}'
[
<span class="code-bash__response">[
{
"ver": "0.0.3",
"description": "What is LBRY? An introduction with Alex Tabarrok",
@ -24,11 +24,11 @@
"nsfw": false,
"thumbnail": "https:\/\/s3.amazonaws.com\/files.lbry.io\/logo.png"
}
]</code>
]</span></code>
<p>Above, we called the method <span class="code-plain"><a href="<?php echo DeveloperActions::API_DOC_URL ?>#resolve_name" class="link-primary">resolve_name</a></span> for the URL <span class="code-plain">lbry://what</span>. This returned the metadata associated with the URL.</p>
<p>Now let's download it. This time we're going to call the method <span class="code-plain">get</span> with the same parameters.</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"name":"what"} }'
["d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"]</code>
<span class="code-bash__response">["d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"]</span></code>
<p>The LBRY API consists about 50 calls, all related to discovering, distributing, and purchasing content. <a class="link-primary" href="http://lbryio.github.io/lbry/api/">View the full API documentation</a>.</p>
<p>You can also list all of the commands available by calling the <span class="code-plan">help</span> command.</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}'

View file

@ -1,8 +1,8 @@
<h3 id="credits">Credits</h3>
<p>So far, everything we've done with LBRY has been free. However, some actions, such as reserving a name or purchasing paid content, require credits.</p>
<p>To receive credits, first generate a wallet address:</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_new_address","params":[]}'
["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]</code>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_new_address"}'
<span class="code-bash__response">["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]</span></code>
<p>Enter this address in the form below and we'll send you 50 credits.</p>
<div class="quickstart__claim-form content-light content" id="new-developer">
<?php echo View::render('developer/_formNewDeveloperReward', [
@ -11,7 +11,7 @@
</div>
<p>Next, confirm you've received your credits by calling <span class="code-plain">wallet_balance</span>:</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_balance"}'
[50.00000000]</code>
<span class="code-bash__response">[50.00000000]</span></code>
<h3 id="publish">Publishing</h3>
<p>Publishing to LBRY is just as easy as everything else! If you publish something, we'll send you an additional 200 LBC for further use.</p>
<p>Not sure what to publish? We recommend your favorite picture or home video. Or just grab something from <a class="link-primary" href="https://archive.org/details/movies">here</a>.</p>
@ -21,7 +21,7 @@
"bid": 1,
"metadata": {"what goes here": "who knows if you do not work for LBRY, certainly you will not be able to figure it out from response messages or API docs"
}}'
[whatever this response looks like]</code>
<span class="code-bash__response">[whatever this response looks like]</span></code>
<div class="quickstart__claim-form content-light content" id="new-publish">
<?php echo View::render('developer/_formCreditsPublish', [
'returnUrl' => Request::getRelativeUri() . '#new-developer'

View file

@ -1,63 +0,0 @@
<?php NavActions::setNavUri('/learn') ?>
<?php Response::setMetaDescription('Be up and running with the LBRY API in just a few minutes.') ?>
<?php Response::setMetaTitle('LBRY Quickstart') ?>
<?php echo View::render('nav/_header', ['isDark' => false, 'isAbsolute' => false]) ?>
<main class="cover-stretch-wrap">
<div class="cover cover-center cover-dark cover-dark-grad">
<div class="content content-dark content-readable">
<h1>Set Up</h1>
<p>This step-by-step guide will have you running LBRY and interacting with the API in just a few minutes.</p>
<p>This guide is for programmers and other technical users. For consumer usage of LBRY, please <a href="/get" class="link-primary">go here</a>.</p>
<h3>What's Covered</h3>
<ol class="table-of-contents">
<li><a href="#installation" class="link-primary">Installation</a></li>
<li><a href="#running-lbry" class="link-primary">Running LBRY</a></li>
<li><a href="#api" class="link-primary">The API</a></li>
<li><a href="#credits" class="link-primary">Credits</a></li>
<li><a href="#community" class="link-primary">Community & Issues</a></li>
</ol>
<section>
<h3 id="installation">1. Installation</h3>
<p>The easiest way to install LBRY is to use a pre-packaged binary. We provide binaries for Windows, macOS, and Debian-based Linux.</p>
<table class="content">
<thead>
<tr>
<th>macOS <span class="icon-apple"></span></th>
<th>Linux <span class="icon-linux"></span></th>
<th>Windows <span class="icon-windows"></span></th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://lbry.io/get/lbry.dmg">Download DMG</a></td>
<td><a href="https://lbry.io/get/lbry.deb">Download DEB</a></td>
<td><a href="https://lbry.io/get/lbry.msi">Download MSI</a></td>
</tr>
</tbody>
</table>
<p>
If you prefer to compile from source or are not on one of the above operating systems, follow
<a class="link-primary" href="https://github.com/lbryio/lbry/blob/master/INSTALL.md">this guide</a>.
</p>
</section>
<section>
<h3 id="running-lbry">2. Running LBRY</h3>
<p>
Launch the deamon to run as a background process:
</p>
<p>
<code class="code-bash"><span class="code-bash__prompt">$</span>lbrynet-daemon</code>
</p>
<p>The first time you run the daemon, it must catch-up with most recent blockheaders. This can take several minutes.</p>
<div class="meta">macOS and Windows do not currently bundle the daemon separately. Just launch the full app and the API will still be available. This will be resolved in v0.9.</div>
</section>
<section>
<section>
</div>
</div>
</div>
</main>
<?php echo View::render('nav/_footer') ?>

View file

@ -97,16 +97,16 @@
<p>Here is a sample key-value entry in the LBRY blockchain. Here, wonderfullife is the key, and the rest of the description is the value.</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>lbrynet-cli resolve_name name=wonderfullife
<span class="code-bash__kw1">wonderfullife</span> : {
<span class="code-bash__kw2">title</span>: "Its a Wonderful Life",
<span class="code-bash__kw2">description</span>: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
<span class="code-bash__kw2">thumbnail</span>: "http://i.imgur.com/MW45x88.jpg",
<span class="code-bash__kw2">license</span>: "public domain",
<span class="code-bash__kw2">price</span>: 0, <span class="code-bash__comment">//free!</span>
<span class="code-bash__kw2">publisher</span>: "A Fan Of George Bailey", <span class="code-bash__comment">//simplification</span>
<span class="code-bash__kw2">sources</span>: { <span class="code-bash__comment">//extensible, variable list</span>
<span class="code-bash__kw2">lbry_hash</span> : &lt;unique id&gt;,
<span class="code-bash__kw2">url</span> : &lt;url&gt;
<span class="code-bash__kw">wonderfullife</span> : {
<span class="code-bash__kw">title</span>: "Its a Wonderful Life",
<span class="code-bash__kw">description</span>: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
<span class="code-bash__kw">thumbnail</span>: "http://i.imgur.com/MW45x88.jpg",
<span class="code-bash__kw">license</span>: "public domain",
<span class="code-bash__kw">price</span>: 0, <span class="code-bash__comment">//free!</span>
<span class="code-bash__kw">publisher</span>: "A Fan Of George Bailey", <span class="code-bash__comment">//simplification</span>
<span class="code-bash__kw">sources</span>: { <span class="code-bash__comment">//extensible, variable list</span>
<span class="code-bash__kw">lbry_hash</span> : &lt;unique id&gt;,
<span class="code-bash__kw">url</span> : &lt;url&gt;
}
}</code>
<div class="meta text-center content-inset"><p>A slightly simplified sample entry of metadata in the LBRY blockchain. Whichever party or parties bid the most in an ongoing auction control what a name returns.</p></div>
@ -245,16 +245,16 @@
<p>Here is a sample key-value entry in the LBRY blockchain. Here, wonderfullife is the key, and the rest of the description is the value.</p>
<div class="code-bash">
<code><pre style="white-space: pre-wrap;">
<span class="code-bash__kw1">wonderfullife</span> : {
<span class="code-bash__kw2">title</span>: "Its a Wonderful Life",
<span class="code-bash__kw2">description</span>: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
<span class="code-bash__kw2">thumbnail</span>: "http://i.imgur.com/MW45x88.jpg",
<span class="code-bash__kw2">license</span>: "public domain",
<span class="code-bash__kw2">price</span>: 0, <span class="code-bash__comment">//free!</span>
<span class="code-bash__kw2">publisher</span>: "A Fan Of George Bailey", <span class="code-bash__comment">//simplification</span>
<span class="code-bash__kw2">sources</span>: { <span class="code-bash__comment">//extensible, variable list</span>
<span class="code-bash__kw2">lbry_hash</span> : &lt;unique id&gt;,
<span class="code-bash__kw2">url</span> : &lt;url&gt;
<span class="code-bash__kw">wonderfullife</span> : {
<span class="code-bash__kw">title</span>: "Its a Wonderful Life",
<span class="code-bash__kw">description</span>: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
<span class="code-bash__kw">thumbnail</span>: "http://i.imgur.com/MW45x88.jpg",
<span class="code-bash__kw">license</span>: "public domain",
<span class="code-bash__kw">price</span>: 0, <span class="code-bash__comment">//free!</span>
<span class="code-bash__kw">publisher</span>: "A Fan Of George Bailey", <span class="code-bash__comment">//simplification</span>
<span class="code-bash__kw">sources</span>: { <span class="code-bash__comment">//extensible, variable list</span>
<span class="code-bash__kw">lbry_hash</span> : &lt;unique id&gt;,
<span class="code-bash__kw">url</span> : &lt;url&gt;
}
}</pre></code>
</div>

View file

@ -34,7 +34,6 @@ pre
user-select: text;
margin-bottom: $spacing-vertical;
border-left: .3rem solid $color-primary;
padding: $spacing-vertical / 2 $spacing-vertical;
unicode-bidi: embed;
overflow-x: auto;
@ -42,10 +41,22 @@ pre
display: block;
word-wrap: break-word;
background: #222;
color: #fff;
font-size: 0.75em;
}
.code-bash__kw1 {color: #c20cb9; font-weight: bold;}
.code-bash__kw2 {color: #7a0874; font-weight: bold; }
.code-bash__response {
color: #ccc;
}
.code-bash__kw {color: #c20cb9; font-weight: bold;}
.code-bash__comment { color: #888; }
.code-bash__prompt { font-weight: bold; margin-right: 5px; }
.code-bash__prompt
{
font-weight: bold;
margin-right: 5px;
color: lighten($color-primary, 20%);
@include user-select(none);
}

View file

@ -169,6 +169,13 @@ $info_text: #3a87ad;
}
@mixin user-select ($value) {
-webkit-user-select: $value;
-moz-user-select: $value;
-ms-user-select: $value;
user-select: $value;
}
@mixin transition($transition-property, $transition-time, $method) {
-webkit-transition: $transition-property $transition-time $method;
-moz-transition: $transition-property $transition-time $method;