moneriote-python is a Python script to maintain DNS records of monero nodes with their RPC port open. It actively scans
the Monero network through monerod
and manages DNS records.
An example is the remote node service node.moneroworld.com:
dig A node.moneroworld.com
;; ANSWER SECTION:
node.moneroworld.com. 3600 IN CNAME opennode.xmr-tw.org.
opennode.xmr-tw.org. 300 IN A 69.94.198.240
opennode.xmr-tw.org. 300 IN A 91.121.57.211
opennode.xmr-tw.org. 300 IN A 139.59.59.176
opennode.xmr-tw.org. 300 IN A 139.99.195.96
opennode.xmr-tw.org. 300 IN A 212.83.130.45
Supports the following DNS providers: Cloudflare, TransIP
- Python >= 3.5
- Domain name
- A running and fully synced Monero daemon
git clone <this repo> python-moneriote
cd python-moneriote
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
python setup.py develop
Moneriote is now installed inside the virtualenv.
Usage: moneriote [OPTIONS]
Options:
--monerod-path TEXT Path to the monero daemon executable (monerod). [default: monerod]
--monerod-address TEXT Monero daemon address. [default: 127.0.0.1]
--monerod-port INTEGER Monero daemon port. [default: 18081]
--monerod-auth TEXT Monero daemon auth as 'user:pass'. Will be passed to monerod as `--rpc-login` argument.
--blockheight-discovery TEXT Available options: 'monerod', 'xmrchain', 'moneroblocks'. When set to 'compare', it will use all methods and pick the highest
blockheight. [default: compare]
--dns-provider TEXT The DNS provider/plugin to use. [default: cloudflare]
--domain TEXT The domain name without the subdomain. 'example.com'.
--subdomain TEXT The subdomain name. [default: node]
--api-key TEXT DNS API key.
--api-email TEXT DNS email address or username.
--max-records INTEGER Maximum number of DNS records to add. [default: 5]
--loop-interval INTEGER Update loop interval. [default: 600]
--scan-interval INTEGER Interval at which to mass-scan RPC nodes. [default: 3600]
--concurrent_scans INTEGER The amount of servers to scan at once. [default: 20]
--ban-list TEXT Enable ban-list if list path is provided. One IP address per line.
--from-config TEXT Load configuration from ini file.
--help Show this message and exit.
Easiest is to run in screen
or tmux
. If you really care about uptime and
want to babysit the process, write some configuration for supervisord
or systemd
.
moneriote --monerod-path "/home/xmr/monero-gui-v0.12.3.0/monerod"
--blockheight-discovery "compare"
--dns-provider "cloudflare"
--domain "example.com"
--subdomain "node"
--api-key "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
--api-email "example@bla.com"
--max-records 5
--ban-list "/home/xmr/block.txt"
The full path to the monerod executable. On windows this ends on .exe.
Default: 127.0.0.1
The address on which your local monerod is listening
Default: 18081
The port on which your local monerod is listening
The authentication string to use when contacting monerod.
Default: compare
Available options: monerod
, xmrchain
, moneroblocks
. When set to compare
,
it will use all methods and pick the highest blockheight.
xmrchain
and moneroblocks
are both Monero explorer websites that expose an API.
Available DNS providers: cloudflare
, transip
.
If your DNS provider is not included but does provide an API for adding/removing records,
you can code a custom implementation of DnsProvider
. See moneriote/dns/
The domain name without the subdomain, example: example.com
The subdomain name, example: node
The full domain would become node.example.com
The key required by your DNS provider for API access.
The email required by your DNS provider for API access. This flag could also serve for an username, depending
on DnsProvider
.
Default: 5
The maximum amount of records to add.
Default: 600
Shuffle/randomize the records every X
seconds. Default is 10 minutes.
Default: 3600
Ask monerod for new peers and mass-scan them, every X
seconds. Default is 1 hour.
Default: 20
The amount of servers to scan at once.
Enable ban-list if list file path is provided. One IP address per line.
Alternatively, configuration can be passed via config.ini
.
Additional DNS provider(s) can be implemented by inheriting from moneriote.dns.DnsProvider()
. Your custom
class must implement the following methods.
Must return a list of nodes (moneriote.rpc.RpcNodeList
).
Adds the A record to the subdomain
Removes the A record from the subdomain.
- Originally developed as a bash script in Gingeropolous/moneriote.
- Improved and rewritten in Python by connorw600/moneriote
- Improved by Lafudoci/moneriote
- Rewritten by skftn