mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
Delete quickstart and other instances (#889)
Remove quickstart in favor or lbry.tech playground
This commit is contained in:
parent
9ef9077bbc
commit
fe7bb8db9d
13 changed files with 3 additions and 612 deletions
|
@ -86,10 +86,6 @@ class Controller
|
|||
}
|
||||
$router->get('/roadmap', 'ContentActions::executeRoadmap');
|
||||
|
||||
$router->post('/quickstart/auth', 'DeveloperActions::executeQuickstartAuth');
|
||||
$router->get('/quickstart/{step}?', 'DeveloperActions::executeQuickstart');
|
||||
$router->get('/quickstart/github/callback', 'DeveloperActions::executeQuickstartGithubCallback');
|
||||
|
||||
$router->post('/postcommit', 'OpsActions::executePostCommit');
|
||||
$router->post('/log-upload', 'OpsActions::executeLogUpload');
|
||||
$router->get(static::CACHE_CLEAR_PATH, 'OpsActions::executeClearCache');
|
||||
|
|
|
@ -1,126 +0,0 @@
|
|||
<?php
|
||||
|
||||
class DeveloperActions extends Actions
|
||||
{
|
||||
const DEVELOPER_REWARD = 10,
|
||||
API_DOC_URL = 'https://lbryio.github.io/lbry/';
|
||||
|
||||
public static function executeQuickstart(string $step = null)
|
||||
{
|
||||
$stepLabels = [
|
||||
'' => 'Home',
|
||||
'install' => 'Installation',
|
||||
'api' => 'The API',
|
||||
'credits' => 'Credits'
|
||||
];
|
||||
$allSteps = array_keys($stepLabels);
|
||||
$currentStep = $step ?: $allSteps[0];
|
||||
|
||||
$viewParams = [
|
||||
'currentStep' => $currentStep,
|
||||
'stepLabels' => $stepLabels
|
||||
];
|
||||
|
||||
if ($currentStep !== 'all') {
|
||||
if (!isset($stepLabels[$currentStep])) {
|
||||
Controller::redirect('/quickstart');
|
||||
}
|
||||
|
||||
$stepNum = array_flip($allSteps)[$currentStep];
|
||||
|
||||
$viewParams += [
|
||||
'stepNum' => $stepNum,
|
||||
'prevStep' => $stepNum === 0 ? null : $allSteps[$stepNum - 1],
|
||||
'nextStep' => $stepNum + 1 >= count($allSteps) ? null : $allSteps[$stepNum + 1],
|
||||
];
|
||||
}
|
||||
|
||||
return ['developer/quickstart', $viewParams];
|
||||
}
|
||||
|
||||
public static function prepareQuickstartHomePartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'usdValue' => static::DEVELOPER_REWARD * LBRY::getLBCtoUSDRate()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public static function prepareQuickstartInstallPartial(array $vars)
|
||||
{
|
||||
return $vars + ['versions' => [
|
||||
Os::OS_LINUX => Github::getDaemonReleaseProperty(OS::OS_LINUX, 'tag_name'),
|
||||
Os::OS_OSX => Github::getDaemonReleaseProperty(OS::OS_OSX, 'tag_name'),
|
||||
Os::OS_WINDOWS => Github::getDaemonReleaseProperty(OS::OS_WINDOWS, 'tag_name'),
|
||||
]];
|
||||
}
|
||||
|
||||
public static function prepareFormNewDeveloperRewardPartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'defaultWalletAddress' => Session::get(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS),
|
||||
'error' => Session::get(Session::KEY_DEVELOPER_LAST_FORM) == "new_developer" ? Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR) : '',
|
||||
'apiUrl' => LBRY::getApiUrl('/reward/new?reward_type=new_developer')
|
||||
];
|
||||
}
|
||||
|
||||
public static function prepareFormCreditsPublishPartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'defaultWalletAddress' => Session::get(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS),
|
||||
'error' => Session::get(Session::KEY_DEVELOPER_LAST_FORM) == "new_publish" ? Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR) : '',
|
||||
'apiUrl' => LBRY::getApiUrl('/reward/new?reward_type=first_publish')
|
||||
];
|
||||
}
|
||||
|
||||
public static function executeQuickstartAuth()
|
||||
{
|
||||
Session::set(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS, trim(Request::getPostParam('wallet_address')));
|
||||
Session::set(Session::KEY_DEVELOPER_LAST_FORM, Request::getPostParam('formName'));
|
||||
|
||||
if (Request::getPostParam('returnUrl')) {
|
||||
Session::set(Session::KEY_DEVELOPER_RETURN_URL_SUCCESS, Request::getPostParam('returnUrl'));
|
||||
}
|
||||
|
||||
if (!Config::get(Config::GITHUB_DEVELOPER_CREDITS_CLIENT_ID)) {
|
||||
throw new Exception('no github client id');
|
||||
}
|
||||
|
||||
$gitHubParams = [
|
||||
'client_id' => Config::get(Config::GITHUB_DEVELOPER_CREDITS_CLIENT_ID),
|
||||
'redirect_uri' => Request::getHostAndProto() . '/quickstart/github/callback',
|
||||
'scope' => 'user:email',
|
||||
'allow_signup' => false
|
||||
];
|
||||
|
||||
return Controller::redirect('https://github.com/login/oauth/authorize?' . http_build_query($gitHubParams));
|
||||
}
|
||||
|
||||
public static function executeQuickstartGithubCallback()
|
||||
{
|
||||
$code = Request::getParam('code');
|
||||
|
||||
if (!$code) {
|
||||
Session::setFlash(Session::KEY_DEVELOPER_CREDITS_ERROR, 'This does not appear to be a valid response from GitHub.');
|
||||
} else {
|
||||
$authResponseData = Curl::post('https://github.com/login/oauth/access_token', [
|
||||
'code' => $code,
|
||||
'client_id' => Config::get(Config::GITHUB_DEVELOPER_CREDITS_CLIENT_ID),
|
||||
'client_secret' => Config::get(Config::GITHUB_DEVELOPER_CREDITS_CLIENT_SECRET)
|
||||
], [
|
||||
'headers' => ['Accept: application/json'],
|
||||
'json_response' => true
|
||||
]);
|
||||
|
||||
if (!$authResponseData || !isset($authResponseData['access_token'])) {
|
||||
Session::setFlash(Session::KEY_DEVELOPER_CREDITS_ERROR, 'Request to GitHub failed.');
|
||||
} elseif (isset($authResponseData['error_description'])) {
|
||||
Session::setFlash(Session::KEY_DEVELOPER_CREDITS_ERROR, 'GitHub replied: ' . $authResponseData['error_description']);
|
||||
} else {
|
||||
Session::set(Session::KEY_GITHUB_ACCESS_TOKEN, $authResponseData['access_token']);
|
||||
}
|
||||
}
|
||||
|
||||
return Controller::redirect(Session::get(Session::KEY_DEVELOPER_RETURN_URL_SUCCESS, '/quickstart/credits'));
|
||||
}
|
||||
}
|
|
@ -23,10 +23,10 @@ class DownloadActions extends Actions
|
|||
|
||||
if (isset($oses[$os])) {
|
||||
$uri = GitHub::getDaemonDownloadUrl($os);
|
||||
}
|
||||
|
||||
return Controller::redirect($uri ?: '/quickstart', 302);
|
||||
}
|
||||
return Controller::redirect($uri, 302);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* this is a quick fix to add android, prob not proper design
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?php js_start() ?>
|
||||
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">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">
|
||||
<label for="wallet">Wallet Address</label>
|
||||
<div class="form-input">
|
||||
<input type="text" name="wallet_address" value="<?php echo htmlspecialchars($defaultWalletAddress) ?>"
|
||||
class="required standard " placeholder="bYnFQUPTTDM1BYNCxgxKEav4FFQsrgDBoE">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="wallet">Publishing Transaction ID</label>
|
||||
<div class="form-input">
|
||||
<input type="text" name="transaction_id" value="<?php echo '' ?>"
|
||||
class="required standard " placeholder="e99240e60499b372371a4e461ca25506745686b4c8fa3dd646a83f44ad358255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit-row">
|
||||
<input type="hidden" name="returnUrl" value="<?php echo $returnUrl ?? '/quickstart/credits#no-return' ?>" />
|
||||
<input type="hidden" name="formName" value="new_publish" />
|
||||
<input type="hidden" name="access_token" value="<?php echo Session::get(Session::KEY_GITHUB_ACCESS_TOKEN) ?>" />
|
||||
<input type="submit" value="Send" class="btn-primary" data-submit-label="Send" data-submitting-label="Sending credits..." />
|
||||
</div>
|
||||
</form>
|
|
@ -1,26 +0,0 @@
|
|||
<?php js_start() ?>
|
||||
lbry.quickstartForm('#form-new-developer-reward', "<?php echo $apiUrl ?>");
|
||||
<?php js_end() ?>
|
||||
<form method="POST" action="/quickstart/auth" class="form-inset" id="form-new-developer-reward">
|
||||
<h4 style="margin-top: 0">Receive Credits</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">
|
||||
<label for="wallet">Wallet Address</label>
|
||||
<div class="form-input">
|
||||
<input type="text" name="wallet_address" value="<?php echo htmlspecialchars($defaultWalletAddress) ?>"
|
||||
class="required standard " placeholder="bYnFQUPTTDM1BYNCxgxKEav4FFQsrgDBoE">
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit-row spacer-half">
|
||||
<input type="hidden" name="returnUrl" value="<?php echo $returnUrl ?? '/quickstart/credits#no-return' ?>" />
|
||||
<input type="hidden" name="formName" value="new_developer" />
|
||||
<input type="hidden" name="access_token" value="<?php echo Session::get(Session::KEY_GITHUB_ACCESS_TOKEN) ?>" />
|
||||
<input type="submit" value="Send" class="btn-primary" data-submit-label="Send" data-submitting-label="Sending credits..." />
|
||||
</div>
|
||||
<div class="meta">
|
||||
We require a GitHub account to prevent abuse. This will record your email (no spam) and mark you as interested in the lbry repo.
|
||||
No GitHub account or no public commits? No problem! Join our <a href="https://chat.lbry.io" class="link-primary">Discord chat</a> and
|
||||
post an introduction in #tech.
|
||||
</div>
|
||||
</form>
|
|
@ -1,65 +0,0 @@
|
|||
<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</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>.
|
||||
</p>
|
||||
<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' --data '{"method":"resolve","params":{"uri":"what"}}'
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
"author": "Samuel Bryan",
|
||||
"content_type": "video/mp4",
|
||||
"description": "What is LBRY? An introduction with Alex Tabarrok",
|
||||
"language": "en",
|
||||
"license": "LBRY inc",
|
||||
"nsfw": false,
|
||||
"sources": {
|
||||
"lbry_sd_hash": "d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"
|
||||
},
|
||||
"thumbnail": "https://s3.amazonaws.com/files.lbry.io/logo.png",
|
||||
"title": "What is LBRY?",
|
||||
"ver": "0.0.3"
|
||||
}
|
||||
]</span></code>
|
||||
<h3>First Download</h3>
|
||||
<p>
|
||||
Above, we called the method
|
||||
<code class="code-inline"><a href="<?php echo DeveloperActions::API_DOC_URL ?>#resolve" class="link-primary">resolve</a></code>
|
||||
for the URL <code class="code-inline">lbry://what</code>. This returned the metadata associated with the URL.
|
||||
</p>
|
||||
|
||||
<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' --data '{"method":"get","params":{"uri":"what"} }'
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
<span class="code-bash__comment">//some response fields omitted for brevity</span>
|
||||
"claim_id": "7b670f0034d0eb119c32acfe8b19ae6622dd218f", <span class="code-bash__comment">//a claim ID is persistent for a piece of content. It stays the same if the original publisher updates the entry.</span>
|
||||
"download_directory": "/home/kauffj/Downloads",
|
||||
"download_path": "/home/kauffj/Downloads/LBRY100.mp4",
|
||||
"file_name": "LBRY100.mp4",
|
||||
"metadata": { ... }, <span class="code-bash__comment">//same dictionary as above</span>
|
||||
"outpoint": "6e224057a9dfa3417bb3890da2c4b4e9d2471641185c6c8b33cb57d61365a4f0:1", <span class="code-bash__comment">//an outpoint is a frozen-in-time pointer to a specific piece of content. It changes if the content changes.</span>
|
||||
"total_bytes": 158433904,
|
||||
"written_bytes": 0 <span class="code-bash__comment">//will increase as the file downloads</span>
|
||||
}
|
||||
]</span></code>
|
||||
<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' --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' -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" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
|
||||
</code>
|
|
@ -1,76 +0,0 @@
|
|||
<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>
|
||||
There are several ways to obtain credits. See <a href="/faq/earn-credits" class="link-primary">this page</a> for options. We also reward
|
||||
testers and contributors, so <a href="http://chat.lbry.io" class="link-primary">join our Discord Chat</a> if you'd like to help.
|
||||
</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' --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' --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' --data '{"method":"publish", "params": {
|
||||
"name": "electricsheep",
|
||||
"file_path": "/home/kauffj/Desktop/electric-sheep.mp4",
|
||||
"bid": 1,
|
||||
"metadata": {
|
||||
"description": "Some interesting content",
|
||||
"title": "My interesting content",
|
||||
"author": "Video shot by me@example.com",
|
||||
"language": "en",
|
||||
"license": "LBRY Inc",
|
||||
"nsfw": false
|
||||
} <span class="code-bash__comment">//this should match the metadata returned by resolve_name </span>
|
||||
}}'
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
"claim_id": "2081486f32dc493980c77bdaa0502950b532af13",
|
||||
"fee": 0.000329,
|
||||
"nout": 0,
|
||||
"tx": "0100000001a2dcee285b3f552fb8b3eef416c9f17...",
|
||||
"txid": "d71d63ebb3e10067bfd0b302433bc1ab09fbdd5dc9bc687f50aeb6809d1770fe" <span class="code-bash__comment">//this is the value you need to copy</span>
|
||||
}
|
||||
]</span></code>
|
||||
|
||||
|
||||
<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' --data '{"method":"get","params":{"uri":"itsadisaster"} }'
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
<span class="code-bash__comment">//some response fields omitted for brevity</span>
|
||||
"claim_id": "bd970a51249cba542a9acfb130147294a6326ee2",
|
||||
"download_directory": "/home/kauffj/Downloads",
|
||||
"download_path": "/home/kauffj/Downloads/It's A Disaster_Feature.mp4",
|
||||
"metadata": {
|
||||
"author": "Written and directed by Todd Berger",
|
||||
"content_type": "video/mp4",
|
||||
"description": "Four couples meet for Sunday brunch only to discover they are stuck in a house together as the world may be about to end."
|
||||
}
|
||||
}
|
||||
]</span></code>
|
||||
|
||||
|
||||
<h3>Try the UI</h3>
|
||||
<p>LBRY comes with a fully-featured UI so that normal people can use it too. You can download it <a href="https://github.com/lbryio/lbry-desktop/releases" class="link-primary">here</a>.</p>
|
||||
<h3 id="community">You Did It! What's Next?</h3>
|
||||
<p>
|
||||
Start building something awesome! LBRY works as a discovery and distribution backend for everything from films to CAD files.
|
||||
<a class="link-primary" href="/api">View the full API documentation</a>.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://chat.lbry.io" class="link-primary">Join our Discord chat</a> to interact with LBRY developers and other community members. Please visit the #dev room (note: this is not a default channel).
|
||||
</p>
|
||||
<p>
|
||||
Visit our <a href="https://github.com/lbryio" class="link-primary">GitHub page</a> to view the source code or report issues.
|
||||
</p>
|
|
@ -1,16 +0,0 @@
|
|||
<div class="meta">Quickstart Home</div>
|
||||
<h2>
|
||||
LBRY is an open-source "<a href="http://www.usv.com/blog/fat-protocols" class="link-primary">fat</a>" protocol, providing
|
||||
decentralized content discovery and distribution.</h2>
|
||||
<h2>
|
||||
In just a few minutes, you will have:
|
||||
</h2>
|
||||
<ul>
|
||||
<li><h3>Learned the basics of the LBRY API.</h3></li>
|
||||
<li><h3>Irrevocably inscribed a piece of knowledge. Possibly of a cat.</h3>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-center">
|
||||
<a href="/quickstart/<?php echo $firstStep ?>" class="btn-alt">Begin the Guide</a>
|
||||
</p>
|
||||
<div class="meta">Not a guide lover? <a href="/quickstart/all" class="link-primary"> Here it is all on one page</a>.</div>
|
|
@ -1,33 +0,0 @@
|
|||
<h3>Download</h3>
|
||||
<table class="quickstart__table">
|
||||
<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="/get/lbrynet.<?php echo Os::OS_OSX ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_OSX] ?></a></td>
|
||||
<td><a href="/get/lbrynet.<?php echo Os::OS_LINUX ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_LINUX] ?></a></td>
|
||||
<td><a href="/get/lbrynet.<?php echo Os::OS_WINDOWS ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_WINDOWS] ?></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>
|
||||
<h3>Run</h3>
|
||||
<p>
|
||||
Unzip and launch the daemon:
|
||||
</p>
|
||||
<p>
|
||||
<code class="code-bash"><span class="code-bash__prompt">$</span>lbrynet-daemon</code>
|
||||
</p>
|
||||
<p>While running, the daemon will provide a JSON-RPC interface on localhost. We'll learn how to interact with that next.</p>
|
||||
<?php /*
|
||||
<div class="meta spacer1">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>
|
||||
<div class="meta">The first time you run the daemon, it must catch-up with most recent blockheaders. This can take a few minutes.</div>
|
||||
*/ ?>
|
|
@ -1,53 +0,0 @@
|
|||
<?php NavActions::setNavUri('/learn') ?>
|
||||
<?php Response::addJsAsset('/js/quickstart.js') ?>
|
||||
<?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="quickstart">
|
||||
<?php if ($currentStep === 'all'): ?>
|
||||
<div class="content content-dark">
|
||||
<div class="meta"><a href="/quickstart" class="link-primary">Quickstart Home</a></div>
|
||||
<h1>Quickstart</h1>
|
||||
</div>
|
||||
<?php foreach (array_filter(array_keys($stepLabels)) as $step): ?>
|
||||
<section>
|
||||
<div class="content content-dark">
|
||||
<?php echo View::render('developer/_quickstart' . ucfirst($step)) ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endforeach ?>
|
||||
<?php elseif ($stepNum > 0): ?>
|
||||
<div class="content content-dark">
|
||||
<h1>Quickstart: <?php echo $stepLabels[$currentStep] ?></h1>
|
||||
</div>
|
||||
<ol class="quickstart__progress-bar">
|
||||
<?php $stepCounter = 0 ?>
|
||||
<?php foreach ($stepLabels as $step => $stepLabel): ?>
|
||||
<li class="<?php echo $currentStep == $step ? 'active' : '' ?> <?php echo ++$stepCounter <= $stepNum ? 'completed' : '' ?>">
|
||||
<a href="/quickstart<?php echo $step ? '/' . $step : '' ?>"><?php echo $stepLabel ?></a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<div class="content content-dark">
|
||||
<div class="spacer2">
|
||||
<?php echo View::render('developer/_quickstart' . ucfirst($currentStep)) ?>
|
||||
</div>
|
||||
<?php if ($nextStep): ?>
|
||||
<div>
|
||||
<a href="/quickstart/<?php echo $nextStep ?>" class="btn-alt">Next: <?php echo $stepLabels[$nextStep] ?> »</a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="content content-dark">
|
||||
<?php echo View::render('developer/_quickstartHome', [
|
||||
'firstStep' => array_keys($stepLabels)[1]
|
||||
]) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer') ?>
|
|
@ -1,82 +0,0 @@
|
|||
lbry.quickstartForm = function (selector, apiUrl) {
|
||||
var form = $(selector),
|
||||
accessToken = form.find(':input[name="access_token"]').val(),
|
||||
walletAddressInput = form.find(':input[name="wallet_address"]'),
|
||||
transactionIdInput = form.find(':input[name="transaction_id"]'),
|
||||
storageKey = form.attr('id') + "SuccessHTML",
|
||||
submitButton = form.find(':input[type="submit"]'),
|
||||
isAutomaticSubmit = false,
|
||||
isSubmitting = false;
|
||||
|
||||
function resetFormState() {
|
||||
isSubmitting = false;
|
||||
walletAddressInput.attr('readonly', null);
|
||||
transactionIdInput.attr('readonly', null);
|
||||
submitButton.val(submitButton.data('submitLabel')).attr('disabled', null);
|
||||
}
|
||||
|
||||
if (window.localStorage.getItem(storageKey)) {
|
||||
form.find('.notice-success').html(window.localStorage.getItem(storageKey)).show();
|
||||
form.find('.form-row, .submit-row').hide();
|
||||
} else if (accessToken) {
|
||||
form.submit(function (event) {
|
||||
if (isSubmitting) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var postData = {
|
||||
access_token: accessToken,
|
||||
wallet_address: walletAddressInput.val()
|
||||
};
|
||||
|
||||
form.find('.notice-success, .notice-error').hide();
|
||||
|
||||
if (!walletAddressInput.val()) {
|
||||
resetFormState();
|
||||
if (!isAutomaticSubmit) {
|
||||
form.find('.notice-error').html("Please supply a wallet address.").show();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (transactionIdInput.length) {
|
||||
if (!transactionIdInput.val()) {
|
||||
resetFormState();
|
||||
if (!isAutomaticSubmit) {
|
||||
form.find('.notice-error').html("Please supply a transaction ID.").show();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
postData.transaction_id = transactionIdInput.val();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
walletAddressInput.attr('readonly', 'readonly');
|
||||
transactionIdInput.attr('readonly', 'readonly');
|
||||
submitButton.val(submitButton.data('submittingLabel')).attr('disabled', 'disabled');
|
||||
|
||||
$.post(apiUrl, postData)
|
||||
.done(function (responseData) {
|
||||
var data = responseData.data;
|
||||
var anchor = $('<a class="link-primary--break-word"></a>');
|
||||
anchor.attr("href", "https://explorer.lbry.io/tx/" + data.TransactionID);
|
||||
anchor.html(data.TransactionID)
|
||||
form.find('.notice-success')
|
||||
.html(data.RewardAmount + " credits sent in transaction ")
|
||||
.append(anchor)
|
||||
.show();
|
||||
window.localStorage.setItem(storageKey, form.find('.notice-success').html());
|
||||
})
|
||||
.fail(function (xhr) {
|
||||
var responseData = $.parseJSON(xhr.responseText);
|
||||
form.find('.notice-error').html(responseData.error.length ? responseData.error : "Something went wrong. Please email grin@lbry.io").show();
|
||||
})
|
||||
.always(resetFormState);
|
||||
})
|
||||
|
||||
isAutomaticSubmit = true;
|
||||
form.submit();
|
||||
isAutomaticSubmit = false;
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
@import "global";
|
||||
|
||||
.quickstart
|
||||
{
|
||||
max-width: 860px;
|
||||
}
|
||||
|
||||
.quickstart__table
|
||||
{
|
||||
margin: 0 auto $spacing-vertical;
|
||||
td, th
|
||||
{
|
||||
border-right: 1px dotted #eee;
|
||||
padding: 4px 20px;
|
||||
&:last-child
|
||||
{
|
||||
border-right: 0 none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.quickstart__section
|
||||
{
|
||||
margin-bottom: $spacing-vertical * 3;
|
||||
}
|
||||
|
||||
.quickstart__claim-form
|
||||
{
|
||||
margin: $spacing-vertical * 2 0;
|
||||
input[type="text"] { width: 100%; }
|
||||
}
|
||||
|
||||
.quickstart__progress-bar
|
||||
{
|
||||
margin: $spacing-vertical * 3 80px;
|
||||
background: #ddd;
|
||||
display: flex;
|
||||
height: 16px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
|
||||
> li {
|
||||
flex: auto;
|
||||
list-style: none;
|
||||
position: relative;
|
||||
|
||||
&:first-child {
|
||||
max-width: 0;
|
||||
|
||||
> a {
|
||||
// arbitrary values
|
||||
// since % won't work
|
||||
right: -30px;
|
||||
width: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
&:before {
|
||||
background: #ddd;
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
display: block;
|
||||
height: 24px;
|
||||
right: -12px;
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
width: 24px;
|
||||
}
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
color: #ccc;
|
||||
padding: 4px 0;
|
||||
position: absolute;
|
||||
right: -25%;
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
top: -36px;
|
||||
width: 50%;
|
||||
}
|
||||
$color-indicator: #777;
|
||||
.completed {
|
||||
background: lighten($color-indicator, 10%);
|
||||
|
||||
&:before {
|
||||
background: lighten($color-indicator, 10%);
|
||||
}
|
||||
}
|
||||
.active {
|
||||
a { font-weight: bold; }
|
||||
background: lighten($color-indicator, 10%);
|
||||
|
||||
&:before {
|
||||
background: lighten($color-indicator, 16%);
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,0.3);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
@import "blog";
|
||||
@import "bounty";
|
||||
@import "roadmap";
|
||||
@import "quickstart";
|
||||
@import "social";
|
||||
@import "home";
|
||||
@import "slider";
|
||||
|
|
Loading…
Add table
Reference in a new issue