Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pythd Dashboard Issue #284

Open
hkalirai opened this issue Sep 1, 2022 · 2 comments
Open

Pythd Dashboard Issue #284

hkalirai opened this issue Sep 1, 2022 · 2 comments

Comments

@hkalirai
Copy link

hkalirai commented Sep 1, 2022

We had a few questions about the pythd dashboard referenced in your documentation [here]
(https://urldefense.com/v3/__https:/docs.pyth.network/publish-data*running-the-dashboard__;Iw!!GSt_xZU7050wKg!qOrCVC6LYuM9QkJT5v0UNKyt_FzhxX27xu4cI4ccru8FsSs_jcyUmeVdd1nmza1ybJXCPL-5Ms6r6d3DVKvlSaw$).

First, the dashboard is broken. The file dashboard/dashboard.js attempts to make a websocket connection to pythd at a hardcoded URL: ws://localhost:8910. This is a problem for multiple reasons:
• You might not want to view the dashboard on the same host on which you’re running pythd.
• Even if you are viewing the dashboard on the same host as pythd’s docker container, the container’s published port is unlikely to be 8910.
The dashboard, as-is, only works if the browser you’re viewing it on is on the same host as pythd and the published port of pythd’s container is 8910. Can your team fix this?

Second, the dashboard doesn’t seem very useful to a publisher. It shows a view of the current aggregated state of all symbols. It might be more useful to us if it was a view of what pythd was seeing from its clients and sending to the broader pyth network. Is that something that you could change?

Thanks,

@tompntn
Copy link
Contributor

tompntn commented Sep 1, 2022

We are working on a new re-write of pythd which will expose metrics relating to the updates pythd receives from it's clients, as you suggest. This is with the aim of increasing the observability of pythd. If you have any suggestions about which metrics would be useful to you, we'd love to hear them. Thank-you 😄

@gmarkey
Copy link

gmarkey commented Sep 20, 2022

I maintain my own fork of pyth-client and have patched the dashboard with the following

diff --git a/dashboard/dashboard.js b/dashboard/dashboard.js
index 840f098..aaa3d46 100644
--- a/dashboard/dashboard.js
+++ b/dashboard/dashboard.js
@@ -125,7 +125,14 @@ class Prices
 let ws = null;
 let px = null;
 window.onload = function() {
-  ws = new WebSocket('ws://localhost:8910')
+  var loc = window.location, ws_uri;
+  if (loc.protocol === "https:") {
+    ws_uri = "wss:";
+  } else {
+    ws_uri = "ws:";
+  }
+  ws_uri += "//" + loc.hostname + ":" + loc.port;
+  ws = new WebSocket(ws_uri)
   px = new Prices
   ws.onopen = function(e) {
     let n = document.getElementById('notify');```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants