From 6cc62e7d945c5efa5cdd0fd9b0b6dca3b5060e7e Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Tue, 2 Mar 2021 14:55:03 +1000 Subject: [PATCH] fix: timeout provider --- src/priceWatcher.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/priceWatcher.js b/src/priceWatcher.js index b8f0139..923f97c 100644 --- a/src/priceWatcher.js +++ b/src/priceWatcher.js @@ -3,9 +3,11 @@ const { redisUrl, offchainOracleAddress, oracleRpcUrl } = require('./config') const { getArgsForOracle, setSafeInterval } = require('./utils') const redis = new Redis(redisUrl) const Web3 = require('web3') -const web3 = new Web3(oracleRpcUrl, { - timeout: 200000, // ms -}) +const web3 = new Web3( + new Web3.providers.HttpProvider(oracleRpcUrl, { + timeout: 200000, // ms + }), +) const offchainOracleABI = require('../abis/OffchainOracle.abi.json')