Skip to content

Commit

Permalink
Merge pull request #8 from kryptokrauts/feat/1.0.10-shipreader-config…
Browse files Browse the repository at this point in the history
…-params

feat: configurable ship reader params
  • Loading branch information
marc0olo authored Apr 5, 2024
2 parents 618c9f3 + 81fe786 commit 5aa1fb1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .env_template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ EOSIO_NODE_API=
EOSIO_START_BLOCK=
# number of threads
EOSIO_DS_THREADS=4
# max messages in flight
EOSIO_MAX_MESSAGES_IN_FLIGHT=50
# fetch blocks true/false
EOSIO_FETCH_BLOCK=true
# fetch traces true/false
EOSIO_FETCH_TRACES=true
# fetch deltas true/false
EOSIO_FETCH_DELTAS=true

# unique client_id for interacting with Kafka
KAFKA_CLIENT_ID=
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kryptokrauts/event-processor-node-lib",
"version": "1.0.9",
"version": "1.0.10",
"description": "Wrapper for ease listening on antelope blockchain based on @blockmatic/antelope-ship-reader",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const EOSIO_CONFIG = {
eosio_node_api: process.env.EOSIO_NODE_API,
eosio_ship_api: process.env.EOSIO_SHIP_API,
ds_threads: Number(process.env.EOSIO_DS_THREADS || 4),
max_messages_in_flight: Number(process.env.EOSIO_MAX_MESSAGES_IN_FLIGHT || 50),
fetch_block: process.env.EOSIO_FETCH_BLOCK !== 'false',
fetch_traces: process.env.EOSIO_FETCH_TRACES !== 'false',
fetch_deltas: process.env.EOSIO_FETCH_DELTAS !== 'false',
};

export const KAFKA_CONFIG: KafkaConfig = {
Expand Down
8 changes: 4 additions & 4 deletions src/eosio/ship-reader-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ export class ShipReaderWrapper {
request: {
start_block_num: this.start_block,
end_block_num: 0xffffffff,
max_messages_in_flight: 50,
max_messages_in_flight: EOSIO_CONFIG.max_messages_in_flight,
have_positions: [],
irreversible_only: this.config.only_irreversible_blocks,
fetch_block: true,
fetch_traces: true,
fetch_deltas: true,
fetch_block: EOSIO_CONFIG.fetch_block,
fetch_traces: EOSIO_CONFIG.fetch_traces,
fetch_deltas: EOSIO_CONFIG.fetch_deltas,
},
auto_start: true,
};
Expand Down

0 comments on commit 5aa1fb1

Please sign in to comment.