Skip to content

snapshot-labs/sx-monorepo

Repository files navigation

Test CI Discord

Snapshot monorepository

This is the Snapshot monorepository containing a Vue frontend, GraphQL API, transaction relayer, and TypeScript SDK.

Apps and packages

Usage

Project setup

bun install

Compiles and hot-reloads for development

UI only

bun run dev

UI with backend services

See here.

Compiles and minifies for production

bun run build

Lints and fixes files

bun run lint

Runs tests

bun run test

Run E2E tests using Playwright

bun run test:e2e

Verifies TypeScript code

bun run typecheck

Running local services

You can run all local services (api, mana, ui) with single command assuming you have all necessary environment variables set up. Local APIs will only be used for Ethereum Sepolia and Starknet Sepolia.

This command will allow you to select which services you want to run.

bun run dev:interactive

Setup

You need to have Docker running on your machine.

In apps/api and apps/mana copy .env.example to .env files.

In apps/mana/.env you need to fill in following empty variables:

  • WALLET_SECRET - if you want to use it as relayer (used for both Starknet and Ethereum wallets).
  • HERODOTUS_API_KEY and HERODOTUS_LEGACY_API_KEY - if you want to use L1<->L2 messaging (voting with strategies that use L1 proofs)

Getting it running faster

If you run bun run dev:interactive it will take long time to sync all the blocks for the first time. To mitigate it you can just change starting block for indexing here:

If you do that make sure to create a new space, because spaces created before the new starting block you picked won't be available.

Versioning packages

Packages are versioned using changesets. In most cases all you need to do is when adding new changes to versioned packages (right now it's just sx.js) is to execute bun run changeset, specify package you updated, version bump per semver and description of your changes. Then commit generated files in your PR.

Once merged changesets actions will create PR that can be used to release and publish those packages.

Development docs

About

Snapshot monorepo

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors