Skip to content

Commit

Permalink
feat: support redis stream as event source (#2192)
Browse files Browse the repository at this point in the history
* chore: initial server logic separation

* fix: dummy import

* fix: imports

* fix: export ibd

* chore: client

* feat: use new client

* chore: add pre-release
  • Loading branch information
rafaelcr authored Jan 7, 2025
1 parent a5d2a8b commit cba79fb
Show file tree
Hide file tree
Showing 17 changed files with 1,456 additions and 1,018 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ PG_APPLICATION_NAME=stacks-blockchain-api
# (with both Event Server and API endpoints).
# STACKS_API_MODE=

# If this API instance should consume events from a Stacks node (`stacks` or `default`) or a Store-and-forward Redis service (`redis`).
# STACKS_API_EVENT_SOURCE=
# REDIS_URL=

# To avoid running unnecessary mempool stats during transaction influx, we use a debounce mechanism for the process.
# This variable controls the duration it waits until there are no further mempool updates
# MEMPOOL_STATS_DEBOUNCE_INTERVAL=1000
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
- develop
- beta
- nakamoto
- redis-stream
tags-ignore:
- "**"
paths-ignore:
Expand Down
4 changes: 2 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"prerelease": true
},
{
"name": "nakamoto",
"channel": "nakamoto",
"name": "redis-stream",
"channel": "redis-stream",
"prerelease": true
}
],
Expand Down
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"env": {
"NODE_ENV": "development",
"TS_NODE_SKIP_IGNORE": "true"
}
},
"killBehavior": "polite",
},
{
"type": "node",
Expand Down
15 changes: 15 additions & 0 deletions migrations/1736275393880_stacks-node-event-sequence-id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable camelcase */

exports.shorthands = undefined;

exports.up = pgm => {
pgm.addColumn('event_observer_requests', {
sequence_id: {
type: 'string'
}
});
};

exports.down = pgm => {
pgm.dropColumn('event_observer_requests', 'sequence_id');
};
Loading

0 comments on commit cba79fb

Please sign in to comment.