From ed3e6848e551c3acb856844b874576d2dd94b590 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Thu, 9 Feb 2017 18:45:20 -0500 Subject: [PATCH] quickstart/bash style fixes and cleanup --- view/template/page/quickstart.php | 19 +++++------- view/template/page/what.php | 50 +++++++++++++++---------------- web/scss/_code.scss | 28 ++++++++--------- 3 files changed, 44 insertions(+), 53 deletions(-) diff --git a/view/template/page/quickstart.php b/view/template/page/quickstart.php index dd6e5889..24f195ee 100644 --- a/view/template/page/quickstart.php +++ b/view/template/page/quickstart.php @@ -44,9 +44,7 @@ Launch the deamon to run as a background process:

- - lbrynet-daemon --no-launch - + $lbrynet-daemon

The first time you run the daemon, it must catch-up with most recent blockheaders. This can take several minutes.

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.
@@ -62,7 +60,7 @@

To verify the LBRY daemon is running correctly and responding to requests, run:

-
curl 'http://localhost:5279/lbryapi' --data '{"method":"status","params":[]}'
+      $curl 'http://localhost:5279/lbryapi' --data '{"method":"status","params":[]}'
 [
   {
     "connection_status": {
@@ -75,12 +73,11 @@
     "startup_status": {
       "message": "Started lbrynet",
       "code": "started"
-    },
-    "lbry_id": "7J75jSuxU9eizREuxk1r"
+    }
   }
-]
+]

This makes it easy to interact with the LBRY API in the programming language of your choice. Here's another example:

-
curl 'http://localhost:5279/lbryapi' --data '{"method":"resolve_name","params":[{"name":"what"}]}'
+      $curl 'http://localhost:5279/lbryapi' --data '{"method":"resolve_name","params":[{"name":"what"}]}'
 [
   {
     "ver": "0.0.3",
@@ -96,7 +93,7 @@
     "nsfw": false,
     "thumbnail": "https:\/\/s3.amazonaws.com\/files.lbry.io\/logo.png"
   }
-]
+]

LBRY can be used to build everything from a censorship-proof image host, to a store for 3D printing files, to distribute large files or datasets, or use cases even we can't imagine!

View Full API Documentation

@@ -104,8 +101,8 @@

4. Getting Credits

Many actions, such as reserving a name or purchasing paid content, require credits.

To receive credits, first generate a wallet address:

-
curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_new_address","params":[]}'
-["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]
+ $curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_new_address","params":[]}' +["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]

Use this address to get credits in one of two ways:

diff --git a/view/template/page/what.php b/view/template/page/what.php index 8554478a..c707f4e8 100644 --- a/view/template/page/what.php +++ b/view/template/page/what.php @@ -95,21 +95,19 @@

If you’re a programmer, you might recognize the LBRY blockchain as a key-value store. Each key, or name, corresponds to a value, or a metadata entry. Whichever party or parties bid the most LBC gets to control the metadata returned by a key lookup.

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.

-
-
-    wonderfullife : {
-      title: "It’s a Wonderful Life",
-      description: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
-      thumbnail: "http://i.imgur.com/MW45x88.jpg",
-      license: "public domain",
-      price: 0, //free!
-      publisher: "A Fan Of George Bailey", //simplification
-      sources: { //extensible, variable list
-        lbry_hash : <unique id>,
-        url : <url>
-      }
-    }
-
+ $lbrynet-cli resolve_name name=wonderfullife +wonderfullife : { + title: "It’s a Wonderful Life", + description: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.", + thumbnail: "http://i.imgur.com/MW45x88.jpg", + license: "public domain", + price: 0, //free! + publisher: "A Fan Of George Bailey", //simplification + sources: { //extensible, variable list + lbry_hash : <unique id>, + url : <url> + } +}

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.

Other than the usage of the LBRY blockchain to store names and metadata, there are only minor differences between the blockchains of LBRY and Bitcoin, and the changes are generally consensus improvements. We’ve buffed the hashing algorithm, smoothed the block reward function, increased the block size, increased the total number of credits, and prepared for offchain settlement.

@@ -182,7 +180,7 @@
  • 60% earned by LBRY users, via mining the LBRY cryptocurrency.
  • - +

    Combatting The Ugly

    As neither naïfs nor knaves, we acknowledge that LBRY can be used for bad ends. Technology is frequently this way. Encryption protects our privacy -- as well as that of terrorists. Cars allow us to travel marvelous distances -- and kill millions per year.

    @@ -246,16 +244,16 @@

    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.

    -    wonderfullife : {
    -      title: "It’s a Wonderful Life",
    -      description: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
    -      thumbnail: "http://i.imgur.com/MW45x88.jpg",
    -      license: "public domain",
    -      price: 0, //free!
    -      publisher: "A Fan Of George Bailey", //simplification
    -      sources: { //extensible, variable list
    -        lbry_hash : <unique id>,
    -        url : <url>
    +    wonderfullife : {
    +      title: "It’s a Wonderful Life",
    +      description: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.",
    +      thumbnail: "http://i.imgur.com/MW45x88.jpg",
    +      license: "public domain",
    +      price: 0, //free!
    +      publisher: "A Fan Of George Bailey", //simplification
    +      sources: { //extensible, variable list
    +        lbry_hash : <unique id>,
    +        url : <url>
           }
         }
    diff --git a/web/scss/_code.scss b/web/scss/_code.scss index 280143ff..a28c2197 100644 --- a/web/scss/_code.scss +++ b/web/scss/_code.scss @@ -8,7 +8,6 @@ code { padding: 3px 5px; font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, monospace, serif; - font-size: 90%; color: darken($color-primary, 10%); } pre @@ -23,7 +22,6 @@ pre overflow-x: auto; } - .code-bash { -webkit-user-select: text; @@ -31,21 +29,19 @@ pre -ms-user-select: text; 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; + white-space: pre; + display: block; word-wrap: break-word; - .sy0 { display: inline-block; } //will allow wrapping here font-size: 0.75em; - background-color: #F8F8F8; - border: 1px solid #ddd; - padding: $spacing-vertical / 2; +} - .code-bash-kw1 {color: #c20cb9; font-weight: bold;} - .code-bash-kw2 {color: #7a0874; font-weight: bold; } - .code-bash-comment { color: #888; } - .sy0 {color: #000000; font-weight: bold; } - - > code - { - display: block; - } -} \ No newline at end of file +.code-bash__kw1 {color: #c20cb9; font-weight: bold;} +.code-bash__kw2 {color: #7a0874; font-weight: bold; } +.code-bash__comment { color: #888; } +.code-bash__prompt { font-weight: bold; margin-right: 5px; } \ No newline at end of file