-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: indexer service #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few smol comments
.npmrc
Outdated
shamefully-hoist=true | ||
# Needed so users can run `pnpm install` in the root of the repo without requiring the `-w` flag. | ||
ignore-workspace-root-check=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the necessity of adding the -w
flag so you don't mistakenly install a dep globally when it should specific to a package/app
address: | ||
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3 | ||
|
||
- id: 10 # optimism |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we sync all chains but only consume one for the MVP?
apps/indexer/package.json
Outdated
"yaml": "2.5.1" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove carets ^
(why the .npmrc config didn't work here 🤔 )
"esModuleInterop": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"module": "CommonJS" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because of the issue you mentioned offline regarding envio deps right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, lets be flexible here :)
const eventHandlers = loadYaml(yamlFilePath); | ||
const handlerFunctions = loadHandlerFunctions(handlersDir); | ||
|
||
assert.equal(compareEventsAndHandlers(eventHandlers, handlerFunctions), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💎 byutiful, maybe we can make this a script instead of part of a test suite wdyt? just a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, initially was a script, but wanted to integrate it to the ci/cd pipeline as fast as possible 🤣
Finally i left it as a test, but i will add a TODO comment to migrate it to a Github workflow as a script, because this checks will grow in the future.
docker-compose.yaml
Outdated
- "5433:5432" | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
environment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO for the env vars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, looking good
apps/indexer/Dockerfile
Outdated
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the target=
point to $PNPM_HOME/store
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
apps/indexer/Dockerfile
Outdated
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm dlx envio codegen | ||
|
||
CMD pnpm dlx envio local db-migrate setup && pnpm dlx envio start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to ask, do we want to db-migrate setup
the DB whenever a new container boots up? The docs say that it drops the schema before running all migrations.
If this is going to be used during dev only, we could rename this Dockerfile to Dockerfile.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, i think we can replace it like this
CMD pnpm dlx envio local db-migrate setup && pnpm dlx envio start | |
CMD pnpm dlx envio local db-migrate up && pnpm dlx envio start |
and won't drop older tables i think.
Lets keep Dockerfile name as it is, if we need to improve it or create a new one in the future we can rename it :)
🤖 Linear
Closes GIT-30 GIT-31 GIT-50 GIT-51
Description
Adds indexer service, docker file for the indexer process from envio, base docker-compose for the full app , docs and last but not least an important test that ensures that all the events from envio config.yaml file are handled.
Checklist before requesting a review