Dependencies
You’ll need the following things installed locally:- Docker (or Podman 4.6.0+, which works even better)
- Buildah (for
docker buildx, included with Podman and Docker for Mac) - Go v1.20+
- Node.js v18+ (Studio development only)
- Make
- git
- llvm (
brew install llvmfor compiling MistServer and go-livepeer on MacOS only)
Development
Now you’re ready to boot up your development environment!- URL: http://localhost:8888
- Email:
admin@example.com - Password:
livepeer
Customizing the Environment
If you need to add additional parameters to things running inside the box, you can create a.env file that contains key-value pairs:
config/full-stack.json. A
more robust configuration management system is under development.
Making changes
TLDR: Use a command like this and the Makefile will take care of it for you:- Make changes to code on your local filesystem
- Build a Linux binary from that code
- Move that Linux binary into the
bindirectory ofcatalyst, which is mounted bymake box-dev - Kill the old version of your binary and allow MistController to bring it back up.
catalyst. For
example, if you’re hacking on task-runner, you might have
livepeer, just like
the resulting binaries within the Catalyst container. This yields the following
commands:
| Project | Command |
|---|---|
| catalyst-api | make livepeer-catalyst-api |
| catalyst-uploader | make livepeer-catalyst-uploader |
| task-runner | make livepeer-task-runner |
| analyzer | make livepeer-analyzer |
| Studio Node.js API Server | make livepeer-api |
| MistServer | make mistserver |
Connecting the Frontend
Livepeer in a Box comes with a pkg-bundled version of the Livepeer Studio API server and frontend, but does not include a full development environment for that frontend. If you are making changes to the frontend, you can boot it up as you usually would:localStorage variable you can use
to override the API server URL. Open your browser console and type in the
following:
make livepeer-api does not
package the frontend within the livepeer-api binary that it builds, so if you
experience your frontend suddenly 404ing after you run make livepeer-api you
will have to use the above instructions to boot up the frontend on your host.
You can also build the full API server with a bundled frontend using
make livepeer-api-pkg, but be aware this frequently takes 3-4 minutes to
complete.
Notes
- Your CockroachDB (Postgres) database and your Minio (S3) object store will be
saved in the
datasubdirectory of your Catalyst installation. If you want to start from scratch again with theadmin@example.comdatabase snapshot, shut down your box andrm -rf data. - You can press
Ctrl+Cto trigger a graceful shutdown of the container. If you’re impatient, following it up with aCtrl+\can uncleanly shut things down a bit more cleanly. - Sometimes the rate of logs produced by Catalyst somehow overwhelms Make and
log output simply stops. You’ll know if you get in this state because you’ll
press Ctrl+C and control will return immediately to your terminal instead of
shutting down the Docker image. You can start everything back up with
docker rm -f catalystandmake box-dev.
Changelog
2023-08-12
- Changed the hardcoded streams in the database snapshots to have
easy-to-remember stream keys like
2222-2222-2222-2222 - Changed the built-in streams to use the H264ConstrainedHigh profile so there are no B-Frames in the output
- Moved all references from
127.0.0.1tolocalhost; this is needed for WebRTC/Coturn to work properly - Removed outdated references to
GOOS=linuxandKILL=true; these are the defaults now