How to Use a Monero Remote Node with the Command Line Wallet

This post describes in detail how to use a Monero remote node from the command line wallet (monero-wallet-cli).

Hide Your IP Address - Browse the Internet Anonymously

If you would like more information about what a Monero remote node is, and why you would use one, please read the companion post "Monero Remote Node - Everything You Need to Know". Essentially, while remote nodes save your computer the burden of syncing the blockchain, using insecure remote nodes can compromise your anonymity. Running your own Monero node is safer and faster.

Connecting to a Monero Remote Node

Once you have the IP address and port of the remote node, download the Monero Command Line Tools and extract them. Open up the terminal and navigate to the extracted directory.

Use the following command to connect to the remote node:

./monero-wallet-cli --wallet-file [wallet_file_name] --daemon-address [ip]:[port] --daemon-login [username]:[password] [--trusted-daemon]

This command opens up the specified wallet file, connects to the remote node's IP address and port, and logs into the remote node using its username and password.

The standard Monero wallet node port is 18081, but may be changed by the Monero remote node operator.

As an example, connecting to an iCryptoNode Monero node running on the local network:

./monero-wallet-cli --wallet-file my_wallet --daemon-address --daemon-login icryptonode:my_password --trusted-daemon

This connects to the wallet file named "my_wallet", to the local IP and the default Monero port 18081. After entering the command, if you have a password on the wallet, it will ask you to enter it. If you want the password to be remembered, use the additional '--password "[your_password]"' flag to keep it saved while the wallet is running. Be aware that this will show the password in your running process list, allowing anyone who looks at the task manager to see your wallet password.

NOTE: The '--trusted-daemon' flag was used because iCryptoNode is a trusted daemon on the local network. If you use an unknown remote node, you should not use the '--trusted-daemon' flag!

Restoring a Wallet from Block Height

When you restore a wallet, such as using "./monero-wallet-cli --restore-deterministic-wallet" command, one of the questions it will ask you is:

Restore from specific blockchain height (optional, default 0):

It is best to give a date as close to, but before, the date when you created the wallet. This is because the Monero wallet will have to scan every block above this height to find your transactions, which can take several hours. The more blocks you can exclude, the faster the scan goes.

This Stack Overflow post gives an appendix of Monero block heights and dates. For example:

July      2019           | 1855000
June      2019           | 1835000
May       2019           | 1815000
April     2019           | 1795000
March     2019           | 1775000
February  2019           | 1755000
January   2019           | 1735000

This means if you created your wallet In February 2019, you would use 1755000 as the restore height. If you want to get more accurate, go to a Monero block explorer and start checking heights to narrow down the date of an exact block height.

Refreshing the Wallet

Once you start the wallet you are presented with a command line similar to a standard terminal. Type "help" (without quotes) and press return to see the full list of commands.

The one we are interested in is "refresh". This will scan over all blocks to determine the wallet balance and incoming / outgoing transactions.

If this is the first time running this after restoring the wallet, it may take several hours to run. While it's refreshing the blockchain node will not be interrupted from syncing new blocks and will continue to work fine. Subsequent refreshes should be faster depending on how many new blocks need to be scanned since the last refresh.

Do not let your computer go to sleep or pause the refreshing process. There is no checkpoints in the wallet during refresh, and if the refresh is stopped in the middle then you will have to refresh again.

While refresh is running you will see a list of incoming and outgoing transactions as they are discovered, as well as a live updating count of blocks ("Height 1818101 / 1899620"). At times it may seem like its hanging, but just let it run until finished.

Wallet Synced

Congratulations! Once the refresh finishes, your wallet has now been synced using a remote note. You can continue to connect to the remote node each time you start the wallet with the same command. Be sure to use the "refresh" command to get the latest transactions!

You can use the "wallet_info" command to see your current balance and the "transfer <address> <amount>" command to send XMR. Use "help" for the full list of commands.

Share this post

← Older Post Newer Post →

Leave a comment

Please note, comments must be approved before they are published.