Skip to content

Commit

Permalink
update docker cmd to save logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed May 15, 2023
1 parent 4225ce5 commit 757616c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules
cache
/contracts
artifacts
logs.txt
logs

## Private
.env
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
ADD . .
RUN npm install
CMD while true; do node arb-bot -k "${BOT_WALLET_PRIVATEKEY}" -r "${RPC_URL}" --orderbook-address "${ORDERBOOK_ADDRESS}" --arb-address "${ARB_ADDRESS}" && sleep 30; done;
CMD while true; do node arb-bot -k "${BOT_WALLET_PRIVATEKEY}" -r "${RPC_URL}" --orderbook-address "${ORDERBOOK_ADDRESS}" --arb-address "${ARB_ADDRESS}" | tee -a logs.txt && sleep 30; done;
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ exports.getConfig = async(
*
* @param {ethers.Signer} signer - The ethersjs signer constructed from provided private keys and rpc url provider
* @param {object} config - The configuration object
* @param {number} slippage - (optional) The slippage for clearing orders, default is 0.01 i.e. 1 percent
* @param {string} slippage - (optional) The slippage for clearing orders, default is 0.01 i.e. 1 percent
* @param {boolean} prioritization - (optional) Prioritize better deals to get cleared first, default is true
* @returns The report of details of cleared orders
*/
exports.clear = async(signer, config, queryResults, slippage = 0.01, prioritization = true) => {
exports.clear = async(signer, config, queryResults, slippage = "0.01", prioritization = true) => {
let hits = 0;
const api = config.apiUrl;
const chainId = config.chainId;
Expand Down Expand Up @@ -700,14 +700,14 @@ exports.clear = async(signer, config, queryResults, slippage = 0.01, prioritizat
}
catch (error) {
console.log(">>> Transaction execution failed due to:");
console.log(error.reason, "\n");
console.log(error, "\n");
}
}
else console.log(">>> Skipping because estimated negative profit for this token pair", "\n");
}
catch (error) {
console.log(">>> Transaction failed due to:");
console.log(error.reason, "\n");
console.log(error, "\n");
}
}
else console.log("Failed to get quote from 0x", "\n");
Expand Down

0 comments on commit 757616c

Please sign in to comment.