Skip to content

Commit 88cd03d

Browse files
mikezupperrickstaadob
authored
docs(gateway): add Gateway Docs (Livepeer.cloud SPE Milestone #1 Deliverables) - (#554)
* Livepeer.Cloud SPE Milestone #1 Deliverables: Add Gateway Docs * addressed review comments from Rick * made Prerequisites - more concise * docs(gateway): apply prettier mdx formatting This commit applies the prettier formatting suggestions on the Gateway docs (see https://prettier.io/blog/2021/11/25/2.5.0.html). * docs: add Gateway network page This commit adds a Gateway page under the core-concepts category, explaining the role and functions of a Gateway. * docs: improve Gateway configuration wording * chore: apply prettier to Gateway node page * Update gateways.mdx Clarified gateways as the type of node, and talked about hosted gateways as something that individual entities may run. * docs: fix Gateway node page links This commit fixes some broken links in the Gateway node page. --------- Co-authored-by: Rick Staa <[email protected]> Co-authored-by: Doug Petkanics <[email protected]>
1 parent cbe65c9 commit 88cd03d

10 files changed

+709
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
A Gateway (formerly known as a Broadcaster) on the Livepeer network
2+
is a node that is using the network for video streaming or generative AI inference.
3+
Running a gateway is simple, and it exposes an API that allows you to build
4+
your video application on top of Livepeer.
5+
Under the hood, gateways are responsible for routing transcoding or
6+
AI inference tasks to the appropriate
7+
[Orchestrator](/developers/core-concepts/livepeer-network/orchestrators)
8+
nodes for processing. By running the
9+
[`go-livepeer` client](https://github.com/livepeer/go-livepeer), individuals can
10+
join the Livepeer network as Gateways.
11+
12+
<Info>
13+
Check out the [Livepeer primer](https://livepeer.org/primer) to learn more
14+
about the Livepeer network.
15+
</Info>
16+
17+
#### Configuration
18+
19+
Gateways do not need to stake
20+
[LPT](/developers/core-concepts/livepeer-network/delegators#livepeer-token-lpt)
21+
to participate in the network. They only
22+
[require enough ETH](/gateways/guides/fund-gateway) to cover the cost of
23+
transcoding and AI inference jobs. Unlike Orchestrators, Gateways do not need a
24+
GPU to participate. Any machine with a decent CPU and sufficient bandwidth can
25+
operate as a Gateway.
26+
27+
Gateways are essential components of the Livepeer ecosystem, serving as the
28+
bridge between the Orchestrators performing the work and the clients requesting
29+
the work. Many entities may run gateway nodes and make them available to others
30+
as a hosted service. They often provide additional services such as content delivery
31+
networks (CDNs) and base currency subscriptions, ensuring that jobs are
32+
delivered swiftly to the right client and that clients don't need to set up
33+
crypto wallets themselves.

gateways/guides/docker-install.mdx

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
title: Docker Install
3+
icon: download
4+
---
5+
6+
# Install & Configure Docker
7+
8+
## Key folder structure
9+
10+
Livepeer will require files to be placed on the host and within the docker
11+
container. Here is a list of the key folders used by the docker install.
12+
13+
### Host Folders
14+
15+
By default, docker will store all volumes in the `/var/lib/docker/volumes`
16+
directory
17+
18+
This installation will create a volume called: `gateway-lpData` and it will be
19+
located at `/var/lib/docker/volumes/gateway-lpData/_data`
20+
21+
### Container Folders
22+
23+
Within the docker container, the volume `gateway-lpData` will be mounted at
24+
`/root/.lpData`
25+
26+
## Install Prerequisites
27+
28+
If docker is already installed, you can skip this step. The installation assumes
29+
you are running Docker 20.10.x. If an older version of docker is installed
30+
remove it with the following command:
31+
32+
As the root user (or sudo), run the following:
33+
34+
```
35+
apt remove docker*
36+
```
37+
38+
Install Docker
39+
40+
```
41+
curl https://releases.rancher.com/install-docker/20.10.sh | sh
42+
```
43+
44+
Create a Docker volume
45+
46+
```
47+
docker volume create gateway-lpData
48+
```
49+
50+
Create Docker Compose file from the root user's home directory _/root/_
51+
52+
```
53+
nano docker-compose.yml
54+
```
55+
56+
Copy and paste the following and save the following
57+
58+
```
59+
version: '3.9'
60+
61+
services:
62+
gateway:
63+
image: livepeer/go-livepeer:<RELEASE_VERSION>
64+
container_name: "gateway"
65+
hostname: "gateway"
66+
ports:
67+
- 1935:1935
68+
- 8935:8935
69+
volumes:
70+
- gateway-lpData:/root/.lpData
71+
command: '-ethUrl=https://arb1.arbitrum.io/rpc/
72+
-ethKeystorePath=/root/.lpData
73+
-network=arbitrum-one-mainnet
74+
-cliAddr=gateway:5935
75+
-broadcaster=true
76+
-monitor=true
77+
-v=99
78+
-blockPollingInterval=20
79+
-maxPricePerUnit=300
80+
-pixelsPerUnit=1
81+
-rtmpAddr=0.0.0.0:1935
82+
-httpAddr=0.0.0.0:8935
83+
'
84+
volumes:
85+
gateway-lpData:
86+
external: true
87+
```
88+
89+
# Create Livepeer Gateway ETH account
90+
91+
In this step we need to start the Gateway in order to create an Ethereum
92+
account.
93+
94+
```
95+
docker compose run -it gateway
96+
```
97+
98+
When prompted for the ETH password, enter a strong password to secure your
99+
Ethereum account. This password is used to decrypt and access the ETH private
100+
key. <Warning>Make sure to never share or lose access to either the password or
101+
the keystore file.</Warning>
102+
103+
<Tip>Keep this password handy, we will use it in the following steps.</Tip>
104+
105+
After you see the message that the Ethereum account has been unlocked, CTRL+C to
106+
exit the Livepeer docker instance.
107+
108+
Using the previously created ETH password, create the eth-secret file
109+
110+
```
111+
nano -p /var/lib/docker/volumes/gateway-lpData/_data/eth-secret.txt
112+
```
113+
114+
# Modify Docker compose file to include eth-secret.txt
115+
116+
```
117+
nano docker-compose.yml
118+
```
119+
120+
Add the following line below the `-ethKeystorePath` and save
121+
122+
```
123+
-ethPassword=/root/.lpData/eth-secret.txt
124+
```
125+
126+
Here is the full modified version of the docker-compose.yml file
127+
128+
```
129+
version: '3.9'
130+
131+
services:
132+
gateway:
133+
image: livepeer/go-livepeer:<RELEASE_VERSION>
134+
container_name: "gateway"
135+
hostname: "gateway"
136+
ports:
137+
- 1935:1935
138+
- 8935:8935
139+
volumes:
140+
- gateway-lpData:/root/.lpData
141+
command: '-ethUrl=<YOUR ARB APC>
142+
-ethKeystorePath=/root/.lpData
143+
-ethPassword=/root/.lpData/eth-secret.txt
144+
-network=arbitrum-one-mainnet
145+
-cliAddr=gateway:5935
146+
-broadcaster=true
147+
-monitor=true
148+
-v=99
149+
-blockPollingInterval=20
150+
-maxPricePerUnit=300
151+
-pixelsPerUnit=1
152+
-rtmpAddr=0.0.0.0:1935
153+
-httpAddr=0.0.0.0:8935
154+
'
155+
volumes:
156+
gateway-lpData:
157+
external: true
158+
```
159+
160+
Start Livepeer in the background
161+
162+
```
163+
docker compose up -d
164+
```
165+
166+
Launch the livepeer_cli
167+
168+
```
169+
docker exec -it gateway /bin/bash
170+
livepeer_cli -host gateway -http 5935
171+
```
172+
173+
Jump to [Configure Transcoding Options](/gateways/guides/transcoding-options) to
174+
finish configuring the Gateway

gateways/guides/fund-gateway.mdx

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Fund The Livepeer Gateway
3+
icon: ethereum
4+
description:
5+
The following steps will walk you through adding funds to the newly created
6+
ETH account. This includes funding the ETH account on Ethereum Mainnet,
7+
bridging the funds to Arbritrum's L2 Network, and finally using the Livepeer
8+
CLI to allocate the proper deposit and reserve amounts.
9+
---
10+
11+
# Add Funds to Gateway Wallet
12+
13+
In order to use the Gateway you need to send ETH to your Gateway address on
14+
Ethereum Mainnet and then bridged to Arbitrum's L2 Network.
15+
16+
<Note>
17+
_If you have ETH on the Arbitrum L2 Network, you can simply transfer the funds
18+
to the newly created Gateway ETH Account._
19+
</Note>
20+
<Note>
21+
_Livepeer runs on the Arbitrium's L2 Network and requires the funds to be
22+
bridged._
23+
</Note>
24+
25+
# Bridge Funds to Arbitrum
26+
27+
If you need to bridge ETH you can use the official bridge
28+
https://bridge.arbitrum.io/ or use an exchange that supports L2 transfers. For
29+
additonal information on bridging view the
30+
[Livepeer bridging guide.](/delegators/guides/bridge-lpt-to-arbitrum)
31+
32+
Once you have ETH on the Arbitrum network, transfer it to your newly created
33+
Gateway address.
34+
35+
# Deposit Gateway Funds via Livepeer CLI
36+
37+
We now need to divide the Gateway funds into a **Deposit** and **Reserve**
38+
39+
In this guide we are using a total of 0.1 ETH. This is minimum recommended and
40+
best suited for testing.
41+
42+
To calculate the price your Gateway will pay for transcoding, divide the
43+
_Reserve_ amount by 100. In our example each payment will be 0.0003 ETH (0.03
44+
/ 100)
45+
46+
As you pay for transcoding the amount paid is subtracted from your _Deposit_, so
47+
make sure to monitor your _Deposit_ balance and top it off to keep your Gateway
48+
transcoding.
49+
50+
## Open the Livepeer CLI
51+
52+
Open the Livepeer CLI by following the instructions for your platform.
53+
54+
Choose **Option 11. Invoke "deposit broadcasting funds" (ETH)**
55+
56+
- Enter 0.065 for the **Deposit** and 0.03 for the **Reserve** amounts when
57+
prompted.
58+
59+
Choose **Option 1. Get node status** and confirm that the correct amounts are
60+
visible in the **BROADCASTER STATS** section.

gateways/guides/gateway-overview.mdx

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Overview
3+
description:
4+
This guide will walk you through the Livepeer Gateway installation and setup.
5+
Steps to install for Ubuntu Linux, Docker, and Windows are provided. Choose
6+
the environment you want, follow install instructions, then continue to the
7+
configuration section.
8+
icon: Rocket
9+
---
10+
11+
<Note>
12+
The Livepeer Gateway was previously called the Livepeer Broadcaster so you
13+
will see some commands and labels still use the Broadcaster name that haven't
14+
been updated in the code.
15+
</Note>
16+
17+
# Quick Links
18+
19+
<CardGroup cols={2}>
20+
<Card
21+
title="Docker Installation"
22+
icon="download"
23+
href="/gateways/guides/docker-install"
24+
>
25+
Install & Configure Docker
26+
</Card>
27+
<Card
28+
title="Linux Installation"
29+
icon="download"
30+
href="/gateways/guides/linux-install"
31+
>
32+
Install & Configure Linux Binary
33+
</Card>
34+
<Card
35+
title="Windows Installation"
36+
icon="download"
37+
href="/gateways/guides/windows-install"
38+
>
39+
Install & Configure Windows Binary
40+
</Card>
41+
<Card
42+
title="Configure Transcoding Options"
43+
icon="gear"
44+
href="/gateways/guides/transcoding-options"
45+
>
46+
Specify the resolution and bitrate for your encoding ladder
47+
</Card>
48+
<Card
49+
title="Fund the Livepeer Gateway"
50+
icon="ethereum"
51+
href="/gateways/guides/fund-gateway"
52+
>
53+
Add Funds to Gateway Wallet
54+
</Card>
55+
<Card
56+
title="Publish Content"
57+
icon="upload"
58+
href="/gateways/guides/publish-content"
59+
>
60+
Publish and consume content to the Livepeer Gateway.
61+
</Card>
62+
<Card
63+
title="Playback Content"
64+
icon="circle-play"
65+
href="/gateways/guides/playback-content"
66+
>
67+
Playback using VLC Media Player
68+
</Card>
69+
</CardGroup>
70+
71+
## Prerequisites
72+
73+
Working knowledge of system adminsitration tasks for your target platform are
74+
required. This guide provides directions for Linux, Windows, and Docker
75+
platforms. Familiarity with Livepeer protocol is beneficial. For more
76+
information view the go Livepeer
77+
[installation guide.](//orchestrators/guides/install-go-livepeer)
78+
79+
This guide was developed using:
80+
81+
- Ubuntu Linux 22.04
82+
- Docker 20.10.14
83+
- Windows
84+
- Livepeer 0.7.2
85+
- root user access (sudo is ok)
86+
87+
Have access to an Arbitrum RPC URL. This is required to run Livepeer. Popular
88+
services include [Infura](https://www.infura.io/) and
89+
[Alchemy](https://www.alchemy.com/). Be aware that these services have their own
90+
pricing plans. That being said, the latest versions of livepeer should be able
91+
to stay within the request limit for these provider's free tier at least for a
92+
single node. As an alternative, you can self-host your own Arbitrum node, see
93+
the
94+
[instructions from Offchain Labs](https://docs.arbitrum.io/node-running/how-tos/running-a-full-node).

0 commit comments

Comments
 (0)