mirror of
https://github.com/ZigZagExchange/zksync-lite-market-maker.git
synced 2025-12-18 07:34:21 +01:00
Merge pull request #97 from TrooperCrypto/master
enable uniswap mainnet feed for goerli
This commit is contained in:
@@ -44,7 +44,7 @@ node marketmaker.js
|
|||||||
|
|
||||||
## Configuration Via Environment Variables
|
## 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`:
|
If your hosting service requires you to pass in configs via environment variables you can compress `config.json`:
|
||||||
|
|
||||||
|
|||||||
@@ -46,12 +46,15 @@ console.log("ACTIVE PAIRS", activePairs);
|
|||||||
// Connect to zksync
|
// Connect to zksync
|
||||||
const CHAIN_ID = parseInt(MM_CONFIG.zigzagChainId);
|
const CHAIN_ID = parseInt(MM_CONFIG.zigzagChainId);
|
||||||
const ETH_NETWORK = (CHAIN_ID === 1) ? "mainnet" : "goerli";
|
const ETH_NETWORK = (CHAIN_ID === 1) ? "mainnet" : "goerli";
|
||||||
let ethersProvider;
|
const infureKey = (process.env.infura || MM_CONFIG.infura);
|
||||||
const providerUrl = (process.env.INFURA_URL || MM_CONFIG.infuraUrl);
|
let ethersProvider = null;
|
||||||
if(providerUrl && ETH_NETWORK=="mainnet") {
|
if (infureKey) {
|
||||||
ethersProvider = ethers.getDefaultProvider(providerUrl);
|
ethersProvider = new ethers.providers.InfuraProvider(
|
||||||
|
"mainnet",
|
||||||
|
infureKey
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
ethersProvider = ethers.getDefaultProvider(ETH_NETWORK);
|
ethersProvider = new ethers.getDefaultProvider("mainnet");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start price feeds
|
// Start price feeds
|
||||||
|
|||||||
Reference in New Issue
Block a user