2021-03-18 21:12:48 +01:00
# LBRY Hub
A hub provides back-end services to LBRY clients. Services include
- URL resolution
- search
- wallet services (getting and sending transactions, address subscription)
- hub federation and discovery
2021-03-19 20:10:32 +01:00
This project will eventually subsume and replace the
[wallet server ](https://github.com/lbryio/lbry-sdk/blob/v0.92.0/docker/Dockerfile.wallet_server )
2021-03-18 21:12:48 +01:00
and the [lighthouse ](https://github.com/lbryio/lighthouse ) search provider.
2021-03-19 20:10:32 +01:00
![](./diagram.png)
2021-03-18 21:12:48 +01:00
## Installation
2021-04-21 22:19:05 +02:00
No install instructions yet. See Contributing below.
2021-03-18 21:12:48 +01:00
## Usage
2021-04-21 22:19:05 +02:00
### Prerequisite: run python block processor and search plugin
2021-04-19 21:25:34 +02:00
Follow the instructions [here ](https://lbry.tech/resources/wallet-server ).
### Run this hub
```bash
2021-04-21 22:19:05 +02:00
./hub serve
2021-04-19 21:25:34 +02:00
```
### Search for stuff
```bash
2021-04-21 22:19:05 +02:00
./hub search text goes here
2021-04-19 21:25:34 +02:00
```
2021-03-18 21:12:48 +01:00
## Contributing
2021-04-21 22:19:05 +02:00
Contributions to this project are welcome, encouraged, and compensated. Details [here ](https://lbry.tech/contribute ).
2021-03-18 21:12:48 +01:00
2021-03-18 22:14:56 +01:00
### Dev Dependencies
Install Go 1.14+
- Ubuntu: `sudo add-apt-repository ppa:longsleep/golang-backports && sudo apt install golang-go`
- OSX: `brew install go`
2021-05-13 18:02:03 +02:00
- Windows https://golang.org/doc/install
2021-03-18 22:14:56 +01:00
2021-03-19 20:10:32 +01:00
Download `protoc` from https://github.com/protocolbuffers/protobuf/releases and make sure it is
2021-03-18 22:14:56 +01:00
executable and in your path.
Install Go plugin for protoc:
```
go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc
```
2021-04-21 22:19:05 +02:00
If you can run `./protobuf/build.sh` without errors, you have `go` and `protoc` installed correctly.
Finally, run the block processor as described under Usage.
### Running from Source
Run `./dev.sh` to start the hub. The script will restart the hub as you make changes to `*.go` files.
To search, use `go run . search text goes here` .
2021-03-18 22:14:56 +01:00
2021-05-13 18:02:03 +02:00
#### Windows
reflex doesn't work on windows, so you'll need to run `go run . serve` and restart manually as you make changes.
2021-03-18 21:12:48 +01:00
## License
This project is MIT licensed. For the full license, see [LICENSE ](LICENSE ).
## Security
2021-05-04 00:04:03 +02:00
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our PGP key is here ](https://lbry.com/faq/pgp-key ) if you need it.
2021-03-18 21:12:48 +01:00
## Contact
2021-03-19 20:10:32 +01:00
The primary contact for this project is [@lyoshenka ](https://github.com/lyoshenka ) ([grin@lbry.com](mailto:grin@lbry.com)).