Skip to content

Commit

Permalink
Merge pull request #321 from drift-labs/master
Browse files Browse the repository at this point in the history
master -> mainnet
  • Loading branch information
lowkeynicc authored Dec 17, 2024
2 parents d0a2776 + d8b79bf commit 4bf3f87
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*/**/node_modules/
*/**/lib
.husky/
node_modules/
41 changes: 29 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
FROM public.ecr.aws/bitnami/node:20.18.1
RUN apt-get install git
ENV NODE_ENV=production
RUN npm install -g typescript
FROM node:20.18.1 AS builder

WORKDIR /app
COPY drift-common /app/drift-common
COPY . .

# Copy package files first to leverage cache
COPY package.json yarn.lock ./
COPY drift-common/protocol/sdk/package.json ./drift-common/protocol/sdk/
COPY drift-common/common-ts/package.json ./drift-common/common-ts/

RUN npm install -g bun typescript husky

WORKDIR /app/drift-common/protocol/sdk
RUN yarn
RUN yarn build
COPY drift-common/protocol/sdk/ .
RUN bun install && bun run build

WORKDIR /app/drift-common/common-ts
RUN yarn
RUN yarn build
COPY drift-common/common-ts/ .
RUN bun install && bun run build

WORKDIR /app
RUN yarn
RUN yarn build
COPY . .
# no '--production' for esbuild
RUN bun install && bun esbuild.config.js

FROM node:20.18.1-alpine
# 'bigint-buffer' native lib for performance
# @triton-one/yellowstone-grpc so .wasm lib included
RUN apk add python3 make g++ --virtual .build &&\
npm install -C /lib bigint-buffer @triton-one/yellowstone-grpc &&\
apk del .build
COPY --from=builder /app/lib/ ./lib/

ENV NODE_ENV=production
EXPOSE 9464

CMD ["node", "./lib/index.js"]
2 changes: 1 addition & 1 deletion drift-common
Submodule drift-common updated 40 files
+2 −1 .github/workflows/deploy-on-sdk-update.yml
+ common-ts/bun.lockb
+1 −1 common-ts/package.json
+8 −4 common-ts/src/EnvironmentConstants.ts
+6 −3 common-ts/src/utils/s3Buckets.ts
+74 −102 common-ts/yarn.lock
+ icons/bun.lockb
+1 −1 icons/package.json
+1 −1 protocol
+ react/bun.lockb
+1 −0 react/package.json
+54 −0 react/src/components/Charts/ActiveDot.tsx
+1 −0 react/src/components/Charts/index.ts
+18 −0 react/src/components/Loaders/InlineLoadingBar.tsx
+22 −0 react/src/components/Loaders/ProgressBarThreeColor.tsx
+2 −0 react/src/components/Loaders/index.ts
+8 −0 react/src/components/Loaders/inlineLoading.css
+35 −0 react/src/components/Tables/BodyCell.tsx
+53 −0 react/src/components/Tables/BodyCellWrapper.tsx
+36 −0 react/src/components/Tables/BodyRow.tsx
+14 −0 react/src/components/Tables/BodyRowWrapper.tsx
+17 −0 react/src/components/Tables/HeaderCell.tsx
+24 −0 react/src/components/Tables/HeaderCellWrapper.tsx
+34 −0 react/src/components/Tables/HeaderRow.tsx
+25 −0 react/src/components/Tables/SummaryRow.tsx
+48 −0 react/src/components/Tables/TableCellCardValue.tsx
+51 −0 react/src/components/Tables/TableRowWrapper.tsx
+51 −0 react/src/components/Tables/TableSkeleton.tsx
+11 −0 react/src/components/Tables/index.tsx
+107 −0 react/src/components/Utils/CentreFillScroller.tsx
+1 −0 react/src/components/Utils/index.tsx
+3 −0 react/src/components/index.ts
+18 −0 react/src/constants/charts.ts
+1 −0 react/src/constants/index.ts
+97 −0 react/src/hooks/charts/useGroupHistoricalPricesByAverage.ts
+1 −0 react/src/hooks/index.ts
+4 −3 react/src/index.ts
+92 −0 react/src/utils/graph.tsx
+2 −0 react/src/utils/index.ts
+7 −0 react/src/utils/ui.ts
28 changes: 28 additions & 0 deletions esbuild.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const esbuild = require('esbuild');
const glob = require('tiny-glob');

const commonConfig = {
bundle: true,
platform: 'node',
target: 'node20',
sourcemap: false,
// minify: true, makes messy debug/error output
treeShaking: true,
legalComments: 'none',
mainFields: ['module', 'main'],
metafile: true,
format: 'cjs',
external: [
'bigint-buffer',
'@triton-one/yellowstone-grpc'
]
};

(async () => {
let entryPoints = await glob("./src/**/*.ts");
await esbuild.build({
...commonConfig,
entryPoints,
outdir: 'lib',
});
})().catch(() => process.exit(1));
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"license": "Apache-2.0",
"dependencies": {
"@coral-xyz/anchor": "^0.29.0",
"@drift/common": "file:./drift-common/common-ts",
"@drift-labs/sdk": "file:./drift-common/protocol/sdk",
"@drift/common": "file:./drift-common/common-ts",
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/auto-instrumentations-node": "^0.31.1",
"@opentelemetry/exporter-prometheus": "^0.31.0",
Expand All @@ -33,7 +33,6 @@
"response-time": "^2.3.2",
"rxjs": "^7.8.1",
"socket.io-redis": "^6.1.1",
"typescript": "4.5.4",
"undici": "^6.16.1",
"winston": "^3.8.1",
"ws": "^8.14.2"
Expand All @@ -42,12 +41,14 @@
"@types/k6": "^0.45.0",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"esbuild": "^0.24.0",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^7.0.4",
"k6": "^0.0.0",
"prettier": "^2.4.1",
"tiny-glob": "^0.2.9",
"ts-node": "^10.9.1"
},
"scripts": {
Expand Down

0 comments on commit 4bf3f87

Please sign in to comment.