Closed weltitob closed 5 months ago
Hi @weltitob!
Thanks for reaching out and for the issue report!
Which browser are you using, and have you ensured that Javascript is enabled in the browser settings?
Moving a comment from #707 over to this issue to keep the conversation under the same issue, see https://github.com/lightninglabs/lightning-terminal/issues/707#issue-2082746055.
My Code:
import base64, codecs, json, requests
import sys
REST_HOST = 'localhost:8443' #8443
MACAROON_PATH = './pythonfunctions/admin.macaroon'
TLS_PATH = './pythonfunctions/taproot_tls.cert'
url = f'https://{REST_HOST}/v1/taproot-assets/getinfo'
macaroon = codecs.encode(open(MACAROON_PATH, 'rb').read(), 'hex')
headers = {'Grpc-Metadata-macaroon': macaroon}
response = requests.get(url, headers=headers, verify=TLS_PATH)
if response.status_code == 200:
try:
data = response.json()
print(data) # Print the parsed JSON data
# process data
except json.JSONDecodeError:
# Handle JSON decode error
print("Response is not in JSON format:", response.text)
else:
# Handle HTTP error
print("Error:", response.status_code, response.text)
My Error message:
Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.49cc9a87.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
I dont know how to activate Javascript, am I doing something wrong, do I need to include soem sort of other information on API request or what am I missing?
Hi @weltitob!
Thanks for reaching out and for the issue report!
Which browser are you using, and have you ensured that Javascript is enabled in the browser settings?
For the whitescreen issue I'm using Chrome and when running Litd manually outside of the docker I have experienced zero issues with the same Chrome Browser. It seems to come down to whats happening inside of the docker. What Browser do I use inside the docker, idk, none i guess.
My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix
You are using the path-prefix
image which sets the url path of the frontend UI to be /lit
. You should use the lightninglabs/lightning-terminal:v0.12.2-alpha
docker image instead which hosts the frontend app at the rool url path /
I believe this should also fix your second issue as well.
My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix
You are using the
path-prefix
image which sets the url path of the frontend UI to be/lit
. You should use thelightninglabs/lightning-terminal:v0.12.2-alpha
docker image instead which hosts the frontend app at the rool url path/
I believe this should also fix your second issue as well.
Hi, this actually fixed my whitescreen issue, but not my other issue. Now that I can properly try to call the API even with my docker instances aswell I got the same issue as for my personal node.
Thats why I seperated the two issues it now might get confusing now haha.
So basically I still have the API Error with this message once I try calling the API:
c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py
Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
My docker whitescreen issue is fixed tho.
This is unrelated to the docker stuff as I got this issue even before on one instance where the ui of the terminal was working (my personal node which is not dockerized)
Should I reopen the seperate issue for this? @ViktorTigerstrom
Even if not everything is fixed thanks a lot @jamaljsr 👍 💯
So basically I still have the API Error with this message once I try calling the API:
c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Ah, I also thought these two issues were for the same server. For this remaining issue, are you starting litd
with the --enablerest
config option? Without that, the frontend app server will respond to the HTTP requests instead of the sub-servers.
So basically I still have the API Error with this message once I try calling the API:
c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Ah, I also thought these two issues were for the same server. For this remaining issue, are you starting
litd
with the--enablerest
config option? Without that, the frontend app server will respond to the HTTP requests instead of the sub-servers.
Nah you're just amazing man, it worked out like that, will close the ticket now. Thanks a lot haha <3
Hello, I'm currently trying to develop an app using some of the capabilities of lightning terminal, but I encountered some issues trying to setup Dockercontainers
The console output on :8443 I encounter:
Other than that I can only see a whitescreen. But when I inspect the error logs further and click on one of the urls I can see a html dom looking like this:
As you can see it seems to be an issue related to javascript. I also seem to miss the lnd folder. Do I need to import it myself into the docker containers or smth?
My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix
Enabled Portforwarding for 8443, 10002, 9735
Docker Container has a wallet_password file and a preconfigured litd.conf looking like this:
I did also already use lncli create to create a wallet.
All litcli status shows running for all services. Other than that I didnt preconfigure anything for my docker container do I need to add some sort of lnd file or does anybody know what might be going on here?