Skip to content

Commit

Permalink
Merge pull request #101 from javiersuweijie/chore/docker
Browse files Browse the repository at this point in the history
chore: add start from block
  • Loading branch information
Lukasz Maslanka authored Aug 13, 2024
2 parents 3628094 + c8e05bc commit 7bbbe7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions eth/.env_example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ETH_URL="https://ropsten.infura.io/v3/{API_KEY}"
ETH_BLOCK_CONFIRMATION="7"
ETH_BLOCK_LOAD_UNIT="10"
ETH_BLOCK_SECOND="10"
ETH_START_FROM="0"

FEE_RATE="0.001"
REDIS_URL="redis://127.0.0.1:6379"
Expand Down
5 changes: 4 additions & 1 deletion eth/src/Shuttle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const KEY_QUEUE_MISSING_TX = 'queue_missing_tx';
const REDIS_URL = process.env.REDIS_URL as string;
const ETH_BLOCK_SECOND = parseInt(process.env.ETH_BLOCK_SECOND as string);
const ETH_BLOCK_LOAD_UNIT = parseInt(process.env.ETH_BLOCK_LOAD_UNIT as string);
const ETH_START_FROM = (process.env.ETH_START_FROM as string) || '0';

const SLACK_NOTI_NETWORK = process.env.SLACK_NOTI_NETWORK;
const SLACK_NOTI_ETH_ASSET = process.env.SLACK_NOTI_ETH_ASSET;
Expand Down Expand Up @@ -155,7 +156,9 @@ class Shuttle {
// rebroadcast the tx with same sequence.
await this.checkTxQueue();

const lastHeight = parseInt((await this.getAsync(KEY_LAST_HEIGHT)) || '0');
const lastHeight = parseInt(
(await this.getAsync(KEY_LAST_HEIGHT)) || ETH_START_FROM
);
const missingTxHashes = await this.loadMissingTxHashes();
const [newLastHeight, monitoringDatas] = await this.monitoring.load(
lastHeight,
Expand Down

0 comments on commit 7bbbe7d

Please sign in to comment.