1

I want to open my Monero testnet wallet via a php script using a remote node but it's returning: "Method not found".

Here is the code I am using:

$hostname = 'node.xmr.to';
$port     = '28081';
$daemonRPC          = new \MoneroIntegrations\MoneroPhp\daemonRPC($hostname, $port);
$getblockcount      = $daemonRPC->getblockcount();
$on_getblockhash    = $daemonRPC->on_getblockhash(42069);
$getlastblockheader = $daemonRPC->getlastblockheader();
$get_info           = $daemonRPC->get_info();

$walletRPC     = new \MoneroIntegrations\MoneroPhp\walletRPC($hostname, $port);
$open_wallet   = $walletRPC->open_wallet('<wallet name>','<wallet password>');
dd($open_wallet);
die();

Also I am trying to get unique deposit address for my Monero wallet.

1

The wallet RPC and daemon RPC are different. Refer to the projects documentation on how to run both wallet and daemon RPCs.

The node you reference at node.xmr.to is a daemon RPC, not a wallet RPC, therefore you cannot use it for any of the wallet commands, only daemon commands.

To use a wallet RPC (like you are trying to do from php), you have to run this wallet RPC yourself (e.g. the app monero-wallet-rpc, again mentioned in the monerophp documentation). Note, the wallet RPC still needs to connect to a daemon (monerod), for which you can specify a remote daemon if you are not running your own local full node.

For the wallet RPC to use a remote daemon, you launch passing the parameter --daemon-address. E.g.

./monero-wallet-rpc --help
...
--daemon-address arg                  Use daemon instance at <host>:<port>
...

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.