Contributing
How to contribute
Thank you for your interest in contributing to Blobscan! We welcome contributions from everyone, and this document provides some guidelines to make the contribution process smoother.
Code of Conduct
All contributors are expected to follow our Code of Conduct. Please make sure you are welcoming and friendly in all our spaces.
Getting Started
- Ensure you have a GitHub account.
- Look for an issue to tackle in our issue tracker on GitHub.
- Once you've chosen an issue, comment on it to let others know you're working on it.
Making Changes
- Begin by setting up Blobscan locally.
- Proceed to make your changes.
- Ensure you've tested your changes comprehensively. Refer to our Testing Guide for details on our testing setup.
- Once done, push your changes to your GitHub fork.
- Create a pull request against our main repository.
Contact
If you have questions or need help with your contribution, join our Discord server and ask in the #🔎-blobscan channel.
Examples
Add support for a new network
Steps:
- Add a new chain file under
packages/chains/src/chains/(see existing chains for reference) and export it frompackages/chains/src/chains/index.ts - Add the new network name to the
networkSchemaenum inpackages/env/index.ts - Update environment documentation in
apps/docs/src/app/docs/environment/page.md
Check out the following PRs:
- https://github.com/Blobscan/blobscan/pull/823
- https://github.com/Blobscan/blobscan/commit/0a2a94c587e9b93f6b36ad15fd55065e824b5049
- https://github.com/Blobscan/blobscan/pull/826
Add a new storage provider
Steps:
- Add the new storage value to the
BlobStorageenum inpackages/db/prisma/schema.prismaand create a Prisma migration - Implement the storage class in
packages/blob-storage-manager/src/storages/extendingBlobStorageand export it from itsindex.ts - Add any new environment variables to
packages/env/index.tsand document them inapps/docs/src/app/docs/environment/page.md - Wire up the new storage in
packages/blob-storage-manager/src/utils/storage.ts(createStorageFromEnv) - Add a worker processor file in
packages/blob-propagator/src/worker-processors/and register it inpackages/blob-propagator/src/BlobPropagator.ts - Add an SVG icon to
apps/web/src/icons/blob-storages/, register it inapps/web/src/icons/blob-storages/index.ts, and add the badge entry inapps/web/src/components/Badges/StorageBadge.tsx - Add tests for the new storage class and worker processor
Check out the following PRs:
- https://github.com/Blobscan/blobscan/pull/820
Label a new rollup
Steps:
- Add a directory in
packages/rollups/src/rollups/with the rollup ID as its name. - Add
definition.tswith the display name, theme colors, icon filename, and poster addresses for each chain. The folder name supplies the ID; do not add anidfield. Use an existing definition as a template. - Add
icon.svg,icon.png,icon.jpg, oricon.jpegin the same directory. SVG icons can usecurrentColorfor theme colors. - Run
pnpm rollups:syncfrom the repository root. This generates the registry, icon map, and Prisma enum entries. - If the enum changed, run
pnpm --filter @blobscan/db db:migrate --create-only --name add_example_rollup. Review the migration, apply it to the development database, and runpnpm db:generate. - Commit the definition, icon, generated files, and migration together. Apply the migration before the updated application writes the new rollup ID.
- Run a separate backfill if existing address records or metrics need updates.
Run pnpm rollups:sync --check to check generated files without writing them. The sync command does not connect to the database or change migration files.
Check out the following PRs:
- https://github.com/Blobscan/blobscan/pull/923