-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIN-1597] Minswap syncer for query price for v1, v2 and stableswap p…
…ool. (#40) * init * add dockerignore * fix ts-node esm loading * disable esm warning * syncer for v1, v2 and stableswap * fix rollback logic * Minswap adapter * add node-ogmios docker compose * update minswap adapter * update ci * fix build * fix jest * fix ci * fix test * fix test adapter * fix jest * change to npm * change to npm * change to npm ci * upgrade node from 18 to 20 and use pnpm instead of npm * ci: fix node version * add output prisma client * fix node linker * strict engine check * update readme * add v2 historical pool * remove node-configs * fix comment --------- Co-authored-by: Nhat Khanh <[email protected]>
- Loading branch information
1 parent
2b34342
commit c3eeee0
Showing
31 changed files
with
7,192 additions
and
7,413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
build | ||
examples | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# "mainnet" | "testnet-preview" | "testnet-preprod" | ||
ENVIRONMENT="testnet-preprod" | ||
|
||
# "mainnet" | "preview" | "preprod" ref: https://ogmios.dev/getting-started/docker | ||
OGMIOS_NETWORK="preprod" | ||
|
||
# preprod: 7790880c9f0ff09990f253dd1bf1a55d2a2e5340bf694e5c0bb166439e513e45.10918782 | ||
# mainnet: 231d8151ca08efcdd68d05920d0622624892dd8719ddc28aef131b7f1d4315db.56553271 | ||
SYNC_START_POINT="7790880c9f0ff09990f253dd1bf1a55d2a2e5340bf694e5c0bb166439e513e45.10918782" | ||
|
||
# prisma config database url: | ||
DATABASE_URL="postgresql://postgres:minswap@localhost:5432/syncer?schema=public" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node-linker=hoisted | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18 | ||
v20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:20 | ||
RUN apt-get update -y && \ | ||
apt-get install -y ca-certificates tzdata | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json pnpm-lock.yaml .npmrc ./ | ||
COPY src/syncer/postgres/prisma ./src/syncer/postgres/prisma | ||
RUN corepack enable && corepack install | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
services: | ||
syncer: | ||
build: | ||
dockerfile: Dockerfile.syncer | ||
restart: always | ||
environment: | ||
ENVIRONMENT: | ||
OGMIOS_HOST: ogmios | ||
OGMIOS_PORT: 1337 | ||
REDIS_URL: redis://default:minswap@redis:6379 | ||
POSTGRES_URL: postgresql://postgres:minswap@postgres:5432/syncer?schema=public&connection_limit=5 | ||
SYNC_START_POINT: | ||
command: pnpm run syncer:start | ||
|
||
redis: | ||
image: redis:7 | ||
restart: always | ||
command: --requirepass minswap | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- redis-data:/data | ||
|
||
postgres: | ||
image: postgres:16 | ||
restart: always | ||
environment: | ||
POSTGRES_DB: syncer | ||
POSTGRES_PASSWORD: minswap | ||
volumes: | ||
- ./src/syncer/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- postgres-data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
|
||
ogmios: | ||
image: cardanosolutions/cardano-node-ogmios:v6.5.0_9.0.0-${OGMIOS_NETWORK} | ||
restart: always | ||
ports: | ||
- 1337:1337 | ||
volumes: | ||
- ogmios-data:/db | ||
|
||
volumes: | ||
redis-data: {} | ||
ogmios-data: {} | ||
postgres-data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.