terra-money / core

GO implementation of the Terra Protocol
https://www.terra.money
Other
382 stars 89 forks source link

Feature Request: Node can host its own API for 3rd party apps #314

Open oldcityws opened 2 months ago

oldcityws commented 2 months ago

I am a software developer and would love to use terra as a payment processing platform, so I can collect fees for SAAS.

One of the things I wanted to do was also use terra to host blockchain-involved apps on my own servers.

Like, to play games, people could send currency to a specific developer or game-designated wallet and then their wallet address is credited with play credits.

So, I was thinking that URL-encoded API interface would enable further use of the blockchain, as hosted by a node owned by a programmer / developer.

javiersuweijie commented 1 month ago

Not sure if I'm understanding your use-case.

You can use the REST endpoints for your use-case. Example: terra-api.polkachu.com/swagger/ Does this work?

oldcityws commented 1 month ago

I checked the options listed in your reference and I do not see where I can poll the blockchain for transactions matching an individual account. So, I was thinking that nodes can have a server mode option where there's a specific API to poll for transactions to/from specific accounts, and the amounts.

So, I could theoretically click a switch to indicate that I want the blockchain to be watched and any transactions matching a specific account would be noted and [ SendAddress + ReceiveAddress + AmountTransacted + TransactionHash + BlockHeight ] would be present in a database accessible by a third-party app. SQLite is one option to implement that function.

Apps such as games and SAAS need a way to credit users for their payments, and if you see how SAAS + data systems integrate "watching" of data, it makes sense. Court case software, for example, allows lawyers to select a plaintiff to monitor them and watch all activity on the network. So, here, with the blockchain, we should be able to have a watch list of accounts to save a record of all transactions on the watch list.

oldcityws commented 1 month ago

My use case would effectively be something like this:

  1. App presents User with ReceiveAccount
  2. User registers SendAccount in App data store
  3. User sends coins to ReceiveAccount
  4. Node is constantly on lookout using ReceiveAccount to sift transactions
  5. Node discovers Transaction
  6. Node notes Transaction in Database
  7. App has process that checks Database for updates
  8. App discovers Transaction noted in updated Database
  9. App uses SendAddress to poll its own database to find out who Sender is
  10. App finds User account with matching SendAccount
  11. App credits User for Transaction

... and there it is, someone can pay and a node with a "watch list" address can become a Point-Of-Sale terminal, saving merchants thousands of dollars in fees that large companies grift from merchants... and the blockchain gains strength by way of increased utility and gain in market share in crypto industry.

Ditch the banks, crypto requires no approval.