Skip to content

Commit

Permalink
🎉 Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival committed Jul 19, 2023
0 parents commit 0899402
Show file tree
Hide file tree
Showing 43 changed files with 25,299 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 1,4 @@
/.git
/node_modules
/lib
/*Versions.json
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 1,5 @@
DB_NAME=squid
DB_PORT=23798
GQL_PORT=4350
# wss or endpoint to an Eth mainnet archive node
RPC_ENDPOINT=https://rpc.ankr.com/eth
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 1,7 @@
/node_modules
/lib

/**Versions.json

# IDE files
/.idea
42 changes: 42 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 1,42 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false

tasks:
- init: |
npm i
npm i -g @subsquid/cli
docker compose pull
gp sync-done setup
- name: DB
command: |
gp sync-await setup
sqd up
- name: GraphQL API
command: |
gp sync-await setup
sqd serve
- command: |
gp ports await 4350
gp preview $(gp url 4350)/graphql
- name: Squid procesor
command: |
gp open src/processor.ts
gp sync-await setup
sqd build
gp ports await 23798
sqd process
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 1,40 @@
FROM node:19-alpine AS node

FROM node AS node-with-gyp
RUN apk add g make python3

FROM node-with-gyp AS builder
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
RUN npm ci
ADD tsconfig.json .
ADD src src
RUN npm run build

FROM node-with-gyp AS deps
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
RUN npm ci --production

FROM node AS squid
WORKDIR /squid
COPY --from=deps /squid/package.json .
COPY --from=deps /squid/package-lock.json .
COPY --from=deps /squid/node_modules node_modules
COPY --from=builder /squid/lib lib
ADD db db
ADD schema.graphql .
# TODO: use shorter PROMETHEUS_PORT
ENV PROCESSOR_PROMETHEUS_PORT 3000
EXPOSE 3000
EXPOSE 4000


FROM squid AS processor
CMD ["npm", "run", "squid-etl:start"]


FROM squid AS query-node
CMD ["npm", "run", "squid-api:start"]
Loading

0 comments on commit 0899402

Please sign in to comment.