From 757616ccae13c7d0e9aea4f62e66754e33d804b3 Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Mon, 15 May 2023 22:18:56 +0000 Subject: [PATCH] update docker cmd to save logs --- .gitignore | 2 ++ Dockerfile | 2 +- src/index.js | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 410c77c1..38e97211 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ node_modules cache /contracts artifacts +logs.txt +logs ## Private .env diff --git a/Dockerfile b/Dockerfile index fee133a4..c63f9373 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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; diff --git a/src/index.js b/src/index.js index 4b0cd5aa..4ffb5b5f 100644 --- a/src/index.js +++ b/src/index.js @@ -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; @@ -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");