• Stars
    star
    2,576
  • Rank 17,795 (Top 0.4 %)
  • Language
    C++
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The blockchain that provides the digital content namespace for the LBRY protocol

LBRYcrd - The LBRY blockchain

Build Status MIT licensed

LBRYcrd uses a blockchain similar to bitcoin's to implement an index and payment system for content on the LBRY network. It is a fork of bitcoin core. In addition to the libraries used by bitcoin, LBRYcrd also uses icu4c.

Please read the lbry.tech overview for a general understanding of the LBRY pieces. From there you could read the LBRY spec for specifics on the data in the blockchain.

Table of Contents

  1. Installation
  2. Usage
    1. Examples
    2. Data directory
  3. Running from Source
    1. Ubuntu with pulled static dependencies
    2. Ubuntu with local shared dependencies
    3. MacOS (cross-compiled)
    4. MacOS with local shared dependencies
    5. Windows (cross-compiled)
    6. Use with CLion
  4. Contributing
  5. Mailing List
  6. License
  7. Security
  8. Contact

Installation

Latest binaries are available from https://github.com/lbryio/lbrycrd/releases. There is no installation procedure; the CLI binaries will run as-is and will have any uncommon dependencies statically linked into the binary. The QT GUI is not supported. LBRYcrd is distributed as a collection of executable files; traditional installers are not provided.

Usage

The lbrycrdd executable will start a LBRYcrd node and connect you to the LBRYcrd network. Use the lbrycrd-cli executable to interact with lbrycrdd through the command line. Command-line help for both executables are available through the "--help" flag (e.g. lbrycrdd --help). Examples:

Examples

Run ./lbrycrdd -server -daemon to start lbrycrdd in the background.

Run ./lbrycrd-cli -getinfo to check for some basic information about your LBRYcrd node.

Run ./lbrycrd-cli help to get a list of all commands that you can run. To get help on specific commands run ./lbrycrd-cli [command_name] help

Test locally:

./lbrycrdd -server -regtest -txindex  # run this in its own window
./lbrycrd-cli -regtest generate 120   # mine 20 spendable coins
./lbrycrd-cli -regtest claimname my_name deadbeef 1 # hold a name claim with 1 coin
./lbrycrd-cli -regtest generate 1     # get that claim into the block
./lbrycrd-cli -regtest listnameclaims # show owned claims
./lbrycrd-cli -regtest getclaimsforname my_name # show claims under that name
./lbrycrd-cli -regtest stop           # kill lbrycrdd
rm -fr ~/.lbrycrd/regtest/            # destroy regtest data

For further understanding of a "regtest" setup, see the local stack setup instructions here: https://lbry.tech/resources/regtest-setup

The CLI help is also browsable online at https://lbry.tech/api/blockchain

Data directory

Lbrycrdd will use the below default data directories (changeable with -datadir):

Windows:  %APPDATA%\lbrycrd
Mac:      ~/Library/Application Support/lbrycrd
Unix:     ~/.lbrycrd

The data directory contains various things such as your default wallet (wallet.dat), debug logs (debug.log), and blockchain data. You can optionally create a configuration file lbrycrd.conf in the default data directory which will be used by default when running lbrycrdd.

For a list of configuration parameters, run ./lbrycrdd --help. Below is a sample lbrycrd.conf to enable JSON RPC server on lbrycrdd.

rpcuser=lbry
rpcpassword=xyz123456790
daemon=1
server=1
txindex=1

Running from Source

The easiest way to compile is to utilize the Docker image that contains the necessary compilers: lbry/build_lbrycrd. This will allow you to reproduce the build as made on our build servers. In this sample we map a local lbrycrd folder and a local ccache folder inside the image:

git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd
docker run -v "$(pwd):/lbrycrd" --rm -v "${HOME}/ccache:/ccache" -w /lbrycrd -e CCACHE_DIR=/ccache lbry/build_lbrycrd packaging/build_linux_64bit.sh

Some examples of compiling directly:

Ubuntu with pulled static dependencies

sudo apt install build-essential git libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates
git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd
./packaging/build_linux_64bit.sh
./src/test/test_lbrycrd

Other Linux distros would be similar. The build shell script is fairly trivial; take a peek at its contents.

Ubuntu with local shared dependencies

Note: using untested dependencies may lead to conflicting results.

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev libicu-dev libssl-dev libevent-dev \
                     build-essential git libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates \
                     libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

# optionally include libminiupnpc-dev libzmq3-dev

git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd
./autogen.sh
./configure --enable-static --disable-shared --with-pic --without-gui CXXFLAGS="-O3 -march=native"
make -j$(nproc)
./src/lbrycrdd -server ...

MacOS (cross-compiled)

sudo apt-get install clang llvm git libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates \
                     libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd
# download MacOS SDK from your favorite source
mkdir depends/SDKs
tar ... extract SDK to depends/SDKs/MacOSX10.11.sdk
./packaging/build_darwin_64bit.sh

Look in packaging/build_darwin_64bit.sh for further understanding.

MacOS with local shared dependencies

brew install boost berkeley-db@4 icu4c libevent
# fix conflict with gawk pulled first:
brew reinstall readline
brew reinstall gawk

git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd/depends
make NO_QT=1
cd ..
./autogen.sh
CONFIG_SITE=$(pwd)/depends/x86_64-apple-darwin15.6.0/share/config.site ./configure --enable-static --disable-shared --with-pic --without-gui --enable-reduce-exports CXXFLAGS=-O2
make -j$(sysctl -n hw.ncpu)

Windows (cross-compiled)

Compiling on MS Windows (outside of WSL) is not supported. The Windows build is cross-compiled from Linux like so:

sudo apt-get install build-essential git libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates \
                     g++-mingw-w64-x86-64 mingw-w64-x86-64-dev

update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix

git clone https://github.com/lbryio/lbrycrd.git
cd lbrycrd
./packaging/build_windows_64bit.sh

If you encounter any errors, please check doc/build-*.md for further instructions. If you're still stuck, create an issue with the output of that command, your system info, and any other information you think might be helpful. The scripts in the packaging folder are simple and will grant extra light on the build process as needed.

Use with CLion

CLion has not traditionally supported Autotools projects, although some progress on that is now in the works. We do include a cmake build file for compiling lbrycrd. See contrib/cmake. Alas, CLion doesn't support external projects in cmake, so that particular approach is also insufficient. CLion does support "compile_commands.json" projects. Fortunately, this can be easily generated for lbrycrd like so:

pip install --user compiledb
./autogen.sh && ./configure --enable-static=no --enable-shared --with-pic --without-gui CXXFLAGS="-O0 -g" CFLAGS="-O0 -g" # or whatever normal lbrycrd config
compiledb make -j10

Then open the newly generated compile_commands.json file as a project in CLion. Debugging is supported if you compiled with -g. To enable that you will need to create a target in CLion by going to File -> Settings -> Build -> Custom Build Targets. Add an empty target with your choice of name. From there you can go to "Edit Configurations", typically found in a drop-down at the top of the editor. Add a Custom Build Application, select your new target, select the compiled file (i.e. test_lbrycrd or lbrycrdd, etc), and then add any necessary command line parameters. Ensure that there is nothing in the "Before launch" section.

Contributing

Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.tech/contribute

We follow the same coding guidelines as documented by Bitcoin Core, see here. To run an automated code formatting check, try: git diff -U0 master -- '*.h' '*.cpp' | ./contrib/devtools/clang-format-diff.py -p1. This will check any commits not on master for proper code formatting. We try to avoid altering parts of the code that is inherited from Bitcoin Core unless absolutely necessary. This will make it easier to merge changes from Bitcoin Core. If commits are expected not to be merged upstream (i.e. we broke up a commit from Bitcoin Core in order to use a single feature in it), the commit message must contain the string "NOT FOR UPSTREAM MERGE".

The master branch is regularly built and tested, but is not guaranteed to be completely stable. Releases are created regularly to indicate new official, stable release versions.

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money. Developers are strongly encouraged to write unit tests for new code and to submit new unit tests for old code. Unit tests are compiled by default and can be run with src/test/test_lbrycrd

The Travis CI system makes sure that every pull request is built, and that unit and sanity tests are automatically run. See https://travis-ci.org/lbryio/lbrycrd

Testnet

Testnet is maintained for testing purposes and can be accessed using the command ./lbrycrdd -testnet. If you would like to obtain testnet credits, please contact [email protected] or [email protected] .

It is easy to solo mine on testnet. (It's easy on mainnet too, but much harder to win.) For instructions see SGMiner and Mining Contributions

Mailing List

We maintain a mailing list for notifications of upgrades, security issues, and soft/hard forks. To join, visit https://lbry.com/forklist.

License

This project is MIT licensed. For the full license, see LICENSE.

Security

We take security seriously. Please contact [email protected] regarding any security issues. Our PGP key is here if you need it.

Contact

The primary contact for this project is @BrannonKing ([email protected])

More Repositories

1

lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
Python
7,193
star
2

lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
JavaScript
3,563
star
3

lbry-android

The LBRY Android app
Java
2,433
star
4

torba

Torba makes it easy to create fast and correct bitcoin based crypto wallets.
Python
2,196
star
5

lbry.com

lbry.com, the website for the LBRY protocol
PHP
263
star
6

spee.ch

An image hosting service on top of the LBRY protocol.
JavaScript
185
star
7

lbry-fdroid

The LBRY Android app (on F-Droid)
Java
64
star
8

lbry.tech

Technical documentation website for the LBRY protocol
JavaScript
50
star
9

ytsync

An overly complex tool to mirror youtube content to LBRY
Go
42
star
10

aioupnp

UPnP for asyncio
Python
29
star
11

lbry.go

Go
29
star
12

dmca

Repository with text of DMCA takedown notices as received. LBRY Inc. does not endorse or adopt any assertion contained in the following notices. Users identified in the notices are presumed innocent until proven guilty. Additional information about our DMCA policy can be found at https://lbry.io/faq/dmca and content policy at https://lbry.io/faq/content
DIGITAL Command Language
26
star
13

lbrycrd-gpu

Please use https://github.com/lbryio/sgminer-gm or https://github.com/lbryio/ccminer or https://github.com/lbryio/cpuminer instead.
22
star
14

lbrypress

LBRY WordPress plugin
PHP
21
star
15

herald.go

Go
20
star
16

block-explorer

The new LBRY block explorer
JavaScript
18
star
17

hub

Python
16
star
18

lbry-redux

Common shared app components for desktop and mobile
JavaScript
15
star
19

reflector.go

Go
14
star
20

lighthouse.js

Lighthouse - A lightning fast search for the LBRY blockchain
JavaScript
14
star
21

lbry-ios

LBRY on iOS
Objective-C
13
star
22

lbry-docker

This repository will be for Dockerfiles for the various LBRY packages.
CSS
11
star
23

lbry-react-native

The React Native frontend for the LBRY mobile app
JavaScript
11
star
24

php-api

LBRY API wrapper
PHP
10
star
25

piratebay.com

A pretty implementation for the homepage at piratebay
CSS
10
star
26

lbry-format

The LBRY format is an application format designed to promote interoperability and transmission of complex digital media.
JavaScript
10
star
27

comment-server

comment server implemented in python to host comments on lbry
Python
10
star
28

lbry-gentoo-overlay

[needs some love] Gentoo Portage overlay for LBRY
Shell
9
star
29

types

Cross-language definitions for standard LBRY types
JavaScript
8
star
30

spec

LBRY protocol specification
CSS
7
star
31

electron-starter

A bare bones electron app with the lbry-sdk and lbry-redux already added
JavaScript
7
star
32

twitter-tipbot

A tipbot for twitter that speaks LBRY!
JavaScript
7
star
33

lbryinc

JavaScript
6
star
34

web-daemon

A web-based API for using LBRY (used by lbry.tech)
JavaScript
5
star
35

docker-lbrynet

Shell
5
star
36

www.spee.ch

A web app that uses the spee.ch codebase
JavaScript
5
star
37

lbrycrd-dependencies

Copies of the libraries that lbrycrd depends on
HTML
4
star
38

lbryschema.go

Go
4
star
39

claimtrie

Go
4
star
40

lbry-social-tipbot

LBRY reddit tipbot
JavaScript
4
star
41

lbry-first

One stop shop for uploading digital content to alternatives to empower LBRY First!
Go
4
star
42

components

Styling for shared components across LBRY properties...IN PROGRESS
CSS
4
star
43

research

Jupyter Notebook
4
star
44

lbry-unity

Unity Package SDK for LBRY
JavaScript
4
star
45

open.lbry.com

A simple page that allows hotlinking content on the LBRY blockchain
HTML
3
star
46

speechbot

A Slack bot for https://spee.ch
JavaScript
3
star
47

SpeechVR

VR model viewer prototype, works with AltspaceVR
JavaScript
2
star
48

lbry-android-sdk

The LBRY SDK packaged as an Android AAR library
C
2
star
49

cantina

Go
2
star
50

lbry.id

Own your identity online
HTML
2
star
51

errors.go

Better error handling
Go
2
star
52

lbry-desktop-alpha-releases

Repo for testing updates
2
star
53

query.go

Utils for working with queries in Go
Go
2
star
54

dashboard

Python
1
star
55

proposals

Discussion of large projects
1
star
56

SpeechShare

Objective-C
1
star
57

timing-scripts

A work in progress collection of timing scripts
JavaScript
1
star
58

sentinel

Watcher of the Blockchain
Go
1
star
59

web-wallet

Non-custodial transaction signing for web apps
TypeScript
1
star
60

wallet-sync-server

Go
1
star
61

lightseeker.go

This project benchmarks search results from lighthouse
Go
1
star