Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
125c4edb49 | ||
|
|
a2197547c1 | ||
|
|
a8f9d90f22 | ||
|
|
2098f6bbba | ||
|
|
158c49b58f | ||
|
|
08759225a6 | ||
|
|
2fe727d9c2 | ||
|
|
935ca0694a | ||
|
|
ff9c0dbc8b | ||
|
|
cf6850c89d | ||
|
|
f97bb66eda | ||
|
|
04a8ef7d96 | ||
|
|
b46edd2ba0 | ||
|
|
2eef37c05d | ||
|
|
62cbc4edad | ||
|
|
9be3af9cb5 | ||
|
|
679561b334 | ||
|
|
7da3b6dacf | ||
|
|
88bc857a31 | ||
|
|
abbebe07d3 | ||
|
|
cd3faa3270 | ||
|
|
786be56ed4 | ||
|
|
a9cdfd94ba | ||
|
|
aa79b0ae21 | ||
|
|
53262f300d | ||
|
|
ae51c52240 | ||
|
|
706b9752e2 | ||
|
|
34f7842505 | ||
|
|
0e95e6dc72 | ||
|
|
55d0a6df63 | ||
|
|
ad1395a5b9 | ||
|
|
0a7955bcdc | ||
|
|
d7f7612f6d | ||
|
|
d0069e7a51 | ||
|
|
c207123556 |
No files matched your search
@@ -57,7 +57,7 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
|
||||
## Security
|
||||
We take security seriously. Please contact [security@lbry.com](mailto:security@lbry.com) regarding any security issues.
|
||||
|
||||
[Our PGP key is here](https://keybase.io/lbry/key.asc) if you need it.
|
||||
[Our PGP key is here](https://lbry.com/faq/pgp-key) if you need it.
|
||||
|
||||
## Contact
|
||||
The primary contact for this project is [Thomas Zarebczan](https://github.com/tzarebczan) (tom+github@lbry.com).
|
||||
@@ -32,6 +32,11 @@ export default currentUrl => {
|
||||
title: "View LBRY resources",
|
||||
url: "/resources"
|
||||
},
|
||||
{
|
||||
name: "Tutorials",
|
||||
title: "LBRY Tutorials",
|
||||
url: "/tutorials"
|
||||
},
|
||||
{
|
||||
name: "Community",
|
||||
title: "Interact with LBRY",
|
||||
|
||||
@@ -35,9 +35,4 @@ export default () => linkGrid([{
|
||||
destination: "/build",
|
||||
label: "Build An App",
|
||||
title: "Builder's Guide"
|
||||
}, {
|
||||
description: "Jumpstart your LBRY development with 100 LBC, on us",
|
||||
destination: "/developer-program",
|
||||
label: "Get Credits",
|
||||
title: "Developer Program"
|
||||
}]);
|
||||
@@ -180,6 +180,23 @@ function generateEvent(event) {
|
||||
title="View this pull request on GitHub"
|
||||
>${escapeSpecialCharacters(event.payload.pull_request.title)}</a></em> in
|
||||
`;
|
||||
|
||||
case "PullRequestReviewEvent":
|
||||
return `
|
||||
<strong><a
|
||||
href="${generateUrl("actor", event)}"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
title="Visit ${event.actor.login}'s profile on GitHub"
|
||||
>${event.actor.display_login}</a></strong> reviewed pull request
|
||||
|
||||
<em><a
|
||||
href="${generateUrl("pull_request", event)}"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
title="View this review on GitHub"
|
||||
>${escapeSpecialCharacters(event.payload.pull_request.title)}</a></em> in
|
||||
`;
|
||||
|
||||
case "PullRequestReviewCommentEvent":
|
||||
return `
|
||||
|
||||
@@ -12,7 +12,7 @@ const resolve = function(urls) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
const options = {
|
||||
method: "POST",
|
||||
url: "https://api.lbry.tv/api/v1/proxy",
|
||||
url: "https://api.na-backend.odysee.com/api/v1/proxy",
|
||||
headers:
|
||||
{
|
||||
"Content-Type": "application/json"
|
||||
@@ -49,7 +49,7 @@ const getTrending = function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
const options = {
|
||||
method: "POST",
|
||||
url: "https://api.lbry.tv/api/v1/proxy",
|
||||
url: "https://api.na-backend.odysee.com/api/v1/proxy",
|
||||
headers:
|
||||
{
|
||||
"Content-Type": "application/json"
|
||||
@@ -77,7 +77,7 @@ const getTrending = function() {
|
||||
"technology"],
|
||||
channel_ids: [],
|
||||
not_channel_ids: [],
|
||||
not_tags: ["porn", "nsfw", "mature", "xxx"],
|
||||
not_tags: ["porn", "porno", "nsfw", "mature", "xxx", "sex", "creampie", "blowjob", "handjob", "vagina", "boobs", "big boobs", "big dick", "pussy", "cumshot", "anal", "hard fucking", "ass", "fuck", "hentai"],
|
||||
order_by: ["trending_group", "trending_mixed"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30,9 +30,9 @@ If you want to contribute to LBRY, there's definitely something for you! The fir
|
||||
--- | --- | --- | ---
|
||||
| [lbry-desktop](https://github.com/lbryio/lbry-desktop) (and lbry.tv) | JavaScript (ReactJS, Electron) | A desktop browser for the LBRY network for Windows, macOS, and Linux as well as a web interface on lbry.tv. [[lbry-desktop]] is built with [[lbry-sdk]]. | [Video](/resources/video-lbrydesktop)
|
||||
| [lbry-android](https://github.com/lbryio/lbry-android) | Java | A graphical browser for the LBRY network for Android. [[lbry-android]] uses [[lbry-sdk]] to interact with the network. | [Video](/resources/video-lbryandroid)
|
||||
| [odysee-api](https://github.com/lbryio/odysee-api) | Go | An API server for https://odysee.com that reimplements some of the SDK APIs. | |
|
||||
| [odysee-ios](https://github.com/lbryio/odysee-ios) | Swift | The Odysee IOS app. | |
|
||||
| [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between [[lbry-desktop]] and [[lbry-android]]. | |
|
||||
| [lbrytv](https://github.com/lbryio/lbrytv) | Go | An API server for https://lbry.tv and https://odysee.com that reimplements some of the SDK APIs. | |
|
||||
|
||||
### Websites
|
||||
| Domain | Language (Toolset) | What Is It
|
||||
@@ -44,7 +44,7 @@ If you want to contribute to LBRY, there's definitely something for you! The fir
|
||||
| Domain | Language (Toolset) | What Is It
|
||||
--- | --- | ---
|
||||
| [chainquery](https://github.com/lbryio/chainquery) | Go | A utility for parsing, extracting, and updating the LBRY blockchain into structured SQL data. Used by several internal tools and useful for 3rd-party application development.
|
||||
| [lighthouse](https://github.com/lbryio/lighthouse) | JavaScript, ElasticSearch | A search service for the LBRY blockchain.
|
||||
| [lighthouse](https://github.com/lbryio/lighthouse) | Go, ElasticSearch | A search service for the LBRY blockchain.
|
||||
| [wunderbot](https://github.com/lbryio/lbry-wunderbot) | JavaScript (Node) | A chatbot used by the LBRY discord.
|
||||
| [block-explorer](https://github.com/lbryio/block-explorer) | PHP (vanilla) | A blockchain explorer for the LBRY blockchain.
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ description: Find the LBRY specification, API documentation, our Contributor's g
|
||||
- [API Wrappers](/resources/api-wrappers)
|
||||
- [LBRY SDK Configuration Settings](/resources/daemon-settings)
|
||||
- [Claim Signing](/resources/claim-signing)
|
||||
- [Regtest Setup](/resources/regtest-setup)
|
||||
- [LBRY Android App Build Steps](/resources/android-build)
|
||||
- [Lighthouse (search) API](https://github.com/lbryio/lighthouse)
|
||||
- [Run Your Own Wallet Server](/resources/wallet-server)
|
||||
- [Run Your Own lbry.tv](/resources/web-instance)
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
title: Hosting a BitTorrent UDP Tracker
|
||||
description: Setting up a tracker for use with LBRY P2P.
|
||||
---
|
||||
|
||||
*Warning: Unfortunately, some hosting providers explicitly forbids running a tracker in the ToS. Check with your ISP or VPS before running one yourself.*
|
||||
|
||||
The main difference from this guide to any other BitTorrent tracker guide is that it contains optional instructions for configuring a default peer IP fallback from a reflector node in the LBRY network.
|
||||
The software we are going to use is a [fork of chihaya](https://github.com/lbryio/tracker) with support for this optional feature of using default peer IPs.
|
||||
|
||||
# Configuration
|
||||
A default configuration can be found at `dist/example_config.yaml`.
|
||||
This is an example for an UDP server running on 6969 with metrics enabled. Remember to **change the private key** to some random string.
|
||||
|
||||
Also, "fixed peers" prehook is enabled with default IPs. This will include reflector on responses. Discard the section to disable it or ask around on Discord for different servers. Enabling it helps as a fallback for content with no seeds.
|
||||
```
|
||||
---
|
||||
tracker:
|
||||
announce_interval: "30m"
|
||||
min_announce_interval: "15m"
|
||||
metrics_addr: "0.0.0.0:6880"
|
||||
udp:
|
||||
addr: "0.0.0.0:6969"
|
||||
max_clock_skew: "10s"
|
||||
private_key: ">>>>CHANGE THIS TO SOME RANDOM THING<<<<"
|
||||
enable_request_timing: false
|
||||
allow_ip_spoofing: false
|
||||
max_numwant: 100
|
||||
default_numwant: 50
|
||||
max_scrape_infohashes: 50
|
||||
storage:
|
||||
name: "memory"
|
||||
config:
|
||||
gc_interval: "3m"
|
||||
peer_lifetime: "31m"
|
||||
shard_count: 1024
|
||||
prometheus_reporting_interval: "1s"
|
||||
prehooks:
|
||||
- name: "fixed peers"
|
||||
options:
|
||||
fixed_peers:
|
||||
- 51.81.57.64:5567
|
||||
- 135.148.122.112:5567
|
||||
```
|
||||
|
||||
# Running from Docker
|
||||
|
||||
This section assumes `docker` and `docker-compose` to be installed on a Linux distro. Please check official docs on how to install [Docker Engine](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/).
|
||||
|
||||
## Setting up
|
||||
In order to define a tracker service and let Docker Compose manage it, create a file named `docker-compose.yml` with:
|
||||
```
|
||||
version: "3"
|
||||
services:
|
||||
tracker:
|
||||
image: lbry/tracker
|
||||
command: --config /config/conf.yml
|
||||
volumes:
|
||||
- .:/config
|
||||
network_mode: host
|
||||
restart: always
|
||||
```
|
||||
Unfortunately the tracker does not work without `network_mode: host` due some bug with UDP on Docker. In this mode, firewall configuration needs to be done manually. If using `ufw`, try `ufw allow 6969`.
|
||||
|
||||
Now, move the configuration to the same directory as `docker-compose.yml`, naming it `conf.yml`. If it is not ready, check the configuration section above.
|
||||
|
||||
Start the tracker by running the following in the same directory as the compose file:
|
||||
`docker-compose up -d`
|
||||
Logs can be read with:
|
||||
`docker-compose logs`
|
||||
To stop:
|
||||
`docker-compose down`
|
||||
|
||||
## Building the containter (optional)
|
||||
A Dockerfile is provided within the repo. To build the container locally, run this command on the same directory the repo was cloned:
|
||||
`sudo docker build -f Dockerfile . -t some_name/tracker:latest`
|
||||
It will produce an image called `some_name/tracker`, which can be used in the Docker Compose section.
|
||||
|
||||
# Running from source as a service
|
||||
|
||||
Up to date guide will always live in the [chihaya repo](https://github.com/chihaya/chihaya#getting-started).
|
||||
|
||||
This section assumes Go language compiler to be installed. If that is not the case, please follow the [official instructions](https://go.dev/doc/install).
|
||||
|
||||
## Cloning and compiling
|
||||
```bash
|
||||
git clone https://github.com/lbryio/tracker.git
|
||||
cd tracker
|
||||
go build ./cmd/chihaya
|
||||
./chihaya --help
|
||||
```
|
||||
|
||||
## Running
|
||||
After configuring
|
||||
```bash
|
||||
./chihaya --config path/to/your/config.yaml
|
||||
```
|
||||
|
||||
For ease of maintenance, it is recommended to run the tracker as a service. As there are many ways of doing it, please check a guide on `init`, `systemd` or the way your operating system distribution recommends.
|
||||
|
||||
This is an example for running it under as the current user using `systemd`:
|
||||
```
|
||||
[Unit]
|
||||
Description=Chihaya BT tracker
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
#User=chihaya
|
||||
#Group=chihaya
|
||||
WorkingDirectory=/home/user/github/tracker
|
||||
ExecStart=/home/user/github/tracker/chihaya --config dist/example_config.yaml
|
||||
Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
To try it, change `/home/user/github/tracker` to where the code was cloned and run:
|
||||
```bash=
|
||||
mkdir -p ~/.config/systemd/user
|
||||
# PASTE FILE IN ~/.config/systemd/user/tracker.service
|
||||
systemctl --user enable tracker
|
||||
systemctl --user start tracker
|
||||
systemctl --user status tracker
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Hosting a DHT bootstrap node
|
||||
description: How to setup a bootstrap DHT node
|
||||
---
|
||||
|
||||
This guide will help you setup and maintain a LBRY DHT [bootstrap node](https://en.wikipedia.org/wiki/Bootstrapping_node). Those nodes are important so people can join the network on first startup.
|
||||
|
||||
After finishing and checking that it works, if you want to add your node to the SDK bootstrap list just open a PR adding yourself to the [conf file](https://github.com/lbryio/lbry-sdk/blob/master/lbry/conf.py#L694) or an issue on the [SDK repo](https://github.com/lbryio/lbry-sdk/).
|
||||
|
||||
## Requirements
|
||||
- Being reachable over UDP on the internet at some port
|
||||
- 1GB of memory
|
||||
- Docker or Python 3.7 (check [pyenv](https://github.com/pyenv/pyenv) if your Linux distribution doesn't offer that version)
|
||||
|
||||
## Running directly from Docker
|
||||
This is the easiest way to run and maintain your node. Just run:
|
||||
```bash
|
||||
docker run -d -p 4444:4444 lbry/dht-bootstrap:latest
|
||||
```
|
||||
|
||||
## Installing LBRY SDK from source
|
||||
The most up to date guide for doing it will always be in the [INSTALL.md file](https://github.com/lbryio/lbry-sdk/blob/master/INSTALL.md). Please refer to it if you run into trouble. Otherwise, this should be enough most of the time (assuming requirements are all there):
|
||||
```bash
|
||||
git clone https://github.com/lbryio/lbry-sdk.git
|
||||
make install
|
||||
```
|
||||
|
||||
### Running a node from source
|
||||
After installing, just:
|
||||
```bash
|
||||
python scripts/dht_node.py
|
||||
```
|
||||
|
||||
### Checking if it is working
|
||||
From another machine with the SDK installed, run:
|
||||
```bash
|
||||
python scripts/dht_node.py --bootstrap_node your-server-domain-here.com:4444
|
||||
```
|
||||
After 10-20 seconds, you should see more than 0 peers on the log messages. If that is not the case, check firewall on the bootstrap node and see if it is reachable.
|
||||
@@ -1,208 +0,0 @@
|
||||
---
|
||||
title: Regtest Setup
|
||||
description: Regtest is a parallel testing network for the LBRY blockchain. Learn how to use it in this resource article.
|
||||
---
|
||||
|
||||
## Why Use Regtest
|
||||
|
||||
A regtest server provides for a way to instantly generate blocks so that transactions can be instantaneous, which ultimately means no waiting for confirmations from the blockchain. Also, it’s not a problem if you accidentally corrupt your wallet, since no real funds are lost! Delete the files and setup a new one.
|
||||
|
||||
## Setup
|
||||
|
||||
To begin setting up the network, there are a few things you need.
|
||||
|
||||
You'll need a Linux or a Mac distribution to run all this. A virtual machine is fine.
|
||||
Note: These instructions specifically were tested on Ubuntu version 16.04.
|
||||
|
||||
### Virtual Environment
|
||||
|
||||
First up it's a good idea to create a Python virtual environment. This requires you to have a functional python2.7 setup, with the Python package manager `pip` installed. To create a new virtual environment in a folder `lbry-env`, run this:
|
||||
`virtualenv -p /usr/bin/python2.7 lbry-env`
|
||||
To enter the environment, run:
|
||||
`source lbry-env/bin/activate`.
|
||||
|
||||
### lbrycrd
|
||||
|
||||
You need to download a build of `lbrycrd` from [here](https://github.com/lbryio/lbrycrd/releases/), no installation required. To configure `lbrycrd` you need to create a file at `~/.lbrycrd/lbrycrd.conf`,
|
||||
containing the following:
|
||||
```ini
|
||||
rpcuser=test
|
||||
rpcpassword=test
|
||||
rpcport=18332
|
||||
regtest=1
|
||||
server=1
|
||||
txindex=1
|
||||
daemon=1
|
||||
listen=0
|
||||
discover=0
|
||||
```
|
||||
|
||||
### lbryum-server
|
||||
|
||||
To install lbryum-server, you first need to install the package `leveldb`. After that, download the source from [here](https://github.com/lbryio/lbryum-server/releases), and run the following _not_ inside the environment:
|
||||
```bash
|
||||
cd lbryum-server
|
||||
sudo pip2 install -r requirements.txt
|
||||
```
|
||||
|
||||
If you're not running debian/\*buntu or a derivative of those, you need to edit the `configure` file a bit. In line 11, remove the `apt-get` line and manually install the required packages. In line 51, change `adduser` to `useradd` and on the same line, change `--disabled-password` to `-p !`.
|
||||
|
||||
```bash
|
||||
sudo ./configure
|
||||
sudo python2 setup.py install
|
||||
```
|
||||
The `sudo ./configure` command creates a new user in the system by the name "lbryum", which is the user through which we'll be running the server. lbryum-server also needs W/R access to `/var/lbryum-server`.
|
||||
To do that run:
|
||||
```bash
|
||||
sudo chown -R lbryum /var/lbryum-server
|
||||
```
|
||||
When installed, append/use the following config options to the `/etc/lbryum.conf` file:
|
||||
```ini
|
||||
[lbrycrdd]
|
||||
lbrycrdd_host = localhost
|
||||
lbrycrdd_port = 18332
|
||||
# user and password from lbrycrd.conf
|
||||
lbrycrdd_user = test
|
||||
lbrycrdd_password = test
|
||||
|
||||
[network]
|
||||
type=lbrycrd_regtest
|
||||
```
|
||||
|
||||
### lbryum
|
||||
|
||||
To install lbryum, first download the source from [here](https://github.com/lbryio/lbryum/releases). To install it, run the following inside the virtual environment:
|
||||
```bash
|
||||
cd lbryum
|
||||
pip2 install -r requirements.txt
|
||||
pip2 install -e .
|
||||
```
|
||||
|
||||
After installation completes, you must set the config option for lbryum using:
|
||||
```bash
|
||||
lbryum setconfig default_servers '{ "localhost": { "t": "50001" }}'
|
||||
lbryum setconfig chain 'lbrycrd_regtest'
|
||||
```
|
||||
|
||||
Alternatively, you can create a file `touch ~/.lbryum/config` and paste the following config:
|
||||
```json
|
||||
{
|
||||
"chain": "lbrycrd_regtest",
|
||||
"default_servers": {
|
||||
"localhost": {
|
||||
"t": "50001"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### lbry
|
||||
|
||||
Download source from [here](https://github.com/lbryio/lbry-sdk/releases), and run the following inside the environment:
|
||||
```bash
|
||||
cd lbry
|
||||
pip2 install -r requirements.txt
|
||||
pip2 install -e .
|
||||
mkdir ~/.lbrynet
|
||||
touch ~/.lbrynet/daemon_settings.yml
|
||||
```
|
||||
|
||||
Append the following in the newly created `~/.lbrynet/daemon_settings.yml` file:
|
||||
```yml
|
||||
blockchain_name: lbrycrd_regtest
|
||||
lbryum_servers:
|
||||
- localhost:50001
|
||||
reflect_uploads: false
|
||||
share_usage_data: false
|
||||
use_upnp: false
|
||||
```
|
||||
|
||||
### Last step
|
||||
Go to the `lbryum` folder once again and run:
|
||||
```bash
|
||||
pip2 install -e .
|
||||
```
|
||||
This is to ensure that `lbrynet-daemon` uses the correct wallet.
|
||||
|
||||
## Firing up the regtest server
|
||||
|
||||
### Wallet backup
|
||||
|
||||
To start off, if you've already used LBRY on your machine, you need to backup the wallet by copying the folders `~/.lbrynet` and `~/.lbryum` and then deleting them to start from fresh. Run
|
||||
`mkdir ~/.lbryum`
|
||||
|
||||
Now it should be all set-up. Just execute the commands in the following order, and the regtest server should be good to go.
|
||||
|
||||
### 1) lbrycrd
|
||||
|
||||
To run the `lbrycrd` daemon, run the following in the `lbrycrd` folder:
|
||||
`./lbrycrdd`
|
||||
|
||||
To generate blocks, run `./lbrycrd-cli generate <num_of_blocks>`
|
||||
You'll need to generate some blocks to get the network going. Start off by generating at least 100.
|
||||
`./lbrycrd-cli generate 173`
|
||||
|
||||
If you'd prefer a more verbose output from lbrycrdd, run lbrycrd using:
|
||||
`./lbrycrdd -printtoconsole`
|
||||
|
||||
### 2) lbryum-server
|
||||
|
||||
To run the server, run:
|
||||
```bash
|
||||
sudo runuser -l lbryum -c 'lbryum-server --conf=/etc/lbryum.conf'
|
||||
```
|
||||
Note: conf flag can be left out if the config is in the default directory(default: `/etc/lbryum.conf`)
|
||||
|
||||
### 3) lbryum
|
||||
|
||||
To run the lbryum, run:
|
||||
```bash
|
||||
lbryum daemon start
|
||||
```
|
||||
|
||||
Generate some more blocks, get a wallet address by running:
|
||||
`lbryum getunusedaddress`
|
||||
and then send some credits to your wallet by doing
|
||||
`./lbrycrd-cli sendtoaddress <address> <num_of_credits>`
|
||||
|
||||
### 4) lbry
|
||||
|
||||
You can now run `lbrynet-daemon`, and it should connect to the `lbryum`. Now you can use the regtest stack as you would normally use lbryum.
|
||||
|
||||
## Shutdown
|
||||
|
||||
To stop the network, run `lbrynet-cli daemon_stop`, `lbryum daemon stop`, and kill the `lbryum-server` process and stop lbrycrd by `lbrycrdd-cli stop`. If you want to use your wallet and the official servers again, backup the new regtest wallet, and replace it with your own.
|
||||
|
||||
## Note 1
|
||||
You need to generate a few blocks every time you make a new transaction in the form of send, receive, claim, update, publish, support, tip, etc. for it to show up in the daemon and lbryum, etc.
|
||||
|
||||
## Note 2
|
||||
If something goes wrong and you get a "Block not found" error, remember to delete `/var/lbryum-server` before trying again.
|
||||
|
||||
## Cheatsheet
|
||||
|
||||
#### Required processes in the correct order
|
||||
```bash
|
||||
lbrycrdd
|
||||
|
||||
sudo runuser -l lbryum -c 'lbryum-server --conf=/etc/lbryum.conf'
|
||||
|
||||
lbryum daemon start
|
||||
|
||||
lbrynet-daemon
|
||||
```
|
||||
|
||||
#### Generate blocks
|
||||
```bash
|
||||
lbrycrd-cli generate 5
|
||||
```
|
||||
|
||||
#### Get a wallet address
|
||||
```bash
|
||||
lbryum getunsusedaddress
|
||||
```
|
||||
|
||||
#### Send credits from lbrycrd to your wallet
|
||||
```bash
|
||||
lbrycrd-cli sendtoaddress <address> <num_of_credits>
|
||||
```
|
||||
@@ -65,7 +65,7 @@ This document exists to introduce a project to a new visitor. It may also serve
|
||||
|
||||
### Security
|
||||
|
||||
* "We take security seriously. Please contact [security@lbry.com](mailto:security@lbry.com) regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it."
|
||||
* "We take security seriously. Please contact [security@lbry.com](mailto:security@lbry.com) regarding any security issues. Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it."
|
||||
|
||||
### Contact
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# How to spend your time locked transaction
|
||||
|
||||
This guide will walk you through the process of claiming a time locked transaction from a USB key. This involves accessing the transaction details on the key, making sure you have the latest version of `lbrynet` and finally using the transaction details to call `account_deposit` to claim your LBC.
|
||||
|
||||
## Check `lbrynet` version
|
||||
|
||||
If you already have `lbrynet` installed then you can check your version like this:
|
||||
|
||||
```
|
||||
lbrynet version
|
||||
```
|
||||
|
||||
If above command fails, you may need to start `lbrynet` first (and then try above again):
|
||||
|
||||
```
|
||||
lbrynet start
|
||||
```
|
||||
|
||||
If you do not have `lbrynet` installed or your version is less than `v0.108.0` then you can get latest version here:
|
||||
|
||||
[https://github.com/lbryio/lbry-sdk/releases](https://github.com/lbryio/lbry-sdk/releases)
|
||||
|
||||
|
||||
## Gather Information
|
||||
|
||||
### Transaction ID and Transaction Output Number
|
||||
|
||||
1. On the USB key, find a file named `address.txt` and copy the address in this file.
|
||||
1. Go to [LBRY Explorer](https://explorer.lbry.com/) and enter the address you copied.
|
||||
1. You should see one transaction containing this address, click on this transaction.
|
||||
1. You will need two pieces of information on this page, the `transaction id` and the `nout`.
|
||||
1. The `transaction id` can be found at the top of the page and directly below the text `LBRY Transaction`.
|
||||
1. The `nout` is the position of the output containing your address, starting with 0. Starting from the top of the list of outputs, count the outputs until you get to your address, then subtract 1 from this count, that is your `nout`.
|
||||
|
||||
### Private Key and Redeem Script
|
||||
|
||||
1. On the USB key, find a file named `key.zip` and unzip this file using the password emailed to you previously.
|
||||
1. You should now have a file named `key.txt` which is base64 encoded and contains your `private key` and `redeem script`.
|
||||
1. To decode the contents of the file you can use a website such as [base64decode.org](https://www.base64decode.org/) (not a secure option) or if you have Python installed you can do this on the command line:
|
||||
```
|
||||
python -m base64 -d /path/to/key.txt
|
||||
```
|
||||
1. After decoding you will see a key/value mapping of various items, including `privateKey` and `redeemScript`. Take note of these values.
|
||||
|
||||
## Redeem
|
||||
|
||||
Now that you have gathered the necessary information it is easy to redeem your LBC. Time locked transaction can be redeemed using the `lbrynet account deposit` command (fill in the values you gathered previously):
|
||||
|
||||
```
|
||||
lbrynet account deposit <transaction id> <nout> <redeemScript> <privateKey>
|
||||
```
|
||||
|
||||
If you get an error that says `AssertionError: Cannot find private key for signing output.`, try a different number for `<nout>` (for example, increase or decrease it by 1).
|
||||
|
||||
Enjoy your LBC!
|
||||
|
||||
## Get in touch
|
||||
|
||||
Whether you got to the end without a hiccup or you got stuck along the way, we want to hear from you. [Join our Discord](https://discord.gg/y3W9JuS) to get help, stay updated, and talk to other wallet server operators.
|
||||
@@ -7,7 +7,7 @@ This guide will walk you through the process of setting up a LBRY wallet server.
|
||||
|
||||
## Start With A Fresh Server
|
||||
|
||||
We recommend a dual-core server with at least 16GB RAM, 100GB disk, and a fresh Ubuntu 18.04 install. Memory usage is flexible. 32 GB works best, but 16 GB is enough for a few clients.
|
||||
We recommend a quad-core server with at least 16GB RAM, 200GB disk, and a fresh Ubuntu 18.04 install. Memory usage is flexible. 32 GB works best, but 16 GB is enough for a few clients.
|
||||
|
||||
Make sure your firewall has ports 9246 and 50001 open. 9246 is the port lbrycrd uses to communicate to other nodes. 50001 is the wallet server RPC port.
|
||||
|
||||
@@ -24,7 +24,6 @@ daemon=1
|
||||
rpcuser=lbry
|
||||
rpcpassword=lbry
|
||||
dustrelayfee=0.00000001
|
||||
rpcworkqueue=128
|
||||
```
|
||||
|
||||
Feel free to change the `rpcuser` or `rpcpassword`. If you do, you'll have to update the `DAEMON_URL` variable later on (in the docker-compose.yml file) to match the user/password you chose.
|
||||
@@ -41,11 +40,19 @@ Description="LBRYcrd daemon"
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/<your_user>/lbrycrdd -datadir="/home/<your_user>/.lbrycrd"
|
||||
User=<your_user>
|
||||
Group=<your_user_group>
|
||||
ExecStart=/home/<your_user>/lbrycrdd -datadir="/home/<your_user>/.lbrycrd" -pid="/run/lbrycrdd/lbrycrdd.pid"
|
||||
# Creates /run/lbrycrdd
|
||||
RuntimeDirectory=lbrycrdd
|
||||
Type=Forking
|
||||
PIDFile=/run/lbrycrdd/lbrycrdd.pid
|
||||
Restart=on-failure
|
||||
KillMode=process
|
||||
|
||||
# hardening
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
MemoryDenyWriteExecute=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -55,6 +62,8 @@ Then run `sudo systemctl daemon-reload`.
|
||||
|
||||
Now you can start and stop lbrycrd with `sudo service lbrycrdd start` and `sudo service lbrycrdd stop`.
|
||||
|
||||
You can watch the lbrycrd log with `tail -f ~/.lbrycrd/debug.log`
|
||||
|
||||
## Set Up Docker
|
||||
|
||||
### Install Docker & Docker Compose
|
||||
@@ -67,21 +76,58 @@ sudo systemctl enable docker && sudo systemctl start docker && \
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
```
|
||||
|
||||
### Download our docker-compose.yml
|
||||
### Download our example docker-compose.yml
|
||||
|
||||
You can see it [here](https://github.com/lbryio/lbry-sdk/blob/master/docker/docker-compose-wallet-server.yml).
|
||||
```
|
||||
curl -L "https://raw.githubusercontent.com/lbryio/lbry-sdk/master/docker/docker-compose-wallet-server.yml" -o docker-compose.yml
|
||||
```
|
||||
|
||||
Make sure the user and password in the `DAEMON_URL` variable (the `lbry@lbry` part) in this docker-compose.yml matches thes user/password in your `~/.lbrycrd/lbrycrd.conf` file.
|
||||
Make sure the user and password in the `DAEMON_URL` variable (the `lbry@lbry` part) in this docker-compose.yml matches the user/password in your `~/.lbrycrd/lbrycrd.conf` file.
|
||||
|
||||
### Download snapshots for elasticsearch and the wallet server (optional)
|
||||
|
||||
You can skip the initial sync by starting from a snapshot. The following will download a snapshot of the elasticsearch volume and move it into the default location for docker volumes on ubuntu, on other systems you may need to adjust the path used here. Note: snapshot heights must be the same. The tars can be deleted after setting the volumes up.
|
||||
|
||||
```bash
|
||||
SNAPSHOT_HEIGHT="1049658"
|
||||
ES_VOLUME_PATH="/var/lib/docker/volumes/${USER}_es01"
|
||||
ES_SNAPSHOT_TAR_NAME="es_snapshot_${SNAPSHOT_HEIGHT}.tar"
|
||||
ES_SNAPSHOT_URL="https://snapshots.lbry.com/hub/${ES_SNAPSHOT_TAR_NAME}"
|
||||
|
||||
wget $ES_SNAPSHOT_URL
|
||||
echo "decompressing elasticsearch snapshot"
|
||||
tar -xf $ES_SNAPSHOT_TAR_NAME
|
||||
sudo chown -R $USER:root "snapshot_es_${SNAPSHOT_HEIGHT}"
|
||||
sudo chmod -R 775 "snapshot_es_${SNAPSHOT_HEIGHT}"
|
||||
sudo mkdir -p $ES_VOLUME_PATH
|
||||
sudo rm -rf "${ES_VOLUME_PATH}/_data"
|
||||
sudo mv "snapshot_es_${SNAPSHOT_HEIGHT}" "${ES_VOLUME_PATH}/_data"
|
||||
```
|
||||
|
||||
The following will download the wallet server docker volume and move it into place as well.
|
||||
|
||||
```bash
|
||||
echo "fetching wallet server snapshot"
|
||||
SNAPSHOT_HEIGHT="1049658"
|
||||
HUB_VOLUME_PATH="/var/lib/docker/volumes/${USER}_wallet_server"
|
||||
SNAPSHOT_TAR_NAME="wallet_server_snapshot_${SNAPSHOT_HEIGHT}.tar"
|
||||
SNAPSHOT_URL="https://snapshots.lbry.com/hub/${SNAPSHOT_TAR_NAME}"
|
||||
|
||||
wget $SNAPSHOT_URL
|
||||
tar -xf $SNAPSHOT_TAR_NAME
|
||||
sudo mkdir -p $HUB_VOLUME_PATH
|
||||
sudo rm -rf "${HUB_VOLUME_PATH}/_data"
|
||||
sudo chown -R 999:999 "snapshot_${SNAPSHOT_HEIGHT}"
|
||||
sudo mv "snapshot_${SNAPSHOT_HEIGHT}" "${HUB_VOLUME_PATH}/_data"
|
||||
```
|
||||
|
||||
## Turn It On
|
||||
|
||||
### Start the servers
|
||||
|
||||
```
|
||||
docker-compose up --detach
|
||||
```
|
||||
@@ -111,7 +157,7 @@ echo '{"id":1,"method":"server.version"}' | timeout 1 curl telnet://localhost:50
|
||||
You should see a response like `{"jsonrpc": "2.0", "result": ["0.46.1", "0.0"], "id": 1}`. If you do, congratulations! You've set up your own wallet server.
|
||||
|
||||
|
||||
To check Elastic search, there are two commands you can use:
|
||||
To check Elastic search, there are two commands you can use:
|
||||
|
||||
```
|
||||
curl localhost:9200 # get Elastic status
|
||||
@@ -142,7 +188,7 @@ From time to time, we'll release an update that requires recreating one of the d
|
||||
The process is similar to an update, but causes the server to be down for much longer.
|
||||
|
||||
#### Main database
|
||||
Holds the raw blockchain data and takes many hours (can take a day or two) to resync from scratch, so be sure to have a snapshot or try that last.
|
||||
Holds the raw blockchain data and takes several days to resync from scratch, so be sure to have a snapshot or try that last.
|
||||
|
||||
```
|
||||
docker pull lbry/wallet-server:latest-release
|
||||
@@ -152,8 +198,7 @@ WALLET_SERVER_SNAPSHOT_URL= docker-compose up --detach
|
||||
```
|
||||
|
||||
#### Elasticsearch
|
||||
ES does the indexing of claims from the main database. It should take around 30 minutes to resync on a fast machine.
|
||||
|
||||
ES does the indexing of claims from the main database. It should take around 6 hours to resync on a fast machine.
|
||||
|
||||
```
|
||||
docker pull lbry/wallet-server:latest-release
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: Hosting your own LBRY Web Instance
|
||||
description: Setting up an app instance as a webpage.
|
||||
---
|
||||
|
||||
Run your own instance of https://lbry.tv using Docker images.
|
||||
|
||||
|
||||
## Run the SDK
|
||||
|
||||
The LBRY SDK provides RPC and streaming endpoints to interact with the LBRY network. Web users will connect to it directly, so it must be web-accessible. You may have to open ports on your firewall.
|
||||
|
||||
```
|
||||
docker run -d -p 5279:5279 -p 5280:5280 vshyba/websdk
|
||||
```
|
||||
|
||||
This image will not save files to disk. It has the `save_blobs` and `save_files` config options set to `false`. If you want to save files, see [Building your own SDK image](#building-your-own-sdk-image) below.
|
||||
|
||||
|
||||
## Run the web app
|
||||
|
||||
Clone and install the app as described in the [lbry-desktop repo README](https://github.com/lbryio/lbry-desktop).
|
||||
If you want to customize it further, follow the extra steps in `Customize the web app` section. Otherwise:
|
||||
|
||||
```
|
||||
git clone https://github.com/lbryio/lbry-desktop.git
|
||||
yarn
|
||||
cp .env.defaults .env
|
||||
```
|
||||
|
||||
Configure .env with the following settings. They must match the SDK ports in the previous section.
|
||||
```
|
||||
WEB_SERVER_PORT=8080
|
||||
SDK_API_PATH=http://localhost:5279
|
||||
LBRY_WEB_API=http://localhost:5279
|
||||
LBRY_WEB_STREAMING_API=http://localhost:5280
|
||||
LBRY_API_URL=http://disabled-api/
|
||||
LBRY_WEB_BUFFER_API=https://disabled
|
||||
```
|
||||
|
||||
Compile and run
|
||||
```
|
||||
NODE_ENV=production yarn compile:web
|
||||
nodejs web/index.js
|
||||
```
|
||||
|
||||
|
||||
## Building your own SDK image
|
||||
|
||||
If you want to customize the SDK settings, you can
|
||||
|
||||
Clone the SDK repo:
|
||||
```
|
||||
git clone https://github.com/lbryio/lbry-sdk.git
|
||||
```
|
||||
|
||||
Create a `docker/webconf.yaml` file and modify as you need. This is a good start:
|
||||
```
|
||||
allowed_origin: "*"
|
||||
max_key_fee: "0.0 USD"
|
||||
save_files: false
|
||||
save_blobs: false
|
||||
streaming_server: "0.0.0.0:5280"
|
||||
api: "0.0.0.0:5279"
|
||||
data_dir: /tmp
|
||||
download_dir: /tmp
|
||||
wallet_dir: /tmp
|
||||
```
|
||||
|
||||
Note that it is required to have `streaming_server` and `api` set to user-accessible IPs. If you want this to be accessible on the open web, that means setting them to `0.0.0.0`.
|
||||
|
||||
|
||||
To build the image, run:
|
||||
```
|
||||
docker build -f docker/Dockerfile.web -t <your dockerhub username>/<project name, like 'websdk'> .
|
||||
docker push <dockerhub username/project name>
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
## Hello Satoshi - The LBRY "Hello World" Tutorial
|
||||
|
||||
Let's get started with a simple "Hellow World" tutorial... LBRY style!
|
||||
|
||||
This tutorial will guide you through creating a basic [Electron](https://electronjs.org) application that calls to the LBRY network and renders an image returned by the network.
|
||||
|
||||
Electron is nice because it allows you to easily create web apps that don't rely on any centralized web servers, but you can absolutely use any tooling or language you would like.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
This tutoral only has a few simple requirements:
|
||||
|
||||
- [npm](https://www.npmjs.com). Learn how to install it [here](https://www.npmjs.com/get-npm).
|
||||
- [git](https://git-scm.com/).
|
||||
|
||||
Once you have those installed (see the links above for downloads and How-To's), you are ready to begin!
|
||||
|
||||
#### Step 1. Download and build the starter project
|
||||
|
||||
Grab "[electron-starter](https://github.com/lbryio/electron-starter)". This project serves as a base upon which you can build LBRY applications. (Similar to "create-react-app" for React development.)
|
||||
|
||||
If you have git and npm installed, run the following lines one at a time:
|
||||
|
||||
```
|
||||
git clone https://github.com/lbryio/electron-starter
|
||||
cd electron-starter
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
#### Step 2. Make sure everything works
|
||||
|
||||
Before we make any changes, it's a good idea to verify that everything is working correctly.
|
||||
|
||||
Try typing a word into the text input and click the button to [resolve](https://lbry.tech/api/sdk#resolve) it.
|
||||
|
||||
This performs a [[claim]] lookup, which retrieves metadata the title, thumbnail, and file type from the LBRY blockchain.
|
||||
|
||||
Try resolving `lbry://doitlive`.
|
||||
|
||||
If you received no errors, move on to Step 3! Otherwise, head back to Step 1 to make sure you have all the requirements installed correctly.
|
||||
|
||||
#### Step 3. Make a small change to the code
|
||||
|
||||
Now that we have the metadata, let's [get](https://lbry.tech/api/sdk#get) the actual file!
|
||||
|
||||
The code to do this is already there, just un-comment these lines in the app's [renderer/index.js](https://github.com/lbryio/electron-starter/blob/master/src/renderer/index.js) file.
|
||||
|
||||
```js
|
||||
claimData.innerText = "Loading...";
|
||||
|
||||
Lbry.get({ uri: `lbry://${value}` })
|
||||
.then(result => {
|
||||
const filePath = result.download_path;
|
||||
const image = document.createElement("img");
|
||||
|
||||
image.src = filePath;
|
||||
imageWrapper.appendChild(image);
|
||||
|
||||
claimData.innerText = JSON.stringify(result, null, 2);
|
||||
})
|
||||
.catch(error => {
|
||||
claimData.innerText = JSON.stringify(error, null, 2);
|
||||
});
|
||||
```
|
||||
|
||||
This is the code that actually downloads a file.
|
||||
|
||||
There are more robust ways to handle the download progress, but this will work fine for images. After you added that code back, try `get`ing `lbry://doitlive`.
|
||||
|
||||
### Success! You Did It!
|
||||
|
||||
While our Hello Satoshi app isn't much to look at, it shows how simple it is to connect to the LBRY network and download files!
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: Tutorials
|
||||
description: Learn how to setup, use, deploy, and develop with LBRY.
|
||||
---
|
||||
# LBRY Programming Tutorials
|
||||
|
||||
## Tutorial #1 - "Hello Satoshi!"
|
||||
Learn how to [create and modify a simple LBRY electron application](/tutorial-hellosatoshi) we'll call "[Hello Satoshi](/tutorial-hellosatoshi)".
|
||||
|
||||
---
|
||||
|
||||
# Setup your Development Environment
|
||||
|
||||
## Desktop Application
|
||||
[Video tutorial](/resources/video-lbrydesktop) to setup the [Desktop app](https://github.com/lbryio/lbry-desktop) development environment.
|
||||
|
||||
## Android Application
|
||||
[Video tutorial](/resources/video-lbryandroid) to setup the [Android app](https://github.com/lbryio/lbry-android) development environment.
|
||||
|
||||
## LBRY SDK
|
||||
[Video tutorial](/resources/video-lbrysdk) to setup the [LBRY SDK](https://github.com/lbryio/lbry-sdk) development environment.
|
||||
|
||||
## LBRY Blockchain
|
||||
[Video tutorial](/resources/video-lbrycrd) to setup the [LBRY Blockchain](https://github.com/lbryio/lbrycrd) development environment.
|
||||
|
||||
Reference in new issue
Block a user