lbry-sdk/README.md

74 lines
3.6 KiB
Markdown
Raw Normal View History

2016-05-23 04:45:08 +02:00
[![Build Status](https://travis-ci.org/lbryio/lbry.svg?branch=master)](https://travis-ci.org/lbryio/lbry)
2016-10-30 22:55:12 +01:00
[![Coverage Status](https://coveralls.io/repos/github/lbryio/lbry/badge.svg)](https://coveralls.io/github/lbryio/lbry)
2016-05-23 04:45:08 +02:00
# LBRYnet
2015-08-20 17:27:15 +02:00
LBRYnet is a fully decentralized network for distributing data. It consists of peers uploading
and downloading data from other peers, possibly in exchange for payments, and a distributed hash
table, used by peers to discover other peers.
2016-05-23 22:13:46 +02:00
## Installation
Download the [latest release](https://github.com/lbryio/lbry/releases/latest) or see [INSTALL.md](INSTALL.md) for manual installation.
## Overview
2015-08-20 17:27:15 +02:00
On LBRYnet, data is broken into chunks, and each chunk is specified by its sha384 hash sum. This
guarantees that peers can verify the correctness of each chunk without having to know anything
about its contents, and can confidently re-transmit the chunk to other peers. Peers wishing to
transmit chunks to other peers announce to the distributed hash table that they are associated
with the sha384 hash sum in question. When a peer wants to download that chunk from the network,
it asks the distributed hash table which peers are associated with that sha384 hash sum. The
distributed hash table can also be used more generally. It simply stores IP addresses and
ports which are associated with 384-bit numbers, and can be used by any type of application to
help peers find each other. For example, an application for which clients don't know all of the
necessary chunks may use some identifier, chosen by the application, to find clients which do
know all of the necessary chunks.
2016-05-23 22:13:46 +02:00
## For Developers
2015-08-20 17:27:15 +02:00
2016-06-11 00:39:35 +02:00
The bundled LBRY application uses the lbrynet JSONRPC api found in `lbrynet.lbrynet_daemon.LBRYDaemon`. This api allows for applications and web services like the lbry browser UI to interact with lbrynet. If you've installed lbrynet, you can run `lbrynet-daemon` without running the app. While the app or `lbrynet-daemon` is running, you can use the following to show the help for all the available commands:
2016-06-11 00:28:21 +02:00
```
from jsonrpc.proxy import JSONRPCProxy
2016-06-11 00:39:35 +02:00
try:
from lbrynet.conf import API_CONNECTION_STRING
except:
print "You don't have lbrynet installed!"
API_CONNECTION_STRING = "http://localhost:5279/lbryapi"
2016-06-11 00:28:21 +02:00
api = JSONRPCProxy.from_url(API_CONNECTION_STRING)
if not api.is_running():
print api.daemon_status()
else:
for func in api.help():
print "%s:\n%s" % (func, api.help({'function': func}))
```
If you've installed lbrynet, it comes with a file sharing application, called `lbrynet-daemon`, which breaks
2015-08-20 17:27:15 +02:00
files into chunks, encrypts them with a symmetric key, computes their sha384 hash sum, generates
a special file called a 'stream descriptor' containing the hash sums and some other file metadata,
and makes the chunks available for download by other peers. A peer wishing to download the file
2016-06-11 00:28:21 +02:00
must first obtain the 'stream descriptor' and then may open it with his `lbrynet-daemon` client,
2015-08-20 17:27:15 +02:00
download all of the chunks by locating peers with the chunks via the DHT, and then combine the
chunks into the original file, according to the metadata included in the 'stream descriptor'.
2016-05-23 22:13:46 +02:00
For detailed instructions, see [INSTALL.md](INSTALL.md) and [RUNNING.md](RUNNING.md).
2015-08-20 17:27:15 +02:00
2016-05-23 22:13:46 +02:00
Documentation: doc.lbry.io (may be out of date)
2015-08-20 17:27:15 +02:00
Source code: https://github.com/lbryio/lbry
2015-08-20 17:27:15 +02:00
2016-05-23 22:13:46 +02:00
To contribute, [join us on Slack](https://lbry-slackin.herokuapp.com/) or contact josh@lbry.io. Pull requests are also welcome.
2015-08-20 17:27:15 +02:00
## Support
2015-08-20 17:27:15 +02:00
2016-05-23 22:13:46 +02:00
Please open an issue and describe your situation in detail. We will respond as soon as we can.
2016-05-23 22:25:14 +02:00
For private issues, contact josh@lbry.io.
2015-08-20 17:27:15 +02:00
## License
2015-08-20 17:27:15 +02:00
2015-12-06 20:36:41 +01:00
See [LICENSE](LICENSE)