Learn
+New to LND? + Overview, + Installation, and + Tutorial +
+Curious about the Lightning Network? Resources
+diff --git a/README.md b/README.md index 8929b22..2b5898b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,42 @@ # Lightning Network Daemon Developer Site -Documentation for the Lightning Network Daemon +Developer guides and resources for the Lightning Network Daemon + +## Overview + +This repository contains functionality for programmatically pulling guides from +the lnd repo, using a Python script and Jinja2 templates to output markdown +files, which are the corresponding pages in the fully rendered Jekyll static +site. + +Pay special attention to these files: +- `templates/base.md`: The Jinja2 template fed into the Python + script, holding the Jeykll header to be prepended to the guide content pulled + from Github. The `templates` dir also holds the templates for special cases + where for example a dev site-specific footer needs to be appended +- `update_and_render.sh`: Update local guides to the latest version available +- `render.py`: The Python script that uses local guides and Jinja template to + strip out redundant titles, add page headers/footers, and output Jekyll + markdown +- `deploy.sh`: Build static site from Jekyll markdown and deploy to Google Cloud + Platform + +The rest of the files in this repo are the standard Jekyll site files. ## Running the site locally +### Prerequisites + +You're going to need: + + - **Linux or OS X** — Windows may work, but is unsupported. + - **Ruby, version 2.2.5 or newer** + - **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal. + +### Running locally + +```shell +git clone https://github.com/lightninglabs/lightning-dev-site +``` Install Jekyll: ``` $ gem install jekyll bundler @@ -11,23 +45,65 @@ Run the site and watch for changes: ``` $ bundle exec jekyll serve ``` +* If running remotely add: `--host=0.0.0.0` -## Deployment -The Lightning Dev Site is deployed with `s3_website`. Visit their [github -repo](https://github.com/laurilehmijoki/s3_website) for more information. +## Regenerating documentation -### Steps +```shell +# Install Jinja for python templating +pip install Jinja2 +``` + +### Get the latest INSTALL.md +```shell +curl -o INSTALL.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/INSTALL.md +``` + +### Fetch the latest Docker guide +```shell +curl -o DOCKER-README.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docker/README.md +``` -1. Add the deployment credentials for `s3_config.yml` +### Get the latest gRPC guides +```shell +curl -o python.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/grpc/python.md +curl -o javascript.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/grpc/javascript.md ``` -$ export LN_S3_ID="YOUR_S3_ID" -$ export LN_S3_SECRET="YOUR_S3_SECRET" -$ export LN_CLOUDFRONT_DISTRIBUTION_ID="YOUR_CLOUDFRONT_DISTRIBUTION_ID" + +Let's run the script to render the guides: +```shell +python render.py ``` -2. Deploy the site from local changes: +Now that you're all set up, you can just run `./update_and_render.sh` to +automatically pull the latest markdown files and render the local Jekyll docs. + +## Deployment + +The Lightning API is deployed with Google Cloud Platform. Visit [this blog +post](https://little418.com/2015/07/jekyll-google-cloud-storage.html) for more +information. +### Steps + +1. Install Google Cloud SDK and authenticate into it: +```bash +brew cask install google-cloud-sdk +gcloud auth login +``` + +2. Build +```bash +bundle exec jekyll build ``` -s3_website push + +3. Push to Google Cloud Bucket +```bash +# -m use faster multithreaded uploads +# -d delete remote files that aren't in the source +# -r recurse into source subdirectories +gsutil -m rsync -d -r ./_site gs://dev.lightning.community ``` + +In the future, you can just run `./deploy.sh` to deploy automatically. diff --git a/_config.yml b/_config.yml index e283820..a90951d 100644 --- a/_config.yml +++ b/_config.yml @@ -14,14 +14,13 @@ # You can create any custom variable you would like, and they will be accessible # in the templates via {{ site.myvariable }}. title: Lightning Network Developers -email: maxfangx@gmail.com +email: hello@lightning.engineering description: > # this means to ignore newlines until "baseurl:" - Developer resources, documentation, and education for the Lightning Network - Daemon. + Developer resources and documentation for the Lightning Network Daemon. baseurl: "" # the subpath of your site, e.g. /blog -url: "" # the base hostname & protocol for your site, e.g. http://example.com +url: "http://dev.lightning.community" # the base hostname & protocol for your site, e.g. http://example.com twitter_username: lightning -github_username: lightninglabs +github_username: lightningnetwork/lnd # Build settings markdown: kramdown @@ -34,11 +33,15 @@ permalink: pretty # Exclude from processing. # The following items will not be processed, by default. Create a custom list # to override the default setting. -# exclude: -# - Gemfile -# - Gemfile.lock -# - node_modules -# - vendor/bundle/ -# - vendor/cache/ -# - vendor/gems/ -# - vendor/ruby/ +exclude: + - Gemfile + - Gemfile.lock + - node_modules + - vendor/bundle/ + - vendor/cache/ + - vendor/gems/ + - vendor/ruby/ + - templates + - render.py + - update_and_render.sh + - s3_website.yml diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..744eb45 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,49 @@ + diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..3ebfe3c --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,17 @@ +
+ + + + +New to lnd? - Installation and - Tutorial +
Resources and documentation for the + Lightning Network Daemon (LND) +
+New to LND? + Overview, + Installation, and + Tutorial +
+Curious about the Lightning Network? Resources
+Looking for detailed dev manuals? Developer Guides
+API Reference Documentation? API site
+Want to help build the future? Contribute
+Looking to read the code? Github
+Follow the + Lightning Labs community blog + to keep posted about LND.
-Need a reference? Documentation
-Want to learn about Lightning Network? Resources
-Want to help build the future? Contribute
- - {{ content }} +Join the + LND Developer Slack + to meet the team, discuss development, and hang out! +
+See the cool apps and wallets built on Lightning: Lapp directory
++ The Lightning Network scales blockchains and enables trustless instant + payments by keeping most transactions off-chain and leveraging the + security of the underlying blockchain as an arbitration layer. +
++ This is accomplished primarily through "payment-channels", wherein two + parties commit funds and pay each other by updating the balance + redeemable by either party in the channel. This process is instant and + saves users from having to wait for block confirmations before they can + render goods or services. +
++ Payment channels are trustless, since any attempt to defraud the current + agreed-upon balance in the channel results in the complete forfeiture of + funds by the liable party. +
++ By moving payments off-chain, the cost of opening and closing channels + (in the form of on-chain transaction fees) is ammortized over the volume + of payments in that channel, enabling micropayments and small-value + transactions for which the on-chain transaction fees would otherwise be + too expensive to justify. Furthermore, the Lightning Network scales not + with the transaction throughput of the underlying blockchain, but with + modern data processing and latency limits - payments can be made nearly + as quickly as packets can be sent. +
++ Hash Time-Locked Contracts (HTLCs) allow transactions to be sent between + parties who do not have a direct channels by routing it through multiple + hops, so anyone connected to the Lightning Network is part of a single, + interconnected global financial system. +
++ In short, the Lightning Network enables scalable blockchains through a + high-volume of instant transactions not requiring custodial delegation. +
++ Continue reading at the full LND Overview and + Developer Guide. +
++ To view this article, please log in and return to this page to make + a payment. +
+ Log in + {% elif payment.status == "complete" %} +To view this article, please pay 1000 satoshis via the request below:
+{{ payment.payment_request }}