Coder Social home page Coder Social logo

Comments (11)

bytestostring avatar bytestostring commented on July 18, 2024

Hi, @JasonHe

Invalid NodeState (from UpdateNodeAN)

It is okay.

I think it is frontend issue.

But I got stuck on the initial page for a whole night

Please open your site and go to DevTools in your browser (usually F12 or CTRL+SHIFT+I ) and go to the "Console" tab.
Next step: refresh the page and show me output from Console tab.

Also, did you re-compile wasm binary?
If you did it, you should replace web/static/js/wasm_exec.js file with the file from your golang distribution.

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

Hi, @JasonHe

Invalid NodeState (from UpdateNodeAN)

It is okay.

I think it is frontend issue.

But I got stuck on the initial page for a whole night

Please open your site and go to DevTools in your browser (usually F12 or CTRL+SHIFT+I ) and go to the "Console" tab. Next step: refresh the page and show me output from Console tab.

Also, did you re-compile wasm binary? If you did it, you should replace web/static/js/wasm_exec.js file with the file from your golang distribution.

You are right. It is an frontend issue as I change the login method to direct IP:8081, It works well. I use aapanle to manage my vps. I create a nginx reverse proxy conf as follow:

#PROXY-START/
location ~* .(gif|png|jpg|css|js|woff|woff2)$
{
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
expires 12h;
}
location /
{
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;

add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
proxy_ignore_headers Set-Cookie Cache-Control expires;
add_header Cache-Control no-cache;

}

#PROXY-END/

from nkn.ovh.

bytestostring avatar bytestostring commented on July 18, 2024

You should add these lines to the "location / { }" block.
It allow upgrade your browser's connection to WebSocket.

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

and restart nginx.

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

You should add these lines to the "location / { }" block. It allow upgrade your browser's connection to WebSocket.

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

and restart nginx.

added and nginx restarted, but still not working, the conf file as followed:

#PROXY-START/
location ~* .(gif|png|jpg|css|js|woff|woff2)$
{
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
expires 12h;
}
location /
{
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
proxy_ignore_headers Set-Cookie Cache-Control expires;
add_header Cache-Control no-cache;

}

#PROXY-END/

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

Also, the info in console as follow:

userscript.html?name=%E7%BD%91%E7%9B%98%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%86%99%E8%AE%BF%E9%97%AE%E7%A0%81%E3%80%90%E5%A8%81%E5%8A%9B%E5%8A%A0%E5%BC%BA%E7%89%88%E3%80%91.user.js&id=c5632291-b2f3-4950-8b0d-64926a0fcb73:881 {pwdRule: /(?:提取|访问)[码碼]?\s*[::﹕ ]?\s*([a-z\d]{4})/, codeRule: /(?:(?:提取|访问|(?<!解压)密[码碼]|艾|Extracted-code)[码碼]?)\s*[::﹕ ]?\s*([a-z\d]{4})/i, YunDisk: {…}, JumpUrl: {…}, Support: {…}}
userscript.html?name=%E7%BD%91%E7%9B%98%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%86%99%E8%AE%BF%E9%97%AE%E7%A0%81%E3%80%90%E5%A8%81%E5%8A%9B%E5%8A%A0%E5%BC%BA%E7%89%88%E3%80%91.user.js&id=c5632291-b2f3-4950-8b0d-64926a0fcb73:886 conf: undefined
DevTools 无法加载源映射: 无法加载chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/jquery.min.map 的内容:HTTP 错误: 状态代码 404,net::ERR_UNKNOWN_URL_SCHEME
wasm_exec.js?1633185165:51 Go Wasm loaded
wasm_exec.js?1633185165:51 Events registered
wasm_exec.js?1633185165:51 WebSocket onopen registered
wasm_exec.js?1633185165:51 WebSocket onclose registered
wasm_exec.js?1633185165:51 WebSocket onmessage registered
wasm_exec.js?1633185165:433

   WebSocket connection to 'wss://my.domain.xyz/polling' failed: 

syscall/js.valueNew @ wasm_exec.js?1633185165:433
$func1652 @ 012851ce:0x16b823
$func1629 @ 012851ce:0x16973a
$func2438 @ 012851ce:0x226b28
$func3050 @ 012851ce:0x30355c
$func1021 @ 012851ce:0xe0009
$run @ 012851ce:0xdffdc
run @ wasm_exec.js?1633185165:570
(匿名) @ (索引):18

from nkn.ovh.

bytestostring avatar bytestostring commented on July 18, 2024

Okay, nginx use http 1.0 version for proxying by default.
Switch proxy protocol version, add follow line:

proxy_http_version 1.1;

You can add this into location/server/http block and reload nginx.

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

Thank you so much that my own nkn.ovh works fine and well.
But for now I am facing another problem. My offline nodes always got deleted after few hours for which I would like to keep it on the panel for records and replace it later. Is there any configuration to choose to not delete it?
Also, since this is another problem, do I need to open another issue post?

Sincerely, and thanks again @bytestostring

from nkn.ovh.

bytestostring avatar bytestostring commented on July 18, 2024

Is there any configuration to choose to not delete it?

Unfortunately, it's hardcoded.
I will move the option to config.json in future.

You can edit source code manually.

Look for internal/nknovh-engine/nknovh.go, 367 and 368 lines:
https://github.com/bytestostring/nkn.ovh/blob/v1.1/internal/nknovh-engine/nknovh.go#L367#L368

  1. Change the lines:
o.rmNodesByFcnt(180, 1)
o.rmNodesByFcnt(5040, 0)

to

o.rmNodesByFcnt(2147483647, 1)
o.rmNodesByFcnt(2147483647, 0)
  1. Rebuild app:
# go to root application directory before run:
go build cmd/nknovh/nknovh.go
  1. Restart app

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

Is there any configuration to choose to not delete it?

Unfortunately, it's hardcoded. I will move the option to config.json in future.

You can edit source code manually.

Look for internal/nknovh-engine/nknovh.go, 367 and 368 lines: https://github.com/bytestostring/nkn.ovh/blob/v1.1/internal/nknovh-engine/nknovh.go#L367#L368

  1. Change the lines:
o.rmNodesByFcnt(180, 1)
o.rmNodesByFcnt(5040, 0)

to

o.rmNodesByFcnt(2147483647, 1)
o.rmNodesByFcnt(2147483647, 0)
  1. Rebuild app:
# go to root application directory before run:
go build cmd/nknovh/nknovh.go
  1. Restart app

Now its perfectly run as what I want. Thanks and hope this issue can help more people to use your great work.

from nkn.ovh.

JasonHe avatar JasonHe commented on July 18, 2024

@bytestostring Sorry for the bothering. But is there any way to change the source code to remove the 3 wallets limit for self-deploy user?

from nkn.ovh.

bytestostring avatar bytestostring commented on July 18, 2024

Most settings will be added in the next release to conf.json.

In the current version app try to change this:
https://github.com/bytestostring/nkn.ovh/blob/v1.1/internal/nknovh-engine/apimethods.go#L234

from nkn.ovh.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.