Skip to content

RPC Pay Feature

shermand100 edited this page Feb 12, 2025 · 5 revisions

RPC Pay:

Note: Additionally a Monero-cli wallet is required to use this feature.

Information on the function of this feature can be found at the Monero Outreach - https://www.monerooutreach.org/stories/RPC-Pay.html

The following menu can be found under the "Node Control" Tab. This feature removed at PiNodeXMR version 6.25.01 due to little use and what seems to be the eventual removal from Monero codebase and ecosystem. However, I don't like being a spoilsport so the following can be configured in the "Custom Node" box to manually retain this feature in your PiNodeXMR. It was always going to be for advanced users anyway, these are the options flags/setting removed:

./monerod --rpc-bind-ip=$DEVICE_IP --rpc-bind-port=$MONERO_PORT --zmq-pub tcp://$DEVICE_IP:18083 --rpc-restricted-bind-port=$MONERO_RPCPAY_PORT --confirm-external-bind --rpc-payment-allow-free-loopback --ban-list /home/pinodexmr/ban_list_InUse.txt --rpc-ssl disabled --in-peers=$IN_PEERS --out-peers=$OUT_PEERS --limit-rate-up=$LIMIT_RATE_UP --limit-rate-down=$LIMIT_RATE_DOWN --max-log-file-size=10485760 --log-level=1 --max-log-files=1 --pidfile /home/pinodexmr/monero/build/release/bin/monerod.pid --rpc-payment-address=$PAYMENT_ADDRESS --rpc-payment-credits=$CREDITS --rpc-payment-difficulty=$DIFFICULTY --public-node --enable-dns-blocklist --detach

For context, below is the original implementation and wallet CLI use...


Enter a valid Monero Address for payment of a successfully mined block by a client wallet, credits and difficulty value.

Values can be copy/pasted into the text boxes. Click outside of the box to save the new value. This will be confirmed by receiving a web notification.

RPC Pay

Quoting https://www.monerooutreach.org/stories/RPC-Pay.html

The payment address is a standard Monero payment address that will receive payments whenever a mining hash payment actually mines a new block. The rpc-payment-credits and payment-difficulty values work together so that a client receives the ratio credits/difficulty for each mining hash provided. These examples (Credits: 250, Difficulty: 1000), which you will want to change to suit your needs, would give 250/1000 = 0.25 credits per hash.

For the PiNode-XMR side of things this is all that is required to start the node.


Monero-cli wallet settings example

For this example I am using Monero-cli wallet 0.16.0.1 on Windows 10. This example should be easily transferable to other systems or at least give an indication of the sort of commands needed. Below shows one method of passing additional commands to when starting the wallet, there are many way, choose one that suits your system.

In this case I have created a file in a text editor and saved it with the .bat extension (for windows). For example lets say I called it "RPC_Pay_Wallet_Start.bat"

It contains:

"C:\Program Files\Monero GUI Wallet\monero-wallet-cli" --daemon-address 10.193.192.65:18081 --trusted-daemon

PAUSE

When I then double click this file it will open the monero-wallet-cli, and automatically connect to my PiNode-XMR as a trusted daemon. From here I either create a new wallet or load a previous one, as in the usual way for the Monero-cli wallet.

If you need help creating a new wallet there are plenty of good sources that talk you through it such as https://www.monero.how/tutorial-how-to-create-a-command-line-monero-wallet

Once your wallet is open you will see the following:

RPC Wallet 1 - test

There are three useful commands relevant to the RPC Pay system:

  • start_mining_for_rpc
  • stop_mining_for_rpc
  • rpc_payment_info

The first two I hope are obvious, and rpc_payment_info allows us to keep track of our current credits balance.

Additionally, rpc_payment_info provides us with our "RPC client ID" and "RPC client secret key". These can be used so the node identifies the wallet as a repeat worker, keeping a record of past credits. So:

By adding your RPC key (Not your Monero Private Key) in the format --rpc-client-secret-key f547e9aa98c80b8bab83bc3fdfefafe80432653e45e14e0f5c21f5737fc3520a

To your wallet start command. Example:

"C:\Program Files\Monero GUI Wallet\monero-wallet-cli" --daemon-address 10.193.192.65:18083 --rpc-client-secret-key f547e9aa98c8008bab83bc3fdfefafe80432653e45e14e0f5c21f5737fc3520a --trusted-daemon

Your wallet with continue with it's credit balance from it's previous session.

Note: This also allows you to mine for RPC credits with a powerful device, then login with a weak device (using this key) so the weak device can use the credits.

returning client


Security

A final important note:

The default Monero RPC node port is 18081 (changeable in the global settings section of node control) This would be normally be forwarded/opened by yourself via your router firewall settings to allow wallet connections for every node run type on PiNode-XMR except RPC Pay This is usually fine as it is protected by the RPC username:password combo.

However when running the node in the RPC Pay mode, the default RPC port becomes un-restricted, and the port specified as the RPC pay port becomes the restricted port so please ensure your firewall rules reflect this so as not to allow accidental external access to the unrestricted port.

In a later version I will change the way this works to avoid this type of accidental exposure.

Clone this wiki locally