aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-17 21:44:11 -0700
committerAdam Soltys <[email protected]>2020-05-17 21:44:11 -0700
commit11724003fbbcd12b90b27dc370c9537eb1bbcbf2 (patch)
tree0316c9441de4fbae9487d90a8d334d7c1c476a9e
parent56f05870ff6cc9100683ba017b6f6b4818a47f7f (diff)
downloadcoinos-server-11724003fbbcd12b90b27dc370c9537eb1bbcbf2.tar.gz
coinos-server-11724003fbbcd12b90b27dc370c9537eb1bbcbf2.zip
more logging
-rw-r--r--lib/binance.js11
-rw-r--r--routes/assets.js1
-rw-r--r--routes/bitcoin/receive.js1
-rw-r--r--routes/liquid/receive.js1
4 files changed, 14 insertions, 0 deletions
diff --git a/lib/binance.js b/lib/binance.js
index 2f4f7ef7..151ce6a7 100644
--- a/lib/binance.js
+++ b/lib/binance.js
@@ -1,11 +1,21 @@
const WebSocket = require("ws");
module.exports = () => {
+ l.info("connecting to binance");
binance = new WebSocket(
"wss://stream.binance.com:9443/ws/btcusdt@ticker"
);
+ binance.onopen = function(event) {
+ l.info("binance socket opened");
+ };
+
+ binance.onerror = function(event) {
+ l.error("binance socket error", event);
+ };
+
binance.onmessage = async function(event) {
+ l.info("got rates from binance");
try {
let msg = JSON.parse(event.data);
app.set("bid", msg.b);
@@ -21,6 +31,7 @@ module.exports = () => {
});
app.set("rates", rates);
+ l.info("saved binance rates");
} catch(e) {
l.error("binance socket error", e);
}
diff --git a/routes/assets.js b/routes/assets.js
index 350781d7..10eee1f5 100644
--- a/routes/assets.js
+++ b/routes/assets.js
@@ -2,6 +2,7 @@ const axios = require("axios");
app.get("/assets", async (req, res) => {
let assets;
+ l.info("getting assets list from blockstream registry");
try {
assets = await axios.get("https://assets.blockstream.info/");
res.send(assets.data);
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js
index 77aabd68..6cc7e6fe 100644
--- a/routes/bitcoin/receive.js
+++ b/routes/bitcoin/receive.js
@@ -130,6 +130,7 @@ zmqRawBlock.on("message", async (topic, message, sequence) => {
});
setInterval(async () => {
+ l.info("checking for received bitcoin transactions");
try {
let arr = Object.keys(queue);
for (let i = 0; i < arr.length; i++) {
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js
index a7d02829..9ef67967 100644
--- a/routes/liquid/receive.js
+++ b/routes/liquid/receive.js
@@ -139,6 +139,7 @@ zmqRawBlock.on("message", async (topic, message, sequence) => {
});
setInterval(async () => {
+ l.info("checking for received liquid transactions");
try {
let arr = Object.keys(queue);