Skip to content

Commit 15488bf

Browse files
committed
add README
1 parent 787e1d7 commit 15488bf

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# project-claim-api
2+
3+
Standalone service that executes Lit Protocol actions to generate owner-signature proofs for Drips project claims. Supports GitHub (via FUNDING.json) and ORCID source types.
4+
5+
## Endpoints
6+
7+
### `POST /owner-signature`
8+
9+
Request body:
10+
11+
```json
12+
{
13+
"sourceKind": "gitHub",
14+
"name": "owner/repo",
15+
"chainName": "ethereum"
16+
}
17+
```
18+
19+
or
20+
21+
```json
22+
{
23+
"sourceKind": "orcid",
24+
"name": "0000-0002-1825-0097",
25+
"chainName": "ethereum"
26+
}
27+
```
28+
29+
Response:
30+
31+
```json
32+
{
33+
"sourceId": 0,
34+
"name": "owner/repo",
35+
"owner": "0x...",
36+
"timestamp": 1711000000,
37+
"r": "0x...",
38+
"vs": "0x..."
39+
}
40+
```
41+
42+
### `GET /health`
43+
44+
Returns `{ "status": "ok" }`.
45+
46+
## Environment variables
47+
48+
| Variable | Required | Default | Description |
49+
|---|---|---|---|
50+
| `PORT` | No | `3100` | Port to listen on |
51+
| `LIT_NETWORK` | No | `naga` | Lit network: `dev`, `test`, or `naga` |
52+
| `LIT_ETHEREUM_PRIVATE_KEY` | For `test`/`naga` | - | Private key for Lit auth. Optional on `dev`. |
53+
| `GITHUB_PERSONAL_ACCESS_TOKEN` | No | - | GitHub token for FUNDING.json lookups (avoids rate limits) |
54+
| `CACHE_REDIS_CONNECTION_STRING` | No | - | Redis URL for rate limiting (e.g. `redis://localhost:6379`) |
55+
56+
## Development
57+
58+
```sh
59+
npm install
60+
cp .env.example .env # configure env vars
61+
npm run dev # starts with tsx watch
62+
```
63+
64+
## Production
65+
66+
```sh
67+
npm run build
68+
npm start
69+
```
70+
71+
## Docker
72+
73+
```sh
74+
docker build -f Dockerfile.dockerhub -t project-claim-api .
75+
docker run -p 3100:3100 --env-file .env project-claim-api
76+
```
77+
78+
The GitHub Actions workflow in `.github/workflows/publish-docker.yml` builds and publishes multi-arch images to Docker Hub on push.
79+
80+
## Architecture
81+
82+
This service was extracted from the main Drips app to isolate the Lit Protocol SDK (~845MB) and its ethers v5/v6 dependency conflicts from the SvelteKit build. The app proxies requests to this service via `PROJECT_CLAIM_API_URL`.

0 commit comments

Comments
 (0)