appditto / natrium-wallet-server

Backend for the Natrium NANO Mobile Wallets
MIT License
88 stars 77 forks source link

call back and nano-work-server is not working #10

Closed traderpedroso closed 1 year ago

traderpedroso commented 1 year ago

my setup is:

Nano node on server 192.168.1.53 ports 7075 7076 7078 work server on 192.168.1.140:7076 Natrium server on 192.168.1.140:3000

Nano node working ok work server working ok Natrum server are not working callback & work server

on config-node.toml

[node.websocket]

# WebSocket server bind address
# type:string,ip
address = "::ffff:0.0.0.0"

# Enable or disable WebSocket server.
# type:bool
enable = true

[rpc]

# Enable or disable RPC
# type:bool
enable = true

[node]

# Enable or disable voting. Enabling this option requires additional system resources, namely increased CPU, bandwidth and disk usage.

enable_voting = true
work_threads = 0
work_peers = ["::ffff:192.168.1.140:7076"]

callback_address = "::ffff:192.168.1.140"
callback_port = "3000"
callback_target = "/callback"

if I use the callback on the git, the node doesn't start

"callback_address": "::ffff:192.168.1.140",
"callback_port": "3000",
"callback_target": "\/callback",

I also tried

[node.httpcallback]

# Callback address
# type:string,ip
address = "::ffff:192.168.1.140"

# Callback port number
# type:uint16
port = 3000

# Callback target path
# type:string,uri
target = "/callback"

envs from prinenv:

RPC_URL=http://192.168.1.153:7076
WORK_URL=http://localhost:7076 or 192.168.1.140:7076
NODE_WS_URL=ws://192.168.1.153:7078

appreciate all possible help thank you

bbedward commented 1 year ago

The callback only works if the node is fully sync’d, is that the case with yours?

traderpedroso commented 1 year ago

The callback only works if the node is fully sync’d, is that the case with yours?

It's a test network with a single genesis node, but I think the problem was a socket origin check! Change it to:

var Upgrader = websocket.Upgrader{
    CheckOrigin: func(r *http.Request) bool { return true },
} 

I haven't been able to complete all the tests yet, but I believe this was one of the main issues! The action confirmation_quorum is not supported, I guess, because it was removed in version 22.0: peers_stake_required! Sorry for complaining in advance about the cause, and thank you for your support.