mirror of
https://github.com/ZigZagExchange/zksync-lite-market-maker.git
synced 2025-12-17 07:04:23 +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
|
||||
|
||||
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`:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user