Pedalboard is a collection of packages and plugins meant to run alongside a discovery indexer and database. They're meant to operate in isolation but stack together to expose various combinations of functionality to the network.
npm install turbo --global
npm install
There are two main directories where work is done. Packages and Apps. Packages are modules and libraries that are useful across various plugins. Apps are code that gets compiled and run against the database and indexer.
To create a new application copy and paste the app-template. Rename your directory and package json project name to what you'd like and you should be ready to start developing. The application template will have an example app for you to get started with.
At this time of writing this is what it looks like:
import { log } from "@pedalboard/logger";
import App from "@pedalboard/basekit/src/app";
import moment from "moment";
type SharedData = {};
const main = async () => {
await new App<SharedData>({})
.tick({ seconds: 5 }, async (_app) => {
console.log(`tick ${moment().calendar()}`)
})
.run();
};
(async () => {
await main().catch(log);
})();
- Copy the app template
cp ./apps/app-template ./apps/my-app
-
Modify
package.json
to have your app name -
Install dependencies from the monorepo root
npm i
This monorepo uses Turborepo for fast, efficient development. Turborepo provides caching, parallel execution, and dependency management.
Run a single app for development (with hot reload):
turbo run dev --filter=@pedalboard/app-template
turbo run dev --filter=@pedalboard/relay
Run with dependencies (builds packages first):
turbo run dev --filter=@pedalboard/app-template...
Run multiple apps:
turbo run dev --filter=@pedalboard/relay --filter=@pedalboard/staking
Build everything:
turbo run build
Build specific packages:
turbo run build --filter=@pedalboard/logger
Build with concurrency:
turbo run build --concurrency=4
Lint all packages:
turbo run lint
Run tests:
turbo run test
Clean build artifacts:
turbo run clean
This repository was extracted from the main audius-protocol repository. To sync new changes from the main repo:
Add the main audius-protocol repo as a remote:
git remote add ap https://github.com/AudiusProject/audius-protocol.git
git fetch ap
- Find pedalboard-related commits in the main repo:
git log ap/main --oneline -- "*pedalboard*" "*/pedalboard/*"
- Cherry-pick specific commits:
git cherry-pick <commit-hash>
- Test your changes:
turbo run build
turbo run dev --filter=@pedalboard/app-template
- Handle conflicts if they occur:
# Fix conflicts manually, then:
git add .
git cherry-pick --continue
Example workflow:
# Fetch latest from main repo
git fetch ap
# Look for recent pedalboard changes
git log ap/main --oneline -20 -- "*pedalboard*"
# Cherry-pick a specific commit
git cherry-pick abc1234
# Test the changes
turbo run build --filter=@pedalboard/relay
Turborepo
Docker
Typescript
Npm