Skip to content

Commit a2a3a1f

Browse files
committed
watcher: change bsc rpc
1 parent b2f23e2 commit a2a3a1f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

watcher/src/consts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const TIMEOUT = 0.5 * 1000;
2828
export const RPCS_BY_CHAIN: { [key in Environment]: { [key in ChainName]?: string } } = {
2929
['mainnet']: {
3030
ethereum: process.env.ETH_RPC,
31-
bsc: process.env.BSC_RPC || 'https://rpc.ankr.com/bsc',
31+
bsc: process.env.BSC_RPC || 'https://bsc.publicnode.com',
3232
polygon: process.env.POLYGON_RPC || 'https://rpc.ankr.com/polygon',
3333
avalanche: process.env.AVALANCHE_RPC || 'https://rpc.ankr.com/avalanche',
3434
oasis: process.env.OASIS_RPC || 'https://emerald.oasis.dev',

watcher/src/watchers/Watcher.ts

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class Watcher {
5656
let retry = 0;
5757
while (true) {
5858
try {
59+
this.logger.debug(`fromBlock = ${fromBlock}, toBlock = ${toBlock}`);
5960
if (fromBlock !== null && toBlock !== null && fromBlock <= toBlock) {
6061
// fetch logs for the block range, inclusive of toBlock
6162
toBlock = Math.min(fromBlock + this.maximumBatchSize - 1, toBlock);
@@ -67,6 +68,7 @@ export class Watcher {
6768
try {
6869
this.logger.info('fetching finalized block');
6970
toBlock = await this.getFinalizedBlockNumber();
71+
this.logger.debug(`finalized block = ${toBlock}`);
7072
if (fromBlock === null) {
7173
// handle first loop on a fresh chain without initial block set
7274
fromBlock = toBlock;

0 commit comments

Comments
 (0)