Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# contributing to multi-delegator

Thanks for helping improve this project. This document explains how to set up a dev environment, run checks, and open pull requests against [solana-program/multi-delegator](https://github.com/solana-program/multi-delegator).

## before you start

- Read the [README](README.md) for an overview, program id, and project layout.
- Architecture notes live under [docs/](docs/); start with [ADR-001](docs/001-multi-delegator-architecture.md) if you change on-chain behavior.
- The program is **not audited**. Treat changes that touch funds or authority as high risk and call them out clearly in your PR.

## fork and clone

Fork the repository on GitHub, then clone your fork and add the upstream remote:

```bash
git clone https://github.com/<your-username>/multi-delegator.git
cd multi-delegator
git remote add upstream https://github.com/solana-program/multi-delegator.git
```

Keep your `main` branch tracking `upstream/main`, and use a feature branch for changes:

```bash
git fetch upstream
git checkout -b your-branch-name upstream/main
```

## prerequisites

The [README prerequisites](README.md#prerequisites) list the toolchain: Rust, Solana CLI, pnpm, Just, and Surfpool (for integration tests and local flows).

Run `just setup` once after cloning to install Node dependencies and configure git hooks.

## build and test

Typical workflow:

| Task | Command |
|------|---------|
| Build program + idl + clients | `just build` |
| Program tests only | `just test-program` |
| Full suite (program + TS client integration tests) | `just test` |
| Format + lint (same as CI) | `just check` |

Fix formatting before pushing if `just check` fails: `just fmt` and `just lint` (see [justfile](justfile)).

## generated code

IDL and Codama-generated clients under `programs/multi_delegator/idl/`, `clients/typescript/src/generated/`, and `clients/rust/src/generated/` are produced by the build. If you change the on-chain program, run `just build` (or `just generate-idl` / `just generate-client` as appropriate) and commit the regenerated artifacts so CI stays green.

## pull requests

- Open PRs against `solana-program/multi-delegator` `main` from your fork.
- Describe what changed and why; link related issues if any.
- Ensure `just check` and `just test` pass locally when your change touches code they cover.

## community

- Use [GitHub issues](https://github.com/solana-program/multi-delegator/issues) for bugs and feature ideas.
- For security-sensitive reports, use the contact options the maintainers prefer (see repository README or security policy if present).
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ The GitHub Actions workflow (`.github/workflows/ci.yml`) runs on PRs and pushes
| **integration-test** | Start Surfpool, run TypeScript integration tests |
| **benchmark** | (PRs only) Generate CU report and post as PR comment |

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for fork workflow, tests, and pull request expectations.

## Architecture Docs

| Document | Description |
Expand Down
2 changes: 1 addition & 1 deletion clients/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"build": "tsup",
"test": "vitest run --config vitest.config.ts",
"clean": "rm -rf dist && rm -rf src/generated",
"clean": "node ./scripts/clean.mjs",
"format": "biome check --write",
"format:check": "biome check",
"lint": "biome lint --write",
Expand Down
8 changes: 8 additions & 0 deletions clients/typescript/scripts/clean.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { rmSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';

const root = dirname(fileURLToPath(import.meta.url));

rmSync(join(root, '..', 'dist'), { recursive: true, force: true });
rmSync(join(root, '..', 'src', 'generated'), { recursive: true, force: true });