0

I want to run monero-wallet-cli on a separate machine that connects to monerod onion service. To this end, inspired by this tutorial, having created the onion service I configured my bitmonero.conf:

no-igd=1
restricted-rpc=1
rpc-login=USERNAME:PASSWORD

and launched monerod like so: monerod --detach . The daemon works as evidenced by the informational output that I get from executing this from my cient curl --socks5-hostname 127.0.0.1:9150 -u USERNAME:PASSWORD --digest -X POST http://j************************d.onion:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json'.

When I ssh into the machine that hosts monerod I try to shut it down with monerod exit or monerod stop_daemon it does not work, I get:

2024-04-04 12:32:54.642 I Monero 'Fluorine Fermi' (v0.18.1.0-c8214782f)
Error: Daemon did not stop-- rpc_request:

instead of what i normally would get when the daemon is launched without RPC options,

2024-04-04 12:31:27.478 I Monero 'Fluorine Fermi' (v0.18.1.0-c8214782f)
Stop signal sent

Having unsuccessfully tried stopping the service serverside, I then proceeded to stop the daemon by sending a request from the client: curl --socks5-hostname 127.0.0.1:9150 -u USER:PASSWORD http://j************************d.onion:18081/stop_daemon -H 'Content-Type: application/json' and got this output:

<html><head><title>Unauthorized Access</title></head><body><h1>401 Unauthorized</h1></body></html>

What is happening with the m̀onerod? Why cannot I shut it down?

P.S. My monerod is hosted on a Debian based system and is run by root. As I have not started my deamon with --rpc-bind-ip please do not consider it a duplicate of this question.

1 Answer 1

2

Unless otherwise configured, monerod starts with its default options. Note: --rpc-bind-ip is default, see monerod --help My RPC relevant part in monerod.conf:

# RPC open node
public-node=1
rpc-bind-ip=127.0.0.1          # (default localhost 127.0.0.1)
rpc-bind-ipv6-address=[::1]    # (default localhost ::1)
rpc-bind-port=8081             # (default 18081)
rpc-restricted-bind-ip=0.0.0.0         # (default 127.0.0.1)
rpc-restricted-bind-ipv6-address=[::]  # (default ::1)
rpc-restricted-bind-port=18081 # Bind on default port 18081
rpc-use-ipv6=1                 # (default false)
confirm-external-bind=1

Then I can use commands on the localhost like:

monerod --rpc-bind-port=8081 help
monerod --rpc-bind-port=8081 exit
monerod --rpc-bind-port=8081 --rpc-login username:password exit

But you actually start and stop services on Debian via systemd. Example: monerod.service

systemctl start monerod
systemctl status monerod
systemctl stop monerod

And you should never run services as root! Setting up Monero as a system service, start with:

addgroup --system monero
adduser --system --home /var/lib/monero --ingroup monero monero
mkdir /var/run/monero
mkdir /var/log/monero
mkdir /etc/monero
touch /etc/monero/monerod.conf
chown monero:monero /var/run/monero
chown monero:monero /var/log/monero
chown -R monero:monero /etc/monero

& read the rest in Seth's excellent guide Run a Monero Node:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.