Skip to content

Commit

Permalink
feat: ingest messages from redis (#65)
Browse files Browse the repository at this point in the history
* feat: ingest messages from redis

* chore: rename chainhook related files

* feat: ingest messages from redis

* chore: move sql read/write type queries into correct classes

* chore: disable postgres listen/notify usage for socket-io events

* feat: use worker threads for CPU intensive message parsing (#66)

* feat: use worker threads for CPU intensive message parsing

* chore: misc fixes

* fix: insert reward_sets for pre-naka blocks

* chore: bump nodejs to v22

* ci: add `redis-stream` pre-release deployment
  • Loading branch information
zone117x authored Jan 9, 2025
1 parent 6c5505d commit 26f8e62
Show file tree
Hide file tree
Showing 31 changed files with 1,884 additions and 1,114 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- develop
- beta
- redis-stream
tags-ignore:
- '**'
paths-ignore:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
5 changes: 5 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"name": "beta",
"channel": "beta",
"prerelease": true
},
{
"name": "redis-stream",
"channel": "redis-stream",
"prerelease": true
}
],
"plugins": [
Expand Down
7 changes: 2 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
"env": {
"NODE_ENV": "development",
"TS_NODE_SKIP_IGNORE": "true",
"CHAINHOOK_NODE_AUTH_TOKEN": "test",
"CHAINHOOK_AUTO_PREDICATE_REGISTRATION": "true",
"CHAINHOOK_PREDICATE_PATH": "tmp",
"EXTERNAL_HOSTNAME": "host.docker.internal:3199",
"EVENT_PORT": "3199",
"NETWORK": "testnet",
"PGDATABASE": "postgres",
"PGHOST": "localhost",
Expand All @@ -30,10 +25,12 @@
"PGPASSWORD": "postgres",
"STACKS_NODE_RPC_HOST": "127.0.0.1",
"STACKS_NODE_RPC_PORT": "20443",
"REDIS_URL": "redis://127.0.0.1:8379",
},
"killBehavior": "polite",
"preLaunchTask": "npm: testenv:run",
"postDebugTask": "npm: testenv:stop",
"nodeVersionHint": 22
},
{
"type": "node",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine
FROM node:22-alpine

WORKDIR /app
COPY . .
Expand Down
5 changes: 5 additions & 0 deletions docker/docker-compose.dev.redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
postgres:
image: "redis:7"
ports:
- "8379:6379"
13 changes: 13 additions & 0 deletions migrations/1736371826669_chain_tip_last_msg_id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;

export function up(pgm: MigrationBuilder): void {
pgm.addColumns('chain_tip', {
last_redis_msg_id: {
type: 'text',
notNull: true,
default: '0',
},
});
}
Loading

0 comments on commit 26f8e62

Please sign in to comment.