Skip to content

AudiusProject/pedalboard

Repository files navigation

Pedalboard

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

Project Structure

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.

Starting a new application

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);
})();

Starting a new package

  1. Copy the app template
cp ./apps/app-template ./apps/my-app
  1. Modify package.json to have your app name

  2. Install dependencies from the monorepo root

npm i

Development with Turborepo

This monorepo uses Turborepo for fast, efficient development. Turborepo provides caching, parallel execution, and dependency management.

Running Applications

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

Building

Build everything:

turbo run build

Build specific packages:

turbo run build --filter=@pedalboard/logger

Build with concurrency:

turbo run build --concurrency=4

Other Commands

Lint all packages:

turbo run lint

Run tests:

turbo run test

Clean build artifacts:

turbo run clean

Syncing from audius-protocol

This repository was extracted from the main audius-protocol repository. To sync new changes from the main repo:

Setup (one-time)

Add the main audius-protocol repo as a remote:

git remote add ap https://github.com/AudiusProject/audius-protocol.git
git fetch ap

Syncing Changes

  1. Find pedalboard-related commits in the main repo:
git log ap/main --oneline -- "*pedalboard*" "*/pedalboard/*"
  1. Cherry-pick specific commits:
git cherry-pick <commit-hash>
  1. Test your changes:
turbo run build
turbo run dev --filter=@pedalboard/app-template
  1. 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

Tools

Turborepo

Docker

Typescript

Npm

About

collection of apps and packages to be used with audius.co

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10