From acd0a783a8cb7a24fbebba6271b68948fffd7a3e Mon Sep 17 00:00:00 2001
From: Alex Grintsvayg
- When running, the LBRY daemon provides a JSON-RPC server running at
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. Learn more.
@@ -8,7 +8,7 @@
To verify the LBRY daemon is running correctly, let's try looking up a URI:
Now let's download it. This time we're going to call the method This file will download in the background to the The LBRY API consists of about 50 calls, all related to discovering, distributing, and purchasing content. View the full API documentation. You can also list all of the commands available by calling the help command. If you are running Windows and would like to follow this guide you could substitute curl with a PowerShell console and the following code.
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.
API Basics
http://localhost:5279/lbryapi
.
+ When running, the LBRY daemon provides a JSON-RPC server running at http://localhost:5279
.
$curl 'http://localhost:5279/lbryapi' --data '{"method":"resolve","params":{"uri":"what"}}'
+
$curl 'http://localhost:5279' --data '{"method":"resolve","params":{"uri":"what"}}'
[
{
"author": "Samuel Bryan",
@@ -35,7 +35,7 @@
get
with the same parameters.
$curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"uri":"what"} }'
+
$curl 'http://localhost:5279' --data '{"method":"get","params":{"uri":"what"} }'
[
{
//some response fields omitted for brevity
@@ -52,14 +52,14 @@
download_directory
specified in the returned data. Subsequent calls to get
or file_list
will return the status.$curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}'
+
$curl 'http://localhost:5279' --data '{"method":"help"}'
Windows
$Invoke-RestMethod -Uri 'http://localhost:5279/lbryapi' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
+
$Invoke-RestMethod -Uri 'http://localhost:5279' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
$curl "http://localhost:5279/lbryapi" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
+
$curl "http://localhost:5279" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
diff --git a/view/template/developer/_quickstartCredits.php b/view/template/developer/_quickstartCredits.php
index de8befed..3127b668 100644
--- a/view/template/developer/_quickstartCredits.php
+++ b/view/template/developer/_quickstartCredits.php
@@ -7,18 +7,18 @@
To receive credits, you will need to generate a wallet address:
-$curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_new_address"}'
+$curl 'http://localhost:5279' --data '{"method":"wallet_new_address"}'
["bbFxRyWCFRkA9YcuuZD8nE7XTLUxYnddTs"]
Once you have received or purchased some credits, confirm your balance by calling wallet_balance
:
-$curl 'http://localhost:5279/lbryapi' --data '{"method":"wallet_balance"}'
+$curl 'http://localhost:5279' --data '{"method":"wallet_balance"}'
[50.00000000]
Publishing
Publishing to LBRY is just as easy as everything else!
Not sure what to publish? We recommend your favorite picture or home video. Or just grab something from here.
-$curl 'http://localhost:5279/lbryapi' --data '{"method":"publish", "params": {
+$curl 'http://localhost:5279' --data '{"method":"publish", "params": {
"name": "electricsheep",
"file_path": "/home/kauffj/Desktop/electric-sheep.mp4",
"bid": 1,
@@ -45,7 +45,7 @@
Enjoy a Hollywood Film
It's a Disaster starring David Cross is just one of tens of thousands of great pieces of content available. Check it out!
Note! This will cost you LBC. Run the resolve command to see the cost.
-$curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"uri":"itsadisaster"} }'
+$curl 'http://localhost:5279' --data '{"method":"get","params":{"uri":"itsadisaster"} }'
[
{
//some response fields omitted for brevity