Merge pull request #97 from TrooperCrypto/master

enable uniswap mainnet feed for goerli
This commit is contained in:
Trooper
2022-08-12 12:03:56 +02:00
committed by GitHub
2 changed files with 9 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ node marketmaker.js
## Configuration Via Environment Variables
It is __recommended__ to use environment variables to set your private keys. You can set `ETH_PRIVKEY`, `CRYPTOWATCH_API_KEY` and `INFURA_URL` using them. You can set them using `ETH_PRIVKEY=0x____`. For more informations on private keys read [this](https://linuxize.com/post/how-to-set-and-list-environment-variables-in-linux/).
It is __recommended__ to use environment variables to set your private keys. You can set `ETH_PRIVKEY`, `CRYPTOWATCH_API_KEY` and `INFURA` using them. You can set them using `ETH_PRIVKEY=0x____`. For more informations on private keys read [this](https://linuxize.com/post/how-to-set-and-list-environment-variables-in-linux/).
If your hosting service requires you to pass in configs via environment variables you can compress `config.json`:

View File

@@ -46,12 +46,15 @@ console.log("ACTIVE PAIRS", activePairs);
// Connect to zksync
const CHAIN_ID = parseInt(MM_CONFIG.zigzagChainId);
const ETH_NETWORK = (CHAIN_ID === 1) ? "mainnet" : "goerli";
let ethersProvider;
const providerUrl = (process.env.INFURA_URL || MM_CONFIG.infuraUrl);
if(providerUrl && ETH_NETWORK=="mainnet") {
ethersProvider = ethers.getDefaultProvider(providerUrl);
const infureKey = (process.env.infura || MM_CONFIG.infura);
let ethersProvider = null;
if (infureKey) {
ethersProvider = new ethers.providers.InfuraProvider(
"mainnet",
infureKey
);
} else {
ethersProvider = ethers.getDefaultProvider(ETH_NETWORK);
ethersProvider = new ethers.getDefaultProvider("mainnet");
}
// Start price feeds