This guide will help you set up and run the Murmurations Aggregator locally. Follow the steps in order to ensure a smooth installation.
First, copy the example environment file:
cp .env.example .envSecond, Set the Aggregator's Tools URL:
PUBLIC_TOOLS_URL=http://localhost:5173Finally, configure the Resend API Key for email-based account recovery. You can create a free account at Resend:
PRIVATE_RESEND_KEY=<YOUR_API_KEY>Install the required packages:
pnpm installRun the following command to generate UCAN server keys. Copy the output
into your .env file:
pnpm generate-server-keysExample output:
✅ Generated server keys successfully!
Please add the following to your .env file:
PUBLIC_SERVER_DID_KEY=did:key:z6MkwEzW43zy5CJ4rSscCA4N6EpFGK6WHbFQrg8NxomZoEJS
PRIVATE_SERVER_KEY=SClA0WPgndVIBcYMy9KNc2SVcsEFJEjGQdyxTNHTc+75ciH16VlgrKUcw/x8t6btDeb5FpvQwk2g8AVqIZPbdw==Murmurations Aggregator uses Cloudflare D1 as its database.
Run the migration command to initialize the local database:
pnpm db:migrateThis will create a .wrangler folder containing a local SQLite database
in .wrangler/d1/, which you can use for local testing and preview.
Start the development server:
pnpm devYour application should now be available locally at: http://localhost:5173
Click the login button and select a name for the admin role. The public/private keypair generated in your browser will be associated with the username you create.
Use your favorite database editor to find the user_roles table and change the role_id for the newly created account from 2 to 1.
Open up IndexedDB in your browser and delete the core database. Refresh the page and the cached UCAN token will be replaced with a new one with the roles permissions updated from user to admin.
Navigate to http://localhost:5173/admin in your browser.