1

I am building a python app that depends on both monerod, and the JSON-RPC server for access to the (testnet) blockchain. In my testing environment, I had access to more than enough space to hold the testnet blockchain, however now that I am deploying to a VPS, I no longer have that luxury. I am willing to give in to potential security risks.

My question is, what arguments do I have to run monerod with to connect with a public testnet node (like testnet.community.xmr.to) instead of automatically downloading the 2gb+ blockchain?

2

You seem to misunderstand. monerod doesn't operate on a remote blockchain (other than syncing of course). You can however use the wallet (or another app, such as a python script) with a remote (or local) node via its JSON-RPC interface. This is almost certainly all you need (i.e. it's highly unlikely your python script depends on a local monerod).

A python example using a remote node:

import requests
import json

payload = {
        'jsonrpc':'2.0',
        'id':'0',
        'method':'get_block',
        'params': {
            'height': 101
            }
        }
rpc_url = 'http://testnet.community.xmr.to:28081/json_rpc'
req = requests.post(rpc_url, json=payload)
result = req.json().get('result')
print(result)

An example using the same remote node with either the monero-wallet-rpc or monero-wallet-cli, simply launch the wallet with:

--daemon-address testnet.community.xmr.to:28081

All this said, it is possible to start monerod with the --no-sync flag which will allow you to run the daemon and not sync the blockchain, but note, calling any RPC method which depends on blockchain data will fail in this mode.

4
  • my problem is that since i am using the monero-python sdk, i have to use the RPC server (not the problem since i can just run this on the VPS tbh) which connects to the ./monerod daemon. the monero daemon always by default begins by syncing a native copy of the blockchain, which must be downloaded on device. im asking if there is a way to make the monerod run on data from a public node (and more specifically, what the flags for the Bash command are). if i can connect directly to the node in the daemon Bash command, how would i do this? Thanks for the help! – ars Jun 5 at 1:01
  • imgur.com/9P6yx57 – ars Jun 5 at 1:03
  • "im asking if there is a way to make the monerod run on data from a public node" <- No, as answered. Your screenshot in your comment shows you trying to use the monero-wallet-rpc, which absolutely can use a remote node (again as answered). To run the wallet RPC against a remote node you simply use --daemon-address host:port argument. – jtgrassie Jun 5 at 1:31
  • 1
    thank you so much! i think i just made a bunch of small mistakes that ended up creating a lot of problems, but now its working. have a great day! – ars Jun 5 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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