2021-08-19 20:41:48 +02:00
|
|
|
# lbcd
|
2013-09-09 18:00:46 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions)
|
|
|
|
[![Coverage Status](https://coveralls.io/repos/github/lbryio/lbcd/badge.svg?branch=master)](https://coveralls.io/github/lbryio/lbcd?branch=master)
|
2020-05-13 14:44:07 +02:00
|
|
|
[![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
|
2021-08-19 20:41:48 +02:00
|
|
|
<!--[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/lbryio/lbcd)-->
|
|
|
|
|
|
|
|
`lbcd` is a full node implementation of LBRY's blockchain written in Go (golang).
|
|
|
|
|
|
|
|
This project is currently under active development and is in a Beta state while
|
|
|
|
we ensure it matches LBRYcrd's functionality. The intention is that it properly
|
|
|
|
downloads, validates, and serves the block chain using the exact rules
|
|
|
|
(including consensus bugs) for block acceptance as LBRYcrd.
|
|
|
|
We have taken great care to avoid lbcd causing a fork to the blockchain.
|
|
|
|
|
|
|
|
Note: `lbcd` does *NOT* include wallet functionality. That functionality is provided by the
|
|
|
|
[lbcwallet](https://github.com/lbryio/lbcwallet) and the [LBRY SDK](https://github.com/lbryio/lbry-sdk).
|
|
|
|
|
|
|
|
## Security
|
|
|
|
|
|
|
|
We take security seriously. Please contact [security](mailto:security@lbry.com) regarding any security issues.
|
|
|
|
Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it.
|
|
|
|
|
|
|
|
We maintain a mailing list for notifications of upgrades, security issues,
|
|
|
|
and soft/hard forks. To join, visit [fork list](https://lbry.com/forklist)
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2014-02-13 18:39:17 +01:00
|
|
|
## Requirements
|
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
All common operating systems are supported. lbcd requires at least 8GB of RAM
|
|
|
|
and at least 100GB of disk storage. Both RAM and disk requirements increase slowly over time.
|
|
|
|
Using a fast NVMe disk is recommended.
|
2014-02-13 18:39:17 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
`lbcd` is not immune to data loss. It expects a clean shutdown via SIGINT or
|
|
|
|
SIGTERM. SIGKILL, immediate VM kills, and sudden power loss can cause data
|
|
|
|
corruption, thus requiring chain resynchronization for recovery.
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
For compilation, [Go](http://golang.org) 1.16 or newer is required.
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
## Installation
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Acquire binary files from [releases](https://github.com/lbryio/lbcd/releases)
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
### To build from Source on Linux/BSD/MacOSX/POSIX
|
2015-05-29 22:25:52 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Install Go according to its [installation instructions](http://golang.org/doc/install).
|
2015-05-29 22:25:52 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
``` sh
|
|
|
|
git clone https://github.com/lbryio/lbcd
|
|
|
|
cd lbcd
|
2015-05-29 22:25:52 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
# Build lbcd
|
|
|
|
go build .
|
2015-02-08 19:00:36 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
# Build lbcctl
|
|
|
|
go build ./cmd/lbcctl
|
2015-02-08 19:00:36 +01:00
|
|
|
```
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Both [GoLand](https://www.jetbrains.com/go/)
|
|
|
|
and [VS Code](https://code.visualstudio.com/docs/languages/go) IDEs are supported.
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
## Usage
|
2013-10-08 20:30:36 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
By default, data and logs are stored in `<LBCDDIR>`:
|
2013-10-08 20:30:36 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
- Linux: `~/.lbcd/`
|
|
|
|
- MacOS: `/Users/<username>/Library/Application Support/Lbcd/`
|
2015-02-08 19:00:36 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
To enable RPC access a username and password is required. Example:
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass
|
2015-02-08 19:00:36 +01:00
|
|
|
```
|
2013-10-08 20:30:36 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Interact with lbcd via RPC using `lbcctl`
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass getblockcount
|
|
|
|
./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass getblocktemplate
|
|
|
|
```
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
By default, the RPCs are served over TLS. `lbcd` generates (if not exists) `rpc.cert` and
|
|
|
|
`rpc.key` under `<LBCDDIR>` where `lbcctl` would search and use them.
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
The RPCs can also be served without TLS *(on localhost only)* using (`--notls`)
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
``` sh
|
|
|
|
./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --notls
|
|
|
|
./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --notls getblockcount
|
2016-09-13 21:10:19 +02:00
|
|
|
```
|
2014-03-04 18:58:59 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
## Working with Different Networks
|
|
|
|
|
|
|
|
By default, `lbcd` and `lbcctl` use the following ports for different networks respectively:
|
2014-03-04 18:58:59 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
| Network | RPC Port | Network Port |
|
|
|
|
| ------- | -------- | ------------ |
|
|
|
|
| mainnet | 9245 | 9246 |
|
|
|
|
| testnet | 19245 | 19246 |
|
|
|
|
| regtest | 29245 | 29246 |
|
2014-03-04 18:58:59 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Running `lbcd` and `lbcctl` with `--testnet` or `--regtest` would use different chain params as well as default RPC and Network ports.
|
2013-09-09 18:00:46 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
``` sh
|
|
|
|
./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --regtest
|
|
|
|
./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --regtest getblockcount
|
|
|
|
```
|
|
|
|
|
|
|
|
The default Network and RPC ports of `lbcd` can be overriden using `--listen` and `--rpclisten`
|
|
|
|
`lbcctl` can also connect to RPC server specified by `--rpcserver`
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --regtest --listen=127.0.0.1:29248 --rpclisten=127.0.0.1:29247
|
|
|
|
./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --regtest --rpcserver=127.0.0.1:29247 getblockcount
|
|
|
|
```
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Note: Wallet related RPCs are provided by [lbcwallet](https://github.com/lbryio/lbcwallet).
|
2014-02-04 18:06:39 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
## Contributing
|
2014-02-04 18:06:39 +01:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
Contributions to this project are welcome, encouraged, and compensated.
|
|
|
|
The [integrated github issue tracker](https://github.com/lbryio/lbcd/issues)
|
|
|
|
is used for this project. All pull requests will be considered.
|
2013-10-05 05:59:05 +02:00
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
<!-- ## Release Verification
|
2019-10-11 01:17:57 +02:00
|
|
|
Please see our [documentation on the current build/verification
|
2021-08-19 20:41:48 +02:00
|
|
|
process](https://github.com/lbryio/lbcd/tree/master/release) for all our
|
2019-10-11 01:17:57 +02:00
|
|
|
releases for information on how to verify the integrity of published releases
|
|
|
|
using our reproducible build system.
|
2021-08-19 20:41:48 +02:00
|
|
|
-->
|
2013-10-05 05:59:05 +02:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
2021-08-19 20:41:48 +02:00
|
|
|
lbcd is licensed under the [copyfree](http://copyfree.org) ISC License.
|