6

I'm hoping to create a Monero-based website based on the work by 'TheKoziTwo' (https://github.com/TheKoziTwo/xmr-integration).

I'm nearing the end of the project and I'm now hoping to connect the wallet to the website, but how do I do so?

There is little information given in the git explaining how to connect the wallet to the website, neither is there much information out there on the internet.

It does mention Cryptonote, though, although after having a look, I'm unsure on what exactly I need to do and I fear making a mistake by not following exact instructions.

Also, what would be the best securities measures to take to ensure the safety of the wallet?

Apologies for my stupidity and ignorance on this particular topic.

1 Answer 1

2

I'm assuming the monero-wallet-rpc is on the same host as the website.

In init.php, define a username and password for the rpc wallet:

// RPC login credentials for monero-wallet-rpc. Use --rpc-login user:pass when starting the rpc wallet. 
// Example: monero-wallet-rpc --rpc-login user:pass --wallet-file wallet.bin --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18082
define('RPC_CRED','user:pass');`

Your username and password can be anything. In these examples they're user:pass but change them in your code.

I like to use tmux on my server. In one pane I'll run

./monerod --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18081

...and in another tmux pane I'll run:

monero-wallet-rpc --rpc-login user:pass --wallet-file wallet.bin --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18082

Another tmux pane runs cron.php with php ./cron.php

At this point your web pages should be interacting with the database, monerod, and monero-wallet-rpc.

As for security, that's the never-ending job. At a minimum, rename init.php, cron.php, and config.php. I've seen where people have tried to access those pages on my server, but I renamed those files with completely random names.

Also, in init.php where it has the line:

define('APP',true);

...change APP to something else...whatever you want. You'll need to do this on every page that references APP, which I believe is almost every page.

Make sure to block the wallet port (18082 unless you've changed it) on your firewall, log php error messages instead of displaying them, and keep your server patched.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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