From ed9c201e25321f7cf02eb343bb7f038ba384ff37 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Sat, 25 Nov 2023 11:59:10 -0500 Subject: [PATCH 1/4] Update substreams-sink --- .github/workflows/npm.yml | 19 +++++++++++++++ Dockerfile | 12 +++++++--- package-lock.json | 49 +++++++++++++++++++++++++++++---------- package.json | 21 +++++++++-------- 4 files changed, 76 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..608d093 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,19 @@ +name: NPM Registry +on: + release: + types: [ published ] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/Dockerfile b/Dockerfile index d10bb16..3a7c9a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,10 @@ -FROM oven/bun +FROM node:alpine + +EXPOSE 9102 + +COPY package*.json ./ +RUN npm ci COPY . . -RUN bun install -ENTRYPOINT [ "bun", "./bin/cli.ts", "run" ] \ No newline at end of file +RUN npm run build + +ENTRYPOINT ["npm", "start"] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 73bd8d6..cc00073 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.6.0", "dependencies": { "p-queue": "latest", - "substreams-sink": "^0.13.0", + "substreams-sink": "^0.13.3", "tweetnacl": "latest" }, "devDependencies": { @@ -272,10 +272,16 @@ "@bufbuild/protobuf": "^1.3.3" } }, - "node_modules/@connectrpc/connect-web": { + "node_modules/@connectrpc/connect-node": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-1.1.3.tgz", - "integrity": "sha512-WfShOZt91duJngqivYF4wJFRbeRa4bF/fPMfDVN0MAYSX3VuaTMn8o9qgKN7tsg2H2ZClyOVQwMkZx6IdcP7Zw==", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-1.1.3.tgz", + "integrity": "sha512-oq7Uk8XlLzC2+eHaxZTX189dhujD0/tK9plizxofsFHUnLquMSmzQQ2GzvTv4u6U05eZYc/crySmf86Sqpi1bA==", + "dependencies": { + "undici": "^5.26.2" + }, + "engines": { + "node": ">=16.0.0" + }, "peerDependencies": { "@bufbuild/protobuf": "^1.3.3", "@connectrpc/connect": "1.1.3" @@ -291,6 +297,14 @@ "fast-check": "^3.13.2" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", + "engines": { + "node": ">=14" + } + }, "node_modules/@substreams/core": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@substreams/core/-/core-0.7.0.tgz", @@ -316,13 +330,13 @@ } }, "node_modules/@substreams/node": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@substreams/node/-/node-0.4.1.tgz", - "integrity": "sha512-T+Atg2fXj/3aO7pTr/3vUtkiQySgqDJnM9NLe6N8/UbRwvY3HTLf1i7vYlqbjPrdQMbDUfPIermsoOsn7jiK6A==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@substreams/node/-/node-0.4.3.tgz", + "integrity": "sha512-XpzXg4QhNgqTXjXB/OfuBwfp8REgPC9arpPFQ4vNS0toia6BZjOLirB42txl7DLo053FIaEDqPsKaR7D2Cmv0g==", "dependencies": { "@bufbuild/protobuf": "latest", "@connectrpc/connect": "latest", - "@connectrpc/connect-web": "latest", + "@connectrpc/connect-node": "latest", "@substreams/core": "^0.7.0", "eventemitter3": "latest" }, @@ -453,13 +467,13 @@ "peer": true }, "node_modules/substreams-sink": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/substreams-sink/-/substreams-sink-0.13.0.tgz", - "integrity": "sha512-99uVsnwkcd8WrSVBROsLicruvnMfprQZ37vKQRw300iG+deUJt2PRsbFBtMd4qNpuVXFnALJsqLkymPGW1OTOw==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/substreams-sink/-/substreams-sink-0.13.3.tgz", + "integrity": "sha512-TkDZI+4si5a8ZlKddBBYOUWUwh5G/R0XOS7V1VB4R+HOnvjarKXHY3JLWPStHWIVyADD8gjR0QUAex1A7wPbug==", "dependencies": { "@substreams/core": "^0.7.0", "@substreams/manifest": "^0.6.0", - "@substreams/node": "^0.4.1", + "@substreams/node": "^0.4.3", "commander": "latest", "dotenv": "latest", "prom-client": "latest", @@ -506,6 +520,17 @@ "node": ">=14.17" } }, + "node_modules/undici": { + "version": "5.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.0.tgz", + "integrity": "sha512-gM12DkXhlAc5+/TPe60iy9P6ETgVfqTuRJ6aQ4w8RYu0MqKuXhaq3/b86GfzDQnNA3NUO6aUNdvevrKH59D0Nw==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/yaml": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", diff --git a/package.json b/package.json index 57cabb7..536830d 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,28 @@ { - "private": true, - "version": "0.6.0", + "version": "0.6.1", "name": "substreams-sink-webhook", "description": "Substreams Sink Webhook", "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "bin": { + "substreams-sink-webhook": "dist/bin/cli.js" + }, "author": { "name": "Denis", "email": "denis@pinax.network" }, "scripts": { - "start": "bun bin/cli.ts run", - "dev": "bun --watch bin/cli.ts run", - "pretest": "bunx tsc --noEmit", - "server": "bun ./examples/node/http.ts 3000", + "start": "tsc && node ./dist/bin/cli.js run", + "pretest": "tsc --noEmit", "test": "bun test", - "bench": "bun ./src/*.bench.ts", + "prepublishOnly": "tsc", "build": "bun build --compile ./index.ts --outfile substreams-sink-webhook", - "format": "biome format --write . && biome check --apply .", - "lint": "biome check ." + "bench": "bun ./src/*.bench.ts" }, "dependencies": { "p-queue": "latest", - "substreams-sink": "^0.13.0", + "substreams-sink": "^0.13.3", "tweetnacl": "latest" }, "devDependencies": { From 0e4aca69de7fd7b164beee2dc1438a927d224151 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Sat, 25 Nov 2023 12:03:00 -0500 Subject: [PATCH 2/4] include dist --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 536830d..39f6f50 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "name": "Denis", "email": "denis@pinax.network" }, + "files": ["dist"], "scripts": { "start": "tsc && node ./dist/bin/cli.js run", "pretest": "tsc --noEmit", From 87c050f8cd9ad4ef8fc735caa1f6d54bb28b43a6 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Sat, 25 Nov 2023 12:06:38 -0500 Subject: [PATCH 3/4] remove run build --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3a7c9a8..0aa9c31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,5 @@ EXPOSE 9102 COPY package*.json ./ RUN npm ci COPY . . -RUN npm run build ENTRYPOINT ["npm", "start"] \ No newline at end of file From 3e0c8293bb807177865dc5ed17816c9bf1079a6a Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Sat, 25 Nov 2023 12:11:43 -0500 Subject: [PATCH 4/4] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39f6f50..8284d48 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.6.1", + "version": "0.6.2", "name": "substreams-sink-webhook", "description": "Substreams Sink Webhook", "type": "module",