cake-tech / cake_wallet

The open source repository for Cake Wallet, a noncustodial multi-currency wallet, and Monero.com, a noncustodial Monero-only wallet. Need help? Check out https://guides.cakewallet.com
https://cakewallet.com
MIT License
573 stars 158 forks source link

Monero: Can't connect to custom node #1298

Open raldone01 opened 4 months ago

raldone01 commented 4 months ago

The following monerod config works fine from the desktop app. Cake Wallet can't connect to the node.

Monerod custom node config:

# https://monerodocs.org/interacting/monerod-reference/

# Data directory (blockchain db and indices)
data-dir=/data
log-file=/log/monero.log
log-level=2

# Server
no-igd=1            # Disable UPnP port mapping
# Emergency checkpoints set by MoneroPulse operators will be enforced to workaround potential consensus bugs
# Check https://monerodocs.org/infrastructure/monero-pulse/ for explanation and trade-offs
enforce-dns-checkpointing=1 # Prevent invalid forks

# P2P network
p2p-bind-ip=0.0.0.0     # Bind to all interfaces (the default)
p2p-bind-port=18080     # Bind to default port

p2p-use-ipv6=1          # Allow ipv6
p2p-bind-ipv6-address=::    # Bind to all interfaces (the default)

hide-my-port=1          # Do not propagate self as a peer for others.
limit-rate-down=200000      # Download limit
limit-rate-up=   10000      # Upload limit

# Node RPC API
public-node=0           # We are not a public node

rpc-restricted-bind-ip=0.0.0.0  # Bind to all interfaces
rpc-restricted-bind-port=18089  # Bind on default port

zmq-rpc-bind-ip=0.0.0.0
zmq-rpc-bind-port=18082
zmq-pub=tcp://0.0.0.0:18084

rpc-bind-ip=0.0.0.0
rpc-bind-port=18081
rpc-bind-ipv6-address=::    # Bind to all interfaces
rpc-use-ipv6=1          # Allow ipv6

confirm-external-bind=1     # Open node (confirm)
rpc-login=username:passwordaaaaaaaaaaaaaaaaaaa
rpc-ssl=enabled

# Performance
prune-blockchain=1
sync-pruned-blocks=1
# Slow but reliable db writes
db-sync-mode=safe:sync
# Fast and reckless
#db-sync-mode=fastest:async:250000000bytes

out-peers=64              # This will enable much faster sync and tx awareness; the default 8 is suboptimal nowadays
in-peers=1024             # The default is unlimited; we prefer to put a cap on this

However I can't connect to it from Cake Wallet. The dot stays red.

Expected behavior The dot should turn green and I should be able to use the node. Or at least some sort of connection error message should appear telling me about the problem.

Platform:

Additional context I tried all kinds of permutations of ssl/trusted. I will try to compile the app and get some logcat. Maybe it logs something useful.

tuxpizza commented 4 months ago

Are you exposing your node only through IPv6?

raldone01 commented 4 months ago

Thanks for the pointer I will check it. https://monerodocs.org/interacting/monerod-reference/ is down Huh. Can you tell me how to listen to both ipv4 and ipv6.

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.11:43761        0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18089           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18084           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18082           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18080           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18081           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::18080                :::*                    LISTEN      -                   
tcp6       0      0 :::18081                :::*                    LISTEN      -                   
udp        0      0 127.0.0.11:45603        0.0.0.0:*                           - 

Seems like it doesn't listen on ipv6 for 18089.

Got it to listen to ipv6 on 18089 by adding rpc-restricted-bind-ipv6-address=::.

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:18089           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18081           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18080           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18082           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:18084           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.11:38177        0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::18089                :::*                    LISTEN      -                   
tcp6       0      0 :::18081                :::*                    LISTEN      -                   
tcp6       0      0 :::18080                :::*                    LISTEN      -                   
udp        0      0 127.0.0.11:59823        0.0.0.0:*                           -

Still no dice though.

raldone01 commented 4 months ago

From the monero desktop app I can connect using ipv4, ipv6 addresses directly and it also works with my domain.

tuxpizza commented 4 months ago

Right now Cake Wallet doesn't work with IPv6 which is why I wanted to make sure IPv4 was available. But if it works connecting to IPv4 through Monero GUI I'm not sure what the issue would be. You are trying to connect using public IP or locally using the server's IP?

Also found that page on Wayback Machine :wink: https://web.archive.org/web/20230328072110/https://monerodocs.org/interacting/monerod-reference/

raldone01 commented 4 months ago

Ahh good good to know I will try to fully disable ipv6 and continue testing. Some sort of logs would be a nice feature though. Yes I tried both local and public ipv4 addresses.

Thanks for your help.

tuxpizza commented 4 months ago

Might be able to get some logs using ADB (Android Debug Bridge) and specifying the logs for Cake Wallet adb logcat | gre com.cakewallet.cake_wallet. I'm not sure if that would spit out anything useful for your case though, especially since its not a debug build.

tuxpizza commented 4 months ago

Closing this for now, let me know if you have any update on that.

raldone01 commented 4 months ago

I just checked the logcat and there is nothing of use in there. I would need a dev build. Do you have a dockerfile or something similar so I can quickly get one?

tuxpizza commented 4 months ago

Let me see if I can get one built for you for testing. unfortunately the build process is rather involved and build instructions need to be updated.