Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add start from block #101

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading