more info for building desktop apps

This commit is contained in:
Sean Yesmunt 2019-02-05 16:11:30 -05:00 committed by Jeremy Kauffman
parent e7c1c160b5
commit 62ab4e7c72

View file

@ -43,32 +43,47 @@ Let's look at some specific types of applications and the basic design for each.
By full web application, we mean a centrally-hosted web application that uses most or all of the suite of capabilities the LBRY protocol provides. By full web application, we mean a centrally-hosted web application that uses most or all of the suite of capabilities the LBRY protocol provides.
1. Pick your favorite language and stack and do your typical setup to get a "Hello World" application running. 1. Pick your favorite language and stack and do your typical setup to get a "Hello World" application running.
1. Install [lbry-sdk](//github.com/lbryio/lbry). (Docker images? Other convenient ways of doing this?) 1. Install [lbry-sdk](https://github.com/lbryio/lbry). You can keep this separate from your app, or install it as one of your dependencies. The LBRY desktop app installs it automatically after all the other dependencies are installed. See it in action [here](https://github.com/lbryio/lbry-desktop/blob/master/build/download-sdk.js).
1. Bridging basics. 1. Once [lbry-sdk](https://github.com/lbryio/lbry) is installed, run `lbrynet start` at some point in your startup process.
1. See SDK Basics 1. There are a number of [api wrappers](https://lbry.tech/resources/api-wrappers) available in several different languages. Most of these have been created by community members! These allow you to easily send commands to the SDK in the language of your choice. If a wrapper for the language you would like to use doesn't exist, contact [someone?]. (All of the bounties we have on https://lbry.io/bounty/lbry-binding are claimed, should this be linked at all?)
1. See [SDK Basics](#SDK-basics) for more info on using the API.
#### Blockchain Applications #### Blockchain Applications
Sometimes you don't need the [SDK](https://github.com/lbryio/lbry). If you wanted to build a block explorer, you would only need to include [lbrycrd](https://github.com/lbryio/lbrycrd). Or if you only want to search through blockchain, [chainquery](https://github.com/lbryio/chainquery) is perfect for that. You can pair these with any language or tooling you want. Sometimes you don't need the [SDK](https://github.com/lbryio/lbry). For applications that only need blockchain data, such as a block explorer, check out [lbrycrd](#lbrycrd) and [Chainquery](#Chainquery).
#### Other Web Applications #### Other Web Applications
It is also possible to create a browser extension similar to Joule and Metamask. The browser could interact with the [SDK](https://github.com/lbryio/lbry) running locally on a users computer, or through a centrally hosted server. It is also possible to create a browser extension similar to Joule and Metamask. Generally there are two ways to do this:
1. Have the user run [lbry-sdk](https://github.com/lbryio/lbry) on their computer and send commands from the browser that interact with the user's personal wallet.
### Desktop Applications 2. Run [lbry-sdk](https://github.com/lbryio/lbry) on a centrally hosted server and manage keys or funds for each user.
Going through a centralized server can be safer (with added authentication), but it also comes with more responsibility to keep your user's funds secure.
#### Desktop Applications
If you are looking for more decentralization, a full desktop app can achieve that. If that is not something you care about, there are still a number of features that are desirable over a traditional web application, with full access to the file system being one of those. This allows users to be in control of how they view their files, and if they want to help strengthen LBRY network through seeding. If you are looking for more decentralization, a full desktop app can achieve that. If that is not something you care about, there are still a number of features that are desirable over a traditional web application, with full access to the file system being one of those. This allows users to be in control of how they view their files, and if they want to help strengthen LBRY network through seeding.
If you would like to create a desktop application, there are a few ways to do so. If you would like to create a desktop application, there are a few ways to do so.
#### Electron Apps ##### Electron Apps
The [official LBRY desktop app](https://github.com/lbryio/lbry-desktop) is built with electron. It is very easy to develop with, and allows web developers to easily start creating "native" desktop applications. You can use a plain html page with a `<script>` tag, or build out a large web app. The official desktop app uses React. The [official LBRY desktop app](https://github.com/lbryio/lbry-desktop) is built with electron. It is very easy to build with, and allows web developers to easily start creating "native" desktop applications. You can use a plain html document with a `<script>` tag, or build out a large web app. The official desktop app uses React and Redux.
If you do want to write an electron app, check out the [Electron Starter Project](https://github.com/lbryio/electron-starter) for a bare bones setup that is very similar to how [lbry-desktop](https://github.com/lbryio/lbry-desktop) is structured. It's also a simple way to explore the [SDK api]((https://https://lbry.tech/api/sdk)). We are actively trying to make it better. If you see something wrong, feel free to submit an issue or PR! :) If you want to write an electron app, check out the [electron-starter project](https://github.com/lbryio/electron-starter) for a bare bones setup that is very similar to how [lbry-desktop](https://github.com/lbryio/lbry-desktop) is structured. It's also a simple way to explore the [SDK api](<(https://https://lbry.tech/api/sdk)>).
#### Other Applications Check out [this video](https://spee.ch/6/lbry-electron-starter) for a brief overview and guide to get it running. If you just want the source code, go [here](https://github.com/lbryio/electron-starter). Or, if you really really want to see it in action _now_, just paste these commands into your terminal:
```
git clone https://github.com/lbryio/electron-starter
cd electron-starter
yarn
yarn dev
```
##### Other Applications
Who needs javascript? You can use any language to develop your own LBRY desktop application. Just use the SDK (see [SDK Basics](#SDK-basics)). Who needs javascript? You can use any language to develop your own LBRY desktop application. Just use the SDK (see [SDK Basics](#SDK-basics)).