I want to implement payments using Bitcoin without any 3rd party services. I already installed full node on my server and configured RPC API. What should I do next?
Now I plan to work in the following way:
- Create wallets for all existing and new users using getaccountaddress method and store address in DB.
- Set up an every minute cron job which will calls listtransactions * 1000, loop through transactions to find new which has more than N confirmations.
- Store filtered transactions in DB, find user by address and add money to balance.
- Send received bitcoins to another (main) wallet using sendfrom method.
I have some doubts about the stability of the solution. I do not think that users will perform more than 1,000 transactions per minute, so when all is working as planned, it looks as pretty stable solution. But what, if, for example, bitcoind (or entire server) will hang / fail / break down? How easy will be to handle payments that were not processed before?
Maybe there is a better way for receiving payments? Thank you.