Skip to content

VincentTide/stellarrobot

Repository files navigation

StellarRobot

A web application that accepted deposits in the Stellar digital currency. Stellar is backed by the popular payments company Stripe. It sends the deposit back to the user minus a small fee. StellarRobot takes advantage of Stellar’s promotion for sending your first payment and receiving a bonus from the Stellar Foundation. A websockets client listens for incoming transactions affecting the interested account. Once it receives a transaction, it sends the message to a celery task queue so the websocket can continue listening for other messages. The celery task verifies the transaction to ensure it is legitimate then records the transaction to the database and starts a second celery task for the return payment. The return payment is separated into its own task because we have to structure the process in a way that is robust against failures and can handle retries without sending multiple payments. We solve this by splitting the payment transaction into two parts. The first is signing the payment with our secret key to generate a unique hash and then submitting this unique hash to the Stellar network. Multiple submissions of the unique hash will only affect the account once. Further protection against multiple payments is provided by a redis lock on the transaction ID to ensure only one task worker is working on the task.

The technology stack used to build StellarRobot was Python, Flask web framework, Postgres database, Websockets to listen for incoming transactions, Celery to handle task management, RabbitMQ for the messaging queue, Redis to handle task locking, and Nginx as a reverse proxy in front of Gunicorn server hosted on Digital Ocean.

Note the project has been discontinued and is kept on Github for reference purposes.

About

A learning web app for the Stellar digital currency.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published