Skip to content

Commit 5aa1fb1

Browse files
authored
Merge pull request #8 from kryptokrauts/feat/1.0.10-shipreader-config-params
feat: configurable ship reader params
2 parents 618c9f3 + 81fe786 commit 5aa1fb1

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.env_template

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ EOSIO_NODE_API=
77
EOSIO_START_BLOCK=
88
# number of threads
99
EOSIO_DS_THREADS=4
10+
# max messages in flight
11+
EOSIO_MAX_MESSAGES_IN_FLIGHT=50
12+
# fetch blocks true/false
13+
EOSIO_FETCH_BLOCK=true
14+
# fetch traces true/false
15+
EOSIO_FETCH_TRACES=true
16+
# fetch deltas true/false
17+
EOSIO_FETCH_DELTAS=true
1018

1119
# unique client_id for interacting with Kafka
1220
KAFKA_CLIENT_ID=

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kryptokrauts/event-processor-node-lib",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "Wrapper for ease listening on antelope blockchain based on @blockmatic/antelope-ship-reader",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/common/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export const EOSIO_CONFIG = {
1111
eosio_node_api: process.env.EOSIO_NODE_API,
1212
eosio_ship_api: process.env.EOSIO_SHIP_API,
1313
ds_threads: Number(process.env.EOSIO_DS_THREADS || 4),
14+
max_messages_in_flight: Number(process.env.EOSIO_MAX_MESSAGES_IN_FLIGHT || 50),
15+
fetch_block: process.env.EOSIO_FETCH_BLOCK !== 'false',
16+
fetch_traces: process.env.EOSIO_FETCH_TRACES !== 'false',
17+
fetch_deltas: process.env.EOSIO_FETCH_DELTAS !== 'false',
1418
};
1519

1620
export const KAFKA_CONFIG: KafkaConfig = {

src/eosio/ship-reader-wrapper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@ export class ShipReaderWrapper {
273273
request: {
274274
start_block_num: this.start_block,
275275
end_block_num: 0xffffffff,
276-
max_messages_in_flight: 50,
276+
max_messages_in_flight: EOSIO_CONFIG.max_messages_in_flight,
277277
have_positions: [],
278278
irreversible_only: this.config.only_irreversible_blocks,
279-
fetch_block: true,
280-
fetch_traces: true,
281-
fetch_deltas: true,
279+
fetch_block: EOSIO_CONFIG.fetch_block,
280+
fetch_traces: EOSIO_CONFIG.fetch_traces,
281+
fetch_deltas: EOSIO_CONFIG.fetch_deltas,
282282
},
283283
auto_start: true,
284284
};

0 commit comments

Comments
 (0)