no more lbryapi

This commit is contained in:
Alex Grintsvayg 2018-01-23 16:44:02 -05:00
parent c4a84a494d
commit acd0a783a8
3 changed files with 11 additions and 11 deletions

View file

@ -11,7 +11,7 @@ To change the port once during runtime, set the LBRY_PEER_PORT env variable. Her
Once the daemon is running, you can change the port permanently by using the following [api](/api) call
curl 'http://localhost:5279/lbryapi' --data '{"method":"settings_set", "params":{"peer_port":<port-num>}}'
curl 'http://localhost:5279' --data '{"method":"settings_set", "params":{"peer_port":<port-num>}}'
or via cli command

View file

@ -1,6 +1,6 @@
<h3 id="api">API Basics</h3>
<p>
When running, the LBRY daemon provides a JSON-RPC server running at <code class="code-inline">http://localhost:5279/lbryapi</code>.
When running, the LBRY daemon provides a JSON-RPC server running at <code class="code-inline">http://localhost:5279</code>.
</p>
<p>
It can be accessed by any utility capable of making HTTPS GET and POST requests, such as cURL or possibly your toaster. On Windows? You can also use PowerShell. <a class="link-primary" href="#windows">Learn more</a>.
@ -8,7 +8,7 @@
<p>
To verify the LBRY daemon is running correctly, let's try looking up a URI:
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"resolve","params":{"uri":"what"}}'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"resolve","params":{"uri":"what"}}'
<span class="code-bash__response">[
{
"author": "Samuel Bryan",
@ -35,7 +35,7 @@
<p>
Now let's download it. This time we're going to call the method <code class="code-inline">get</code> with the same parameters.
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"uri":"what"} }'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"get","params":{"uri":"what"} }'
<span class="code-bash__response">[
{
<span class="code-bash__comment">//some response fields omitted for brevity</span>
@ -52,14 +52,14 @@
<p>This file will download in the background to the <code class="code-inline">download_directory</code> specified in the returned data. Subsequent calls to <code class="code-inline">get</code> or <code class="code-inline">file_list</code> will return the status.</p>
<p>The LBRY API consists of about 50 calls, all related to discovering, distributing, and purchasing content. <a class="link-primary" href="/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"}'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"help"}'
</code>
<h3 id="windows">Windows</h3>
<p>If you are running Windows and would like to follow this guide you could substitute curl with a PowerShell console and the following code.
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>Invoke-RestMethod -Uri 'http://localhost:5279/lbryapi' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
<code class="code-bash"><span class="code-bash__prompt">$</span>Invoke-RestMethod -Uri 'http://localhost:5279' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
</code>
<p>If PowerShell does not work and you want to continue with cURL, you'll need to escape inner double quotes with a \ to pass the JSON properly via Command Prompt.
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl "http://localhost:5279/lbryapi" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
<code class="code-bash"><span class="code-bash__prompt">$</span>curl "http://localhost:5279" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
</code>

View file

@ -7,18 +7,18 @@
</p>
<p>To receive credits, you will need to 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"}'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"wallet_new_address"}'
<span class="code-bash__response">["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]</span></code>
<p>Once you have received or purchased some credits, confirm your balance by calling <code class="code-inline">wallet_balance</code>:</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_balance"}'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"wallet_balance"}'
<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!</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>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"publish", "params": {
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"publish", "params": {
"name": "electricsheep",
"file_path": "/home/kauffj/Desktop/electric-sheep.mp4",
"bid": 1,
@ -45,7 +45,7 @@
<h3>Enjoy a Hollywood Film</h3>
<p><a href="http://www.imdb.com/title/tt1995341/" class="link-primary">It's a Disaster</a> starring David Cross is just one of tens of thousands of great pieces of content available. Check it out!</p>
<p><strong>Note! This will cost you LBC. Run the resolve command to see the cost.</strong></p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"uri":"itsadisaster"} }'
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279' --data '{"method":"get","params":{"uri":"itsadisaster"} }'
<span class="code-bash__response">[
{
<span class="code-bash__comment">//some response fields omitted for brevity</span>