Finally done with this script.
The idea is to make it easier for people to setup their own monero accepting website. A working demo can help with that!
This is a complete PHP integration of monero. Once setup you will have a working membership site with:
There is no guide for how to setup daemon and simplewallet in "server mode". I have been working on a guide as well, but it's not posted anywhere yet, so I'll put some quick guidelines below:
IntroductionWith bitcoin, transactions are identified with a unique address. Monero uses payment id instead to identify transactions. This means that your XMR receiving address will be the same for all users, but payment_id will be unique. Users transferring money to your site need to specify both address and payment id
Setting up serverBitcoin has both wallet and daemon in one and the same software. Monero has split these into two separate applications. You have bitmonerod which is the daemon and simplewallet which is the wallet. This requires us to connect to two different services.
Daemon (localhost:18081/rpc/)You need to launch daemon in server mode, to do so run it with:
./bitmonerod --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18081
Thats all. Once you have a daemon running, you can connect to it from one or even multiple wallets.
Wallet (localhost:18082/rpc/)First of all create a wallet as usual (if you have not already done so):
simplewallet --generate-new-wallet mywallet.dat
Enter a password (demo123), you don’t need to write down the seed, but you may.
exit the wallet.
In order to perform operations usings the API, the wallet must run in rpc server mode, to do so, run it with the following param (make sure the daemon is already running first):
./simplewallet --wallet-file mywallet.dat --password demo123 --rpc-bind-port 18082
Another example, if you have bound the daemon to an IP/PORT and also wants to bind the simplewallet, this example below shows how:
./simplewallet --daemon-host 192.168.10.54 --daemon-port 18081 --wallet-file mywallet.dat --rpc-bind-ip 192.168.10.54 --rpc-bind-port 18082 --password demo123
Now you should be able to access the wallet outside of your localhost also.
IMPORTANT: When wallet is running in RPC mode it’s technically possible for hackers to empty your wallet if your port is open. You don’t want that, so make sure 18082 is closed.