Skip to content

snapshot-labs/sx-monorepo

Repository files navigation

Test CI Discord

Snapshot X monorepository

This is an Snapshot X monorepository.

Apps and Packages

  • ui: Snapshot X front-end written in Vue

Usage

Project setup

yarn

Compiles and hot-reloads for development

UI only

yarn dev

UI with backend services

See here.

Compiles and minifies for production

yarn build

Lints and fixes files

yarn lint

Runs tests

yarn test

Verifies TypeScript code

yarn typecheck

Running local services

You can run all local services (api, subgraph-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.

yarn dev:full

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:

  • STARKNET_MNEMONIC and ETH_MNEMONIC - if you want to use it as relayer.
  • 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 yarn dev:full 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 yarn 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.