Skip to content
Merged
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
50 changes: 33 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,49 @@ As a user storing data with PDP I can use the explorer to:
This project uses subgraph technology and the Goldsky platform for data indexing and monitoring.

## Goldsky
- Log in to [goldsky](https://goldsky.com)

### Configuration
Network configurations are managed in `subgraph/config/network.json`. This file contains network-specific settings including:
- Network name (e.g., `filecoin`, `filecoin-testnet`)
- PDPVerifier contract address
- Start block number
- Max proving period
- Challenge window size

The build system uses mustache templates to automatically generate:
- `subgraph.yaml` from `templates/subgraph.template.yaml`
- `src/generated/constants.ts` from `templates/constants.template.ts`

### Login
Log in to [goldsky](https://goldsky.com):
```bash
cd subgraph
# Login
goldsky login
# API key: enter your Goldsky API key
xxxxxxxxxxxx
```
- Switch chain environment
- mainnet
- Update `subgraph.yaml` with `cp subgraph_mainnet.yaml subgraph.yaml`
- Update `utils/index.ts` to set `export const PDPVerifierAddress = "0xBADd0B92C1c71d02E7d520f64c0876538fa2557F"; export const MaxProvingPeriod = 2880;`
- calibration
- Update `subgraph.yaml` with `cp subgraph_testnet.yaml subgraph.yaml`
- Update `utils/index.ts` to set `export const PDPVerifierAddress = "0x85e366Cf9DD2c0aE37E963d9556F5f4718d6417C"; export const MaxProvingPeriod = 240;`
- Build and deploy subgraph

### Build and Deploy

#### Mainnet
```bash
# mainnet
graph codegen
graph build
# Build for mainnet (generates constants and YAML from config/network.json)
npm run build:mainnet

# Deploy to Goldsky
goldsky subgraph deploy <product-name>/mainnet_<version> --path ./
# calibration: switch chain environment first
graph codegen
graph build
```

#### Calibration
```bash
# Build for calibration (generates constants and YAML from config/network.json)
npm run build:calibration

# Deploy to Goldsky
goldsky subgraph deploy <product-name>/calibration_<version> --path ./
```
- Sync

### Sync
Wait until `mainnet_<version>` and `calibration_<version>` finish syncing.

## Frontend Site
Expand Down
4 changes: 4 additions & 0 deletions subgraph/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ typechain-types

# Hardhat files
cache

# Generated subgraph.yaml
subgraph.yaml
Comment thread
silent-cipher marked this conversation as resolved.
src/generated/
26 changes: 26 additions & 0 deletions subgraph/config/network.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"networks": {
"calibration": {
"name": "filecoin-testnet",
"PDPVerifier": {
"address": "0x85e366Cf9DD2c0aE37E963d9556F5f4718d6417C",
"startBlock": 3140755
},
"FWSS": {
"maxProvingPeriod": "240",
"challengeWindowSize": "20"
}
},
"mainnet": {
"name": "filecoin",
"PDPVerifier": {
"address": "0xBADd0B92C1c71d02E7d520f64c0876538fa2557F",
"startBlock": 5441432
},
"FWSS": {
"maxProvingPeriod": "2880",
"challengeWindowSize": "60"
}
}
}
}
Loading
Loading