Skip to content

Commit

Permalink
Feature/add fallback rpc (#20)
Browse files Browse the repository at this point in the history
* add more logging for webhook helper

* add backuo logger

* fix: bnb override rpc

---------

Co-authored-by: xander <[email protected]>
Co-authored-by: aiswaryawalter <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2023
1 parent 0b241e3 commit e86a22d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@ dump.rdb*
yarn.lock

# ChannelKeys
src/showrunners
src/showrunners/*/*Keys.json
src/showrunners/*/*PrivateSettings.json
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// https://jestjs.io/docs/en/configuration.html

module.exports = {
testTimeout:1000000,
// All imported modules in your tests should be mocked automatically
// automock: false,

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@apollo/client": "^3.6.9",
"@arbitrum/sdk": "^1.1.0",
"@gnosis.pm/safe-service-client": "^1.4.0",
"@google-cloud/bigquery": "^6.2.0",
"@improbable-eng/grpc-web": "^0.15.0",
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
"@injectivelabs/derivatives-consumer": "^0.5.1",
Expand Down Expand Up @@ -123,7 +124,7 @@
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-prettier": "^3.0.1",
"git-json-merge": "0.4.5",
"jest": "^24.1.0",
"jest": "27",
"nodemon": "^2.0.1",
"prettier": "^2.5.1",
"ts-jest": "^27.1.3",
Expand Down
5 changes: 3 additions & 2 deletions src/config/channelsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ const channelWallets = function loadShowrunnersWallets() {

for (const [key, value] of Object.entries(object)) {
// check and decide old standard or not
const isOldStandard = (typeof value === 'string' || value instanceof String) ? true : false;
const pkey = isOldStandard ? value : value.PK;
const isOldStandard = typeof value === 'string' || value instanceof String ? true : false;
const newValue: any = value;
const pkey = isOldStandard ? newValue : newValue.PK;

const result = cryptoHelper.checkPrivateKeyValidity(pkey);

Expand Down
4 changes: 2 additions & 2 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ let config = {
alchemyAPI: process.env.ALCHEMY_API,

web3MainnetProvider: `https://mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
web3MainnetNetwork: staticConfig.MAINNET_WEB3_NETWORK,
web3MainnetNetwork: process.env.MAINNET_RPC_OVERRIDE || staticConfig.MAINNET_WEB3_NETWORK,
web3MainnetSocket: staticConfig.MAINNET_WEB3_SOCKET,

web3RopstenProvider: `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
Expand All @@ -126,7 +126,7 @@ let config = {

web3GnosisRPC: staticConfig.GNOSIS_MAINNET_RPC,

web3BnbMainnetRPC: staticConfig.BNB_MAINNET_RPC,
web3BnbMainnetRPC: process.env.BNB_RPC_OVERRIDE || staticConfig.BNB_MAINNET_RPC,
web3BnbTestnetRPC: staticConfig.BNB_TESTNET_RPC,

/**
Expand Down
3 changes: 2 additions & 1 deletion src/loaders/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const formatter = winston.format.combine(
}),
)

var transport = new (winston.transports.DailyRotateFile)(options.file);
const winstonTransporter:any = winston.transports;
var transport = new (winstonTransporter.DailyRotateFile)(options.file);
transport.on('rotate', function(oldFilename, newFilename) {
// do something fun
console.log("login rotated from: %o | %o", oldFilename, newFilename)
Expand Down

0 comments on commit e86a22d

Please sign in to comment.