Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4d47c1e
fix: reject ssl verification
0xkenj1 Jan 24, 2025
49ae81c
fix: remove admin secret header on envio indexer client
0xkenj1 Jan 24, 2025
fe17f98
fix: db connection
0xkenj1 Jan 30, 2025
9992af7
feat: improve pricing and metadata
0xkenj1 Feb 3, 2025
2d114f0
fix: dependencies
0xkenj1 Feb 4, 2025
5491be8
feat: improve-bootstrap-scripts
0xkenj1 Feb 4, 2025
50ef5b4
fix: metadata and pricing issues
0xkenj1 Feb 4, 2025
adf1bf2
fix: issues
0xkenj1 Feb 4, 2025
ad6c803
fix: exception issue
0xkenj1 Feb 4, 2025
04d481c
Merge branch 'feat/metadata-pricing-improvements' into feat/bootstrap…
0xkenj1 Feb 4, 2025
f0c25ec
Merge remote-tracking branch 'origin/dev' into feat/bootstrap-scripts
0xkenj1 Feb 5, 2025
37c63ae
feat: add optimizations and fix caching
0xkenj1 Feb 5, 2025
1f07ae8
test: envio indexer client
0xkenj1 Feb 11, 2025
227e2a7
fix: metadata tests and smol fixes
0xkenj1 Feb 11, 2025
632cb94
fix: dataflow tests and smol fixes
0xkenj1 Feb 11, 2025
2f7c02c
fix: pricing tests and console logs
0xkenj1 Feb 11, 2025
dbac0f9
fix: pricing tests and console logs
0xkenj1 Feb 11, 2025
a413df9
fix: pr comments
0xkenj1 Feb 11, 2025
45ca767
Merge remote-tracking branch 'origin/dev' into feat/bootstrap-scripts
0xkenj1 Feb 11, 2025
34d7f96
fix: pricing bootstrap script
0xkenj1 Feb 11, 2025
74a3bb5
fix: tests
0xkenj1 Feb 11, 2025
17bcc8b
fix: lint
0xkenj1 Feb 11, 2025
230e42c
fix: pr comments
0xkenj1 Feb 12, 2025
f07d951
fix: yacomments
0xkenj1 Feb 12, 2025
5b4612d
fix: metadata tests
0xkenj1 Feb 12, 2025
218e933
fix: local environment
0xkenj1 Feb 13, 2025
d41c4fb
fix: env example
0xkenj1 Feb 13, 2025
d5a42c0
fix: metadata script
0xkenj1 Feb 13, 2025
43534b3
fix: examples
0xkenj1 Feb 13, 2025
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
23 changes: 13 additions & 10 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,22 @@ HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public
############### PROCESSING #################
############################################

RPC_URLS=["https://optimism.llamarpc.com","https://rpc.ankr.com/optimism","https://optimism.gateway.tenderly.co","https://optimism.blockpi.network/v1/rpc/public","https://mainnet.optimism.io","https://opt-mainnet.g.alchemy.com/v2/demo"]
CHAIN_ID=10

FETCH_LIMIT=1000
FETCH_DELAY_MS=3000
CHAINS=[{"id":10,"name":"optimism","rpcUrls":["https://optimism.llamarpc.com","https://rpc.ankr.com/optimism","https://optimism.gateway.tenderly.co","https://optimism.blockpi.network/v1/rpc/public","https://mainnet.optimism.io","https://opt-mainnet.g.alchemy.com/v2/demo"],"fetchLimit":5000,"fetchDelayMs":1000}]

DATABASE_URL=postgresql://postgres:testing@datalayer-postgres-db:5432/datalayer-postgres-db
DATABASE_SCHEMA=chain_data_schema_1
DATABASE_SCHEMA=public

INDEXER_GRAPHQL_URL=http://indexer-graphql-api:8080/v1/graphql
INDEXER_GRAPHQL_URL= http://indexer-graphql-api:8080/v1/graphql
INDEXER_ADMIN_SECRET=testing

IPFS_GATEWAYS_URL=["https://ipfs.io","https://gateway.pinata.cloud","https://dweb.link", "https://ipfs.eth.aragon.network"]
METADATA_SOURCE=public-gateway
PUBLIC_GATEWAY_URLS=["https://ipfs.io","https://dweb.link","https://cloudflare-ipfs.com","https://gateway.pinata.cloud","https://ipfs.infura.io","https://ipfs.fleek.co","https://ipfs.eth.aragon.network","https://ipfs.jes.xxx","https://ipfs.lol","https://ipfs.mle.party"]

RETRY_MAX_ATTEMPTS=100000
RETRY_BASE_DELAY_MS=200
RETRY_MAX_DELAY_MS=1000
RETRY_FACTOR=1.5

COINGECKO_API_KEY={{YOUR_KEY}}
COINGECKO_API_TYPE=demo
PRICING_SOURCE=coingecko
COINGECKO_API_KEY={{YOUR_PRO_KEY}}
COINGECKO_API_TYPE=pro
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Based on example:
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN npm install -g corepack@latest
RUN corepack enable

FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run -r build
RUN pnpm deploy --filter=./apps/processing --prod /prod/processing
RUN pnpm deploy --filter=./apps/processing /prod/processing
RUN pnpm deploy --filter=./scripts/hasura /prod/hasura-config

FROM base AS processing
COPY --from=build /prod/processing /prod/processing
WORKDIR /prod/processing
CMD [ "pnpm", "start" ]
CMD ["node", "dist/index.js"]

41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Ensure you have the following installed on your machine:

### Setup

1. Install dependencies and build depedencies:

```
pnpm i && pnpm build
```

1. Copy the Example Environment File and edit the `.env` file

```
Expand All @@ -55,26 +61,47 @@ cp .env.example .env
docker-compose up -d --build
```

3. Copy the Example Environment File on `scripts/migrations` and edit the `.env` file
3. Copy the Example Environment File on `scripts/bootstrap` and edit the `.env` file

```
cp scripts/bootstrap/.env.example scripts/bootstrap/.env
```

4. Copy the Example Environment File on `scripts/migrations` and edit the `.env` file

```
cp scripts/migrations/.env.example scripts/migrations/.env
```

4. After starting Docker Compose, run the following command to apply the database migrations:
5. Copy the Example Environment File on `scripts/hasura-config` and edit the `.env` file

```
pnpm db:migrate
cp scripts/hasura-config/.env.example scripts/hasura-config/.env
```

6. Apply cache migrations:

```
pnpm db:cache:migrate
```

7. Bootstrap DB with IPFS metadata and Pricing(optional):

```
pnpm bootstrap:metadata
pnpm bootstrap:pricing
```

5. Copy the Example Environment File on `apps/processing` and edit the `.env` file
8. Apply migrations:

cp apps/processing/.env.example apps/processing/.env
```
pnpm db:migrate
```

6. Start the Processing service with:
9. For automatic hasura API configuration run:

```
pnpm dev
pnpm api:configure
```

Once the setup is completed you can access Hasura by navigating to:
Expand Down
1 change: 1 addition & 0 deletions apps/indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN npm install -g corepack
RUN corepack enable
COPY . /app
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"chai": "4.3.10",
"envio": "2.8.2",
"envio": "2.12.4",
"ethers": "6.8.0",
"yaml": "2.5.1"
},
Expand Down
Loading
Loading